From 4ccef5d0b476b671a4b4ae8c3bc2b5c393bf37bd Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 29 Apr 2021 09:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=BE=E6=96=BD=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=8A=9F=E8=83=BD=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/home/ic_facilities.png | Bin 0 -> 1481 bytes .../manager/facilities/facilities_card.dart | 40 ++++++++++++++ .../manager/facilities/facilities_map.dart | 12 +++++ .../manager/facilities/facilities_page.dart | 51 ++++++++++++++++++ .../manager/facilities/facilities_view.dart | 15 ++++++ lib/tools/user_tool.dart | 15 ++++++ .../home/application/applications_page.dart | 2 + .../inspection_manage_details_page.dart | 5 +- 8 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 assets/home/ic_facilities.png create mode 100644 lib/models/manager/facilities/facilities_card.dart create mode 100644 lib/models/manager/facilities/facilities_map.dart create mode 100644 lib/models/manager/facilities/facilities_page.dart create mode 100644 lib/models/manager/facilities/facilities_view.dart create mode 100644 lib/tools/user_tool.dart diff --git a/assets/home/ic_facilities.png b/assets/home/ic_facilities.png new file mode 100644 index 0000000000000000000000000000000000000000..2ed100930847947791e96a5193a7a63f1db4f526 GIT binary patch literal 1481 zcmV;)1vdJLP)002t}1^@s6I8J)%00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP109Mhgg$H+T2k#9Kqic;Sg#n|r z49IczYDj?=2w+X^5|wX53u38l8?~@9D5y6q6bhN6 zUwdof{Zgsa=-(;%tY-(u zOEB6(aWXv}d`MzZLW*DkAVd<&XNJY%m&^qJ+V>RzsHIZr99&>pt&?=CeSA;!(aaRD z^_!xvH}t&cDXAuech}d~_TXZ(H#3)K&q#ecJ1}S6-xmtmI78R1*}*KSg{naVkr>A*wCr?wh7t>EjT6LCUPra81oVQ)WItJI@ti? z71@Gq6%yB1K?hTZEATkQreyd4+O2l4W0-h`J0Bf9V80)LZl(^oK*mKn#riA-jI^x$ zoiENcW$CKhITUlNbf8_V+1Xr~0xZBe(qcbzbGg-r54V;a$9v?;3@|=Qo?rn~Qv# z67o&|al{kDFb?nP30b0jQ^hYU-%IKAwH}1=3QyDKLg`Mz)9&CmHh!o>Z%JxqHYYvI z&h}>La#gSVnOID?#-jn{S!c4;pR31HItSH1EN0^@gnSDVyw%*%6jt#3S1K)7;5rz@ zs91jwN2SZ5H5-PBr_aKj4z|U-0x8(l}t*#sw7sq{A0~^ zoskucKey}PyFoD;3VWfP1(%uTar0{y`Q4yHn;mv36F&d6Yd zE6HT?epoPzOuv242iL^wto846Fkar?-jpJ97L+~(zhHIdWZxCb&Ch?b)FI?v|324o z@|DWZMyHmIPyQvxC#0T~%?M;+2xvggm+Owz!7#?f3T)EMv|$Jc5J_zAYr!yaO)HCn z4HcLop=I*;3SuCh1q&Y3Qo4A$$(=LzI~4l^$e!cw-%fL%Csr5tnDCTX#NuN_Dg=vN z2TcZ_$3>w+=MV^vr)9-rhCyRQoeVQ3R3RR*3{N-fo<0sE7O@C1n|4h|Jl~&)D*;!0 znEK_!*j=&Ei*}3qr?XbVqw+*zEH9R8w_9bulP9r=Wjun<=L^}^i}n-WMFCfKb~Ysu zqDJsDbNRLY-jy?UdHg-ov6gW&JUQ{C|GMMAP?HZDW4>0vW*kCOkJz#MzHKLb%@DKoLEm*S z(x1{Kfa3T-VlMaDblYoBCtO_J+WKkWd_K=l=un!CQuY=b3VDQPqLkGEvR{*oj!kA$ jz>1}S6-xmtmID6)iP+`$;>HQ=00000NkvXXu0mjfyl20Z literal 0 HcmV?d00001 diff --git a/lib/models/manager/facilities/facilities_card.dart b/lib/models/manager/facilities/facilities_card.dart new file mode 100644 index 0000000..74d32bd --- /dev/null +++ b/lib/models/manager/facilities/facilities_card.dart @@ -0,0 +1,40 @@ +import 'package:aku_community_manager/models/manager/facilities/facilities_map.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class FacilitiesCard extends StatefulWidget { + FacilitiesCard({Key key}) : super(key: key); + + @override + _FacilitiesCardState createState() => _FacilitiesCardState(); +} + +class _FacilitiesCardState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + children: [ + '户外2号篮球场'.text.color(kTextPrimaryColor).size(32.sp).bold.make(), + Spacer(), + '待检查' + .text + .color(FacilitiesMap.insepectColor[0]) + .size(28.sp) + .bold + .make(), + ], + ), + ], + ) + .box + .width(double.infinity) + .withRounded(value: 8.w) + .color(Colors.white) + .padding(EdgeInsets.all(24.w)) + .make(); + } +} diff --git a/lib/models/manager/facilities/facilities_map.dart b/lib/models/manager/facilities/facilities_map.dart new file mode 100644 index 0000000..32c32a5 --- /dev/null +++ b/lib/models/manager/facilities/facilities_map.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; +///设施检查相关map +class FacilitiesMap { + ///设施检查状态 + static Map inspectStatus = {1: '待检查', 2: '未完成', 3: '已检查'}; + ///设施检查状态的文字颜色 + static Map insepectColor = { + 1: Color(0xFFF49F02), + 2: Color(0xFF666666), + 3: Color(0xFF999999) + }; +} diff --git a/lib/models/manager/facilities/facilities_page.dart b/lib/models/manager/facilities/facilities_page.dart new file mode 100644 index 0000000..090dda3 --- /dev/null +++ b/lib/models/manager/facilities/facilities_page.dart @@ -0,0 +1,51 @@ +import 'package:aku_community_manager/models/manager/facilities/facilities_view.dart'; +import 'package:aku_community_manager/tools/user_tool.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class FacilitiesPage extends StatefulWidget { + FacilitiesPage({Key key}) : super(key: key); + + @override + _FacilitiesPageState createState() => _FacilitiesPageState(); +} + +class _FacilitiesPageState extends State + with TickerProviderStateMixin { + List get _tabs { + return UserTool.userProvider.infoModel.canOperation + ? ['待检查', '未完成', '已完成'] + : ['待检查', '已完成']; + } + + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: _tabs.length, vsync: this); + } + + @override + void dispose() { + _tabController?.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '设施检查', + appBarBottom: PreferredSize( + child: AkuTabBar(controller: _tabController, tabs: _tabs), + preferredSize: Size.fromHeight(88.w), + ), + body: TabBarView( + children: List.generate(_tabs.length, (index) => FacilitiesView()), + ), + ); + } +} diff --git a/lib/models/manager/facilities/facilities_view.dart b/lib/models/manager/facilities/facilities_view.dart new file mode 100644 index 0000000..dc97b72 --- /dev/null +++ b/lib/models/manager/facilities/facilities_view.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class FacilitiesView extends StatefulWidget { + FacilitiesView({Key key}) : super(key: key); + + @override + _FacilitiesViewState createState() => _FacilitiesViewState(); +} + +class _FacilitiesViewState extends State { + @override + Widget build(BuildContext context) { + return ListView(); + } +} diff --git a/lib/tools/user_tool.dart b/lib/tools/user_tool.dart new file mode 100644 index 0000000..fed0e9a --- /dev/null +++ b/lib/tools/user_tool.dart @@ -0,0 +1,15 @@ +import 'package:aku_community_manager/provider/app_provider.dart'; +import 'package:aku_community_manager/provider/user_provider.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +///获取应用或用户状态 +class UserTool { + ///应用信息 + static AppProvider get appProvider => + Provider.of(Get.context, listen: false); + ///用户信息 + static UserProvider get userProvider => + Provider.of(Get.context, listen: false); + + UserTool(); +} diff --git a/lib/ui/home/application/applications_page.dart b/lib/ui/home/application/applications_page.dart index fba6658..15d764a 100644 --- a/lib/ui/home/application/applications_page.dart +++ b/lib/ui/home/application/applications_page.dart @@ -1,4 +1,5 @@ // Flutter imports: +import 'package:aku_community_manager/models/manager/facilities/facilities_page.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -67,6 +68,7 @@ class _ApplicationPageState extends State AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, BorrowManagerPage()), AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, InspectionManagePage()), AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()), + AppApplication('设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG,FacilitiesPage() ) ]; @override 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 3740153..43cff1f 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 @@ -76,6 +76,7 @@ class _InspectionManageDetailsPageState bool _onload = true; EasyRefreshController _refreshController; bool _exit = false; + List _points = []; @override void initState() { super.initState(); @@ -215,6 +216,7 @@ class _InspectionManageDetailsPageState child: '确认'.text.size(28.sp).black.isIntrinsic.bold.make(), onPressed: () { _exit = true; + _stopTimer(); Get.back(); }, ), @@ -512,7 +514,7 @@ class _InspectionManageDetailsPageState icon: BitmapDescriptor.defaultMarkerWithHue(210)), onLocationChanged: (argument) async { _aMapController.moveCamera(CameraUpdate.newCameraPosition( - CameraPosition(target: argument.latLng,zoom: 19))); + CameraPosition(target: argument.latLng, zoom: 19))); if (_canUploadLocation) { BaseModel baseModel = await _uploadLocation(widget.executeId, argument.latLng.longitude, argument.latLng.latitude); @@ -520,6 +522,7 @@ class _InspectionManageDetailsPageState BotToast.showText(text: baseModel.message); } else { _canUploadLocation = false; + //TODO:绘制折线 } } },