diff --git a/assets/inspection/inspection_station.png b/assets/inspection/inspection_station.png new file mode 100644 index 0000000..7f49078 Binary files /dev/null and b/assets/inspection/inspection_station.png differ diff --git a/lib/mock_models/manage_models/manage_model.dart b/lib/mock_models/manage_models/manage_model.dart index 69c2542..d2a6392 100644 --- a/lib/mock_models/manage_models/manage_model.dart +++ b/lib/mock_models/manage_models/manage_model.dart @@ -47,7 +47,7 @@ class InspectionManageCardModel{ static List initList(){ return [ InspectionManageCardModel('1号巡检任务', '2020.1-2020.12', '每周一、三、五', '8:00-12:00', ['王珂','陈晖洁','凯尔希','王铁锤','李狗蛋','尼古拉斯'], [ - '小区东门入口','1号南门','3号门站','3号闸门','3号门站' + '小区东门入口','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/ui/manage_pages/inspection_manage/inspection_manage_card.dart b/lib/ui/manage_pages/inspection_manage/inspection_manage_card.dart index e69de29..f97aee8 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_manage_card.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_manage_card.dart @@ -0,0 +1,138 @@ +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/manage_pages/inspection_manage/inspection_manage_details_page.dart'; +import 'package:aku_ui/common_widgets/aku_common_widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:aku_community_manager/const/resource.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/instance_manager.dart'; +import 'package:get/get.dart'; + +class InspectionManageCard { + final InspectionManageCardModel cardModel; + final bool extra; + InspectionManageCard(this.cardModel, {this.extra = true}); + + Widget inspectionManageCard() { + TextStyle _textstyle = + TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp); + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + AkuBox.h(16), + AkuButton( + onPressed: extra? () { + Get.to(InspectionManageDetailsPage(cardModel: cardModel,)); + }:(){}, + child: Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: extra? 48.w:40.w), + width: double.infinity, + height:extra? 362.w:270.w, + decoration: BoxDecoration(borderRadius:BorderRadius.circular(8.w),color: Color(0xFFFFFFFF)), + child: Column(children: [ + Container( + height:extra? 93.w :86.w, + width: double.infinity, + alignment: Alignment.centerLeft, + child: Text( + cardModel.title, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: extra? 32.sp:36.sp, + fontWeight: FontWeight.bold), + )), + extra + ? Divider( + height: 1.w, + ) + : SizedBox(), + extra? AkuBox.h(24):SizedBox(), + 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, + ), + ], + ), + extra ? Spacer() : SizedBox(), + extra + ? 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, + ), + ], + ) + : SizedBox(), + ]), + ), + ), + ], + ); + } +} diff --git a/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart index 88e3718..acb80d6 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart @@ -1,13 +1,138 @@ +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/manage_pages/inspection_manage/inspection_manage_card.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_community_manager/const/resource.dart'; class InspectionManageDetailsPage extends StatelessWidget { - const InspectionManageDetailsPage({Key key}) : super(key: key); + final InspectionManageCardModel cardModel; + InspectionManageDetailsPage({Key key, this.cardModel}) : super(key: key); @override Widget build(BuildContext context) { return AkuScaffold( - + title: '巡检详情', + body: Column( + children: [ + InspectionManageCard(cardModel, extra: false).inspectionManageCard(), + Container( + width: double.infinity, + color: Color(0xFFFFFFFF), + margin: EdgeInsets.only(top: 16.w), + padding: EdgeInsets.only( + top: 24.w, left: 32.w, right: 86.w, bottom: 40.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '巡检人员', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold), + ), + AkuBox.h(16), + GridView( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + childAspectRatio: 250 / 40, + mainAxisSpacing: 16.w), + children: cardModel.persons + .map((e) => _person(cardModel.persons.indexOf(e))) + .toList(), + ), + ], + ), + ), + AkuBox.h(16), + Container( + color: Color(0xFFFFFFFF), + padding: EdgeInsets.only(top: 24.w, left: 32.w, right: 32.w), + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('巡检站点', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold)), + AkuBox.h(16), + Wrap( + runSpacing: 16.w, + children: cardModel.stations + .map((e) => _station(cardModel.stations.indexOf(e))) + .toList(), + ), + AkuBox.h(24), + Image.asset( + R.ASSETS_INSPECTION_INSPECTION_STATION_PNG, + width: 686.w, + height: 343.w, + ), + ]), + ), + ], + ), ); } -} \ No newline at end of file + + Widget _station(index) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: + EdgeInsets.only(top: 16.w, left: 24.w, bottom: 15.w, right: 24.w), + color: Color(0xFFF9F9F9), + height: 64.w, + alignment: Alignment.center, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + cardModel.stations[index], + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 24.sp), + ), + ], + ), + ), + AkuBox.w(8), + (cardModel.stations.length - 1) != index + ? Container( + width: 56.w, + height: 3.w, + color: Color(0xFFE8E8E8), + ) + : SizedBox(), + ], + ); + } + + Widget _person(index) { + return Container( + height: 40.w, + child: Row(mainAxisSize: MainAxisSize.min, children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + AkuBox.w(8), + Text( + cardModel.persons[index], + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + ), + ), + ]), + ); + } +} diff --git a/lib/ui/manage_pages/inspection_manage/inspection_manage_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_manage_page.dart index 2566e45..e266bdc 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_manage_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_manage_page.dart @@ -2,6 +2,7 @@ import 'package:aku_community_manager/mock_models/manage_models/manage_model.dar 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/inspection_manage/inspection_manage_card.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'; @@ -26,126 +27,124 @@ class _InspectionManagePageState extends State { body: ListView( padding: EdgeInsets.only(left: 32.w, right: 32.w), children: _inspectionManageModel.inspectionManageModels - .map((e) => _inspectionManageCard(e)) + .map((e) => InspectionManageCard(e).inspectionManageCard()) .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, - ), - ], - ), - ]), - ), - ), - ], - ); - } +// 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, +// ), +// ], +// ), +// ]), +// ), +// ), +// ], +// ); +// } } diff --git a/pubspec.yaml b/pubspec.yaml index cd22008..7acfedc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -75,6 +75,7 @@ flutter: - assets/user/ - assets/message/ - assets/manage/ + - assets/inspection/ - assets/static_temp/ - assets/static_fix/