house detail update

hmxc
小赖 4 years ago
parent 420680a27b
commit a816a67767

@ -4,7 +4,11 @@ import 'package:flutter/material.dart';
class HouseModel {
int id;
String roomName;
///1.3.4.
int status;
///1 23
int type;
String effectiveTimeStart;
String effectiveTimeEnd;
@ -26,6 +30,21 @@ class HouseModel {
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 {

@ -34,6 +34,14 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
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
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
@ -71,7 +79,8 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
),
if (!_haveAuthedHouse)
Center(child: _houseTitle),
if (_emptyHouse)
Center(
child: ElevatedButton(
onPressed: _addHouse,

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

Loading…
Cancel
Save