diff --git a/assets/home/ic_facilities.png b/assets/home/ic_facilities.png new file mode 100644 index 0000000..2ed1009 Binary files /dev/null and b/assets/home/ic_facilities.png differ 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:绘制折线 } } },