diff --git a/lib/models/sars_model/my_house/my_house_apply_record_list_model.dart b/lib/models/sars_model/my_house/my_house_apply_record_list_model.dart index b5cf7566..85ca8ea3 100644 --- a/lib/models/sars_model/my_house/my_house_apply_record_list_model.dart +++ b/lib/models/sars_model/my_house/my_house_apply_record_list_model.dart @@ -15,7 +15,7 @@ class MyHouseApplyRecordListModel { final String name; final String tel; final int status; - final String remark; + final String? remarks; factory MyHouseApplyRecordListModel.fromJson(Map json) => _$MyHouseApplyRecordListModelFromJson(json); @@ -31,6 +31,6 @@ class MyHouseApplyRecordListModel { required this.name, required this.tel, required this.status, - required this.remark, + this.remarks, }); } diff --git a/lib/models/sars_model/my_house/my_house_apply_record_list_model.g.dart b/lib/models/sars_model/my_house/my_house_apply_record_list_model.g.dart index eb5ca009..7fe40865 100644 --- a/lib/models/sars_model/my_house/my_house_apply_record_list_model.g.dart +++ b/lib/models/sars_model/my_house/my_house_apply_record_list_model.g.dart @@ -20,5 +20,5 @@ MyHouseApplyRecordListModel _$MyHouseApplyRecordListModelFromJson( name: json['name'] as String, tel: json['tel'] as String, status: json['status'] as int, - remark: json['remark'] as String, + remarks: json['remarks'] as String?, ); diff --git a/lib/ui/profile/new_house/apply_record_page.dart b/lib/ui/profile/new_house/apply_record_page.dart index 7c2c29fb..f865cf32 100644 --- a/lib/ui/profile/new_house/apply_record_page.dart +++ b/lib/ui/profile/new_house/apply_record_page.dart @@ -1,4 +1,5 @@ import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/sars_model/my_house/my_house_apply_record_list_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; @@ -18,6 +19,8 @@ class ApplyRecordPage extends StatefulWidget { } class _ApplyRecordPageState extends State { + List _models = []; + @override Widget build(BuildContext context) { return BeeScaffold( @@ -29,13 +32,25 @@ class _ApplyRecordPageState extends State { footer: MaterialFooter(), onRefresh: () async { var base = await NetUtil().get(SARSAPI.profile.house.applyRecord); - if (base.success) {} + if (base.success) { + _models = (base.data as List) + .map((e) => MyHouseApplyRecordListModel.fromJson(e)) + .toList(); + setState(() {}); + } }, onLoad: () async {}, - child: ListView( - padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), - children: [], - ), + child: !_models.isEmpty + ? Container() + : ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + children: [ + ..._models + .map((e) => _houseCard(e)) + .toList() + .sepWidget(separate: 24.w.heightBox), + ], + ), )), ); } @@ -88,7 +103,14 @@ class _ApplyRecordPageState extends State { ], ), ), - Positioned(child: Image.asset(_getStatusIconPath(model.status))), + Positioned( + top: 0, + right: 0, + child: Image.asset( + _getStatusIconPath(model.status), + width: 160.w, + height: 160.w, + )), ], ); } diff --git a/lib/ui/profile/new_house/my_house_page.dart b/lib/ui/profile/new_house/my_house_page.dart index 96b662ae..536f685d 100644 --- a/lib/ui/profile/new_house/my_house_page.dart +++ b/lib/ui/profile/new_house/my_house_page.dart @@ -3,6 +3,7 @@ import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/user/my_house_model.dart'; import 'package:aku_new_community/ui/profile/new_house/add_house_page.dart'; +import 'package:aku_new_community/ui/profile/new_house/apply_record_page.dart'; import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; @@ -28,7 +29,9 @@ class _MyHousePageState extends State { title: '我的房屋', actions: [ IconButton( - onPressed: () {}, + onPressed: () { + Get.to(() => ApplyRecordPage()); + }, icon: Assets.icons.record.image(width: 40.w, height: 40.w)) ], body: SafeArea(