pull/1/head
张萌 3 years ago
parent d1a7396ddc
commit f0e68608bb

@ -15,7 +15,7 @@ class MyHouseApplyRecordListModel {
final String name; final String name;
final String tel; final String tel;
final int status; final int status;
final String remark; final String? remarks;
factory MyHouseApplyRecordListModel.fromJson(Map<String, dynamic> json) => factory MyHouseApplyRecordListModel.fromJson(Map<String, dynamic> json) =>
_$MyHouseApplyRecordListModelFromJson(json); _$MyHouseApplyRecordListModelFromJson(json);
@ -31,6 +31,6 @@ class MyHouseApplyRecordListModel {
required this.name, required this.name,
required this.tel, required this.tel,
required this.status, required this.status,
required this.remark, this.remarks,
}); });
} }

@ -20,5 +20,5 @@ MyHouseApplyRecordListModel _$MyHouseApplyRecordListModelFromJson(
name: json['name'] as String, name: json['name'] as String,
tel: json['tel'] as String, tel: json['tel'] as String,
status: json['status'] as int, status: json['status'] as int,
remark: json['remark'] as String, remarks: json['remarks'] as String?,
); );

@ -1,4 +1,5 @@
import 'package:aku_new_community/constants/sars_api.dart'; 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/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/models/sars_model/my_house/my_house_apply_record_list_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/network/net_util.dart';
@ -18,6 +19,8 @@ class ApplyRecordPage extends StatefulWidget {
} }
class _ApplyRecordPageState extends State<ApplyRecordPage> { class _ApplyRecordPageState extends State<ApplyRecordPage> {
List<MyHouseApplyRecordListModel> _models = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
@ -29,12 +32,24 @@ class _ApplyRecordPageState extends State<ApplyRecordPage> {
footer: MaterialFooter(), footer: MaterialFooter(),
onRefresh: () async { onRefresh: () async {
var base = await NetUtil().get(SARSAPI.profile.house.applyRecord); 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 {}, onLoad: () async {},
child: ListView( child: !_models.isEmpty
? Container()
: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: [], children: [
..._models
.map((e) => _houseCard(e))
.toList()
.sepWidget(separate: 24.w.heightBox),
],
), ),
)), )),
); );
@ -88,7 +103,14 @@ class _ApplyRecordPageState extends State<ApplyRecordPage> {
], ],
), ),
), ),
Positioned(child: Image.asset(_getStatusIconPath(model.status))), Positioned(
top: 0,
right: 0,
child: Image.asset(
_getStatusIconPath(model.status),
width: 160.w,
height: 160.w,
)),
], ],
); );
} }

@ -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/gen/assets.gen.dart';
import 'package:aku_new_community/models/user/my_house_model.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/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/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_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart';
@ -28,7 +29,9 @@ class _MyHousePageState extends State<MyHousePage> {
title: '我的房屋', title: '我的房屋',
actions: [ actions: [
IconButton( IconButton(
onPressed: () {}, onPressed: () {
Get.to(() => ApplyRecordPage());
},
icon: Assets.icons.record.image(width: 40.w, height: 40.w)) icon: Assets.icons.record.image(width: 40.w, height: 40.w))
], ],
body: SafeArea( body: SafeArea(

Loading…
Cancel
Save