house detail update

hmxc
小赖 4 years ago
parent 420680a27b
commit a816a67767

@ -4,7 +4,11 @@ import 'package:flutter/material.dart';
class HouseModel { class HouseModel {
int id; int id;
String roomName; String roomName;
///1.3.4.
int status; int status;
///1 23
int type; int type;
String effectiveTimeStart; String effectiveTimeStart;
String effectiveTimeEnd; String effectiveTimeEnd;
@ -26,6 +30,21 @@ class HouseModel {
return ''; return '';
} }
String get houseStatus {
if (status == 1) return '审核中';
if (status == 3) return '审核失败';
if (type == 1) return '业主';
if (type == 2) return '亲属';
if (type == 3) return '租客';
return '';
}
Color get houseStatusColor {
if (status != 4) return Color(0xFF666666);
if (type == 1) return Color(0xFF333333);
return Colors.white;
}
/// ///
/// ///
List<Color> get backgroundColor { List<Color> get backgroundColor {

@ -34,6 +34,14 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
return (appProvider?.selectedHouse?.status ?? 0) == 4; return (appProvider?.selectedHouse?.status ?? 0) == 4;
} }
Widget get _houseTitle {
final appProvider = Provider.of<AppProvider>(context, listen: false);
if (_emptyHouse) return Text('还没有绑定房屋');
if (appProvider.selectedHouse.status == 1) return Text('您的身份正在审核中,请耐心等待');
if (appProvider.selectedHouse.status == 3) return Text('审核未通过');
return SizedBox();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context); final appProvider = Provider.of<AppProvider>(context);
@ -71,7 +79,8 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
padding: EdgeInsets.symmetric(horizontal: 75.w), padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP), child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
), ),
if (!_haveAuthedHouse) Center(child: _houseTitle),
if (_emptyHouse)
Center( Center(
child: ElevatedButton( child: ElevatedButton(
onPressed: _addHouse, onPressed: _addHouse,

@ -164,9 +164,10 @@ class _HouseCard extends StatelessWidget {
children: [ children: [
Container( Container(
child: Text( child: Text(
model.typeValue, model.houseStatus,
style: Theme.of(context).textTheme.subtitle2.copyWith( style: Theme.of(context).textTheme.subtitle2.copyWith(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: model.houseStatusColor,
), ),
), ),
alignment: Alignment.center, alignment: Alignment.center,

Loading…
Cancel
Save