diff --git a/assets/icons/record.png b/assets/icons/record.png new file mode 100644 index 00000000..194a2760 Binary files /dev/null and b/assets/icons/record.png differ diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index b464c62b..7c53c1ac 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -679,6 +679,9 @@ class $AssetsIconsGen { AssetGenImage get provideAged => const AssetGenImage('assets/icons/provide_aged.png'); + /// File path: assets/icons/record.png + AssetGenImage get record => const AssetGenImage('assets/icons/record.png'); + /// File path: assets/icons/report.png AssetGenImage get report => const AssetGenImage('assets/icons/report.png'); 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 new file mode 100644 index 00000000..b5cf7566 --- /dev/null +++ b/lib/models/sars_model/my_house/my_house_apply_record_list_model.dart @@ -0,0 +1,36 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'my_house_apply_record_list_model.g.dart'; + +@JsonSerializable() +class MyHouseApplyRecordListModel { + final int id; + final String addressName; + final String communityName; + final String buildingName; + final String unitName; + final String estateName; + final String manageEstateTypeName; + final int identity; + final String name; + final String tel; + final int status; + final String remark; + factory MyHouseApplyRecordListModel.fromJson(Map json) => + _$MyHouseApplyRecordListModelFromJson(json); + + const MyHouseApplyRecordListModel({ + required this.id, + required this.addressName, + required this.communityName, + required this.buildingName, + required this.unitName, + required this.estateName, + required this.manageEstateTypeName, + required this.identity, + required this.name, + required this.tel, + required this.status, + required this.remark, + }); +} 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 new file mode 100644 index 00000000..eb5ca009 --- /dev/null +++ b/lib/models/sars_model/my_house/my_house_apply_record_list_model.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'my_house_apply_record_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +MyHouseApplyRecordListModel _$MyHouseApplyRecordListModelFromJson( + Map json) => + MyHouseApplyRecordListModel( + id: json['id'] as int, + addressName: json['addressName'] as String, + communityName: json['communityName'] as String, + buildingName: json['buildingName'] as String, + unitName: json['unitName'] as String, + estateName: json['estateName'] as String, + manageEstateTypeName: json['manageEstateTypeName'] as String, + identity: json['identity'] as int, + name: json['name'] as String, + tel: json['tel'] as String, + status: json['status'] as int, + remark: json['remark'] as String, + ); diff --git a/lib/ui/profile/new_house/apply_record_page.dart b/lib/ui/profile/new_house/apply_record_page.dart new file mode 100644 index 00000000..4a4ddd52 --- /dev/null +++ b/lib/ui/profile/new_house/apply_record_page.dart @@ -0,0 +1,88 @@ +import 'package:aku_new_community/models/sars_model/my_house/my_house_apply_record_list_model.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/tag/bee_tag.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class ApplyRecordPage extends StatefulWidget { + const ApplyRecordPage({Key? key}) : super(key: key); + + @override + _ApplyRecordPageState createState() => _ApplyRecordPageState(); +} + +class _ApplyRecordPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '我的房屋申请', + body: SafeArea( + child: EasyRefresh( + firstRefresh: true, + header: MaterialHeader(), + footer: MaterialFooter(), + onRefresh: () async {}, + onLoad: () async {}, + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + children: [], + ), + )), + ); + } + + Widget _houseCard(MyHouseApplyRecordListModel model) { + return Stack( + children: [ + Container( + width: 686.w, + padding: EdgeInsets.all(24.w), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(8.w)), + child: Column( + children: [ + Row( + children: [ + '${model.addressName} ${model.communityName}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 8.w.heightBox, + Row( + children: [ + '${model.buildingName}${model.unitName}${model.estateName}' + .text + .size(36.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 24.w.widthBox, + BeeTag.yellowSolid(text: '${model.manageEstateTypeName}') + ], + ), + 24.w.heightBox, + BeeDivider.horizontal(), + 24.w.heightBox, + Row( + children: [ + BeeTag.yellowHollow(text: '${model.manageEstateTypeName}'), + 10.w.widthBox, + '${model.name} ${model.tel}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ) + ], + ), + ), + ], + ); + } +} diff --git a/lib/ui/profile/new_house/my_house_page.dart b/lib/ui/profile/new_house/my_house_page.dart index 6770e7ac..96b662ae 100644 --- a/lib/ui/profile/new_house/my_house_page.dart +++ b/lib/ui/profile/new_house/my_house_page.dart @@ -26,13 +26,22 @@ class _MyHousePageState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '我的房屋', + actions: [ + IconButton( + onPressed: () {}, + icon: Assets.icons.record.image(width: 40.w, height: 40.w)) + ], body: SafeArea( child: UserTool.userProvider.myHouses.isEmpty ? _emptyWidget() : ListView( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), - children: [].sepWidget(separate: 24.w.heightBox), + children: [ + ...UserTool.userProvider.myHouses + .map((e) => _houseCard(e)) + .toList() + ].sepWidget(separate: 24.w.heightBox), )), bottomNavi: Padding( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),