From 5fa0586230465d1ab77df8ad5b6271dbfb9899bd Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 3 Jun 2021 19:33:27 +0800 Subject: [PATCH] remove mock models --- lib/main.dart | 16 +- lib/mock_models/all_model.dart | 55 - lib/mock_models/borrow/borrow_data.dart | 95 -- lib/mock_models/borrow/borrow_model.dart | 92 -- .../decoration/decoration_data.dart | 230 --- .../decoration/decoration_model.dart | 371 +++-- lib/mock_models/fix/fix_model.dart | 286 ---- lib/mock_models/fix/fixer_model.dart | 134 +- .../manage_models/manage_model.dart | 59 - lib/mock_models/users/user_info_model.dart | 84 - lib/provider/fix_provider.dart | 71 - lib/provider/manage_provider.dart | 20 - lib/provider/user_provider.dart | 22 +- .../clock_in_out/clock_in_out_main_page.dart | 4 +- .../borrow_manager/borrow_manager_card.dart | 1 - .../borrow_manager/borrow_manager_page.dart | 4 +- .../business_and_fix_page.dart | 1 - .../decoration_check_card_widget.dart | 93 +- .../decoration_check_row.dart | 130 +- .../decoration_department_page.dart | 368 +++-- .../decoration_follow_check.dart | 532 +++---- .../decoration_manager_card.dart | 268 ++-- .../decoration_manager_detail_page.dart | 1390 ++++++++--------- .../decoration_manager_page.dart | 232 +-- .../new_renovation/new_renovation_view.dart | 1 + lib/utils/network/net_util.dart | 1 - 26 files changed, 1776 insertions(+), 2784 deletions(-) delete mode 100644 lib/mock_models/all_model.dart delete mode 100644 lib/mock_models/borrow/borrow_data.dart delete mode 100644 lib/mock_models/borrow/borrow_model.dart delete mode 100644 lib/mock_models/decoration/decoration_data.dart delete mode 100644 lib/mock_models/fix/fix_model.dart delete mode 100644 lib/mock_models/manage_models/manage_model.dart delete mode 100644 lib/mock_models/users/user_info_model.dart delete mode 100644 lib/provider/fix_provider.dart delete mode 100644 lib/provider/manage_provider.dart diff --git a/lib/main.dart b/lib/main.dart index 59e3353..1fa9aa2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -13,8 +13,6 @@ import 'package:provider/provider.dart'; // Project imports: import 'package:aku_community_manager/provider/app_provider.dart'; -import 'package:aku_community_manager/provider/fix_provider.dart'; -import 'package:aku_community_manager/provider/manage_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/style/apptheme.dart'; import 'package:aku_community_manager/ui/splash/splash_page.dart'; @@ -64,13 +62,13 @@ class MyApp extends StatelessWidget { providers: [ ChangeNotifierProvider(create: (context) => UserProvider()), ChangeNotifierProvider(create: (context) => AppProvider()), - ChangeNotifierProvider(create: (context) => FixProvider()), - ChangeNotifierProvider(create: (context) => GreenManageProvider()), - ChangeNotifierProvider( - create: (context) => InspectionManageProvider()), - ChangeNotifierProvider(create: (context) => GreenManageProvider()), - ChangeNotifierProvider( - create: (context) => InspectionManageProvider()), + // ChangeNotifierProvider(create: (context) => FixProvider()), + // ChangeNotifierProvider(create: (context) => GreenManageProvider()), + // ChangeNotifierProvider( + // create: (context) => InspectionManageProvider()), + // ChangeNotifierProvider(create: (context) => GreenManageProvider()), + // ChangeNotifierProvider( + // create: (context) => InspectionManageProvider()), ], child: GestureDetector( onTap: () { diff --git a/lib/mock_models/all_model.dart b/lib/mock_models/all_model.dart deleted file mode 100644 index b19ed7a..0000000 --- a/lib/mock_models/all_model.dart +++ /dev/null @@ -1,55 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:provider/provider.dart'; - -// Project imports: -import 'package:aku_community_manager/mock_models/decoration/decoration_data.dart'; -import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; -import 'package:aku_community_manager/mock_models/fix/fix_model.dart'; -import 'package:aku_community_manager/provider/fix_provider.dart'; - -@Deprecated('this mock model should be removed') -class AllModel { - BuildContext context; - AllModel(this.context); - - List get allThings { - final fixProvider = Provider.of(context, listen: false); - return [ - ...fixProvider.fixModels, - ...DecorationData.allModels, - ]; - } - - List get waitThings { - final fixProvider = Provider.of(context, listen: false); - return [ - ...fixProvider.fixModels.where((element) { - return element.type == FIX_ENUM.WAIT_PICKUP; - }).toList(), - ...DecorationData.getModels(DecorationType.WAIT_HAND_OUT), - ]; - } - - List get processingThings { - final fixProvider = Provider.of(context, listen: false); - return [ - ...fixProvider.fixModels.where((element) { - return element.type == FIX_ENUM.PROCESSING; - }).toList(), - ...DecorationData.getModels(DecorationType.HAND_OUT), - ]; - } - - List get doneThings { - final fixProvider = Provider.of(context, listen: false); - return [ - ...fixProvider.fixModels.where((element) { - return element.type == FIX_ENUM.DONE; - }).toList(), - ...DecorationData.getModels(DecorationType.DONE), - ]; - } -} diff --git a/lib/mock_models/borrow/borrow_data.dart b/lib/mock_models/borrow/borrow_data.dart deleted file mode 100644 index 9b9e45f..0000000 --- a/lib/mock_models/borrow/borrow_data.dart +++ /dev/null @@ -1,95 +0,0 @@ -// Project imports: -import 'package:aku_community_manager/const/resource.dart'; -import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart'; - -//TODO CLEAN BOTTOM CODES. -@Deprecated("borrow_data need to be cleaned.") -class BorrowData { - static List get checkModels => models.where((e) { - return e.borrowGoods.status == BORROW_STATUS.WAIT_CHECK; - }).toList(); - static List get borrowModels => models.where((e) { - return e.borrowGoods.status == BORROW_STATUS.BORROWING; - }).toList(); - - static List get doneModels => models.where((e) { - return e.borrowGoods.status == BORROW_STATUS.DONE; - }).toList(); - - static List models = [ - BorrowModel( - title: '归还梯子一个', - borrowPerson: '李慧珍', - borrowTime: 5, - goodsStatus: GOODS_STATUS.BROKEN, - phone: '19981712931', - borrowGoods: SingleBorrowGoods( - name: '梯子', - assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG, - code: '3193713894', - status: BORROW_STATUS.WAIT_CHECK, - ), - date: DateTime(2020, 5, 5, 12, 35, 45), - ), - BorrowModel( - title: '归还梯子一个', - borrowPerson: '李慧珍', - borrowTime: 5, - goodsStatus: GOODS_STATUS.BROKEN, - phone: '19981712931', - borrowGoods: SingleBorrowGoods( - name: '梯子', - assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG, - code: '3193713894', - status: BORROW_STATUS.DONE, - ), - date: DateTime(2020, 5, 5, 12, 35, 45), - ), - BorrowModel( - title: '借用电钻一把', - borrowPerson: '刘虎门', - borrowTime: 12, - goodsStatus: GOODS_STATUS.NORMAL, - phone: '19981738879', - borrowGoods: SingleBorrowGoods( - name: '电钻', - assetpath: R.ASSETS_STATIC_TEMP_DRILL_PNG, - code: '31937293841', - status: BORROW_STATUS.BORROWING, - ), - date: DateTime(2020, 4, 5, 12, 35, 45), - ), - BorrowModel( - borrowPerson: '刘海保', - borrowTime: 5, - title: '借用榔头一把', - goodsStatus: GOODS_STATUS.NORMAL, - phone: '19981738879', - borrowGoods: SingleBorrowGoods( - name: '榔头', - assetpath: R.ASSETS_STATIC_TEMP_HAMMER_PNG, - code: '3193794102481', - status: BORROW_STATUS.BORROWING, - ), - date: DateTime(2020, 3, 5, 12, 35, 45), - ), - ]; - - static List borrowObjects = [ - BorrowObject.init( - name: '电钻', - assetPath: R.ASSETS_STATIC_TEMP_DRILL_PNG, - allNumber: 5, - ), - BorrowObject.init( - name: '梯子', - assetPath: R.ASSETS_STATIC_TEMP_LADDER_PNG, - allNumber: 3, - ), - BorrowObject.init( - name: '三角榔头', - assetPath: R.ASSETS_STATIC_TEMP_HAMMER_PNG, - allNumber: 8, - ), - ]; -} diff --git a/lib/mock_models/borrow/borrow_model.dart b/lib/mock_models/borrow/borrow_model.dart deleted file mode 100644 index 909286c..0000000 --- a/lib/mock_models/borrow/borrow_model.dart +++ /dev/null @@ -1,92 +0,0 @@ -// Dart imports: -import 'dart:math'; - -// Package imports: -import 'package:meta/meta.dart'; - -enum BORROW_STATUS { - ///出借中 - BORROWING, - - ///待检查 - WAIT_CHECK, - - ///未出借 - NOT_BORROW, - - ///已归还 - DONE, -} - -enum GOODS_STATUS { - NORMAL, - BROKEN, - LOST, -} - -//TODO CLEAN BOTTOM CODES. -@Deprecated(" borrow_model need to be cleaned.") -class BorrowModel { - String borrowPerson; - String phone; - int borrowTime; - GOODS_STATUS goodsStatus; - String title; - SingleBorrowGoods borrowGoods; - DateTime date; - - BorrowModel({ - @required this.borrowPerson, - @required this.phone, - @required this.borrowTime, - @required this.goodsStatus, - @required this.borrowGoods, - @required this.title, - @required this.date, - }); -} - -class BorrowObject { - String name; - int allNumber; - dynamic assetPath; - int borrowNumber; - int get restNumber => allNumber - borrowNumber; - List items; - - BorrowObject.init({ - this.name, - this.allNumber, - this.assetPath, - }) { - this.borrowNumber = 0; - items = List.generate( - this.allNumber, - (index) => SingleBorrowGoods( - name: '${this.name}${index + 1}', - code: (179264234 + Random().nextInt(999999)).toString(), - status: BORROW_STATUS.NOT_BORROW, - assetpath: this.assetPath, - ), - ); - } -} - -class SingleBorrowGoods { - String name; - String code; - dynamic assetpath; - BORROW_STATUS status; - String get borrowValue => { - BORROW_STATUS.BORROWING: '出借中', - BORROW_STATUS.DONE: '已归还', - BORROW_STATUS.NOT_BORROW: '未出借', - BORROW_STATUS.WAIT_CHECK: '待检查', - }[status]; - SingleBorrowGoods({ - this.name, - this.code, - this.assetpath, - this.status, - }); -} diff --git a/lib/mock_models/decoration/decoration_data.dart b/lib/mock_models/decoration/decoration_data.dart deleted file mode 100644 index dd32a51..0000000 --- a/lib/mock_models/decoration/decoration_data.dart +++ /dev/null @@ -1,230 +0,0 @@ -// Project imports: -import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; -import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; - -@Deprecated('this should be removed') -class DecorationData { - static List allModels = [ - DecorationModel( - type: DecorationType.WAIT_HAND_OUT, - statusType: DecorationStatusType.PROGRESS, - decorationDate: DateTime(2020, 1, 23, 12, 23, 0), - userHomeModel: UserHomeModel( - userName: '林居明', - plot: '深圳华茂悦峰', - detailAddr: '2幢-2单元-501室', - phone: '19995430126', - ), - decorationTeamModel: DecorationTeamModel( - name: '深圳莫川装修有限公司', - userName: '李惠政', - phone: '19298540192', - ), - cycleCheck: CycleCheck(), - ), - DecorationModel( - decorationDate: DateTime(2020, 1, 23, 12, 23, 0), - type: DecorationType.HAND_OUT, - statusType: DecorationStatusType.DONE, - userHomeModel: UserHomeModel( - userName: '李慧珍', - plot: '深圳华茂悦峰', - detailAddr: '1幢-1单元-302室', - phone: '18201939840', - ), - decorationTeamModel: DecorationTeamModel( - name: '深圳莫川装修有限公司', - userName: '李惠政', - phone: '19298540192', - ), - cycleCheck: CycleCheck( - authPerson: FixerModel(name: '林鸿章', phone: '18294859301'), - startDate: DateTime(2020, 1, 23, 20, 23, 0), - checkCycle: 7, - checkDetails: [ - CHECK_TYPE.ELECTRIC, - CHECK_TYPE.WATER, - CHECK_TYPE.WALL, - CHECK_TYPE.DOOR_AND_WINDOWS, - ], - ), - workFinishCheck: WorkFinishCheck( - authPerson: FixerModel(name: '林鸿章', phone: '18294859301'), - startDate: DateTime(2020, 1, 23, 20, 23, 0), - checkDetails: [ - CHECK_TYPE.ELECTRIC, - CHECK_TYPE.WATER, - CHECK_TYPE.WALL, - CHECK_TYPE.DOOR_AND_WINDOWS, - CHECK_TYPE.SECURITY, - ], - ), - checkInfomations: [ - CheckInfomation( - checkDate: DateTime(2020, 3, 20, 12, 00), - info: '正常', - checkType: '完工检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - CheckInfomation( - checkDate: DateTime(2020, 2, 14, 12, 00), - info: '正常', - checkType: '周期检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - CheckInfomation( - checkDate: DateTime(2020, 2, 7, 12, 00), - info: '厨房水路异常', - checkType: '周期检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER, status: false), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - CheckInfomation( - checkDate: DateTime(2020, 1, 30, 12, 00), - info: '正常', - checkType: '周期检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - CheckInfomation( - checkDate: DateTime(2020, 1, 23, 12, 00), - info: '正常', - checkType: '周期检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - ], - ), - DecorationModel( - decorationDate: DateTime(2020, 1, 23, 12, 23, 0), - type: DecorationType.DONE, - statusType: DecorationStatusType.DONE, - userHomeModel: UserHomeModel( - userName: '李慧珍', - plot: '深圳华茂悦峰', - detailAddr: '1幢-1单元-302室', - phone: '18201939840', - ), - decorationTeamModel: DecorationTeamModel( - name: '深圳莫川装修有限公司', - userName: '李惠政', - phone: '19298540192', - ), - cycleCheck: CycleCheck( - authPerson: FixerModel(name: '林鸿章', phone: '18294859301'), - startDate: DateTime(2020, 1, 23, 20, 23, 0), - checkCycle: 7, - checkDetails: [ - CHECK_TYPE.ELECTRIC, - CHECK_TYPE.WATER, - CHECK_TYPE.WALL, - CHECK_TYPE.DOOR_AND_WINDOWS, - ], - ), - workFinishCheck: WorkFinishCheck( - authPerson: FixerModel(name: '林鸿章', phone: '18294859301'), - startDate: DateTime(2020, 1, 23, 20, 23, 0), - checkDetails: [ - CHECK_TYPE.ELECTRIC, - CHECK_TYPE.WATER, - CHECK_TYPE.WALL, - CHECK_TYPE.DOOR_AND_WINDOWS, - CHECK_TYPE.SECURITY, - ], - ), - checkInfomations: [ - CheckInfomation( - checkDate: DateTime(2020, 3, 20, 12, 00), - info: '正常', - checkType: '完工检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - CheckInfomation( - checkDate: DateTime(2020, 2, 14, 12, 00), - info: '正常', - checkType: '周期检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - CheckInfomation( - checkDate: DateTime(2020, 2, 7, 12, 00), - info: '厨房水路异常', - checkType: '周期检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER, status: false), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - CheckInfomation( - checkDate: DateTime(2020, 1, 30, 12, 00), - info: '正常', - checkType: '周期检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - CheckInfomation( - checkDate: DateTime(2020, 1, 23, 12, 00), - info: '正常', - checkType: '周期检查', - details: [ - CheckDetail(type: CHECK_TYPE.ELECTRIC), - CheckDetail(type: CHECK_TYPE.WATER), - CheckDetail(type: CHECK_TYPE.WALL), - CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS), - ], - ), - ], - ), - ]; - - static List getModels(DecorationType type) { - return allModels.where((element) => element.type == type).toList(); - } - - static List getTypeModels(DecorationStatusType type) { - return allModels.where((element) => element.statusType == type).toList(); - } - - static List get allPropertyModels { - return allModels - .where((element) => element.type != DecorationType.WAIT_HAND_OUT) - .toList(); - } -} diff --git a/lib/mock_models/decoration/decoration_model.dart b/lib/mock_models/decoration/decoration_model.dart index 729584b..53ca575 100644 --- a/lib/mock_models/decoration/decoration_model.dart +++ b/lib/mock_models/decoration/decoration_model.dart @@ -1,186 +1,185 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Project imports: -import 'package:aku_community_manager/const/resource.dart'; -import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; - -enum DecorationType { - ///待指派 - WAIT_HAND_OUT, - - ///已指派&待执行 - HAND_OUT, - - ///已执行 - DONE, -} - -enum DecorationStatusType { - PROGRESS, - DONE, -} - -enum CHECK_TYPE { - ELECTRIC, - WATER, - WALL, - DOOR_AND_WINDOWS, - SECURITY, -} - -Map checkTypeMap = { - CHECK_TYPE.ELECTRIC: '电路', - CHECK_TYPE.WATER: '水路', - CHECK_TYPE.WALL: '墙面', - CHECK_TYPE.DOOR_AND_WINDOWS: '门窗', - CHECK_TYPE.SECURITY: '安防', -}; - -Map checkTypeStringMap = { - '电路': CHECK_TYPE.ELECTRIC, - '水路': CHECK_TYPE.WATER, - '墙面': CHECK_TYPE.WALL, - '门窗': CHECK_TYPE.DOOR_AND_WINDOWS, - '安防': CHECK_TYPE.SECURITY, -}; - -Map checkAssetMap = { - CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG, - CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG, - CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG, - CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG, - CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG, -}; - -@Deprecated('under should be removed') -class DecorationModel { - DecorationType type; - DecorationStatusType statusType; - DateTime decorationDate; - UserHomeModel userHomeModel; - DecorationTeamModel decorationTeamModel; - CycleCheck cycleCheck; - WorkFinishCheck workFinishCheck; - List checkInfomations; - - String get statusTypeValue { - if (statusType == DecorationStatusType.PROGRESS) - return '装修中'; - else - return '装修完成'; - } - - DecorationModel({ - @required this.type, - @required this.statusType, - @required this.userHomeModel, - @required this.decorationTeamModel, - @required this.decorationDate, - this.cycleCheck, - this.workFinishCheck, - this.checkInfomations, - }); -} - -@Deprecated('under should be removed') - -///用户家庭信息 -class UserHomeModel { - String plot; - String detailAddr; - String userName; - String phone; - UserHomeModel({ - this.plot, - this.detailAddr, - this.userName, - this.phone, - }); -} - -@Deprecated('under should be removed') - -///装修队伍信息 -class DecorationTeamModel { - String name; - String userName; - String phone; - DecorationTeamModel({ - this.name, - this.userName, - this.phone, - }); -} - -@Deprecated('under should be removed') - -///周期检查 -class CycleCheck { - FixerModel authPerson; - DateTime startDate; - - ///check cycle in days - int checkCycle; - List checkDetails = [ - CHECK_TYPE.ELECTRIC, - CHECK_TYPE.WATER, - CHECK_TYPE.WALL, - CHECK_TYPE.DOOR_AND_WINDOWS, - CHECK_TYPE.SECURITY, - ]; - CycleCheck({ - this.authPerson, - this.startDate, - this.checkCycle, - this.checkDetails, - }); -} - -@Deprecated('under should be removed') -class WorkFinishCheck { - FixerModel authPerson; - DateTime startDate; - List checkDetails; - WorkFinishCheck({ - this.authPerson, - this.startDate, - this.checkDetails, - }); -} - -@Deprecated('under should be removed') - -///周期检查细节 -class CheckInfomation { - DateTime checkDate; - List details; - String info; - String checkType; - CheckInfomation({ - this.checkDate, - this.info, - this.details, - this.checkType, - }); - - ///检查结果 - bool get checkAllResult { - for (var item in details) { - if (!item.status) return false; - } - return true; - } -} - -@Deprecated('under should be removed') -class CheckDetail { - CHECK_TYPE type; - bool status; - String get assetpath => checkAssetMap[type]; - CheckDetail({ - @required this.type, - this.status = true, - }); - String get typeValue => checkTypeMap[type]; -} +// // Flutter imports: +// import 'package:flutter/material.dart'; + +// // Project imports: +// import 'package:aku_community_manager/const/resource.dart'; + +// enum DecorationType { +// ///待指派 +// WAIT_HAND_OUT, + +// ///已指派&待执行 +// HAND_OUT, + +// ///已执行 +// DONE, +// } + +// enum DecorationStatusType { +// PROGRESS, +// DONE, +// } + +// enum CHECK_TYPE { +// ELECTRIC, +// WATER, +// WALL, +// DOOR_AND_WINDOWS, +// SECURITY, +// } + +// Map checkTypeMap = { +// CHECK_TYPE.ELECTRIC: '电路', +// CHECK_TYPE.WATER: '水路', +// CHECK_TYPE.WALL: '墙面', +// CHECK_TYPE.DOOR_AND_WINDOWS: '门窗', +// CHECK_TYPE.SECURITY: '安防', +// }; + +// Map checkTypeStringMap = { +// '电路': CHECK_TYPE.ELECTRIC, +// '水路': CHECK_TYPE.WATER, +// '墙面': CHECK_TYPE.WALL, +// '门窗': CHECK_TYPE.DOOR_AND_WINDOWS, +// '安防': CHECK_TYPE.SECURITY, +// }; + +// Map checkAssetMap = { +// CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG, +// CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG, +// CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG, +// CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG, +// CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG, +// }; + +// @Deprecated('under should be removed') +// class DecorationModel { +// DecorationType type; +// DecorationStatusType statusType; +// DateTime decorationDate; +// UserHomeModel userHomeModel; +// DecorationTeamModel decorationTeamModel; +// CycleCheck cycleCheck; +// WorkFinishCheck workFinishCheck; +// List checkInfomations; + +// String get statusTypeValue { +// if (statusType == DecorationStatusType.PROGRESS) +// return '装修中'; +// else +// return '装修完成'; +// } + +// DecorationModel({ +// @required this.type, +// @required this.statusType, +// @required this.userHomeModel, +// @required this.decorationTeamModel, +// @required this.decorationDate, +// this.cycleCheck, +// this.workFinishCheck, +// this.checkInfomations, +// }); +// } + +// @Deprecated('under should be removed') + +// ///用户家庭信息 +// class UserHomeModel { +// String plot; +// String detailAddr; +// String userName; +// String phone; +// UserHomeModel({ +// this.plot, +// this.detailAddr, +// this.userName, +// this.phone, +// }); +// } + +// @Deprecated('under should be removed') + +// ///装修队伍信息 +// class DecorationTeamModel { +// String name; +// String userName; +// String phone; +// DecorationTeamModel({ +// this.name, +// this.userName, +// this.phone, +// }); +// } + +// @Deprecated('under should be removed') + +// ///周期检查 +// class CycleCheck { +// FixerModel authPerson; +// DateTime startDate; + +// ///check cycle in days +// int checkCycle; +// List checkDetails = [ +// CHECK_TYPE.ELECTRIC, +// CHECK_TYPE.WATER, +// CHECK_TYPE.WALL, +// CHECK_TYPE.DOOR_AND_WINDOWS, +// CHECK_TYPE.SECURITY, +// ]; +// CycleCheck({ +// this.authPerson, +// this.startDate, +// this.checkCycle, +// this.checkDetails, +// }); +// } + +// @Deprecated('under should be removed') +// class WorkFinishCheck { +// FixerModel authPerson; +// DateTime startDate; +// List checkDetails; +// WorkFinishCheck({ +// this.authPerson, +// this.startDate, +// this.checkDetails, +// }); +// } + +// @Deprecated('under should be removed') + +// ///周期检查细节 +// class CheckInfomation { +// DateTime checkDate; +// List details; +// String info; +// String checkType; +// CheckInfomation({ +// this.checkDate, +// this.info, +// this.details, +// this.checkType, +// }); + +// ///检查结果 +// bool get checkAllResult { +// for (var item in details) { +// if (!item.status) return false; +// } +// return true; +// } +// } + +// @Deprecated('under should be removed') +// class CheckDetail { +// CHECK_TYPE type; +// bool status; +// String get assetpath => checkAssetMap[type]; +// CheckDetail({ +// @required this.type, +// this.status = true, +// }); +// String get typeValue => checkTypeMap[type]; +// } diff --git a/lib/mock_models/fix/fix_model.dart b/lib/mock_models/fix/fix_model.dart deleted file mode 100644 index dd2f60c..0000000 --- a/lib/mock_models/fix/fix_model.dart +++ /dev/null @@ -1,286 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Project imports: -import 'package:aku_community_manager/const/resource.dart'; - -enum FIX_ENUM { - ///待派单 - HAND_OUT, - - ///已派单&&待接单 - WAIT_PICKUP, - - ///处理中 - PROCESSING, - - ///已处理 - DONE, -} - -@deprecated -class FixModel { - static Map managerRoleMap = { - FIX_ENUM.HAND_OUT: '待派单', - FIX_ENUM.WAIT_PICKUP: '已派单', - FIX_ENUM.PROCESSING: '处理中', - FIX_ENUM.DONE: '已处理', - }; - - static Map otherRoleMap = { - FIX_ENUM.HAND_OUT: '', - FIX_ENUM.WAIT_PICKUP: '待接单', - FIX_ENUM.PROCESSING: '处理中', - FIX_ENUM.DONE: '已处理', - }; - - String title; - DateTime dateStart; - FIX_ENUM type; - - ///dynamic type - /// - ///当img 的类型为String时渲染asset图片,当img 类型为File 时渲染File图片 - List imgs; - FixDetailModel detail; - FixModel({ - @required this.title, - @required this.dateStart, - @required this.type, - @required this.imgs, - @required this.detail, - }); - - static List initList() { - return [ - FixModel( - title: '小区大道路灯坏了。', - dateStart: DateTime(2020, 10, 25, 14, 28, 56), - type: FIX_ENUM.HAND_OUT, - imgs: [ - R.ASSETS_STATIC_FIX_LIGHT1_PNG, - R.ASSETS_STATIC_FIX_LIGHT2_PNG, - R.ASSETS_STATIC_FIX_LIGHT3_PNG, - ], - detail: FixDetailModel( - userName: '杨建', - userPhoneNumber: '18882928888', - fixArea: 'C区', - fixStatuses: [ - FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)), - ], - ), - ), - FixModel( - title: '小区西大门车栏坏了,请物业尽快修理更换。', - dateStart: DateTime(2020, 10, 21, 7, 28, 56), - type: FIX_ENUM.WAIT_PICKUP, - imgs: [R.ASSETS_STATIC_FIX_AIR1_PNG, R.ASSETS_STATIC_FIX_AIR2_PNG], - detail: FixDetailModel( - userName: '杨建', - userPhoneNumber: '18882928888', - fixArea: 'B区', - type: FIX_PAYMENT_TYPE.FREE, - limit: FIX_DATE_LIMIT.HOUR_24, - subType: FIX_SUB_TYPE.NORMAL, - fixStatuses: [ - FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)), - FixStatus( - title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)), - FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)), - ], - result: FixResult( - detail: '电饭煲插头没插', - material: '无', - imgs: [R.ASSETS_STATIC_FIX_FOOD_PNG], - ), - ), - ), - FixModel( - title: '家里空调坏了,请师傅抓紧时间尽快维修。', - dateStart: DateTime(2020, 10, 21, 7, 28, 56), - type: FIX_ENUM.PROCESSING, - imgs: [R.ASSETS_STATIC_FIX_AIR1_PNG, R.ASSETS_STATIC_FIX_AIR2_PNG], - detail: FixDetailModel( - userName: '杨建', - userPhoneNumber: '18882929292', - fixArea: 'A区', - type: FIX_PAYMENT_TYPE.FREE, - limit: FIX_DATE_LIMIT.HOUR_24, - subType: FIX_SUB_TYPE.NORMAL, - fixStatuses: [ - FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)), - FixStatus( - title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)), - FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)), - ], - ), - ), - FixModel( - title: '家中电饭煲出问题了,请师傅速来。', - dateStart: DateTime(2020, 10, 22, 9, 28, 56), - type: FIX_ENUM.DONE, - imgs: [R.ASSETS_STATIC_FIX_FOOD2_PNG, R.ASSETS_STATIC_FIX_FOOD_PNG], - detail: FixDetailModel( - userName: '杨建', - userPhoneNumber: '18882929292', - fixArea: 'A区', - type: FIX_PAYMENT_TYPE.PAY, - limit: FIX_DATE_LIMIT.HOUR_24, - subType: FIX_SUB_TYPE.NORMAL, - fixStatuses: [ - FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)), - FixStatus( - title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)), - FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)), - FixStatus(title: '处理完成', date: DateTime(2020, 10, 23, 11, 01, 08)), - ], - result: FixResult( - detail: '电饭煲插头没插', - material: '无', - imgs: [R.ASSETS_STATIC_FIX_FOOD_PNG], - ), - review: UserReviewInfo( - rate: 5, - content: '师傅太用心了', - ), - priceDetail: FixPriceDetail( - humanPrice: 10, - materialPrice: 0, - ), - ), - ), - ]; - } -} - -///派单类型 -enum FIX_PAYMENT_TYPE { - FREE, - PAY, -} - -Map fixPaymentMap = { - FIX_PAYMENT_TYPE.FREE: '无偿服务', - FIX_PAYMENT_TYPE.PAY: '有偿服务', -}; - -Map fixPaymentStringMap = { - '无偿服务': FIX_PAYMENT_TYPE.FREE, - '有偿服务': FIX_PAYMENT_TYPE.PAY, -}; - -///工单子类 -enum FIX_SUB_TYPE { - ///一般单 - NORMAL, - - ///加急单 - HURRY, -} - -Map fixSubTypeMap = { - FIX_SUB_TYPE.NORMAL: '一般单', - FIX_SUB_TYPE.HURRY: '加急单', -}; - -Map fixSubTypeStringMap = { - '一般单': FIX_SUB_TYPE.NORMAL, - '加急单': FIX_SUB_TYPE.HURRY, -}; - -///工单时限 -enum FIX_DATE_LIMIT { - HOUR_24, - HOUR_12, - HOUR_8, -} - -Map fixDateLimitMap = { - FIX_DATE_LIMIT.HOUR_24: '24小时内处理', - FIX_DATE_LIMIT.HOUR_12: '12小时内处理', - FIX_DATE_LIMIT.HOUR_8: '8小时内处理', -}; - -Map fixDateLimitStringMap = { - '24小时内处理': FIX_DATE_LIMIT.HOUR_24, - '12小时内处理': FIX_DATE_LIMIT.HOUR_12, - '8小时内处理': FIX_DATE_LIMIT.HOUR_8, -}; - -@deprecated -class FixDetailModel { - ///报修人 - String userName; - - String userPhoneNumber; - - String fixArea; - - FIX_PAYMENT_TYPE type; - - FIX_DATE_LIMIT limit; - - FIX_SUB_TYPE subType; - - List fixStatuses; - - FixResult result; - - UserReviewInfo review; - - FixPriceDetail priceDetail; - FixDetailModel({ - this.userName, - this.userPhoneNumber, - this.fixArea, - this.type, - this.limit, - this.subType, - this.fixStatuses, - this.result, - this.review, - this.priceDetail, - }); -} - -class FixStatus { - String title; - DateTime date; - FixStatus({ - this.title, - this.date, - }); -} - -class FixResult { - String detail; - String material; - - ///dynamic img - List imgs; - FixResult({ - this.detail, - this.material, - this.imgs, - }); -} - -class UserReviewInfo { - double rate; - String content; - UserReviewInfo({ - this.rate, - this.content, - }); -} - -class FixPriceDetail { - double humanPrice; - double materialPrice; - FixPriceDetail({ - this.humanPrice, - this.materialPrice, - }); - double get allPrice => humanPrice + materialPrice; -} diff --git a/lib/mock_models/fix/fixer_model.dart b/lib/mock_models/fix/fixer_model.dart index 5a93890..52bfec1 100644 --- a/lib/mock_models/fix/fixer_model.dart +++ b/lib/mock_models/fix/fixer_model.dart @@ -13,74 +13,74 @@ enum FIXER_TYPE { } //TODO CLEAN BOTTOM CODES. -@Deprecated("fixer_model need to be cleaned.") -class FixerModel { - String name; - String phone; - FixerModel({this.name, this.phone}); -} +// @Deprecated("fixer_model need to be cleaned.") +// class FixerModel { +// String name; +// String phone; +// FixerModel({this.name, this.phone}); +// } -class FixerTypedModel { - FIXER_TYPE type; - String get typeName { - switch (type) { - case FIXER_TYPE.AIR_CONDITION: - return '空调组'; - break; - case FIXER_TYPE.ELECTRIC: - return '电力组'; - break; - case FIXER_TYPE.CEMENT: - return '水泥组'; - break; - case FIXER_TYPE.PROPERTY: - return '物业组'; - default: - return ''; - } - } +// class FixerTypedModel { +// FIXER_TYPE type; +// String get typeName { +// switch (type) { +// case FIXER_TYPE.AIR_CONDITION: +// return '空调组'; +// break; +// case FIXER_TYPE.ELECTRIC: +// return '电力组'; +// break; +// case FIXER_TYPE.CEMENT: +// return '水泥组'; +// break; +// case FIXER_TYPE.PROPERTY: +// return '物业组'; +// default: +// return ''; +// } +// } - List fixers; - FixerTypedModel({ - this.type, - this.fixers, - }); +// List fixers; +// FixerTypedModel({ +// this.type, +// this.fixers, +// }); - static List models = [ - FixerTypedModel( - type: FIXER_TYPE.AIR_CONDITION, - fixers: [ - FixerModel(name: '刘能建师傅', phone: '18923747283'), - FixerModel(name: '李惠政师傅', phone: '18910298345'), - FixerModel(name: '李慧珍师傅', phone: '17872342382'), - FixerModel(name: '林 芝师傅', phone: '18292847752'), - ], - ), - FixerTypedModel( - type: FIXER_TYPE.CEMENT, - fixers: [ - FixerModel(name: '李雷师傅', phone: '18923747283'), - FixerModel(name: '林智师傅', phone: '18910298345'), - FixerModel(name: '刘凯欣师傅', phone: '17872342382'), - FixerModel(name: '张亮师傅', phone: '18292847752'), - ], - ), - FixerTypedModel( - type: FIXER_TYPE.ELECTRIC, - fixers: [ - FixerModel(name: '李建国师傅', phone: '18923747283'), - FixerModel(name: '李历程师傅', phone: '18910298345'), - ], - ), - ]; +// static List models = [ +// FixerTypedModel( +// type: FIXER_TYPE.AIR_CONDITION, +// fixers: [ +// FixerModel(name: '刘能建师傅', phone: '18923747283'), +// FixerModel(name: '李惠政师傅', phone: '18910298345'), +// FixerModel(name: '李慧珍师傅', phone: '17872342382'), +// FixerModel(name: '林 芝师傅', phone: '18292847752'), +// ], +// ), +// FixerTypedModel( +// type: FIXER_TYPE.CEMENT, +// fixers: [ +// FixerModel(name: '李雷师傅', phone: '18923747283'), +// FixerModel(name: '林智师傅', phone: '18910298345'), +// FixerModel(name: '刘凯欣师傅', phone: '17872342382'), +// FixerModel(name: '张亮师傅', phone: '18292847752'), +// ], +// ), +// FixerTypedModel( +// type: FIXER_TYPE.ELECTRIC, +// fixers: [ +// FixerModel(name: '李建国师傅', phone: '18923747283'), +// FixerModel(name: '李历程师傅', phone: '18910298345'), +// ], +// ), +// ]; - static List propertyModels = [ - FixerTypedModel( - type: FIXER_TYPE.PROPERTY, - fixers: [ - FixerModel(name: '李国师傅', phone: '18923747283'), - FixerModel(name: '章则林师傅', phone: '18910298345'), - ], - ), - ]; -} +// static List propertyModels = [ +// FixerTypedModel( +// type: FIXER_TYPE.PROPERTY, +// fixers: [ +// FixerModel(name: '李国师傅', phone: '18923747283'), +// FixerModel(name: '章则林师傅', phone: '18910298345'), +// ], +// ), +// ]; +// } diff --git a/lib/mock_models/manage_models/manage_model.dart b/lib/mock_models/manage_models/manage_model.dart deleted file mode 100644 index 517c7d2..0000000 --- a/lib/mock_models/manage_models/manage_model.dart +++ /dev/null @@ -1,59 +0,0 @@ -class GreenManageCardModel { - String title; - String task; - String timestart; - String timeend; - String name; - String body; - GreenManageCardModel(this.title, this.task, this.timestart, this.timeend, - this.name, this.body); - - static List initList() { - return [ - GreenManageCardModel( - '中部广场周围绿化调整', '除杂草、松土、培土', '2020-10-08', '2020-10-18', '陈晖洁', '''详细描述 -1.在小区的园林建设中首先要保证小区园林设计的美观 -性以及与小区其他建筑的协调性,不仅能够吸引小区居 -民的目光,丰富人们的精神生活,也要使小区园林设计 -起到减少噪音污染,为人们遮风避凉。 -2.营造小区美丽园林中要选择合适的树木品种绿化小区 -内不同地方的环境在小区的园路树选择中不能种植矮小 -的树这样不会起到遮阴的作用还有在小区水池周围不能 -选择落叶较多的树这样不利于清理另外,还有小区其他 -的绿化地方,要根据实际情况,合理科学的选择。'''), - GreenManageCardModel( - '东区周围绿化调整', '修剪、造型', '2020-10-08', '2020-10-18', '刘小青', ''), - GreenManageCardModel( - '西区周围绿化调整', '修剪、造型', '2020-10-10', '2020-10-20', '张空间', ''), - GreenManageCardModel( - '北区周围绿化调整', '修剪造型', '2020-10-15', '2020-10-25', '凯尔希', ''), - ]; - } -} - -class InspectionManageCardModel { - String title; - String date; - String cycle; - String time; - List persons; - List stations; - InspectionManageCardModel(this.title, this.date, this.cycle, this.time, - this.persons, this.stations); - - static List initList() { - return [ - InspectionManageCardModel( - '1号巡检任务', - '2020.1-2020.12', - '每周一、三、五', - '8:00-12:00', - ['王珂', '陈晖洁', '凯尔希', '王铁锤', '李狗蛋', '尼古拉斯'], - ['小区东门入口', '1号南门', '3号门站', '3号闸门', '4号门站']), - InspectionManageCardModel( - '2号巡检任务', '2020.1-2020.12', '每周二', '8:00-12:00', ['史尔特尔'], []), - InspectionManageCardModel( - '3号巡检任务', '2020.1-2020.12', '每周二、四、六', '8:00-12:00', ['叶莲娜'], []), - ]; - } -} diff --git a/lib/mock_models/users/user_info_model.dart b/lib/mock_models/users/user_info_model.dart deleted file mode 100644 index 892d8c3..0000000 --- a/lib/mock_models/users/user_info_model.dart +++ /dev/null @@ -1,84 +0,0 @@ -// Dart imports: -import 'dart:io'; - -@Deprecated('use ‘canOpertion/canSendTicket/canPickUpTicke/canPass’ instead') -enum USER_ROLE { - ///管家角色 - MANAGER, - - ///师傅角色 - FIXER, - - ///保安角色 - SECURITY, - - ///物业角色 - PROPERTY, - - ///无角色 - EMPTY, -} - -@Deprecated('use infoModel instead') -class UserInfoModel { - String nickName; - File avatar; - USER_ROLE role; - String phone; - String get securePhone { - if (phone.length < 8) - return phone; - else - return '${phone.substring(0, 3)}****${phone.substring(7)}'; - } - - UserInfoModel({ - this.nickName, - this.avatar, - this.role, - this.phone, - }); - - UserInfoModel.empty({ - this.nickName = '', - this.avatar, - this.role = USER_ROLE.MANAGER, - this.phone = '', - }); - - ///管家角色生成 - ///password 000000 - UserInfoModel.manager({ - this.nickName = '李管家', - this.avatar, - this.role = USER_ROLE.MANAGER, - this.phone = '18819289976', - }); - - ///师傅角色生成 - ///password 000001 - UserInfoModel.fixer({ - this.nickName = '王师傅', - this.avatar, - this.role = USER_ROLE.FIXER, - this.phone = '18927139123', - }); - - ///师傅角色生成 - ///password 000002 - UserInfoModel.security({ - this.nickName = '林保安', - this.avatar, - this.role = USER_ROLE.SECURITY, - this.phone = '13918237877', - }); - - ///师傅角色生成 - ///password 000003 - UserInfoModel.property({ - this.nickName = '刘物业', - this.avatar, - this.role = USER_ROLE.PROPERTY, - this.phone = '18965438676', - }); -} diff --git a/lib/provider/fix_provider.dart b/lib/provider/fix_provider.dart deleted file mode 100644 index 0da5f3e..0000000 --- a/lib/provider/fix_provider.dart +++ /dev/null @@ -1,71 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:provider/provider.dart'; - -// Project imports: -import 'package:aku_community_manager/mock_models/fix/fix_model.dart'; -import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; -import 'package:aku_community_manager/mock_models/users/user_info_model.dart'; -import 'package:aku_community_manager/provider/user_provider.dart'; - -//TODO CLEAN BOTTOM CODES. -@Deprecated("fix_provider need to be cleaned.") -class FixProvider extends ChangeNotifier { - List _fixModels = FixModel.initList(); - List get fixModels => _fixModels; - addFixModel(FixModel model) { - _fixModels.insert(0, model); - notifyListeners(); - } - - List getFixModel(int index, BuildContext context) { - final userProvider = Provider.of(context, listen: false); - USER_ROLE role = userProvider.userInfoModel.role; - List _doneModels = - _fixModels.where((element) => element.type == FIX_ENUM.DONE).toList(); - - List _processingModels = _fixModels - .where((element) => element.type == FIX_ENUM.PROCESSING) - .toList(); - - List _handOutModels = _fixModels - .where((element) => element.type == FIX_ENUM.HAND_OUT) - .toList(); - - List _waitPickUpModels = _fixModels - .where((element) => element.type == FIX_ENUM.WAIT_PICKUP) - .toList(); - - List _fixerModels = _fixModels - .where((element) => element.type != FIX_ENUM.HAND_OUT) - .toList(); - - switch (role) { - case USER_ROLE.MANAGER: - return [ - _handOutModels, - _waitPickUpModels, - _processingModels, - _doneModels, - _fixModels, - ][index]; - break; - - default: - return [ - _waitPickUpModels, - _processingModels, - _doneModels, - _fixerModels, - ][index]; - break; - } - } - - List _fixerModels = FixerTypedModel.models; - List _propertyModels = FixerTypedModel.propertyModels; - List get fixerModels => _fixerModels; - List get propertyModels => _propertyModels; -} diff --git a/lib/provider/manage_provider.dart b/lib/provider/manage_provider.dart deleted file mode 100644 index 9c1b0cd..0000000 --- a/lib/provider/manage_provider.dart +++ /dev/null @@ -1,20 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Project imports: -import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart'; - -class GreenManageProvider extends ChangeNotifier { - List _greenManageModel = - GreenManageCardModel.initList(); - List get greenManageModels => _greenManageModel; - notifyListeners(); -} - -class InspectionManageProvider extends ChangeNotifier { - List _inspectionManageModel = - InspectionManageCardModel.initList(); - List get inspectionManageModels => - _inspectionManageModel; - notifyListeners(); -} diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 6c72d5e..536c4f1 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -2,6 +2,7 @@ import 'dart:io'; // Flutter imports: +import 'package:aku_community_manager/models/user/user_info_model.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -12,7 +13,6 @@ import 'package:provider/provider.dart'; // Project imports: import 'package:aku_community_manager/const/api.dart'; -import 'package:aku_community_manager/mock_models/users/user_info_model.dart'; import 'package:aku_community_manager/models/user/user_profile_model.dart'; import 'package:aku_community_manager/provider/app_provider.dart'; import 'package:aku_community_manager/utils/hive_store.dart'; @@ -20,9 +20,7 @@ import 'package:aku_community_manager/utils/network/base_file_model.dart'; import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/net_util.dart'; -import 'package:aku_community_manager/models/user/user_info_model.dart' - as USER_INFO; - + //登录状态管理 class UserProvider extends ChangeNotifier { bool _isLogin = false; @@ -45,8 +43,8 @@ class UserProvider extends ChangeNotifier { UserProfileModel _profileModel; UserProfileModel get profileModel => _profileModel; - USER_INFO.UserInfoModel _infoModel; - USER_INFO.UserInfoModel get infoModel => _infoModel; + UserInfoModel _infoModel; + UserInfoModel get infoModel => _infoModel; ///更新用户profile Future updateProfile() async { @@ -59,13 +57,13 @@ class UserProvider extends ChangeNotifier { return UserProfileModel.fromJson(model.data); } - Future updateUserInfo() async { + Future updateUserInfo() async { BaseModel model = await NetUtil().get(API.user.info); if (model == null) return null; else { - var userModel = USER_INFO.UserInfoModel.fromJson(model.data); + var userModel = UserInfoModel.fromJson(model.data); JPush().setAlias(userModel.id.toString()); return userModel; } @@ -92,15 +90,9 @@ class UserProvider extends ChangeNotifier { notifyListeners(); } - UserInfoModel _userInfoModel = UserInfoModel.empty(); - UserInfoModel get userInfoModel => _userInfoModel; - setUserInfo(UserInfoModel model) { - _userInfoModel = model; - _isSigned = true; - notifyListeners(); - } + ///修改昵称 setNickName(String name) { diff --git a/lib/ui/manage_pages/clock_in_out/clock_in_out_main_page.dart b/lib/ui/manage_pages/clock_in_out/clock_in_out_main_page.dart index d7e182f..31111a4 100644 --- a/lib/ui/manage_pages/clock_in_out/clock_in_out_main_page.dart +++ b/lib/ui/manage_pages/clock_in_out/clock_in_out_main_page.dart @@ -21,7 +21,8 @@ class ClockInOutMainPage extends StatefulWidget { _ClockInOutMainPageState createState() => _ClockInOutMainPageState(); } -class _ClockInOutMainPageState extends State with AutomaticKeepAliveClientMixin { +class _ClockInOutMainPageState extends State + with AutomaticKeepAliveClientMixin { EasyRefreshController _refreshController; Timer _clockSetState; DateTime _lastPressed; @@ -57,6 +58,7 @@ class _ClockInOutMainPageState extends State with AutomaticK @override Widget build(BuildContext context) { + super.build(context); return EasyRefresh( firstRefresh: true, header: MaterialHeader(), diff --git a/lib/ui/sub_pages/borrow_manager/borrow_manager_card.dart b/lib/ui/sub_pages/borrow_manager/borrow_manager_card.dart index bc25c24..09bc081 100644 --- a/lib/ui/sub_pages/borrow_manager/borrow_manager_card.dart +++ b/lib/ui/sub_pages/borrow_manager/borrow_manager_card.dart @@ -144,7 +144,6 @@ class _BorrowManagerCardState extends State { color: AppStyle.primaryColor, radius: 4.w, onPressed: () async { - //TODO unknown param `butlerMessage` Function cancel = BotToast.showLoading(); await NetUtil().post( API.manage.remindUserReturn, diff --git a/lib/ui/sub_pages/borrow_manager/borrow_manager_page.dart b/lib/ui/sub_pages/borrow_manager/borrow_manager_page.dart index e77705c..271fd2d 100644 --- a/lib/ui/sub_pages/borrow_manager/borrow_manager_page.dart +++ b/lib/ui/sub_pages/borrow_manager/borrow_manager_page.dart @@ -6,7 +6,6 @@ import 'package:get/get.dart'; import 'package:provider/provider.dart'; // Project imports: -import 'package:aku_community_manager/mock_models/users/user_info_model.dart'; import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/ui/sub_pages/borrow_manager/all_borrow_goods.dart'; @@ -23,8 +22,7 @@ class BorrowManagerPage extends StatefulWidget { class _BorrowManagerPageState extends State with TickerProviderStateMixin { - USER_ROLE get role => - Provider.of(context, listen: false).userInfoModel.role; + TabController _tabController; List get _tabs { final userProvider = Provider.of(context, listen: false); diff --git a/lib/ui/sub_pages/business_and_fix/business_and_fix_page.dart b/lib/ui/sub_pages/business_and_fix/business_and_fix_page.dart index 8273e7b..7d85e3b 100644 --- a/lib/ui/sub_pages/business_and_fix/business_and_fix_page.dart +++ b/lib/ui/sub_pages/business_and_fix/business_and_fix_page.dart @@ -60,7 +60,6 @@ class _BusinessAndFixPageState extends State @override Widget build(BuildContext context) { - final userProvider = Provider.of(context, listen: false); return AkuScaffold( title: '报事报修', appBarBottom: PreferredSize( diff --git a/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart b/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart index 05bcd23..baa807d 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart @@ -1,50 +1,49 @@ -// Flutter imports: -import 'package:flutter/material.dart'; +// // Flutter imports: +// import 'package:flutter/material.dart'; -// Project imports: -import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; -import 'package:aku_community_manager/style/app_style.dart'; -import 'package:aku_community_manager/tools/screen_tool.dart'; -import 'package:aku_community_manager/tools/widget_tool.dart'; +// // Project imports: +// import 'package:aku_community_manager/style/app_style.dart'; +// import 'package:aku_community_manager/tools/screen_tool.dart'; +// import 'package:aku_community_manager/tools/widget_tool.dart'; -class DecorationCheckCardWidget extends StatelessWidget { - final CHECK_TYPE type; - final bool checked; - const DecorationCheckCardWidget( - {Key key, @required this.type, this.checked = false}) - : super(key: key); +// class DecorationCheckCardWidget extends StatelessWidget { +// final CHECK_TYPE type; +// final bool checked; +// const DecorationCheckCardWidget( +// {Key key, @required this.type, this.checked = false}) +// : super(key: key); - @override - Widget build(BuildContext context) { - return Container( - height: 160.w, - width: 124.w, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - checkAssetMap[type], - height: 56.w, - width: 56.w, - ), - AkuBox.h(4), - Text( - checkTypeMap[type], - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 24.sp, - ), - ), - ], - ), - decoration: BoxDecoration( - border: Border.all( - color: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8), - width: 3.w, - ), - borderRadius: BorderRadius.circular(8.w), - color: checked ? Color(0xFFFFF3CC) : Colors.white, - ), - ); - } -} +// @override +// Widget build(BuildContext context) { +// return Container( +// height: 160.w, +// width: 124.w, +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// Image.asset( +// checkAssetMap[type], +// height: 56.w, +// width: 56.w, +// ), +// AkuBox.h(4), +// Text( +// checkTypeMap[type], +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 24.sp, +// ), +// ), +// ], +// ), +// decoration: BoxDecoration( +// border: Border.all( +// color: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8), +// width: 3.w, +// ), +// borderRadius: BorderRadius.circular(8.w), +// color: checked ? Color(0xFFFFF3CC) : Colors.white, +// ), +// ); +// } +// } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart b/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart index 3414fc4..7fca503 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart @@ -1,70 +1,70 @@ -// Flutter imports: -import 'package:flutter/material.dart'; +// // Flutter imports: +// import 'package:flutter/material.dart'; -// Project imports: -import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; -import 'package:aku_community_manager/tools/screen_tool.dart'; -import 'package:aku_community_manager/tools/widget_tool.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart'; +// // Project imports: +// import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +// import 'package:aku_community_manager/tools/screen_tool.dart'; +// import 'package:aku_community_manager/tools/widget_tool.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart'; -class DecorationCheckRow extends StatefulWidget { - final List details; - final Function(List details) onChange; - final bool canTap; - DecorationCheckRow( - {Key key, @required this.details, this.onChange, this.canTap = false}) - : super(key: key); +// class DecorationCheckRow extends StatefulWidget { +// final List details; +// final Function(List details) onChange; +// final bool canTap; +// DecorationCheckRow( +// {Key key, @required this.details, this.onChange, this.canTap = false}) +// : super(key: key); - @override - _DecorationCheckRowState createState() => _DecorationCheckRowState(); -} +// @override +// _DecorationCheckRowState createState() => _DecorationCheckRowState(); +// } -class _DecorationCheckRowState extends State { - List _tempCheckDetails = []; - List _checkedDetails = []; - @override - void initState() { - super.initState(); - _tempCheckDetails = widget.details; - widget.details.forEach((element) { - _checkedDetails.add(element); - }); - } +// class _DecorationCheckRowState extends State { +// List _tempCheckDetails = []; +// List _checkedDetails = []; +// @override +// void initState() { +// super.initState(); +// _tempCheckDetails = widget.details; +// widget.details.forEach((element) { +// _checkedDetails.add(element); +// }); +// } - @override - Widget build(BuildContext context) { - return SizedBox( - height: 160.w, - child: ListView.separated( - scrollDirection: Axis.horizontal, - itemBuilder: (context, index) { - return GestureDetector( - onTap: !widget.canTap - ? null - : () { - widget.onChange(_checkedDetails); - setState(() { - _checkedDetails.indexOf(_tempCheckDetails[index]) != -1 - ? _checkedDetails.remove(_tempCheckDetails[index]) - : _checkedDetails.add(_tempCheckDetails[index]); - }); - }, - child: Material( - color: Colors.transparent, - child: DecorationCheckCardWidget( - type: _tempCheckDetails[index], - checked: !widget.canTap - ? false - : _checkedDetails.indexOf(_tempCheckDetails[index]) != -1, - ), - ), - ); - }, - itemCount: _tempCheckDetails.length, - separatorBuilder: (context, index) { - return AkuBox.w(16); - }, - ), - ); - } -} +// @override +// Widget build(BuildContext context) { +// return SizedBox( +// height: 160.w, +// child: ListView.separated( +// scrollDirection: Axis.horizontal, +// itemBuilder: (context, index) { +// return GestureDetector( +// onTap: !widget.canTap +// ? null +// : () { +// widget.onChange(_checkedDetails); +// setState(() { +// _checkedDetails.indexOf(_tempCheckDetails[index]) != -1 +// ? _checkedDetails.remove(_tempCheckDetails[index]) +// : _checkedDetails.add(_tempCheckDetails[index]); +// }); +// }, +// child: Material( +// color: Colors.transparent, +// child: DecorationCheckCardWidget( +// type: _tempCheckDetails[index], +// checked: !widget.canTap +// ? false +// : _checkedDetails.indexOf(_tempCheckDetails[index]) != -1, +// ), +// ), +// ); +// }, +// itemCount: _tempCheckDetails.length, +// separatorBuilder: (context, index) { +// return AkuBox.w(16); +// }, +// ), +// ); +// } +// } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_department_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_department_page.dart index d5bbec3..d4eb8da 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_department_page.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_department_page.dart @@ -1,192 +1,190 @@ -// Flutter imports: -import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; -import 'package:flutter/material.dart'; +// // Flutter imports: +// import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; +// import 'package:flutter/material.dart'; -// Package imports: -import 'package:expandable/expandable.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; +// // Package imports: +// import 'package:expandable/expandable.dart'; +// import 'package:get/get.dart'; -// Project imports: -import 'package:aku_community_manager/const/resource.dart'; -import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; -import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; -import 'package:aku_community_manager/provider/fix_provider.dart'; -import 'package:aku_community_manager/style/app_style.dart'; -import 'package:aku_community_manager/tools/screen_tool.dart'; -import 'package:aku_community_manager/tools/widget_tool.dart'; -import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +// // Project imports: +// import 'package:aku_community_manager/const/resource.dart'; +// import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +// import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; +// import 'package:aku_community_manager/style/app_style.dart'; +// import 'package:aku_community_manager/tools/screen_tool.dart'; +// import 'package:aku_community_manager/tools/widget_tool.dart'; +// import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; -class DecorationDepartmentPage extends StatefulWidget { - final DecorationModel model; - DecorationDepartmentPage({Key key, @required this.model}) : super(key: key); +// class DecorationDepartmentPage extends StatefulWidget { +// final DecorationModel model; +// DecorationDepartmentPage({Key key, @required this.model}) : super(key: key); - @override - _DecorationDepartmentPageState createState() => - _DecorationDepartmentPageState(); -} +// @override +// _DecorationDepartmentPageState createState() => +// _DecorationDepartmentPageState(); +// } -class _DecorationDepartmentPageState extends State { - FixerModel _pickedFixer; - @override - Widget build(BuildContext context) { - final fixProvider = Provider.of(context); +// class _DecorationDepartmentPageState extends State { +// FixerModel _pickedFixer; +// @override +// Widget build(BuildContext context) { +// // final fixProvider = Provider.of(context); - return AkuScaffold( - title: '装修指派', - body: ListView.builder( - padding: EdgeInsets.symmetric(vertical: 16.w), - itemBuilder: (context, index) { - return _buildItem(fixProvider.propertyModels[index], index); - }, - itemCount: fixProvider.propertyModels.length, - ), - bottom: AkuMaterialButton( - height: 96.w, - onPressed: _pickedFixer == null - ? null - : () { - widget.model.cycleCheck.authPerson = _pickedFixer; - Get.back(); - }, - color: AppStyle.primaryColor, - nullColor: AppStyle.primaryColor.withOpacity(0.5), - child: Text( - '选择完成', - style: TextStyle( - color: _pickedFixer == null - ? AppStyle.minorTextColor - : AppStyle.primaryTextColor, - fontSize: 32.w, - fontWeight: FontWeight.bold, - ), - ), - ), - ); - } +// return AkuScaffold( +// title: '装修指派', +// // body: ListView.builder( +// // padding: EdgeInsets.symmetric(vertical: 16.w), +// // itemBuilder: (context, index) { +// // return _buildItem(fixProvider.propertyModels[index], index); +// // }, +// // itemCount: fixProvider.propertyModels.length, +// // ), +// bottom: AkuMaterialButton( +// height: 96.w, +// onPressed: _pickedFixer == null +// ? null +// : () { +// widget.model.cycleCheck.authPerson = _pickedFixer; +// Get.back(); +// }, +// color: AppStyle.primaryColor, +// nullColor: AppStyle.primaryColor.withOpacity(0.5), +// child: Text( +// '选择完成', +// style: TextStyle( +// color: _pickedFixer == null +// ? AppStyle.minorTextColor +// : AppStyle.primaryTextColor, +// fontSize: 32.w, +// fontWeight: FontWeight.bold, +// ), +// ), +// ), +// ); +// } - _buildItem(FixerTypedModel model, int index) { - return Container( - decoration: BoxDecoration( - border: Border( - top: index == 0 - ? BorderSide.none - : BorderSide(color: Color(0xFFE8E8E8), width: 1.w), - bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w), - ), - ), - child: Material( - color: Colors.white, - child: ExpandablePanel( - controller: ExpandableController(initialExpanded: true), - header: Container( - height: 96.w, - alignment: Alignment.centerLeft, - padding: EdgeInsets.symmetric(horizontal: 32.w), - child: Text( - model.typeName, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 32.sp, - fontWeight: FontWeight.bold, - ), - ), - ), - collapsed: SizedBox(), - expanded: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Divider( - color: Color(0xFFE8E8E8), - height: 1.w, - thickness: 1.w, - ), - ...model.fixers.map((e) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - AkuMaterialButton( - height: 96.w, - onPressed: () { - if (_pickedFixer?.name != e.name) { - _pickedFixer = e; - } else { - _pickedFixer = null; - } - setState(() {}); - }, - child: Row( - children: [ - AkuBox.w(72), - Checkbox( - checkColor: AppStyle.primaryTextColor, - activeColor: AppStyle.primaryColor, - value: _pickedFixer?.name == e.name, - onChanged: (state) { - if (_pickedFixer == null) { - _pickedFixer = e; - } else { - _pickedFixer = null; - } - setState(() {}); - }, - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - ), - Image.asset( - R.ASSETS_MESSAGE_IC_PEOPLE_PNG, - height: 40.w, - width: 40.w, - ), - Text( - e.name, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.w, - fontWeight: FontWeight.bold, - ), - ), - Spacer(), - Image.asset( - R.ASSETS_MESSAGE_IC_PHONE_PNG, - height: 40.w, - width: 40.w, - ), - Text( - e.phone, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.w, - fontWeight: FontWeight.bold, - ), - ), - AkuBox.w(101), - ], - ), - ), - model.fixers.last == e - ? SizedBox() - : Divider( - indent: 32.w, - endIndent: 32.w, - height: 1.w, - thickness: 1.w, - color: Color(0xFFE8E8E8), - ), - ], - ); - }).toList() - ], - ), - theme: ExpandableThemeData( - tapHeaderToExpand: true, - iconPlacement: ExpandablePanelIconPlacement.right, - iconPadding: EdgeInsets.only(top: 32.w, right: 32.w), - iconSize: 32.w, - iconColor: AppStyle.minorTextColor, - ), - ), - ), - ); - } -} +// _buildItem(FixerTypedModel model, int index) { +// return Container( +// decoration: BoxDecoration( +// border: Border( +// top: index == 0 +// ? BorderSide.none +// : BorderSide(color: Color(0xFFE8E8E8), width: 1.w), +// bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w), +// ), +// ), +// child: Material( +// color: Colors.white, +// child: ExpandablePanel( +// controller: ExpandableController(initialExpanded: true), +// header: Container( +// height: 96.w, +// alignment: Alignment.centerLeft, +// padding: EdgeInsets.symmetric(horizontal: 32.w), +// child: Text( +// model.typeName, +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 32.sp, +// fontWeight: FontWeight.bold, +// ), +// ), +// ), +// collapsed: SizedBox(), +// expanded: Column( +// mainAxisSize: MainAxisSize.min, +// children: [ +// Divider( +// color: Color(0xFFE8E8E8), +// height: 1.w, +// thickness: 1.w, +// ), +// ...model.fixers.map((e) { +// return Column( +// mainAxisSize: MainAxisSize.min, +// children: [ +// AkuMaterialButton( +// height: 96.w, +// onPressed: () { +// if (_pickedFixer?.name != e.name) { +// _pickedFixer = e; +// } else { +// _pickedFixer = null; +// } +// setState(() {}); +// }, +// child: Row( +// children: [ +// AkuBox.w(72), +// Checkbox( +// checkColor: AppStyle.primaryTextColor, +// activeColor: AppStyle.primaryColor, +// value: _pickedFixer?.name == e.name, +// onChanged: (state) { +// if (_pickedFixer == null) { +// _pickedFixer = e; +// } else { +// _pickedFixer = null; +// } +// setState(() {}); +// }, +// materialTapTargetSize: +// MaterialTapTargetSize.shrinkWrap, +// ), +// Image.asset( +// R.ASSETS_MESSAGE_IC_PEOPLE_PNG, +// height: 40.w, +// width: 40.w, +// ), +// Text( +// e.name, +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 28.w, +// fontWeight: FontWeight.bold, +// ), +// ), +// Spacer(), +// Image.asset( +// R.ASSETS_MESSAGE_IC_PHONE_PNG, +// height: 40.w, +// width: 40.w, +// ), +// Text( +// e.phone, +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 28.w, +// fontWeight: FontWeight.bold, +// ), +// ), +// AkuBox.w(101), +// ], +// ), +// ), +// model.fixers.last == e +// ? SizedBox() +// : Divider( +// indent: 32.w, +// endIndent: 32.w, +// height: 1.w, +// thickness: 1.w, +// color: Color(0xFFE8E8E8), +// ), +// ], +// ); +// }).toList() +// ], +// ), +// theme: ExpandableThemeData( +// tapHeaderToExpand: true, +// iconPlacement: ExpandablePanelIconPlacement.right, +// iconPadding: EdgeInsets.only(top: 32.w, right: 32.w), +// iconSize: 32.w, +// iconColor: AppStyle.minorTextColor, +// ), +// ), +// ), +// ); +// } +// } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_follow_check.dart b/lib/ui/sub_pages/decoration_manager/decoration_follow_check.dart index 1231fe8..5c6435d 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_follow_check.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_follow_check.dart @@ -1,275 +1,275 @@ -// Flutter imports: -import 'package:flutter/material.dart'; +// // Flutter imports: +// import 'package:flutter/material.dart'; -// Package imports: -import 'package:common_utils/common_utils.dart'; -import 'package:get/get.dart'; +// // Package imports: +// import 'package:common_utils/common_utils.dart'; +// import 'package:get/get.dart'; -// Project imports: -import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; -import 'package:aku_community_manager/style/app_style.dart'; -import 'package:aku_community_manager/tools/widget_tool.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_success_page.dart'; -import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; -import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart'; +// // Project imports: +// import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +// import 'package:aku_community_manager/style/app_style.dart'; +// import 'package:aku_community_manager/tools/widget_tool.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_success_page.dart'; +// import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +// import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart'; -class DecorationFollowCheck extends StatefulWidget { - final DecorationModel model; - DecorationFollowCheck({Key key, @required this.model}) : super(key: key); +// class DecorationFollowCheck extends StatefulWidget { +// final DecorationModel model; +// DecorationFollowCheck({Key key, @required this.model}) : super(key: key); - @override - _DecorationFollowCheckState createState() => _DecorationFollowCheckState(); -} +// @override +// _DecorationFollowCheckState createState() => _DecorationFollowCheckState(); +// } -class _DecorationFollowCheckState extends State { - Map checkStatus = { - CHECK_TYPE.ELECTRIC: true, - CHECK_TYPE.WATER: true, - CHECK_TYPE.WALL: true, - CHECK_TYPE.DOOR_AND_WINDOWS: true, - CHECK_TYPE.SECURITY: true, - }; +// class _DecorationFollowCheckState extends State { +// Map checkStatus = { +// CHECK_TYPE.ELECTRIC: true, +// CHECK_TYPE.WATER: true, +// CHECK_TYPE.WALL: true, +// CHECK_TYPE.DOOR_AND_WINDOWS: true, +// CHECK_TYPE.SECURITY: true, +// }; - bool get success { - for (var item in checkStatus.keys) { - if (checkStatus[item] == false) return false; - } - return true; - } +// bool get success { +// for (var item in checkStatus.keys) { +// if (checkStatus[item] == false) return false; +// } +// return true; +// } - TextEditingController _textEditingController = TextEditingController(); - @override - void dispose() { - _textEditingController?.dispose(); - super.dispose(); - } +// TextEditingController _textEditingController = TextEditingController(); +// @override +// void dispose() { +// _textEditingController?.dispose(); +// super.dispose(); +// } - @override - Widget build(BuildContext context) { - return AkuScaffold( - title: '跟踪检查', - body: ListView( - padding: EdgeInsets.symmetric(vertical: 16.w), - children: [ - Container( - color: Colors.white, - padding: EdgeInsets.symmetric( - horizontal: 32.w, - vertical: 16.w, - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - child: Row( - children: [ - Container( - height: 56.w, - width: 56.w, - alignment: Alignment.center, - child: Text( - '家', - style: TextStyle( - color: AppStyle.secondaryColor, - fontSize: 24.sp, - fontWeight: FontWeight.bold, - ), - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(28.w), - color: Color(0xFFE9F2FF), - ), - ), - AkuBox.w(30), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.model.userHomeModel.plot, - style: TextStyle( - fontWeight: FontWeight.bold, - color: AppStyle.primaryTextColor, - fontSize: 24.sp, - ), - ), - Text( - widget.model.userHomeModel.detailAddr, - style: TextStyle( - fontWeight: FontWeight.bold, - color: AppStyle.primaryTextColor, - fontSize: 24.sp, - ), - ), - ], - ), - ), - ], - ), - padding: EdgeInsets.symmetric( - vertical: 26.w, - horizontal: 32.w, - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.w), - color: Color(0xFFF9F9F9), - ), - ), - AkuBox.h(16), - Container( - child: Row( - children: [ - Container( - height: 56.w, - width: 56.w, - alignment: Alignment.center, - child: Text( - '装', - style: TextStyle( - color: AppStyle.secondaryColor, - fontSize: 24.sp, - fontWeight: FontWeight.bold, - ), - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(28.w), - color: Color(0xFFE9F2FF), - ), - ), - AkuBox.w(30), - Expanded( - child: Text( - widget.model.decorationTeamModel.name, - style: TextStyle( - fontWeight: FontWeight.bold, - color: AppStyle.primaryTextColor, - fontSize: 24.sp, - ), - ), - ), - ], - ), - padding: EdgeInsets.symmetric( - vertical: 26.w, - horizontal: 32.w, - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.w), - color: Color(0xFFF9F9F9), - ), - ), - AkuBox.h(16), - Row( - children: [ - Text( - '${DateUtil.formatDate( - DateTime.now(), - format: 'yyyy-MM-dd', - )} 周期检查', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.w, - fontWeight: FontWeight.bold, - ), - ), - Spacer(), - AkuBox.h(96), - Text( - success ? '正常' : '异常', - style: TextStyle( - color: success - ? AppStyle.successColor - : AppStyle.failColor, - fontSize: 28.w, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - _buildRow(CHECK_TYPE.ELECTRIC), - _buildRow(CHECK_TYPE.WATER), - _buildRow(CHECK_TYPE.WALL), - _buildRow(CHECK_TYPE.DOOR_AND_WINDOWS), - _buildRow(CHECK_TYPE.SECURITY), - TextField( - minLines: 3, - maxLines: 99, - controller: _textEditingController, - decoration: InputDecoration( - contentPadding: EdgeInsets.symmetric( - vertical: 16.w, - horizontal: 24.w, - ), - hintText: '请输入检查描述', - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8.w), - borderSide: BorderSide( - width: 2.w, - color: Color(0xFFE8E8E8), - ), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8.w), - borderSide: BorderSide( - width: 2.w, - color: Color(0xFFE8E8E8), - ), - ), - ), - ), - ], - ), - ), - ], - ), - bottom: AkuBottomButton( - onTap: () { - widget.model.checkInfomations.add( - CheckInfomation( - checkDate: DateTime.now(), - checkType: '周期检查', - info: _textEditingController.text, - details: checkStatus.entries.map((e) { - return CheckDetail(type: e.key, status: e.value); - }).toList(), - ), - ); - widget.model.type = DecorationType.DONE; - Get.off(DecorationSuccessPage()); - }, - title: '确认提交', - ), - ); - } +// @override +// Widget build(BuildContext context) { +// return AkuScaffold( +// title: '跟踪检查', +// body: ListView( +// padding: EdgeInsets.symmetric(vertical: 16.w), +// children: [ +// Container( +// color: Colors.white, +// padding: EdgeInsets.symmetric( +// horizontal: 32.w, +// vertical: 16.w, +// ), +// child: Column( +// mainAxisSize: MainAxisSize.min, +// children: [ +// Container( +// child: Row( +// children: [ +// Container( +// height: 56.w, +// width: 56.w, +// alignment: Alignment.center, +// child: Text( +// '家', +// style: TextStyle( +// color: AppStyle.secondaryColor, +// fontSize: 24.sp, +// fontWeight: FontWeight.bold, +// ), +// ), +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(28.w), +// color: Color(0xFFE9F2FF), +// ), +// ), +// AkuBox.w(30), +// Expanded( +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Text( +// widget.model.userHomeModel.plot, +// style: TextStyle( +// fontWeight: FontWeight.bold, +// color: AppStyle.primaryTextColor, +// fontSize: 24.sp, +// ), +// ), +// Text( +// widget.model.userHomeModel.detailAddr, +// style: TextStyle( +// fontWeight: FontWeight.bold, +// color: AppStyle.primaryTextColor, +// fontSize: 24.sp, +// ), +// ), +// ], +// ), +// ), +// ], +// ), +// padding: EdgeInsets.symmetric( +// vertical: 26.w, +// horizontal: 32.w, +// ), +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(8.w), +// color: Color(0xFFF9F9F9), +// ), +// ), +// AkuBox.h(16), +// Container( +// child: Row( +// children: [ +// Container( +// height: 56.w, +// width: 56.w, +// alignment: Alignment.center, +// child: Text( +// '装', +// style: TextStyle( +// color: AppStyle.secondaryColor, +// fontSize: 24.sp, +// fontWeight: FontWeight.bold, +// ), +// ), +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(28.w), +// color: Color(0xFFE9F2FF), +// ), +// ), +// AkuBox.w(30), +// Expanded( +// child: Text( +// widget.model.decorationTeamModel.name, +// style: TextStyle( +// fontWeight: FontWeight.bold, +// color: AppStyle.primaryTextColor, +// fontSize: 24.sp, +// ), +// ), +// ), +// ], +// ), +// padding: EdgeInsets.symmetric( +// vertical: 26.w, +// horizontal: 32.w, +// ), +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(8.w), +// color: Color(0xFFF9F9F9), +// ), +// ), +// AkuBox.h(16), +// Row( +// children: [ +// Text( +// '${DateUtil.formatDate( +// DateTime.now(), +// format: 'yyyy-MM-dd', +// )} 周期检查', +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 28.w, +// fontWeight: FontWeight.bold, +// ), +// ), +// Spacer(), +// AkuBox.h(96), +// Text( +// success ? '正常' : '异常', +// style: TextStyle( +// color: success +// ? AppStyle.successColor +// : AppStyle.failColor, +// fontSize: 28.w, +// fontWeight: FontWeight.bold, +// ), +// ), +// ], +// ), +// _buildRow(CHECK_TYPE.ELECTRIC), +// _buildRow(CHECK_TYPE.WATER), +// _buildRow(CHECK_TYPE.WALL), +// _buildRow(CHECK_TYPE.DOOR_AND_WINDOWS), +// _buildRow(CHECK_TYPE.SECURITY), +// TextField( +// minLines: 3, +// maxLines: 99, +// controller: _textEditingController, +// decoration: InputDecoration( +// contentPadding: EdgeInsets.symmetric( +// vertical: 16.w, +// horizontal: 24.w, +// ), +// hintText: '请输入检查描述', +// border: OutlineInputBorder( +// borderRadius: BorderRadius.circular(8.w), +// borderSide: BorderSide( +// width: 2.w, +// color: Color(0xFFE8E8E8), +// ), +// ), +// focusedBorder: OutlineInputBorder( +// borderRadius: BorderRadius.circular(8.w), +// borderSide: BorderSide( +// width: 2.w, +// color: Color(0xFFE8E8E8), +// ), +// ), +// ), +// ), +// ], +// ), +// ), +// ], +// ), +// bottom: AkuBottomButton( +// onTap: () { +// widget.model.checkInfomations.add( +// CheckInfomation( +// checkDate: DateTime.now(), +// checkType: '周期检查', +// info: _textEditingController.text, +// details: checkStatus.entries.map((e) { +// return CheckDetail(type: e.key, status: e.value); +// }).toList(), +// ), +// ); +// widget.model.type = DecorationType.DONE; +// Get.off(DecorationSuccessPage()); +// }, +// title: '确认提交', +// ), +// ); +// } - _buildRow( - CHECK_TYPE type, - ) { - return Row( - children: [ - Image.asset( - checkAssetMap[type], - height: 40.w, - width: 40.w, - ), - Text( - checkTypeMap[type], - style: TextStyle( - fontSize: 28.w, - color: AppStyle.primaryTextColor, - ), - ), - Spacer(), - DecorationCheckBox( - initValue: checkStatus[type], - onChange: (state) { - checkStatus[type] = state; - setState(() {}); - }, - ), - Spacer(), - ], - ); - } -} +// _buildRow( +// CHECK_TYPE type, +// ) { +// return Row( +// children: [ +// Image.asset( +// checkAssetMap[type], +// height: 40.w, +// width: 40.w, +// ), +// Text( +// checkTypeMap[type], +// style: TextStyle( +// fontSize: 28.w, +// color: AppStyle.primaryTextColor, +// ), +// ), +// Spacer(), +// DecorationCheckBox( +// initValue: checkStatus[type], +// onChange: (state) { +// checkStatus[type] = state; +// setState(() {}); +// }, +// ), +// Spacer(), +// ], +// ); +// } +// } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart index 1937ffa..e1e6650 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart @@ -1,140 +1,140 @@ -// Flutter imports: -import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; -import 'package:flutter/material.dart'; +// // Flutter imports: +// import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; +// import 'package:flutter/material.dart'; -// Package imports: -import 'package:common_utils/common_utils.dart'; -import 'package:get/get.dart'; +// // Package imports: +// import 'package:common_utils/common_utils.dart'; +// import 'package:get/get.dart'; -// Project imports: -import 'package:aku_community_manager/const/resource.dart'; -import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart'; -import 'package:aku_community_manager/style/app_style.dart'; -import 'package:aku_community_manager/tools/screen_tool.dart'; -import 'package:aku_community_manager/tools/widget_tool.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; -import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart'; +// // Project imports: +// import 'package:aku_community_manager/const/resource.dart'; +// import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart'; +// import 'package:aku_community_manager/style/app_style.dart'; +// import 'package:aku_community_manager/tools/screen_tool.dart'; +// import 'package:aku_community_manager/tools/widget_tool.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; +// import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart'; -class DecorationManagerCard extends StatefulWidget { - final DecorationListModel model; - DecorationManagerCard({Key key, @required this.model}) : super(key: key); +// class DecorationManagerCard extends StatefulWidget { +// final DecorationListModel model; +// DecorationManagerCard({Key key, @required this.model}) : super(key: key); - @override - _DecorationManagerCardState createState() => _DecorationManagerCardState(); -} +// @override +// _DecorationManagerCardState createState() => _DecorationManagerCardState(); +// } -class _DecorationManagerCardState extends State { - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(top: 16.w), - padding: EdgeInsets.all(24.w), - child: Column( - children: [ - Row( - children: [ - AkuChipBox(title: '装修管理'), - AkuBox.w(16), - Text( - DateUtil.formatDateStr(widget.model.applicationDate, - format: 'yyyy-MM-dd HH:mm:ss'), - style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 22.w, - ), - ), - Spacer(), - Text( - DecorationUIUtil(context).getTagName( - widget.model.operationStatus, widget.model.status, - tracker: widget.model.tracker), - style: TextStyle( - color: DecorationUIUtil(context) - .getTagColor(widget.model.operationStatus), - fontSize: 24.w, - ), - ), - ], - ), - AkuBox.h(24), - _buildTile(R.ASSETS_MANAGE_HOME_PNG, '小区名称', kEstateName), - AkuBox.h(12), - _buildTile( - R.ASSETS_MANAGE_ADDRESS_PNG, - '详细地址', - widget.model.roomName, - ), - AkuBox.h(12), - _buildTile( - R.ASSETS_MANAGE_DECORATION_PNG, - '装修公司', - widget.model.constructionUnit, - ), - AkuBox.h(12), - _buildTile( - R.ASSETS_MANAGE_STATUS_PNG, - '装修状态', - DecorationUIUtil(context).getDecorationStatus(widget.model.status), - ), - Divider( - height: 48.w, - ), - Align( - alignment: Alignment.centerRight, - child: AkuMaterialButton( - onPressed: () { - Get.to( - DecorationManagerDetailPage(id: widget.model.id,status: widget.model.status,operationStatus: widget.model.operationStatus,)); - }, - height: 64.w, - minWidth: 160.w, - color: AppStyle.primaryColor, - child: Text( - '查看详情', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontWeight: FontWeight.bold, - fontSize: 28.w, - ), - ), - radius: 4.w, - ), - ), - ], - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8.w), - ), - ); - } +// class _DecorationManagerCardState extends State { +// @override +// Widget build(BuildContext context) { +// return Container( +// margin: EdgeInsets.only(top: 16.w), +// padding: EdgeInsets.all(24.w), +// child: Column( +// children: [ +// Row( +// children: [ +// AkuChipBox(title: '装修管理'), +// AkuBox.w(16), +// Text( +// DateUtil.formatDateStr(widget.model.applicationDate, +// format: 'yyyy-MM-dd HH:mm:ss'), +// style: TextStyle( +// color: AppStyle.minorTextColor, +// fontSize: 22.w, +// ), +// ), +// Spacer(), +// Text( +// DecorationUIUtil(context).getTagName( +// widget.model.operationStatus, widget.model.status, +// tracker: widget.model.tracker), +// style: TextStyle( +// color: DecorationUIUtil(context) +// .getTagColor(widget.model.operationStatus), +// fontSize: 24.w, +// ), +// ), +// ], +// ), +// AkuBox.h(24), +// _buildTile(R.ASSETS_MANAGE_HOME_PNG, '小区名称', kEstateName), +// AkuBox.h(12), +// _buildTile( +// R.ASSETS_MANAGE_ADDRESS_PNG, +// '详细地址', +// widget.model.roomName, +// ), +// AkuBox.h(12), +// _buildTile( +// R.ASSETS_MANAGE_DECORATION_PNG, +// '装修公司', +// widget.model.constructionUnit, +// ), +// AkuBox.h(12), +// _buildTile( +// R.ASSETS_MANAGE_STATUS_PNG, +// '装修状态', +// DecorationUIUtil(context).getDecorationStatus(widget.model.status), +// ), +// Divider( +// height: 48.w, +// ), +// Align( +// alignment: Alignment.centerRight, +// child: AkuMaterialButton( +// onPressed: () { +// Get.to( +// DecorationManagerDetailPage(id: widget.model.id,status: widget.model.status,operationStatus: widget.model.operationStatus,)); +// }, +// height: 64.w, +// minWidth: 160.w, +// color: AppStyle.primaryColor, +// child: Text( +// '查看详情', +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontWeight: FontWeight.bold, +// fontSize: 28.w, +// ), +// ), +// radius: 4.w, +// ), +// ), +// ], +// ), +// decoration: BoxDecoration( +// color: Colors.white, +// borderRadius: BorderRadius.circular(8.w), +// ), +// ); +// } - _buildTile(String path, String title, String subTitle) { - return Row( - children: [ - Image.asset( - path, - height: 40.w, - width: 40.w, - ), - Text( - title, - style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 28.sp, - ), - ), - Spacer(), - Text( - subTitle, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.sp, - fontWeight: FontWeight.bold, - ), - ), - ], - ); - } -} +// _buildTile(String path, String title, String subTitle) { +// return Row( +// children: [ +// Image.asset( +// path, +// height: 40.w, +// width: 40.w, +// ), +// Text( +// title, +// style: TextStyle( +// color: AppStyle.minorTextColor, +// fontSize: 28.sp, +// ), +// ), +// Spacer(), +// Text( +// subTitle, +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 28.sp, +// fontWeight: FontWeight.bold, +// ), +// ), +// ], +// ); +// } +// } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart index df167d5..cc9abb0 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart @@ -1,709 +1,709 @@ -// Dart imports: -import 'dart:math'; +// // Dart imports: +// import 'dart:math'; -// Flutter imports: -import 'package:aku_community_manager/const/api.dart'; -import 'package:aku_community_manager/models/manager/decoration/decoration_detail_model.dart'; -import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; -import 'package:aku_community_manager/utils/network/base_model.dart'; -import 'package:aku_community_manager/utils/network/net_util.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; +// // Flutter imports: +// import 'package:aku_community_manager/const/api.dart'; +// import 'package:aku_community_manager/models/manager/decoration/decoration_detail_model.dart'; +// import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; +// import 'package:aku_community_manager/utils/network/base_model.dart'; +// import 'package:aku_community_manager/utils/network/net_util.dart'; +// import 'package:bot_toast/bot_toast.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/material.dart'; -// Package imports: -import 'package:common_utils/common_utils.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; +// // Package imports: +// import 'package:common_utils/common_utils.dart'; +// import 'package:expandable/expandable.dart'; +// import 'package:flutter_easyrefresh/easy_refresh.dart'; +// import 'package:get/get.dart'; -// Project imports: -import 'package:aku_community_manager/const/resource.dart'; -import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; -import 'package:aku_community_manager/style/app_style.dart'; -import 'package:aku_community_manager/tools/screen_tool.dart'; -import 'package:aku_community_manager/tools/user_tool.dart'; -import 'package:aku_community_manager/tools/widget_tool.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; -import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; -import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; -import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart'; -import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart'; -import 'package:aku_community_manager/ui/widgets/inner/show_bottom_sheet.dart'; +// // Project imports: +// import 'package:aku_community_manager/const/resource.dart'; +// import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +// import 'package:aku_community_manager/style/app_style.dart'; +// import 'package:aku_community_manager/tools/screen_tool.dart'; +// import 'package:aku_community_manager/tools/user_tool.dart'; +// import 'package:aku_community_manager/tools/widget_tool.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; +// import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; +// import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +// import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart'; +// import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart'; +// import 'package:aku_community_manager/ui/widgets/inner/show_bottom_sheet.dart'; -class DecorationManagerDetailPage extends StatefulWidget { - final int id; - final int status; - final int operationStatus; - DecorationManagerDetailPage({ - Key key, - this.id, - this.status, this.operationStatus, - }) : super(key: key); +// class DecorationManagerDetailPage extends StatefulWidget { +// final int id; +// final int status; +// final int operationStatus; +// DecorationManagerDetailPage({ +// Key key, +// this.id, +// this.status, this.operationStatus, +// }) : super(key: key); - @override - _DecorationManagerDetailStatePage createState() => - _DecorationManagerDetailStatePage(); -} +// @override +// _DecorationManagerDetailStatePage createState() => +// _DecorationManagerDetailStatePage(); +// } -class _DecorationManagerDetailStatePage - extends State { - EasyRefreshController _refreshController; - DecorationDetailModel _model; - bool _onload = true; - @override - void initState() { - super.initState(); - _refreshController = EasyRefreshController(); - } +// class _DecorationManagerDetailStatePage +// extends State { +// EasyRefreshController _refreshController; +// DecorationDetailModel _model; +// bool _onload = true; +// @override +// void initState() { +// super.initState(); +// _refreshController = EasyRefreshController(); +// } - @override - void dispose() { - _refreshController.dispose(); - super.dispose(); - } +// @override +// void dispose() { +// _refreshController.dispose(); +// super.dispose(); +// } - @override - Widget build(BuildContext context) { - return AkuScaffold( - title: '装修详情', - body: EasyRefresh( - firstRefresh: true, - header: MaterialHeader(), - onRefresh: () async { - BaseModel baseModel = - await NetUtil().get(API.manage.decorationFindByld, params: { - "decorationId ": widget.id, - }); - if (baseModel.status) { - _model = DecorationDetailModel.fromJson(baseModel.data); - _onload = false; - } else { - BotToast.showText(text: baseModel.message); - } - }, - child: _onload - ? Container() - : ListView( - padding: EdgeInsets.symmetric(vertical: 16.w), - children: [ - _buildInfo(), - widget.status > 3 ? SizedBox() : _buildFinishWorkCheck(), - _buildCycleCheck(), - UserTool.userProvider.infoModel.canDecorationTrack - ? SizedBox() - : _buildCheckDetail(), - ], - ), - ), - bottom: Builder(builder: (context) { - if (UserTool.userProvider.infoModel.canDecorationDispatch) { - switch (widget.status) { - case 1: - return AkuBottomButton(title: '立即安排', onTap: () {}); - break; - default: - return SizedBox(); - break; - } - } else if (UserTool.userProvider.infoModel.canDecorationTrack) { - switch (widget.status) { - case 2: - return AkuBottomButton( - title: '立即执行', - onTap: () { - // Get.to(DecorationFollowCheck(model: widget.model)); - }, - ); - break; - default: - return SizedBox(); - break; - } - } else - return SizedBox(); - }), - ); - } +// @override +// Widget build(BuildContext context) { +// return AkuScaffold( +// title: '装修详情', +// body: EasyRefresh( +// firstRefresh: true, +// header: MaterialHeader(), +// onRefresh: () async { +// BaseModel baseModel = +// await NetUtil().get(API.manage.decorationFindByld, params: { +// "decorationId ": widget.id, +// }); +// if (baseModel.status) { +// _model = DecorationDetailModel.fromJson(baseModel.data); +// _onload = false; +// } else { +// BotToast.showText(text: baseModel.message); +// } +// }, +// child: _onload +// ? Container() +// : ListView( +// padding: EdgeInsets.symmetric(vertical: 16.w), +// children: [ +// _buildInfo(), +// widget.status > 3 ? SizedBox() : _buildFinishWorkCheck(), +// _buildCycleCheck(), +// UserTool.userProvider.infoModel.canDecorationTrack +// ? SizedBox() +// : _buildCheckDetail(), +// ], +// ), +// ), +// bottom: Builder(builder: (context) { +// if (UserTool.userProvider.infoModel.canDecorationDispatch) { +// switch (widget.status) { +// case 1: +// return AkuBottomButton(title: '立即安排', onTap: () {}); +// break; +// default: +// return SizedBox(); +// break; +// } +// } else if (UserTool.userProvider.infoModel.canDecorationTrack) { +// switch (widget.status) { +// case 2: +// return AkuBottomButton( +// title: '立即执行', +// onTap: () { +// // Get.to(DecorationFollowCheck(model: widget.model)); +// }, +// ); +// break; +// default: +// return SizedBox(); +// break; +// } +// } else +// return SizedBox(); +// }), +// ); +// } - _buildInfo() { - return AkuTitleBox( - title: '装修信息', - spacing: 24, - suffix: Text( - DecorationUIUtil(context).getTagName(1, 2), - style: TextStyle( - color: DecorationUIUtil(context).getTagColor(1), - fontSize: 24.w, - ), - ), - children: [ - _buildInfoCard( - tag: '家', - midTop: '人才公寓', - midBottom: _model.decorationFBIVo.roomName, - name: '业主:' + UserTool.userProvider.infoModel.nickName, - phone: UserTool.userProvider.profileModel.tel, - rightTopWidget: Transform.rotate( - angle: pi / 4, - child: widget.status == 3 - ? Image.asset(R.ASSETS_MANAGE_IC_WANCHENG_PNG) - : Image.asset(R.ASSETS_MANAGE_IC_ZHUANGXIU_PNG), - ), - ), - AkuBox.h(16), - _buildInfoCard( - tag: '装', - midTop: _model.decorationFBIVo.constructionUnit, - name: '负责人:${_model.decorationFBIVo.director}', - phone: '${_model.decorationFBIVo.directorTel}', - ), - ], - ); - } +// _buildInfo() { +// return AkuTitleBox( +// title: '装修信息', +// spacing: 24, +// suffix: Text( +// DecorationUIUtil(context).getTagName(1, 2), +// style: TextStyle( +// color: DecorationUIUtil(context).getTagColor(1), +// fontSize: 24.w, +// ), +// ), +// children: [ +// _buildInfoCard( +// tag: '家', +// midTop: '人才公寓', +// midBottom: _model.decorationFBIVo.roomName, +// name: '业主:' + UserTool.userProvider.infoModel.nickName, +// phone: UserTool.userProvider.profileModel.tel, +// rightTopWidget: Transform.rotate( +// angle: pi / 4, +// child: widget.status == 3 +// ? Image.asset(R.ASSETS_MANAGE_IC_WANCHENG_PNG) +// : Image.asset(R.ASSETS_MANAGE_IC_ZHUANGXIU_PNG), +// ), +// ), +// AkuBox.h(16), +// _buildInfoCard( +// tag: '装', +// midTop: _model.decorationFBIVo.constructionUnit, +// name: '负责人:${_model.decorationFBIVo.director}', +// phone: '${_model.decorationFBIVo.directorTel}', +// ), +// ], +// ); +// } - _buildInfoCard({ - String tag, - String midTop, - String midBottom, - String name, - String phone, - Widget rightTopWidget = const SizedBox(), - }) { - return Stack( - children: [ - Container( - child: Column( - children: [ - Expanded( - child: Row( - children: [ - AkuBox.w(32), - Container( - height: 96.w, - width: 96.w, - alignment: Alignment.center, - child: Text( - tag, - style: TextStyle( - color: AppStyle.secondaryColor, - fontWeight: FontWeight.bold, - fontSize: 32.sp, - ), - ), - decoration: BoxDecoration( - color: Color(0xFFE9F2FF), - borderRadius: BorderRadius.circular(48.w), - ), - ), - AkuBox.w(24), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - midTop, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 32.sp, - fontWeight: FontWeight.bold, - ), - ), - midBottom == null - ? SizedBox() - : Text( - midBottom, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 32.sp, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - ], - )), - Divider( - height: 1.w, - thickness: 1.w, - ), - Row( - children: [ - AkuBox.h(88), - AkuBox.w(32), - Image.asset( - R.ASSETS_MESSAGE_IC_PEOPLE_PNG, - height: 40.w, - width: 40.w, - ), - Text( - name, - style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 24.sp, - ), - ), - Spacer(), - Image.asset( - R.ASSETS_MESSAGE_IC_PHONE_PNG, - height: 40.w, - width: 40.w, - ), - Text( - '电话:$phone', - style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 24.sp, - ), - ), - AkuBox.w(42), - ], - ), - ], - ), - height: 248.w, - decoration: BoxDecoration( - color: Color(0xFFF9F9F9), - borderRadius: BorderRadius.circular(8.w), - ), - ), - Positioned( - top: -30.w, - right: -30.w, - width: 140.w, - height: 140.w, - child: rightTopWidget, - ), - ], - ); - } +// _buildInfoCard({ +// String tag, +// String midTop, +// String midBottom, +// String name, +// String phone, +// Widget rightTopWidget = const SizedBox(), +// }) { +// return Stack( +// children: [ +// Container( +// child: Column( +// children: [ +// Expanded( +// child: Row( +// children: [ +// AkuBox.w(32), +// Container( +// height: 96.w, +// width: 96.w, +// alignment: Alignment.center, +// child: Text( +// tag, +// style: TextStyle( +// color: AppStyle.secondaryColor, +// fontWeight: FontWeight.bold, +// fontSize: 32.sp, +// ), +// ), +// decoration: BoxDecoration( +// color: Color(0xFFE9F2FF), +// borderRadius: BorderRadius.circular(48.w), +// ), +// ), +// AkuBox.w(24), +// Expanded( +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisSize: MainAxisSize.min, +// children: [ +// Text( +// midTop, +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 32.sp, +// fontWeight: FontWeight.bold, +// ), +// ), +// midBottom == null +// ? SizedBox() +// : Text( +// midBottom, +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 32.sp, +// fontWeight: FontWeight.bold, +// ), +// ), +// ], +// ), +// ), +// ], +// )), +// Divider( +// height: 1.w, +// thickness: 1.w, +// ), +// Row( +// children: [ +// AkuBox.h(88), +// AkuBox.w(32), +// Image.asset( +// R.ASSETS_MESSAGE_IC_PEOPLE_PNG, +// height: 40.w, +// width: 40.w, +// ), +// Text( +// name, +// style: TextStyle( +// color: AppStyle.minorTextColor, +// fontSize: 24.sp, +// ), +// ), +// Spacer(), +// Image.asset( +// R.ASSETS_MESSAGE_IC_PHONE_PNG, +// height: 40.w, +// width: 40.w, +// ), +// Text( +// '电话:$phone', +// style: TextStyle( +// color: AppStyle.minorTextColor, +// fontSize: 24.sp, +// ), +// ), +// AkuBox.w(42), +// ], +// ), +// ], +// ), +// height: 248.w, +// decoration: BoxDecoration( +// color: Color(0xFFF9F9F9), +// borderRadius: BorderRadius.circular(8.w), +// ), +// ), +// Positioned( +// top: -30.w, +// right: -30.w, +// width: 140.w, +// height: 140.w, +// child: rightTopWidget, +// ), +// ], +// ); +// } - ///完工检查 - _buildFinishWorkCheck() { - return AkuTitleBox( - title: '完工检查', - spacing: 24, - children: [ - _buildRow( - title: '开始装修时间', - subTitle: DateUtil.formatDateStr( - _model.decorationFBIVo.actualBegin, - format: 'yyyy-MM-dd', - ), - ), - _buildRow( - title: '接受人', - subTitle: _model.decorationFBIVo.director, - ), - _buildRow(title: '所属项目', subTitle: '装修管理'), - _buildRow( - title: '开始日期', - subTitle: DateUtil.formatDateStr( - _model.trackInspectionFBIVo.startDate, - format: 'yyyy-MM-dd', - ), - ), - Padding( - padding: EdgeInsets.symmetric( - vertical: 28.w, - ), - child: Text( - '检查内容', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.w, - ), - ), - ), - DecorationCheckRow( - details: [ - CHECK_TYPE.ELECTRIC, - CHECK_TYPE.WATER, - CHECK_TYPE.WALL, - CHECK_TYPE.DOOR_AND_WINDOWS, - CHECK_TYPE.SECURITY, - ], - onChange: (details) {}, - ), - ], - ); - } +// ///完工检查 +// _buildFinishWorkCheck() { +// return AkuTitleBox( +// title: '完工检查', +// spacing: 24, +// children: [ +// _buildRow( +// title: '开始装修时间', +// subTitle: DateUtil.formatDateStr( +// _model.decorationFBIVo.actualBegin, +// format: 'yyyy-MM-dd', +// ), +// ), +// _buildRow( +// title: '接受人', +// subTitle: _model.decorationFBIVo.director, +// ), +// _buildRow(title: '所属项目', subTitle: '装修管理'), +// _buildRow( +// title: '开始日期', +// subTitle: DateUtil.formatDateStr( +// _model.trackInspectionFBIVo.startDate, +// format: 'yyyy-MM-dd', +// ), +// ), +// Padding( +// padding: EdgeInsets.symmetric( +// vertical: 28.w, +// ), +// child: Text( +// '检查内容', +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 28.w, +// ), +// ), +// ), +// DecorationCheckRow( +// details: [ +// CHECK_TYPE.ELECTRIC, +// CHECK_TYPE.WATER, +// CHECK_TYPE.WALL, +// CHECK_TYPE.DOOR_AND_WINDOWS, +// CHECK_TYPE.SECURITY, +// ], +// onChange: (details) {}, +// ), +// ], +// ); +// } - ///周期检查 - _buildCycleCheck() { - return AkuTitleBox( - title: '周期检查', - spacing: 24, - children: [ - _buildRow( - title: '开始装修时间', - subTitle: DateUtil.formatDateStr( - _model.decorationFBIVo.actualBegin, - format: 'yyyy-MM-dd', - ), - ), - _buildRow( - title: '接受人', - subTitle: '黄鑫', - onTap: UserTool.userProvider.infoModel.canDecorationTrack - ? () { - // Get.to(DecorationDepartmentPage( - // model: widget.model, - // )).then((value) => setState(() {})); - } - : null, - ), - _buildRow(title: '所属项目', subTitle: '装修管理'), - _buildRow( - title: '开始日期', - subTitle: DateUtil.formatDateStr( - '2021-05-20 13:14:00', - format: 'yyyy-MM-dd', - ), - onTap: UserTool.userProvider.infoModel.canDecorationTrack - ? () { - showAkuSheet( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - children: [ - AkuBox.h(96), - AkuBackButton.text(), - Spacer(), - Text( - '开始日期', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 32.sp, - fontWeight: FontWeight.bold, - ), - ), - Spacer(), - AkuMaterialButton( - minWidth: (64 + 56).w, - onPressed: () { - Get.back(); - }, - child: Text( - '确定', - style: TextStyle( - color: AppStyle.secondaryColor, - fontSize: 28.sp, - ), - ), - ), - ], - ), - Container( - height: 500.w, - child: CupertinoDatePicker( - onDateTimeChanged: (dateTime) {}, - ), - ), - ], - ), - ).then((value) { - setState(() {}); - }); - } - : null, - ), - _buildRow( - title: '检查周期', - subTitle: '${_model.trackInspectionFBIVo.inspectionCycle}天', - onTap: UserTool.userProvider.infoModel.canDecorationTrack - ? () { - showAkuSheet( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - children: [ - AkuBox.h(96), - AkuBackButton.text(), - Spacer(), - Text( - '检查周期', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 32.sp, - fontWeight: FontWeight.bold, - ), - ), - Spacer(), - AkuMaterialButton( - minWidth: (64 + 56).w, - onPressed: () { - Get.back(); - }, - child: Text( - '确定', - style: TextStyle( - color: AppStyle.secondaryColor, - fontSize: 28.sp, - ), - ), - ), - ], - ), - Container( - height: 500.w, - child: CupertinoPicker( - children: [ - Center( - child: Text('1天'), - ), - Center( - child: Text('3天'), - ), - Center( - child: Text('7天'), - ), - Center( - child: Text('14天'), - ), - Center( - child: Text('30天'), - ), - ], - itemExtent: 88.w, - onSelectedItemChanged: (int value) { - int realValue = 0; - switch (value) { - case 0: - realValue = 1; - break; - case 1: - realValue = 3; - break; - case 2: - realValue = 7; - break; - case 3: - realValue = 14; - break; - case 4: - realValue = 30; - break; - } - }, - ), - ), - ], - ), - ).then((value) { - setState(() {}); - }); - } - : null, - ), - Padding( - padding: EdgeInsets.symmetric( - vertical: 28.w, - ), - child: Text( - '检查内容', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.w, - ), - ), - ), - DecorationCheckRow( - details: [ - CHECK_TYPE.ELECTRIC, - CHECK_TYPE.WATER, - CHECK_TYPE.WALL, - CHECK_TYPE.DOOR_AND_WINDOWS, - CHECK_TYPE.SECURITY, - ], - onChange: (details) {}, - canTap: UserTool.userProvider.infoModel.canDecorationTrack, - ) - ], - ); - } +// ///周期检查 +// _buildCycleCheck() { +// return AkuTitleBox( +// title: '周期检查', +// spacing: 24, +// children: [ +// _buildRow( +// title: '开始装修时间', +// subTitle: DateUtil.formatDateStr( +// _model.decorationFBIVo.actualBegin, +// format: 'yyyy-MM-dd', +// ), +// ), +// _buildRow( +// title: '接受人', +// subTitle: '黄鑫', +// onTap: UserTool.userProvider.infoModel.canDecorationTrack +// ? () { +// // Get.to(DecorationDepartmentPage( +// // model: widget.model, +// // )).then((value) => setState(() {})); +// } +// : null, +// ), +// _buildRow(title: '所属项目', subTitle: '装修管理'), +// _buildRow( +// title: '开始日期', +// subTitle: DateUtil.formatDateStr( +// '2021-05-20 13:14:00', +// format: 'yyyy-MM-dd', +// ), +// onTap: UserTool.userProvider.infoModel.canDecorationTrack +// ? () { +// showAkuSheet( +// child: Column( +// mainAxisSize: MainAxisSize.min, +// children: [ +// Row( +// children: [ +// AkuBox.h(96), +// AkuBackButton.text(), +// Spacer(), +// Text( +// '开始日期', +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 32.sp, +// fontWeight: FontWeight.bold, +// ), +// ), +// Spacer(), +// AkuMaterialButton( +// minWidth: (64 + 56).w, +// onPressed: () { +// Get.back(); +// }, +// child: Text( +// '确定', +// style: TextStyle( +// color: AppStyle.secondaryColor, +// fontSize: 28.sp, +// ), +// ), +// ), +// ], +// ), +// Container( +// height: 500.w, +// child: CupertinoDatePicker( +// onDateTimeChanged: (dateTime) {}, +// ), +// ), +// ], +// ), +// ).then((value) { +// setState(() {}); +// }); +// } +// : null, +// ), +// _buildRow( +// title: '检查周期', +// subTitle: '${_model.trackInspectionFBIVo.inspectionCycle}天', +// onTap: UserTool.userProvider.infoModel.canDecorationTrack +// ? () { +// showAkuSheet( +// child: Column( +// mainAxisSize: MainAxisSize.min, +// children: [ +// Row( +// children: [ +// AkuBox.h(96), +// AkuBackButton.text(), +// Spacer(), +// Text( +// '检查周期', +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 32.sp, +// fontWeight: FontWeight.bold, +// ), +// ), +// Spacer(), +// AkuMaterialButton( +// minWidth: (64 + 56).w, +// onPressed: () { +// Get.back(); +// }, +// child: Text( +// '确定', +// style: TextStyle( +// color: AppStyle.secondaryColor, +// fontSize: 28.sp, +// ), +// ), +// ), +// ], +// ), +// Container( +// height: 500.w, +// child: CupertinoPicker( +// children: [ +// Center( +// child: Text('1天'), +// ), +// Center( +// child: Text('3天'), +// ), +// Center( +// child: Text('7天'), +// ), +// Center( +// child: Text('14天'), +// ), +// Center( +// child: Text('30天'), +// ), +// ], +// itemExtent: 88.w, +// onSelectedItemChanged: (int value) { +// int realValue = 0; +// switch (value) { +// case 0: +// realValue = 1; +// break; +// case 1: +// realValue = 3; +// break; +// case 2: +// realValue = 7; +// break; +// case 3: +// realValue = 14; +// break; +// case 4: +// realValue = 30; +// break; +// } +// }, +// ), +// ), +// ], +// ), +// ).then((value) { +// setState(() {}); +// }); +// } +// : null, +// ), +// Padding( +// padding: EdgeInsets.symmetric( +// vertical: 28.w, +// ), +// child: Text( +// '检查内容', +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 28.w, +// ), +// ), +// ), +// DecorationCheckRow( +// details: [ +// CHECK_TYPE.ELECTRIC, +// CHECK_TYPE.WATER, +// CHECK_TYPE.WALL, +// CHECK_TYPE.DOOR_AND_WINDOWS, +// CHECK_TYPE.SECURITY, +// ], +// onChange: (details) {}, +// canTap: UserTool.userProvider.infoModel.canDecorationTrack, +// ) +// ], +// ); +// } - ///执行信息 - _buildCheckDetail() { - return AkuTitleBox( - title: '执行信息', - spacing: 24, - children: _model.trackRecordVos.map((e) { - return Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color(0xFFE8E8E8), - width: 1.w, - ), - ), - ), - child: ExpandablePanel( - theme: ExpandableThemeData( - tapHeaderToExpand: true, - iconPlacement: ExpandablePanelIconPlacement.right, - iconPadding: EdgeInsets.only(top: 32.w), - iconSize: 32.w, - iconColor: AppStyle.minorTextColor, - ), - header: Row( - children: [ - AkuBox.h(96), - Text( - '${DateUtil.formatDateStr('2021-5-20 13:14', format: 'yyyy-MM-dd')} ' + - e.typeString, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontWeight: FontWeight.bold, - fontSize: 28.sp, - ), - ), - Spacer(), - Text( - 3 > 2 ? '正常' : '异常', - style: TextStyle( - color: e.result==1 - ? Color(0xFF32B814) - : Color(0xFFFF4501), - fontSize: 28.sp, - ), - ), - ], - ), - expanded: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ...e.recordDetailVoList.map((e) { - return Container( - height: 96.w, - decoration: BoxDecoration( - border: Border( - top: BorderSide( - color: Color(0xFFE8E8E8), - width: 1.w, - ), - ), - ), - child: Row( - children: [ - AkuBox.w(48), - Image.asset( - R.ASSETS_PLACEHOLDER_WEBP, - height: 40.w, - ), - Text( - e.qualifiedString, - style: TextStyle( - fontSize: 28.sp, - color: AppStyle.primaryTextColor, - fontWeight: FontWeight.bold, - ), - ), - Spacer(), - DecorationCheckBox( - initValue: true, - ), - Spacer(), - ], - ), - ); - }).toList(), - Container( - decoration: BoxDecoration( - border: Border( - top: BorderSide( - width: 1.w, - color: Color(0xFFE8E8E8), - ), - ), - ), - height: 96.w, - padding: EdgeInsets.symmetric(horizontal: 32.w), - alignment: Alignment.centerLeft, - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: '检查描述:', - style: TextStyle( - color: AppStyle.minorTextColor, - ), - ), - TextSpan( - text: e.description, - ), - ], - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.sp, - ), - ), - ), - ), - ], - ), - collapsed: null, - ), - ); - }).toList(), - ); - } +// ///执行信息 +// _buildCheckDetail() { +// return AkuTitleBox( +// title: '执行信息', +// spacing: 24, +// children: _model.trackRecordVos.map((e) { +// return Container( +// decoration: BoxDecoration( +// border: Border( +// bottom: BorderSide( +// color: Color(0xFFE8E8E8), +// width: 1.w, +// ), +// ), +// ), +// child: ExpandablePanel( +// theme: ExpandableThemeData( +// tapHeaderToExpand: true, +// iconPlacement: ExpandablePanelIconPlacement.right, +// iconPadding: EdgeInsets.only(top: 32.w), +// iconSize: 32.w, +// iconColor: AppStyle.minorTextColor, +// ), +// header: Row( +// children: [ +// AkuBox.h(96), +// Text( +// '${DateUtil.formatDateStr('2021-5-20 13:14', format: 'yyyy-MM-dd')} ' + +// e.typeString, +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontWeight: FontWeight.bold, +// fontSize: 28.sp, +// ), +// ), +// Spacer(), +// Text( +// 3 > 2 ? '正常' : '异常', +// style: TextStyle( +// color: e.result==1 +// ? Color(0xFF32B814) +// : Color(0xFFFF4501), +// fontSize: 28.sp, +// ), +// ), +// ], +// ), +// expanded: Column( +// mainAxisSize: MainAxisSize.min, +// children: [ +// ...e.recordDetailVoList.map((e) { +// return Container( +// height: 96.w, +// decoration: BoxDecoration( +// border: Border( +// top: BorderSide( +// color: Color(0xFFE8E8E8), +// width: 1.w, +// ), +// ), +// ), +// child: Row( +// children: [ +// AkuBox.w(48), +// Image.asset( +// R.ASSETS_PLACEHOLDER_WEBP, +// height: 40.w, +// ), +// Text( +// e.qualifiedString, +// style: TextStyle( +// fontSize: 28.sp, +// color: AppStyle.primaryTextColor, +// fontWeight: FontWeight.bold, +// ), +// ), +// Spacer(), +// DecorationCheckBox( +// initValue: true, +// ), +// Spacer(), +// ], +// ), +// ); +// }).toList(), +// Container( +// decoration: BoxDecoration( +// border: Border( +// top: BorderSide( +// width: 1.w, +// color: Color(0xFFE8E8E8), +// ), +// ), +// ), +// height: 96.w, +// padding: EdgeInsets.symmetric(horizontal: 32.w), +// alignment: Alignment.centerLeft, +// child: Text.rich( +// TextSpan( +// children: [ +// TextSpan( +// text: '检查描述:', +// style: TextStyle( +// color: AppStyle.minorTextColor, +// ), +// ), +// TextSpan( +// text: e.description, +// ), +// ], +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 28.sp, +// ), +// ), +// ), +// ), +// ], +// ), +// collapsed: null, +// ), +// ); +// }).toList(), +// ); +// } - _buildRow({ - String title, - String subTitle, - VoidCallback onTap, - }) { - return Material( - color: Colors.transparent, - child: InkWell( - onTap: onTap, - child: Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w)), - ), - child: InkWell( - child: Row( - children: [ - AkuBox.h(96), - Text( - title, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.w, - ), - ), - Spacer(), - Text( - TextUtil.isEmpty(subTitle) ? '请选择' : subTitle, - style: TextStyle( - color: TextUtil.isEmpty(subTitle) - ? AppStyle.minorTextColor - : AppStyle.primaryTextColor, - fontSize: 28.w, - fontWeight: FontWeight.bold, - ), - ), - onTap == null ? SizedBox() : AkuBox.w(24), - onTap == null - ? SizedBox() - : Icon( - Icons.arrow_forward_ios, - size: 32.w, - color: AppStyle.minorTextColor, - ), - ], - ), - ), - ), - ), - ); - } -} +// _buildRow({ +// String title, +// String subTitle, +// VoidCallback onTap, +// }) { +// return Material( +// color: Colors.transparent, +// child: InkWell( +// onTap: onTap, +// child: Container( +// decoration: BoxDecoration( +// border: Border( +// bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w)), +// ), +// child: InkWell( +// child: Row( +// children: [ +// AkuBox.h(96), +// Text( +// title, +// style: TextStyle( +// color: AppStyle.primaryTextColor, +// fontSize: 28.w, +// ), +// ), +// Spacer(), +// Text( +// TextUtil.isEmpty(subTitle) ? '请选择' : subTitle, +// style: TextStyle( +// color: TextUtil.isEmpty(subTitle) +// ? AppStyle.minorTextColor +// : AppStyle.primaryTextColor, +// fontSize: 28.w, +// fontWeight: FontWeight.bold, +// ), +// ), +// onTap == null ? SizedBox() : AkuBox.w(24), +// onTap == null +// ? SizedBox() +// : Icon( +// Icons.arrow_forward_ios, +// size: 32.w, +// color: AppStyle.minorTextColor, +// ), +// ], +// ), +// ), +// ), +// ), +// ); +// } +// } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_page.dart index e3d980b..004007b 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_manager_page.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_page.dart @@ -1,128 +1,128 @@ -// Flutter imports: -import 'package:flutter/material.dart'; +// // Flutter imports: +// import 'package:flutter/material.dart'; -// Package imports: -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:provider/provider.dart'; +// // Package imports: +// import 'package:flutter_easyrefresh/easy_refresh.dart'; +// import 'package:provider/provider.dart'; -// Project imports: -import 'package:aku_community_manager/const/api.dart'; -import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart'; -import 'package:aku_community_manager/provider/user_provider.dart'; -import 'package:aku_community_manager/tools/screen_tool.dart'; -import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_card.dart'; -import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; -import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; -import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart'; +// // Project imports: +// import 'package:aku_community_manager/const/api.dart'; +// import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart'; +// import 'package:aku_community_manager/provider/user_provider.dart'; +// import 'package:aku_community_manager/tools/screen_tool.dart'; +// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_card.dart'; +// import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +// import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; +// import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart'; -class DecorationManagerPage extends StatefulWidget { - DecorationManagerPage({Key key}) : super(key: key); +// class DecorationManagerPage extends StatefulWidget { +// DecorationManagerPage({Key key}) : super(key: key); - @override - _DecorationManagerPageState createState() => _DecorationManagerPageState(); -} +// @override +// _DecorationManagerPageState createState() => _DecorationManagerPageState(); +// } -class _DecorationManagerPageState extends State - with TickerProviderStateMixin { - TabController _tabController; - EasyRefreshController _refreshController; +// class _DecorationManagerPageState extends State +// with TickerProviderStateMixin { +// TabController _tabController; +// EasyRefreshController _refreshController; - List get tabs { - final userProvider = Provider.of(context, listen: false); - if (userProvider?.infoModel?.canSendTicket != null && - userProvider.infoModel.canSendTicket) { - return ['待指派', '已指派', '已执行', '全部']; - } else { - return ['待执行', '已执行', '全部']; - } - } +// List get tabs { +// final userProvider = Provider.of(context, listen: false); +// if (userProvider?.infoModel?.canSendTicket != null && +// userProvider.infoModel.canSendTicket) { +// return ['待指派', '已指派', '已执行', '全部']; +// } else { +// return ['待执行', '已执行', '全部']; +// } +// } - @override - void initState() { - super.initState(); +// @override +// void initState() { +// super.initState(); - _tabController = TabController(length: tabs.length, vsync: this); - _refreshController = EasyRefreshController(); - } +// _tabController = TabController(length: tabs.length, vsync: this); +// _refreshController = EasyRefreshController(); +// } - @override - void dispose() { - _refreshController?.dispose(); - super.dispose(); - } +// @override +// void dispose() { +// _refreshController?.dispose(); +// super.dispose(); +// } - @override - Widget build(BuildContext context) { - return AkuScaffold( - title: '装修管理', - appBarBottom: PreferredSize( - child: AkuTabBar( - controller: _tabController, - tabs: tabs, - ), - preferredSize: Size.fromHeight(96.w), - ), - body: TabBarView( - controller: _tabController, - children: _getViews(), - ), - ); - } +// @override +// Widget build(BuildContext context) { +// return AkuScaffold( +// title: '装修管理', +// appBarBottom: PreferredSize( +// child: AkuTabBar( +// controller: _tabController, +// tabs: tabs, +// ), +// preferredSize: Size.fromHeight(96.w), +// ), +// body: TabBarView( +// controller: _tabController, +// children: _getViews(), +// ), +// ); +// } - List _getViews() { - final userProvider = Provider.of(context); - if (userProvider?.infoModel?.canSendTicket != null && - userProvider.infoModel.canSendTicket) { - return [...List.generate(4, (index) => _getSingleListView(index))]; - } else { - return [...List.generate(3, (index) => _getSingleListView(index))]; - } - // switch (role) { - // case USER_ROLE.MANAGER: - // return [ - // _getSingleListView( - // DecorationData.getModels(DecorationType.WAIT_HAND_OUT)), - // _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)), - // _getSingleListView(DecorationData.getModels(DecorationType.DONE)), - // _getSingleListView(DecorationData.allModels), - // ]; - // break; - // case USER_ROLE.PROPERTY: - // return [ - // _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)), - // _getSingleListView(DecorationData.getModels(DecorationType.DONE)), - // _getSingleListView(DecorationData.allPropertyModels), - // ]; - // default: - // return [ - // _getSingleListView( - // DecorationData.getTypeModels(DecorationStatusType.PROGRESS)), - // _getSingleListView( - // DecorationData.getTypeModels(DecorationStatusType.DONE)), - // _getSingleListView(DecorationData.allPropertyModels), - // ]; - // break; - // } - } +// List _getViews() { +// final userProvider = Provider.of(context); +// if (userProvider?.infoModel?.canSendTicket != null && +// userProvider.infoModel.canSendTicket) { +// return [...List.generate(4, (index) => _getSingleListView(index))]; +// } else { +// return [...List.generate(3, (index) => _getSingleListView(index))]; +// } +// // switch (role) { +// // case USER_ROLE.MANAGER: +// // return [ +// // _getSingleListView( +// // DecorationData.getModels(DecorationType.WAIT_HAND_OUT)), +// // _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)), +// // _getSingleListView(DecorationData.getModels(DecorationType.DONE)), +// // _getSingleListView(DecorationData.allModels), +// // ]; +// // break; +// // case USER_ROLE.PROPERTY: +// // return [ +// // _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)), +// // _getSingleListView(DecorationData.getModels(DecorationType.DONE)), +// // _getSingleListView(DecorationData.allPropertyModels), +// // ]; +// // default: +// // return [ +// // _getSingleListView( +// // DecorationData.getTypeModels(DecorationStatusType.PROGRESS)), +// // _getSingleListView( +// // DecorationData.getTypeModels(DecorationStatusType.DONE)), +// // _getSingleListView(DecorationData.allPropertyModels), +// // ]; +// // break; +// // } +// } - _getSingleListView(int index) { - return BeeListView( - extraParams: {'operationStatus': index}, - path: API.manage.decorationList, - controller: _refreshController, - convert: (models) { - return models.tableList - .map((e) => DecorationListModel.fromJson(e)) - .toList(); - }, - builder: (items) { - return ListView.builder( - itemBuilder: (context, index) { - return DecorationManagerCard(model: items[index]); - }, - itemCount: items.length, - padding: EdgeInsets.symmetric(horizontal: 32.w), - ); - }); - } -} +// _getSingleListView(int index) { +// return BeeListView( +// extraParams: {'operationStatus': index}, +// path: API.manage.decorationList, +// controller: _refreshController, +// convert: (models) { +// return models.tableList +// .map((e) => DecorationListModel.fromJson(e)) +// .toList(); +// }, +// builder: (items) { +// return ListView.builder( +// itemBuilder: (context, index) { +// return DecorationManagerCard(model: items[index]); +// }, +// itemCount: items.length, +// padding: EdgeInsets.symmetric(horizontal: 32.w), +// ); +// }); +// } +// } diff --git a/lib/ui/sub_pages/decoration_manager/new_renovation/new_renovation_view.dart b/lib/ui/sub_pages/decoration_manager/new_renovation/new_renovation_view.dart index 68cd688..cd8840a 100644 --- a/lib/ui/sub_pages/decoration_manager/new_renovation/new_renovation_view.dart +++ b/lib/ui/sub_pages/decoration_manager/new_renovation/new_renovation_view.dart @@ -32,6 +32,7 @@ class _NewRenovationState extends State @override Widget build(BuildContext context) { + super.build(context); return BeeListView( path: API.manage.newRenovationList, controller: _refreshController, diff --git a/lib/utils/network/net_util.dart b/lib/utils/network/net_util.dart index 5ef961c..76332ba 100644 --- a/lib/utils/network/net_util.dart +++ b/lib/utils/network/net_util.dart @@ -150,7 +150,6 @@ class NetUtil { } _parseErr(DioError err) { - final userProvider = Provider.of(Get.context, listen: false); LoggerData.addData(err); _makeToast(String message) { BotToast.showText(text: '$message\_${err?.response?.statusCode ?? ''}');