From 032bba7c7cf2768c0f495ad312292cde9f654779 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Wed, 4 Nov 2020 13:20:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=8C=E5=91=BD=E5=90=8D=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 1 + ...en_manage_model.dart => manage_model.dart} | 21 +++ lib/provider/manage_provider.dart | 8 +- .../home/application/applications_page.dart | 2 + ...ls.dart => green_manage_details_page.dart} | 6 +- lib/ui/manage_pages/green_manage_page.dart | 6 +- .../inspection_manage_details_page.dart | 13 ++ .../manage_pages/inspection_manage_page.dart | 151 ++++++++++++++++++ 8 files changed, 201 insertions(+), 7 deletions(-) rename lib/mock_models/manage_models/{green_manage_model.dart => manage_model.dart} (64%) rename lib/ui/manage_pages/{green_manage_details.dart => green_manage_details_page.dart} (97%) create mode 100644 lib/ui/manage_pages/inspection_manage_details_page.dart create mode 100644 lib/ui/manage_pages/inspection_manage_page.dart diff --git a/lib/main.dart b/lib/main.dart index 9e2419b..9206018 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -22,6 +22,7 @@ class MyApp extends StatelessWidget { ChangeNotifierProvider(create: (context) => AppProvider()), ChangeNotifierProvider(create: (context) => FixProvider()), ChangeNotifierProvider(create: (context)=> GreenManageProvider()), + ChangeNotifierProvider(create: (context)=>InspectionManageProvider()), ], child: GetMaterialApp( title: '小蜜蜂管家', diff --git a/lib/mock_models/manage_models/green_manage_model.dart b/lib/mock_models/manage_models/manage_model.dart similarity index 64% rename from lib/mock_models/manage_models/green_manage_model.dart rename to lib/mock_models/manage_models/manage_model.dart index 11e222a..69c2542 100644 --- a/lib/mock_models/manage_models/green_manage_model.dart +++ b/lib/mock_models/manage_models/manage_model.dart @@ -34,3 +34,24 @@ class GreenManageCardModel { ]; } } + +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号闸门','3号门站' + ]), + InspectionManageCardModel('2号巡检任务', '2020.1-2020.12', '每周二', '8:00-12:00',['史尔特尔'] , []), + InspectionManageCardModel('3号巡检任务', '2020.1-2020.12', '每周二、四、六', '8:00-12:00', ['叶莲娜'], []), + ]; + } +} + diff --git a/lib/provider/manage_provider.dart b/lib/provider/manage_provider.dart index df8bb6a..5478b6b 100644 --- a/lib/provider/manage_provider.dart +++ b/lib/provider/manage_provider.dart @@ -1,8 +1,14 @@ -import 'package:aku_community_manager/mock_models/manage_models/green_manage_model.dart'; +import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart'; import 'package:flutter/material.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(); } \ No newline at end of file diff --git a/lib/ui/home/application/applications_page.dart b/lib/ui/home/application/applications_page.dart index d651a54..623e3e3 100644 --- a/lib/ui/home/application/applications_page.dart +++ b/lib/ui/home/application/applications_page.dart @@ -1,4 +1,5 @@ import 'package:aku_community_manager/ui/manage_pages/green_manage_page.dart'; +import 'package:aku_community_manager/ui/manage_pages/inspection_manage_page.dart'; import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_manager_page.dart'; import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart'; @@ -51,6 +52,7 @@ class _ApplicationPageState extends State ]; List _wisdomApplications=[ AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()), + AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, InspectionManagePage()), ]; @override Widget build(BuildContext context) { diff --git a/lib/ui/manage_pages/green_manage_details.dart b/lib/ui/manage_pages/green_manage_details_page.dart similarity index 97% rename from lib/ui/manage_pages/green_manage_details.dart rename to lib/ui/manage_pages/green_manage_details_page.dart index 8c9828b..43ace63 100644 --- a/lib/ui/manage_pages/green_manage_details.dart +++ b/lib/ui/manage_pages/green_manage_details_page.dart @@ -1,4 +1,4 @@ -import 'package:aku_community_manager/mock_models/manage_models/green_manage_model.dart'; +import 'package:aku_community_manager/mock_models/manage_models/manage_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'; @@ -7,10 +7,10 @@ import 'package:flutter/material.dart'; import 'package:aku_community_manager/const/resource.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -class GreenManageDetails extends StatelessWidget { +class GreenManageDetailsPage extends StatelessWidget { final GreenManageCardModel cardModel; - GreenManageDetails(this.cardModel); + GreenManageDetailsPage(this.cardModel); @override Widget build(BuildContext context) { diff --git a/lib/ui/manage_pages/green_manage_page.dart b/lib/ui/manage_pages/green_manage_page.dart index c198d30..1b9c432 100644 --- a/lib/ui/manage_pages/green_manage_page.dart +++ b/lib/ui/manage_pages/green_manage_page.dart @@ -1,8 +1,8 @@ -import 'package:aku_community_manager/mock_models/manage_models/green_manage_model.dart'; +import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart'; import 'package:aku_community_manager/provider/manage_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/manage_pages/green_manage_details.dart'; +import 'package:aku_community_manager/ui/manage_pages/green_manage_details_page.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_ui/common_widgets/aku_common_widgets.dart'; import 'package:flutter/material.dart'; @@ -42,7 +42,7 @@ class _GreenManagePageState extends State { //跳转管理详情按钮 AkuButton( onPressed: () { - Get.to(GreenManageDetails(cardModel) + Get.to(GreenManageDetailsPage(cardModel) ); }, child: Container( diff --git a/lib/ui/manage_pages/inspection_manage_details_page.dart b/lib/ui/manage_pages/inspection_manage_details_page.dart new file mode 100644 index 0000000..88e3718 --- /dev/null +++ b/lib/ui/manage_pages/inspection_manage_details_page.dart @@ -0,0 +1,13 @@ +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:flutter/material.dart'; + +class InspectionManageDetailsPage extends StatelessWidget { + const InspectionManageDetailsPage({Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return AkuScaffold( + + ); + } +} \ No newline at end of file diff --git a/lib/ui/manage_pages/inspection_manage_page.dart b/lib/ui/manage_pages/inspection_manage_page.dart new file mode 100644 index 0000000..2566e45 --- /dev/null +++ b/lib/ui/manage_pages/inspection_manage_page.dart @@ -0,0 +1,151 @@ +import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart'; +import 'package:aku_community_manager/provider/manage_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/widgets/common/aku_scaffold.dart'; +import 'package:aku_ui/common_widgets/aku_common_widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:provider/provider.dart'; +import 'package:aku_community_manager/const/resource.dart'; + +class InspectionManagePage extends StatefulWidget { + InspectionManagePage({Key key}) : super(key: key); + + @override + _InspectionManagePageState createState() => _InspectionManagePageState(); +} + +class _InspectionManagePageState extends State { + @override + Widget build(BuildContext context) { + final _inspectionManageModel = + Provider.of(context); + return AkuScaffold( + title: '巡检管理', + body: ListView( + padding: EdgeInsets.only(left: 32.w, right: 32.w), + children: _inspectionManageModel.inspectionManageModels + .map((e) => _inspectionManageCard(e)) + .toList(), + ), + ); + } + + Widget _inspectionManageCard(InspectionManageCardModel cardModel) { + TextStyle _textstyle = + TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp); + return Column( + children: [ + AkuBox.h(16), + AkuButton( + onPressed: () { + + }, + child: Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 48.w), + width: 686.w, + height: 362.w, + color: Color(0xFFFFFFFF), + child: Column(children: [ + Container( + height: 93.w, + width: double.infinity, + alignment: Alignment.centerLeft, + child: Text( + cardModel.title, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold), + )), + Divider( + height: 1.w, + ), + AkuBox.h(24), + Row( + children: [ + Image.asset( + R.ASSETS_MANAGE_IC_RENWU_PNG, + width: 40.w, + height: 40.w, + ), + AkuBox.w(4), + Text( + '巡检日期', + style: _textstyle, + ), + Spacer(), + Text( + cardModel.date, + style: AppStyle().primaryStyle, + ) + ], + ), + Spacer(), + Row( + children: [ + Image.asset( + R.ASSETS_HOME_IC_NEWS_PNG, + width: 40.w, + height: 40.w, + ), + AkuBox.w(4), + Text('巡检周期', style: _textstyle), + Spacer(), + Text( + cardModel.cycle, + style: AppStyle().primaryStyle, + ), + ], + ), + Spacer(), + Row( + children: [ + Image.asset( + R.ASSETS_MANAGE_IC_TIME_PNG, + width: 40.w, + height: 40.w, + ), + AkuBox.w(4), + Text( + '巡检时间', + style: _textstyle, + ), + Spacer(), + Text( + cardModel.time, + style: AppStyle().primaryStyle, + ), + ], + ), + Spacer(), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + AkuBox.w(4), + Text( + '巡检人员', + style: _textstyle, + ), + Spacer(), + Text( + cardModel.persons.length > 2 + ? '${cardModel.persons[0]}、${cardModel.persons[1]}等' + : cardModel.persons[0], + style: AppStyle().primaryStyle, + ), + ], + ), + ]), + ), + ), + ], + ); + } +}