diff --git a/lib/ui/home/application/applications_page.dart b/lib/ui/home/application/applications_page.dart index 825a88a..305eb59 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/ui/manage_pages/hygience_manage/hygience_manage_page.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -84,7 +85,8 @@ class _ApplicationPageState extends State AppApplication( '包裹管理', R.ASSETS_HOME_PACKAGE_PNG, () => PackagesManagePage()), AppApplication('钥匙管理', R.ASSETS_HOME_KEY_PNG, () => KeyManagePage()), - AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, () => RulesManagePage()) + AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, () => RulesManagePage()), + AppApplication('卫生管理', R.ASSETS_PLACEHOLDER_WEBP, () => HygienceManagePage()) ]; @override diff --git a/lib/ui/home/search_workorder_page.dart b/lib/ui/home/search_workorder_page.dart index 811ac9d..27e578f 100644 --- a/lib/ui/home/search_workorder_page.dart +++ b/lib/ui/home/search_workorder_page.dart @@ -1,4 +1,9 @@ // Flutter imports: +import 'package:aku_community_manager/models/manager/facilities/facilities_page.dart'; +import 'package:aku_community_manager/ui/manage_pages/hygience_manage/hygience_manage_page.dart'; +import 'package:aku_community_manager/ui/manage_pages/key_manage/key_manage_page.dart'; +import 'package:aku_community_manager/ui/manage_pages/packages_manage/packages_manage_page.dart'; +import 'package:aku_community_manager/ui/manage_pages/rules_manage/rules_manage_page.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -46,6 +51,14 @@ class _SearchWorkOrderpageState 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()), + AppApplication( + '包裹管理', R.ASSETS_HOME_PACKAGE_PNG, () => PackagesManagePage()), + AppApplication('钥匙管理', R.ASSETS_HOME_KEY_PNG, () => KeyManagePage()), + AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, () => RulesManagePage()), + AppApplication( + '卫生管理', R.ASSETS_PLACEHOLDER_WEBP, () => HygienceManagePage()) ]; List _displayApps = []; diff --git a/lib/ui/manage_pages/hygience_manage/hygience_manage_card.dart b/lib/ui/manage_pages/hygience_manage/hygience_manage_card.dart new file mode 100644 index 0000000..ed578a1 --- /dev/null +++ b/lib/ui/manage_pages/hygience_manage/hygience_manage_card.dart @@ -0,0 +1,151 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/aku_divider.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/manage_pages/hygience_manage/hygience_manage_map.dart'; +import 'package:aku_ui/common_widgets/aku_button.dart'; +import 'package:flutter/material.dart'; +import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart'; + +class HyginecManageCard extends StatefulWidget { + final int index; + HyginecManageCard({Key key, this.index}) : super(key: key); + + @override + _HyginecManageCardState createState() => _HyginecManageCardState(); +} + +class _HyginecManageCardState extends State { + @override + Widget build(BuildContext context) { + return AkuButton( + onPressed: () { + // Get.to(GreenManageDetailsPage(cardModel)); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 24.w), + color: Color(0xFFFFFFFF), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + alignment: Alignment.centerLeft, + child: Row( + children: [ + Text( + 'cardModel.title', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.w, + fontWeight: FontWeight.bold), + ), + Spacer(), + HygienceManageMap.statusString(widget.index + 1) + .text + .size(28.sp) + .color(HygienceManageMap.statusColor(widget.index + 1)) + .bold + .make(), + ], + ), + ), + 16.w.heightBox, + AkuDivider.horizontal(), + 24.w.heightBox, + ...[ + Row( + children: [ + Image.asset( + R.ASSETS_MANAGE_IC_RENWU_PNG, + width: 40.w, + height: 40.w, + ), + AkuBox.w(4), + Text('工作内容', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + )), + Spacer(), + Text( + 'cardModel.task', + style: AppStyle().primaryStyle, + ), + ], + ), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + AkuBox.w(4), + Text('负责人员', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + )), + Spacer(), + Text( + 'cardModel.name', + style: AppStyle().primaryStyle, + ), + ], + ), + Row( + children: [ + Image.asset( + R.ASSETS_MANAGE_IC_TIME_PNG, + width: 40.w, + height: 40.w, + ), + AkuBox.w(4), + Text('时间期限', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + Spacer(), + Text( + '${'cardModel.timestart'}至${'cardModel.timeend'}', + style: AppStyle().primaryStyle, + ), + ], + ), + ].sepWidget(separate: 16.w.heightBox), + ..._buttomButtons() + ], + ), + ), + ); + } + + List _buttomButtons() { + return widget.index != 0 + ? [SizedBox()] + : [ + 40.w.heightBox, + Row( + children: [ + '请在期限前完成绿化任务'.text.size(24.sp).color(kTextSubColor).make(), + Spacer(), + AkuButton( + color: kPrimaryColor, + radius: 74.w, + padding: + EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w), + height: 52.w, + child: '确认完成' + .text + .size(26.sp) + .color(kTextPrimaryColor) + .bold + .make(), + onPressed: () {}, + ) + ], + ) + ]; + } +} diff --git a/lib/ui/manage_pages/hygience_manage/hygience_manage_map.dart b/lib/ui/manage_pages/hygience_manage/hygience_manage_map.dart new file mode 100644 index 0000000..a4e42d0 --- /dev/null +++ b/lib/ui/manage_pages/hygience_manage/hygience_manage_map.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; + +class HygienceManageMap { + static String statusString(int status) { + switch (status) { + case 1: + return '待处理'; + case 2: + return '未完成'; + case 3: + return '已完成'; + default: + return '未知'; + } + } + + static Color statusColor(int status) { + switch (status) { + case 1: + return Color(0xFFFF8200); + case 2: + return Color(0xFFE60E0E); + case 3: + return Color(0xFF999999); + default: + return Colors.black; + } + } +} \ No newline at end of file diff --git a/lib/ui/manage_pages/hygience_manage/hygience_manage_page.dart b/lib/ui/manage_pages/hygience_manage/hygience_manage_page.dart new file mode 100644 index 0000000..c75b832 --- /dev/null +++ b/lib/ui/manage_pages/hygience_manage/hygience_manage_page.dart @@ -0,0 +1,49 @@ +import 'package:aku_community_manager/ui/manage_pages/hygience_manage/hygience_manage_view.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'; + +class HygienceManagePage extends StatefulWidget { + HygienceManagePage({Key key}) : super(key: key); + + @override + _HygienceManagePageState createState() => _HygienceManagePageState(); +} + +class _HygienceManagePageState extends State + with TickerProviderStateMixin { + List _tabs = ['待处理', '未完成', '已完成']; + 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( + preferredSize: Size.fromHeight(88.w), + child: AkuTabBar(controller: _tabController, tabs: _tabs)), + body: TabBarView( + controller: _tabController, + children: List.generate( + _tabs.length, + (index) => HygienceManageView( + index: index, + ), + ), + ), + ); + } +} diff --git a/lib/ui/manage_pages/hygience_manage/hygience_manage_view.dart b/lib/ui/manage_pages/hygience_manage/hygience_manage_view.dart new file mode 100644 index 0000000..2ba39c1 --- /dev/null +++ b/lib/ui/manage_pages/hygience_manage/hygience_manage_view.dart @@ -0,0 +1,21 @@ +import 'package:aku_community_manager/ui/manage_pages/hygience_manage/hygience_manage_card.dart'; +import 'package:flutter/material.dart'; + +class HygienceManageView extends StatefulWidget { + final int index; + HygienceManageView({Key key, this.index}) : super(key: key); + + @override + _HygienceManageViewState createState() => _HygienceManageViewState(); +} + +class _HygienceManageViewState extends State { + @override + Widget build(BuildContext context) { + return ListView( + children: [ + HyginecManageCard(index: widget.index,) + ], + ); + } +}