diff --git a/lib/main.dart b/lib/main.dart index 2ef29b6..1455fc8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -15,7 +15,6 @@ import 'package:aku_community_manager/provider/anouncement_provider.dart'; 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/outdoor_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/ui/splash/splash_page.dart'; @@ -58,7 +57,7 @@ class MyApp extends StatelessWidget { ChangeNotifierProvider(create: (context) => FixProvider()), ChangeNotifierProvider(create: (context) => GreenManageProvider()), ChangeNotifierProvider(create: (context) => InspectionManageProvider()), - ChangeNotifierProvider(create: (context) => OutdoorProvider()), + ChangeNotifierProvider(create: (context) => GreenManageProvider()), ChangeNotifierProvider(create: (context) => InspectionManageProvider()), ChangeNotifierProvider(create: (context) => AnouncementProvider()), diff --git a/lib/mock_models/outdoor_models/outdoor_model.dart b/lib/mock_models/outdoor_models/outdoor_model.dart deleted file mode 100644 index 3b864ea..0000000 --- a/lib/mock_models/outdoor_models/outdoor_model.dart +++ /dev/null @@ -1,184 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Project imports: -import 'package:aku_community_manager/const/resource.dart'; - -enum OUTDOORSTATUS { - ///待出户 - NOT_OUT, - - ///已出户 - OUT_DONE, - - ///已驳回 - REJECTED, - - ///已作废 - CANCELLATION, -} - -class ItemsOutdoorModel { - ///出户状态 - OUTDOORSTATUS status; - - ///卡片上方时间,即开始时间 - DateTime datetime; - - ///小区名字 - String communityname; - - ///想起地址 - String adress; - - ///出户人 - String name; - - ///身份 - String identify; - - ///物品 - ItemDetails items; - - ///预计出户时间 - String outtime; - - ///实际出户/驳回时间 - String finalOutTime; - - ///出户地点 - String outPlace; - - ///驳回理由 - String rejectReason; - ItemsOutdoorModel({ - @required this.status, - @required this.datetime, - @required this.communityname, - @required this.adress, - @required this.name, - @required this.identify, - @required this.items, - @required this.outtime, - this.finalOutTime, - this.outPlace, - this.rejectReason, - }); - - static List initList() { - return [ - ItemsOutdoorModel( - status: OUTDOORSTATUS.NOT_OUT, - datetime: DateTime(2020, 10, 23, 09, 28, 56), - communityname: '深圳华悦茂峰', - adress: '1幢1单元702室', - name: '马云', - identify: '业主', - items: ItemDetails( - itemname: '家具', - weight: 40, - way: '搬家公司', - imagepath: [ - R.ASSETS_OUTDOOR_ITME1_PNG, - R.ASSETS_OUTDOOR_ITEM2_PNG, - R.ASSETS_OUTDOOR_ITEM3_PNG - ], - ), - outtime: '2020-10-24 12:00', - finalOutTime: '', - outPlace: '', - rejectReason: '', - ), - ItemsOutdoorModel( - status: OUTDOORSTATUS.OUT_DONE, - datetime: DateTime(2020, 10, 23, 09, 28, 56), - communityname: '深圳华悦茂峰', - adress: '1幢1单元702室', - name: '马云', - identify: '业主', - items: ItemDetails( - itemname: '家具', - weight: 60, - way: '搬家公司', - imagepath: [ - R.ASSETS_OUTDOOR_ITME1_PNG, - R.ASSETS_OUTDOOR_ITEM2_PNG, - R.ASSETS_OUTDOOR_ITEM3_PNG - ], - ), - outtime: '2020-10-24 12:00', - finalOutTime: '2020-10-23 11:23:56', - outPlace: '东大门', - rejectReason: ''), - ItemsOutdoorModel( - status: OUTDOORSTATUS.REJECTED, - datetime: DateTime(2020, 10, 23, 09, 28, 56), - communityname: '深圳华悦茂峰', - adress: '1幢1单元702室', - name: '马云', - identify: '业主', - items: ItemDetails( - itemname: '家具', - weight: 80, - way: '搬家公司', - imagepath: [ - R.ASSETS_OUTDOOR_ITME1_PNG, - R.ASSETS_OUTDOOR_ITEM2_PNG, - R.ASSETS_OUTDOOR_ITEM3_PNG - ], - ), - outtime: '2020-10-24 12:00', - finalOutTime: '2020-10-24 12:22:34', - outPlace: '', - rejectReason: '申报物品与实际物品不符', - ), - ItemsOutdoorModel( - status: OUTDOORSTATUS.CANCELLATION, - datetime: DateTime(2020, 10, 23, 09, 28, 56), - communityname: '深圳华悦茂峰', - adress: '1幢1单元702室', - name: '马云', - identify: '业主', - items: ItemDetails( - itemname: '家具', - weight: 120, - way: '搬家公司', - imagepath: [ - R.ASSETS_OUTDOOR_ITME1_PNG, - R.ASSETS_OUTDOOR_ITEM2_PNG, - R.ASSETS_OUTDOOR_ITEM3_PNG - ], - ), - outtime: '2020-10-24 12:00', - finalOutTime: '', - outPlace: '', - rejectReason: '', - ), - ]; - } - - static Map outdoorStatusMap = { - OUTDOORSTATUS.NOT_OUT: '待出户', - OUTDOORSTATUS.OUT_DONE: '已出户', - OUTDOORSTATUS.REJECTED: '已驳回', - OUTDOORSTATUS.CANCELLATION: '已作废', - }; - static Map outdoorStatusStringMap = { - '待出户': OUTDOORSTATUS.NOT_OUT, - '已出户': OUTDOORSTATUS.OUT_DONE, - '已驳回': OUTDOORSTATUS.REJECTED, - '已作废': OUTDOORSTATUS.CANCELLATION, - }; -} - -class ItemDetails { - String itemname; - double weight; - String way; - List imagepath; - ItemDetails( - {@required this.itemname, - @required this.weight, - this.way, - this.imagepath}); -} diff --git a/lib/provider/outdoor_provider.dart b/lib/provider/outdoor_provider.dart index 5e5d5cf..e69de29 100644 --- a/lib/provider/outdoor_provider.dart +++ b/lib/provider/outdoor_provider.dart @@ -1,32 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Project imports: -import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart'; - -class OutdoorProvider extends ChangeNotifier { - List _itemOutdoorModel = ItemsOutdoorModel.initList(); - List get itemOutdoorModels => _itemOutdoorModel; - addOutdoormodel(ItemsOutdoorModel model) { - _itemOutdoorModel.insert(0, model); - notifyListeners(); - } - - List getOutdoorModels(int index) { - return [ - _itemOutdoorModel - .where((element) => element.status == OUTDOORSTATUS.NOT_OUT) - .toList(), - _itemOutdoorModel - .where((element) => element.status == OUTDOORSTATUS.OUT_DONE) - .toList(), - _itemOutdoorModel - .where((element) => element.status == OUTDOORSTATUS.REJECTED) - .toList(), - _itemOutdoorModel - .where((element) => element.status == OUTDOORSTATUS.CANCELLATION) - .toList(), - _itemOutdoorModel, - ][index]; - } -} diff --git a/lib/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart b/lib/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart index b76e01e..d19fb40 100644 --- a/lib/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart +++ b/lib/ui/sub_pages/items_outdoor/items_outdoor_details_page.dart @@ -17,12 +17,9 @@ import 'package:provider/provider.dart'; // Project imports: import 'package:aku_community_manager/const/resource.dart'; -import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart'; -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/tools/widget_tool.dart'; -import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_card.dart'; import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart'; import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_pass_page.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; diff --git a/lib/ui/sub_pages/items_outdoor/items_outdoor_page.dart b/lib/ui/sub_pages/items_outdoor/items_outdoor_page.dart index 671693c..607574a 100644 --- a/lib/ui/sub_pages/items_outdoor/items_outdoor_page.dart +++ b/lib/ui/sub_pages/items_outdoor/items_outdoor_page.dart @@ -1,19 +1,12 @@ -// Flutter imports: -import 'package:aku_community_manager/const/api.dart'; -import 'package:aku_community_manager/models/manager/goods_out/goods_out_item_model.dart'; + import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_view.dart'; -import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; // Package imports: import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:provider/provider.dart'; // Project imports: -import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart'; -import 'package:aku_community_manager/provider/outdoor_provider.dart'; -import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_card.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart'; diff --git a/lib/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart b/lib/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart index 8371cd3..3b58514 100644 --- a/lib/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart +++ b/lib/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart @@ -10,7 +10,6 @@ import 'package:common_utils/common_utils.dart'; import 'package:get/get.dart'; // Project imports: -import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_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/widgets/common/aku_radio.dart'; diff --git a/lib/ui/sub_pages/items_outdoor/outdoor_pass_page.dart b/lib/ui/sub_pages/items_outdoor/outdoor_pass_page.dart index e5567c0..c6944bd 100644 --- a/lib/ui/sub_pages/items_outdoor/outdoor_pass_page.dart +++ b/lib/ui/sub_pages/items_outdoor/outdoor_pass_page.dart @@ -11,7 +11,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; // Project imports: -import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_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/widgets/common/aku_scaffold.dart'; diff --git a/lib/utils/network/net_util.dart b/lib/utils/network/net_util.dart index 83cccc5..20283e5 100644 --- a/lib/utils/network/net_util.dart +++ b/lib/utils/network/net_util.dart @@ -3,6 +3,7 @@ import 'dart:io'; // Package imports: import 'package:aku_community_manager/provider/user_provider.dart'; +import 'package:aku_community_manager/ui/home/home_page.dart'; import 'package:aku_community_manager/ui/login/login_page.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:dio/dio.dart'; @@ -140,6 +141,7 @@ 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 ?? ''}');