diff --git a/lib/model/user/house_model.dart b/lib/model/user/house_model.dart index 38cef9d1..2128e670 100644 --- a/lib/model/user/house_model.dart +++ b/lib/model/user/house_model.dart @@ -4,7 +4,11 @@ import 'package:flutter/material.dart'; class HouseModel { int id; String roomName; + + ///1.未审核,3.审核失败,4.审核成功 int status; + + ///1 审核业主,2审核亲属,3审核租客 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 get backgroundColor { diff --git a/lib/ui/profile/house/house_owners_page.dart b/lib/ui/profile/house/house_owners_page.dart index 5f6e7900..f1b88076 100644 --- a/lib/ui/profile/house/house_owners_page.dart +++ b/lib/ui/profile/house/house_owners_page.dart @@ -34,6 +34,14 @@ class _HouseOwnersPageState extends State { return (appProvider?.selectedHouse?.status ?? 0) == 4; } + Widget get _houseTitle { + final appProvider = Provider.of(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(context); @@ -71,7 +79,8 @@ class _HouseOwnersPageState extends State { 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, diff --git a/lib/ui/profile/house/pick_my_house_page.dart b/lib/ui/profile/house/pick_my_house_page.dart index f44dc314..dfcb00a5 100644 --- a/lib/ui/profile/house/pick_my_house_page.dart +++ b/lib/ui/profile/house/pick_my_house_page.dart @@ -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,