diff --git a/assets/manage/passed.png b/assets/manage/passed.png new file mode 100644 index 0000000..24b124f Binary files /dev/null and b/assets/manage/passed.png differ diff --git a/assets/manage/rejected.png b/assets/manage/rejected.png new file mode 100644 index 0000000..77d5d5f Binary files /dev/null and b/assets/manage/rejected.png differ diff --git a/lib/const/saas_api.dart b/lib/const/saas_api.dart index ac27718..2f9cd27 100644 --- a/lib/const/saas_api.dart +++ b/lib/const/saas_api.dart @@ -25,11 +25,20 @@ class SAASAPI { static _User user = _User(); static _Message message = _Message(); static _WorkOrder workOrder = _WorkOrder(); + static _HouseHoldAudit householdAudit = _HouseHoldAudit(); ///二级分类 static _OtherApi other = _OtherApi(); } +class _HouseHoldAudit { + ///查询所有的住户审核管理信息 + String get list => '/butlerApp/user/review/list'; + + ///通过/驳回 房屋审核 + String get review => '/butlerApp/user/review/review'; +} + class _Login { ///管家app设置昵称 String get setNickName => '/butlerApp/user/setNickName'; diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 78082a0..5c5d445 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -3,257 +3,128 @@ /// FlutterGen /// ***************************************************** -// ignore_for_file: directives_ordering,unnecessary_import - import 'package:flutter/widgets.dart'; class $AssetsHomeGen { const $AssetsHomeGen(); - /// File path: assets/home/app_alarm.png AssetGenImage get appAlarm => const AssetGenImage('assets/home/app_alarm.png'); - - /// File path: assets/home/bee_task.png AssetGenImage get beeTask => const AssetGenImage('assets/home/bee_task.png'); - - /// File path: assets/home/clock_in_out.png AssetGenImage get clockInOut => const AssetGenImage('assets/home/clock_in_out.png'); - - /// File path: assets/home/device_alarm.png AssetGenImage get deviceAlarm => const AssetGenImage('assets/home/device_alarm.png'); - - /// File path: assets/home/facilities.png AssetGenImage get facilities => const AssetGenImage('assets/home/facilities.png'); - - /// File path: assets/home/fire_alarm.png AssetGenImage get fireAlarm => const AssetGenImage('assets/home/fire_alarm.png'); - - /// File path: assets/home/home_back.png AssetGenImage get homeBack => const AssetGenImage('assets/home/home_back.png'); - - /// File path: assets/home/home_head.png AssetGenImage get homeHead => const AssetGenImage('assets/home/home_head.png'); - - /// File path: assets/home/house_keeping.png AssetGenImage get houseKeeping => const AssetGenImage('assets/home/house_keeping.png'); - - /// File path: assets/home/hygienice.png AssetGenImage get hygienice => const AssetGenImage('assets/home/hygienice.png'); - - /// File path: assets/home/ic_Patrol.png AssetGenImage get icPatrol => const AssetGenImage('assets/home/ic_Patrol.png'); - - /// File path: assets/home/ic_activity.png AssetGenImage get icActivity => const AssetGenImage('assets/home/ic_activity.png'); - - /// File path: assets/home/ic_all.png AssetGenImage get icAll => const AssetGenImage('assets/home/ic_all.png'); - - /// File path: assets/home/ic_article.png AssetGenImage get icArticle => const AssetGenImage('assets/home/ic_article.png'); - - /// File path: assets/home/ic_borrow.png AssetGenImage get icBorrow => const AssetGenImage('assets/home/ic_borrow.png'); - - /// File path: assets/home/ic_decoration.png AssetGenImage get icDecoration => const AssetGenImage('assets/home/ic_decoration.png'); - - /// File path: assets/home/ic_facilities.png AssetGenImage get icFacilities => const AssetGenImage('assets/home/ic_facilities.png'); - - /// File path: assets/home/ic_greening.png AssetGenImage get icGreening => const AssetGenImage('assets/home/ic_greening.png'); - - /// File path: assets/home/ic_news.png AssetGenImage get icNews => const AssetGenImage('assets/home/ic_news.png'); - - /// File path: assets/home/ic_police.png AssetGenImage get icPolice => const AssetGenImage('assets/home/ic_police.png'); - - /// File path: assets/home/ic_scan.png AssetGenImage get icScan => const AssetGenImage('assets/home/ic_scan.png'); - - /// File path: assets/home/ic_search.png AssetGenImage get icSearch => const AssetGenImage('assets/home/ic_search.png'); - - /// File path: assets/home/ic_service.png AssetGenImage get icService => const AssetGenImage('assets/home/ic_service.png'); - - /// File path: assets/home/ic_visitors.png AssetGenImage get icVisitors => const AssetGenImage('assets/home/ic_visitors.png'); - - /// File path: assets/home/interview.png AssetGenImage get interview => const AssetGenImage('assets/home/interview.png'); - - /// File path: assets/home/key.png AssetGenImage get key => const AssetGenImage('assets/home/key.png'); - - /// File path: assets/home/message.png AssetGenImage get message => const AssetGenImage('assets/home/message.png'); - - /// File path: assets/home/nearby_pet.png AssetGenImage get nearbyPet => const AssetGenImage('assets/home/nearby_pet.png'); - - /// File path: assets/home/nearby_service.png AssetGenImage get nearbyService => const AssetGenImage('assets/home/nearby_service.png'); - - /// File path: assets/home/package.png AssetGenImage get package => const AssetGenImage('assets/home/package.png'); - - /// File path: assets/home/provide_aged.png AssetGenImage get provideAged => const AssetGenImage('assets/home/provide_aged.png'); - - /// File path: assets/home/rules.png AssetGenImage get rules => const AssetGenImage('assets/home/rules.png'); - - /// File path: assets/home/second_hand_market.png AssetGenImage get secondHandMarket => const AssetGenImage('assets/home/second_hand_market.png'); - - /// File path: assets/home/share_park.png AssetGenImage get sharePark => const AssetGenImage('assets/home/share_park.png'); - - /// File path: assets/home/shopping_mall.png AssetGenImage get shoppingMall => const AssetGenImage('assets/home/shopping_mall.png'); - - /// File path: assets/home/sos.png AssetGenImage get sos => const AssetGenImage('assets/home/sos.png'); } class $AssetsIconsGen { const $AssetsIconsGen(); - /// File path: assets/icons/alarm_clock.png AssetGenImage get alarmClock => const AssetGenImage('assets/icons/alarm_clock.png'); - - /// File path: assets/icons/camera.png AssetGenImage get camera => const AssetGenImage('assets/icons/camera.png'); - - /// File path: assets/icons/cancel_task.png AssetGenImage get cancelTask => const AssetGenImage('assets/icons/cancel_task.png'); - - /// File path: assets/icons/clock_circle.png AssetGenImage get clockCircle => const AssetGenImage('assets/icons/clock_circle.png'); - - /// File path: assets/icons/connect.png AssetGenImage get connect => const AssetGenImage('assets/icons/connect.png'); - - /// File path: assets/icons/copy.png AssetGenImage get copy => const AssetGenImage('assets/icons/copy.png'); - - /// File path: assets/icons/dissatisfied.png AssetGenImage get dissatisfied => const AssetGenImage('assets/icons/dissatisfied.png'); - - /// File path: assets/icons/edit.png AssetGenImage get edit => const AssetGenImage('assets/icons/edit.png'); - - /// File path: assets/icons/environment.png AssetGenImage get environment => const AssetGenImage('assets/icons/environment.png'); - - /// File path: assets/icons/examining.png AssetGenImage get examining => const AssetGenImage('assets/icons/examining.png'); - - /// File path: assets/icons/finish_order.png AssetGenImage get finishOrder => const AssetGenImage('assets/icons/finish_order.png'); - - /// File path: assets/icons/normal.png AssetGenImage get normal => const AssetGenImage('assets/icons/normal.png'); - - /// File path: assets/icons/pass.png AssetGenImage get pass => const AssetGenImage('assets/icons/pass.png'); - - /// File path: assets/icons/phone.png AssetGenImage get phone => const AssetGenImage('assets/icons/phone.png'); - - /// File path: assets/icons/phone_circle.png AssetGenImage get phoneCircle => const AssetGenImage('assets/icons/phone_circle.png'); - - /// File path: assets/icons/record.png AssetGenImage get record => const AssetGenImage('assets/icons/record.png'); - - /// File path: assets/icons/reject.png AssetGenImage get reject => const AssetGenImage('assets/icons/reject.png'); - - /// File path: assets/icons/reward.png AssetGenImage get reward => const AssetGenImage('assets/icons/reward.png'); - - /// File path: assets/icons/satisfied.png AssetGenImage get satisfied => const AssetGenImage('assets/icons/satisfied.png'); - - /// File path: assets/icons/tag.png AssetGenImage get tag => const AssetGenImage('assets/icons/tag.png'); - - /// File path: assets/icons/task_location.png AssetGenImage get taskLocation => const AssetGenImage('assets/icons/task_location.png'); - - /// File path: assets/icons/watch.png AssetGenImage get watch => const AssetGenImage('assets/icons/watch.png'); } class $AssetsInspectionGen { const $AssetsInspectionGen(); - /// File path: assets/inspection/ic_date.png AssetGenImage get icDate => const AssetGenImage('assets/inspection/ic_date.png'); - - /// File path: assets/inspection/ic_inspection_name.png AssetGenImage get icInspectionName => const AssetGenImage('assets/inspection/ic_inspection_name.png'); - - /// File path: assets/inspection/ic_pattern.png AssetGenImage get icPattern => const AssetGenImage('assets/inspection/ic_pattern.png'); - - /// File path: assets/inspection/ic_station.png AssetGenImage get icStation => const AssetGenImage('assets/inspection/ic_station.png'); - - /// File path: assets/inspection/ic_way.png AssetGenImage get icWay => const AssetGenImage('assets/inspection/ic_way.png'); - - /// File path: assets/inspection/ic_xunjian.png AssetGenImage get icXunjian => const AssetGenImage('assets/inspection/ic_xunjian.png'); - - /// File path: assets/inspection/inspection_station.png AssetGenImage get inspectionStation => const AssetGenImage('assets/inspection/inspection_station.png'); } @@ -261,149 +132,72 @@ class $AssetsInspectionGen { class $AssetsManageGen { const $AssetsManageGen(); - /// File path: assets/manage/add.png AssetGenImage get add => const AssetGenImage('assets/manage/add.png'); - - /// File path: assets/manage/address.png AssetGenImage get address => const AssetGenImage('assets/manage/address.png'); - - /// File path: assets/manage/article.png AssetGenImage get article => const AssetGenImage('assets/manage/article.png'); - - /// File path: assets/manage/borrow.png AssetGenImage get borrow => const AssetGenImage('assets/manage/borrow.png'); - - /// File path: assets/manage/check.png AssetGenImage get check => const AssetGenImage('assets/manage/check.png'); - - /// File path: assets/manage/circuit.png AssetGenImage get circuit => const AssetGenImage('assets/manage/circuit.png'); - - /// File path: assets/manage/clock.png AssetGenImage get clock => const AssetGenImage('assets/manage/clock.png'); - - /// File path: assets/manage/decoration.png AssetGenImage get decoration => const AssetGenImage('assets/manage/decoration.png'); - - /// File path: assets/manage/dingwei.png AssetGenImage get dingwei => const AssetGenImage('assets/manage/dingwei.png'); - - /// File path: assets/manage/estate.png AssetGenImage get estate => const AssetGenImage('assets/manage/estate.png'); - - /// File path: assets/manage/home.png AssetGenImage get home => const AssetGenImage('assets/manage/home.png'); - - /// File path: assets/manage/ic_announce.png AssetGenImage get icAnnounce => const AssetGenImage('assets/manage/ic_announce.png'); - - /// File path: assets/manage/ic_car.png AssetGenImage get icCar => const AssetGenImage('assets/manage/ic_car.png'); - - /// File path: assets/manage/ic_daofang.png AssetGenImage get icDaofang => const AssetGenImage('assets/manage/ic_daofang.png'); - - /// File path: assets/manage/ic_guoqi.png AssetGenImage get icGuoqi => const AssetGenImage('assets/manage/ic_guoqi.png'); - - /// File path: assets/manage/ic_image.png AssetGenImage get icImage => const AssetGenImage('assets/manage/ic_image.png'); - - /// File path: assets/manage/ic_renwu.png AssetGenImage get icRenwu => const AssetGenImage('assets/manage/ic_renwu.png'); - - /// File path: assets/manage/ic_time.png AssetGenImage get icTime => const AssetGenImage('assets/manage/ic_time.png'); - - /// File path: assets/manage/ic_wancheng.png AssetGenImage get icWancheng => const AssetGenImage('assets/manage/ic_wancheng.png'); - - /// File path: assets/manage/ic_weidao.png AssetGenImage get icWeidao => const AssetGenImage('assets/manage/ic_weidao.png'); - - /// File path: assets/manage/ic_zhuangxiu.png AssetGenImage get icZhuangxiu => const AssetGenImage('assets/manage/ic_zhuangxiu.png'); - - /// File path: assets/manage/ic_zuofei.png AssetGenImage get icZuofei => const AssetGenImage('assets/manage/ic_zuofei.png'); - - /// File path: assets/manage/info.png AssetGenImage get info => const AssetGenImage('assets/manage/info.png'); - - /// File path: assets/manage/key.png AssetGenImage get key => const AssetGenImage('assets/manage/key.png'); - - /// File path: assets/manage/location.png AssetGenImage get location => const AssetGenImage('assets/manage/location.png'); - - /// File path: assets/manage/lock.png AssetGenImage get lock => const AssetGenImage('assets/manage/lock.png'); - - /// File path: assets/manage/police.png + AssetGenImage get passed => const AssetGenImage('assets/manage/passed.png'); AssetGenImage get police => const AssetGenImage('assets/manage/police.png'); - - /// File path: assets/manage/remaining.png + AssetGenImage get rejected => + const AssetGenImage('assets/manage/rejected.png'); AssetGenImage get remaining => const AssetGenImage('assets/manage/remaining.png'); - - /// File path: assets/manage/security.png AssetGenImage get security => const AssetGenImage('assets/manage/security.png'); - - /// File path: assets/manage/status.png AssetGenImage get status => const AssetGenImage('assets/manage/status.png'); - - /// File path: assets/manage/submit_success.png AssetGenImage get submitSuccess => const AssetGenImage('assets/manage/submit_success.png'); - - /// File path: assets/manage/wall.png AssetGenImage get wall => const AssetGenImage('assets/manage/wall.png'); - - /// File path: assets/manage/warning.png AssetGenImage get warning => const AssetGenImage('assets/manage/warning.png'); - - /// File path: assets/manage/waterway.png AssetGenImage get waterway => const AssetGenImage('assets/manage/waterway.png'); - - /// File path: assets/manage/window.png AssetGenImage get window => const AssetGenImage('assets/manage/window.png'); } class $AssetsMessageGen { const $AssetsMessageGen(); - /// File path: assets/message/ic_area.png AssetGenImage get icArea => const AssetGenImage('assets/message/ic_area.png'); - - /// File path: assets/message/ic_people.png AssetGenImage get icPeople => const AssetGenImage('assets/message/ic_people.png'); - - /// File path: assets/message/ic_phone.png AssetGenImage get icPhone => const AssetGenImage('assets/message/ic_phone.png'); - - /// File path: assets/message/ic_pinglun.png AssetGenImage get icPinglun => const AssetGenImage('assets/message/ic_pinglun.png'); - - /// File path: assets/message/ic_star.png AssetGenImage get icStar => const AssetGenImage('assets/message/ic_star.png'); - - /// File path: assets/message/ic_tongzhi.png AssetGenImage get icTongzhi => const AssetGenImage('assets/message/ic_tongzhi.png'); } @@ -411,78 +205,40 @@ class $AssetsMessageGen { class $AssetsOutdoorGen { const $AssetsOutdoorGen(); - /// File path: assets/outdoor/ic_address.png AssetGenImage get icAddress => const AssetGenImage('assets/outdoor/ic_address.png'); - - /// File path: assets/outdoor/ic_chuhu.png AssetGenImage get icChuhu => const AssetGenImage('assets/outdoor/ic_chuhu.png'); - - /// File path: assets/outdoor/ic_goout.png AssetGenImage get icGoout => const AssetGenImage('assets/outdoor/ic_goout.png'); - - /// File path: assets/outdoor/ic_home.png AssetGenImage get icHome => const AssetGenImage('assets/outdoor/ic_home.png'); - - /// File path: assets/outdoor/ic_image.png AssetGenImage get icImage => const AssetGenImage('assets/outdoor/ic_image.png'); - - /// File path: assets/outdoor/ic_people.png AssetGenImage get icPeople => const AssetGenImage('assets/outdoor/ic_people.png'); - - /// File path: assets/outdoor/ic_phoneblue.png AssetGenImage get icPhoneblue => const AssetGenImage('assets/outdoor/ic_phoneblue.png'); - - /// File path: assets/outdoor/ic_time.png AssetGenImage get icTime => const AssetGenImage('assets/outdoor/ic_time.png'); - - /// File path: assets/outdoor/ic_transport.png AssetGenImage get icTransport => const AssetGenImage('assets/outdoor/ic_transport.png'); - - /// File path: assets/outdoor/ic_weight.png AssetGenImage get icWeight => const AssetGenImage('assets/outdoor/ic_weight.png'); - - /// File path: assets/outdoor/item2.png AssetGenImage get item2 => const AssetGenImage('assets/outdoor/item2.png'); - - /// File path: assets/outdoor/item3.png AssetGenImage get item3 => const AssetGenImage('assets/outdoor/item3.png'); - - /// File path: assets/outdoor/itme1.png AssetGenImage get itme1 => const AssetGenImage('assets/outdoor/itme1.png'); } class $AssetsStaticFixGen { const $AssetsStaticFixGen(); - /// File path: assets/static_fix/air1.png AssetGenImage get air1 => const AssetGenImage('assets/static_fix/air1.png'); - - /// File path: assets/static_fix/air2.png AssetGenImage get air2 => const AssetGenImage('assets/static_fix/air2.png'); - - /// File path: assets/static_fix/food.png AssetGenImage get food => const AssetGenImage('assets/static_fix/food.png'); - - /// File path: assets/static_fix/food2.png AssetGenImage get food2 => const AssetGenImage('assets/static_fix/food2.png'); - - /// File path: assets/static_fix/light1.png AssetGenImage get light1 => const AssetGenImage('assets/static_fix/light1.png'); - - /// File path: assets/static_fix/light2.png AssetGenImage get light2 => const AssetGenImage('assets/static_fix/light2.png'); - - /// File path: assets/static_fix/light3.png AssetGenImage get light3 => const AssetGenImage('assets/static_fix/light3.png'); } @@ -490,30 +246,15 @@ class $AssetsStaticFixGen { class $AssetsStaticTempGen { const $AssetsStaticTempGen(); - /// File path: assets/static_temp/drill.png AssetGenImage get drill => const AssetGenImage('assets/static_temp/drill.png'); - - /// File path: assets/static_temp/f1.webp AssetGenImage get f1 => const AssetGenImage('assets/static_temp/f1.webp'); - - /// File path: assets/static_temp/f2.webp AssetGenImage get f2 => const AssetGenImage('assets/static_temp/f2.webp'); - - /// File path: assets/static_temp/f3.webp AssetGenImage get f3 => const AssetGenImage('assets/static_temp/f3.webp'); - - /// File path: assets/static_temp/f4.webp AssetGenImage get f4 => const AssetGenImage('assets/static_temp/f4.webp'); - - /// File path: assets/static_temp/f5.webp AssetGenImage get f5 => const AssetGenImage('assets/static_temp/f5.webp'); - - /// File path: assets/static_temp/hammer.png AssetGenImage get hammer => const AssetGenImage('assets/static_temp/hammer.png'); - - /// File path: assets/static_temp/ladder.png AssetGenImage get ladder => const AssetGenImage('assets/static_temp/ladder.png'); } @@ -521,14 +262,9 @@ class $AssetsStaticTempGen { class $AssetsUserGen { const $AssetsUserGen(); - /// File path: assets/user/ic_kefu.png AssetGenImage get icKefu => const AssetGenImage('assets/user/ic_kefu.png'); - - /// File path: assets/user/ic_person.png AssetGenImage get icPerson => const AssetGenImage('assets/user/ic_person.png'); - - /// File path: assets/user/ic_setup.png AssetGenImage get icSetup => const AssetGenImage('assets/user/ic_setup.png'); } diff --git a/lib/gen/fonts.gen.dart b/lib/gen/fonts.gen.dart index 69d5c31..00c6094 100644 --- a/lib/gen/fonts.gen.dart +++ b/lib/gen/fonts.gen.dart @@ -3,11 +3,8 @@ /// FlutterGen /// ***************************************************** -// ignore_for_file: directives_ordering,unnecessary_import - class FontFamily { FontFamily._(); - /// Font family: Bebas static const String bebas = 'Bebas'; } diff --git a/lib/new_ui/household_audit/household_audit_page.dart b/lib/new_ui/household_audit/household_audit_page.dart new file mode 100644 index 0000000..09ecf9f --- /dev/null +++ b/lib/new_ui/household_audit/household_audit_page.dart @@ -0,0 +1,261 @@ +import 'package:aku_new_community_manager/const/saas_api.dart'; +import 'package:aku_new_community_manager/gen/assets.gen.dart'; +import 'package:aku_new_community_manager/saas_models/household_audit/household_audit_list_model.dart'; +import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:aku_new_community_manager/ui/widgets/common/bee_divider.dart'; +import 'package:aku_new_community_manager/ui/widgets/common/car_bottom_button.dart'; +import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart'; +import 'package:aku_new_community_manager/utils/extension/list_extension.dart'; +import 'package:aku_new_community_manager/utils/network/net_util.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/src/extensions/iterable_ext.dart'; +import 'package:velocity_x/src/extensions/num_ext.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class HouseholdAuditPage extends StatefulWidget { + const HouseholdAuditPage({Key? key}) : super(key: key); + + @override + _HouseholdAuditPageState createState() => _HouseholdAuditPageState(); +} + +class _HouseholdAuditPageState extends State + with SingleTickerProviderStateMixin { + List _tabs = ['全部', '待审核', '已同意', '已驳回']; + List _refreshControllers = []; + late TabController _tabController; + List _models = []; + + @override + void initState() { + _refreshControllers = List.filled(_tabs.length, EasyRefreshController()); + _tabController = TabController(length: _tabs.length, vsync: this); + super.initState(); + } + + @override + void dispose() { + _refreshControllers.forEach((element) { + element.dispose(); + }); + _tabController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '住户审核', + appBarBottom: PreferredSize( + preferredSize: Size.fromHeight(107.w), + child: AkuTabBar( + controller: _tabController, + tabs: _tabs, + )), + body: TabBarView( + controller: _tabController, + children: List.generate(_tabs.length, (index) => _getView(index))), + ); + } + + Widget _getView(int index) { + return EasyRefresh( + controller: _refreshControllers[index], + firstRefresh: true, + header: MaterialHeader(), + footer: MaterialFooter(), + onRefresh: () async { + var base = await NetUtil().getList(SAASAPI.householdAudit.list); + _models = base.rows + .map((e) => HouseholdAuditListModel.fromJson(e)) + .toList(); + setState(() {}); + }, + onLoad: () async { + var base = await NetUtil().getList(SAASAPI.householdAudit.list); + if (_models.length < base.total) { + _models.addAll(base.rows + .map((e) => HouseholdAuditListModel.fromJson(e)) + .toList()); + setState(() {}); + } else { + _refreshControllers[index].finishLoad(); + } + }, + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + children: _models + .mapIndexed((currentValue, index) => _card(currentValue, index)) + .toList() + .sepWidget(separate: 24.w.heightBox), + )); + } + + Widget _card(HouseholdAuditListModel model, int index) { + return Stack( + children: [ + Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.w), color: Colors.white), + child: Column( + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w), + height: 77.w, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + // stops: [ + // 0.4, + // 0.6, + // 0.8 + // ], + colors: [ + Color(0xFFFFEAC3).withOpacity(0.31), + Color(0xFFFEE1AE).withOpacity(0.24), + Color(0xFFFFFFFF), + ])), + child: Row( + children: [ + '2栋1单元502室' + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + Spacer(), + '类型:${model.estateTypeName}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: 160.w, + child: '申请人' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make()), + model.name.text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ), + 24.w.heightBox, + Row( + children: [ + SizedBox( + width: 160.w, + child: '申请身份' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make()), + _identity[model.identity]! + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ), + 24.w.heightBox, + Row( + children: [ + SizedBox( + width: 160.w, + child: '申请身份' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make()), + _identity[model.identity]! + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ) + ], + ), + ), + Offstage( + offstage: model.status != 1, + child: Column( + children: [ + BeeDivider.horizontal(), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 32.w, vertical: 24.w), + child: Row( + children: [ + Spacer(), + CardBottomButton.yellow( + text: '通过', + onPressed: () async { + var base = await NetUtil().post( + SAASAPI.householdAudit.review, + params: { + 'operate': 1, + 'estateReviewId': model.estateReviewId + }); + if (base.success) { + _refreshControllers[index].callRefresh(); + } + }), + 24.w.widthBox, + CardBottomButton.white( + text: '驳回', + onPressed: () async { + var base = await NetUtil().post( + SAASAPI.householdAudit.review, + params: { + 'operate': 2, + 'estateReviewId': model.estateReviewId + }); + if (base.success) { + _refreshControllers[index].callRefresh(); + } + }), + ], + ), + ), + ], + ), + ) + ], + ), + ), + Positioned( + right: 24.w, + bottom: 24.w, + child: Offstage( + offstage: model.status == 1, + child: Image.asset( + model.status == 2 + ? Assets.manage.rejected.path + : Assets.manage.passed.path, + width: 160.w, + height: 160.w, + ), + ), + ) + ], + ); + } + + Map _identity = {1: '业主', 2: '业主亲属', 3: '租户', 4: '租户亲属'}; +} diff --git a/lib/new_ui/new_home/application_util.dart b/lib/new_ui/new_home/application_util.dart index 7727873..bd40478 100644 --- a/lib/new_ui/new_home/application_util.dart +++ b/lib/new_ui/new_home/application_util.dart @@ -1,4 +1,5 @@ import 'package:aku_new_community_manager/gen/assets.gen.dart'; +import 'package:aku_new_community_manager/new_ui/household_audit/household_audit_page.dart'; import 'package:aku_new_community_manager/new_ui/work_order/distributor/work_order_distributor_page.dart'; import 'package:aku_new_community_manager/new_ui/work_order/receiver/work_order_receiver_page.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart'; @@ -51,8 +52,10 @@ class ApplicationUtil { }), AppElement( title: '住户审核', - imgPath: Assets.home.icArticle.path, - onTap: () async {}) + imgPath: Assets.home.icVisitors.path, + onTap: () async { + Get.to(() => HouseholdAuditPage()); + }) ]; } diff --git a/lib/new_ui/new_home/new_home_page.dart b/lib/new_ui/new_home/new_home_page.dart index c182ed3..1700b71 100644 --- a/lib/new_ui/new_home/new_home_page.dart +++ b/lib/new_ui/new_home/new_home_page.dart @@ -228,7 +228,7 @@ class _NewHomePageState extends State { Column( children: [ Row( - children: ApplicationUtil(['巡检管理', '工单管理']) + children: ApplicationUtil(['巡检管理', '工单管理', '住户审核']) .elements .map((e) => _applicationElement(e)) .toList() @@ -348,7 +348,12 @@ class _NewHomePageState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - '小蜜蜂'.text.size(32.sp).black.bold.make(), + '${UserTool.userProvider.userInfoModel!.nickName}' + .text + .size(32.sp) + .black + .bold + .make(), 10.w.heightBox, Row( children: [ @@ -359,11 +364,12 @@ class _NewHomePageState extends State { color: Color(0xFFFFC40C), borderRadius: BorderRadius.circular(4.w), ), - child: '测试小区' - .text - .size(24.sp) - .color(Colors.black.withOpacity(0.85)) - .make(), + child: + '${UserTool.userProvider.userInfoModel!.communityName}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), ), 16.w.widthBox, Container( @@ -373,11 +379,12 @@ class _NewHomePageState extends State { color: Color(0xFFFFC40C), borderRadius: BorderRadius.circular(4.w), ), - child: '行政' - .text - .size(24.sp) - .color(Colors.black.withOpacity(0.85)) - .make(), + child: + '${UserTool.userProvider.userInfoModel!.positionName}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), ) ], ), diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index c3d949e..5588b72 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -36,7 +36,7 @@ class UserProvider extends ChangeNotifier { ///注销登录 logout() async { - await NetUtil().get(SAASAPI.login.logOut, showMessage: true); + await NetUtil().post(SAASAPI.login.logOut, showMessage: true); WebSocketUtil().closeWebSocket(); NetUtil().logout(); _isLogin = false; diff --git a/lib/saas_models/household_audit/household_audit_list_model.dart b/lib/saas_models/household_audit/household_audit_list_model.dart new file mode 100644 index 0000000..4f91f68 --- /dev/null +++ b/lib/saas_models/household_audit/household_audit_list_model.dart @@ -0,0 +1,49 @@ +import 'package:equatable/equatable.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'household_audit_list_model.g.dart'; + +@JsonSerializable() +class HouseholdAuditListModel extends Equatable { + final int estateReviewId; + final String name; + final String tel; + final int estateId; + final String estateName; + final String unitName; + final String buildingName; + final int identity; + final String idCard; + final int status; + final String estateTypeName; + factory HouseholdAuditListModel.fromJson(Map json) => + _$HouseholdAuditListModelFromJson(json); + + const HouseholdAuditListModel({ + required this.estateReviewId, + required this.name, + required this.tel, + required this.estateId, + required this.estateName, + required this.unitName, + required this.buildingName, + required this.identity, + required this.idCard, + required this.status, + required this.estateTypeName, + }); + @override + List get props => [ + estateReviewId, + name, + tel, + estateId, + estateName, + unitName, + buildingName, + identity, + idCard, + status, + estateTypeName, + ]; +} diff --git a/lib/saas_models/household_audit/household_audit_list_model.g.dart b/lib/saas_models/household_audit/household_audit_list_model.g.dart new file mode 100644 index 0000000..fe18517 --- /dev/null +++ b/lib/saas_models/household_audit/household_audit_list_model.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'household_audit_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HouseholdAuditListModel _$HouseholdAuditListModelFromJson( + Map json) => + HouseholdAuditListModel( + estateReviewId: json['estateReviewId'] as int, + name: json['name'] as String, + tel: json['tel'] as String, + estateId: json['estateId'] as int, + estateName: json['estateName'] as String, + unitName: json['unitName'] as String, + buildingName: json['buildingName'] as String, + identity: json['identity'] as int, + idCard: json['idCard'] as String, + status: json['status'] as int, + estateTypeName: json['estateTypeName'] as String, + ); diff --git a/lib/utils/network/net_util.dart b/lib/utils/network/net_util.dart index ddb3df7..93b5b8a 100644 --- a/lib/utils/network/net_util.dart +++ b/lib/utils/network/net_util.dart @@ -103,14 +103,11 @@ class NetUtil { }) async { try { Response res = await _dio!.get(path, queryParameters: params); - if ((res.data as Map).containsKey('status') && - (res.data as Map).containsKey('data') && - (res.data as Map).containsKey('message')) { - BaseModel baseModel = BaseModel.fromJson(res.data); - _parseRequestError(baseModel); - } else { - BaseListModel baseListModel = BaseListModel.fromJson(res.data); + if (res.data['success']) { + BaseListModel baseListModel = BaseListModel.fromJson(res.data['data']); return baseListModel; + } else { + return BaseListModel.err(); } } on DioError catch (e) { _parseErr(e);