From 26dcc289253f8dc1c5c6d274f19cf662266eb08c Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 6 May 2021 11:08:45 +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=EF=BC=8C=E8=AE=BE=E6=96=BD=E6=A3=80=E6=9F=A5=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 13 ++ assets/manage/clock.png | Bin 0 -> 1421 bytes .../manager/facilities/facilities_card.dart | 48 ++++- .../facilities_inspect_report_page.dart | 188 +++++++++++++++++- .../manager/facilities/facilities_page.dart | 2 +- .../manager/facilities/facilities_view.dart | 7 +- .../inspection_point_input_page.dart | 6 +- .../app_widgets/aku_pick_image_widget.dart | 11 +- 8 files changed, 265 insertions(+), 10 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 assets/manage/clock.png diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..97e9b7f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "aku_community_manager", + "request": "launch", + "type": "dart" + } + ] +} \ No newline at end of file diff --git a/assets/manage/clock.png b/assets/manage/clock.png new file mode 100644 index 0000000000000000000000000000000000000000..8eb2e479cd199eec1cb72e7beb0bace91d620ad1 GIT binary patch literal 1421 zcmV;81#$$M@B^kO9^kA1u>;;bOf4u&1@$er|0 z+EunZk`2?kr0B0oB{L&ytbcAjJuQd~!!QiPFbu;m4C8GvM-^~#a+1u?&u@?-b8~Y^ zx7+Pd$;^`xgb5gk2^fe87|0@3L-P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C3LhG7_nVHk#C b7;lx|K%sc(eF=&000000NkvXXu0mjf$6uXu literal 0 HcmV?d00001 diff --git a/lib/models/manager/facilities/facilities_card.dart b/lib/models/manager/facilities/facilities_card.dart index 970908e..8c34c49 100644 --- a/lib/models/manager/facilities/facilities_card.dart +++ b/lib/models/manager/facilities/facilities_card.dart @@ -1,6 +1,8 @@ import 'package:aku_community_manager/models/manager/facilities/facilities_inspect_report_page.dart'; import 'package:aku_community_manager/models/manager/facilities/facilities_map.dart'; import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/aku_divider.dart'; +import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -25,12 +27,39 @@ class _FacilitiesCardState extends State { Spacer(), '待检查' .text - .color(FacilitiesMap.insepectColor[0]) + .color(FacilitiesMap.insepectColor[1]) .size(28.sp) .bold .make(), ], ), + 16.w.heightBox, + AkuDivider.horizontal(), + 24.w.heightBox, + _buildTile(R.ASSETS_MANAGE_ADDRESS_PNG, '场地地址', '1号楼4单元门口'), + 15.w.heightBox, + _buildTile( + R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'), + 40.w.heightBox, + Row( + children: [ + Spacer(), + AkuMaterialButton( + radius: 74.w, + height: 52.w, + padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w), + color: Color(0xFFFFC40C), + onPressed: () { + Get.to(() => FacilitiesInspectReportPage()); + }, + child: '扫码报告' + .text + .size(26.sp) + .color(kTextPrimaryColor) + .bold + .make()) + ], + ), ], ) .box @@ -43,4 +72,21 @@ class _FacilitiesCardState extends State { Get.to(() => FacilitiesInspectReportPage()); }); } + + Widget _buildTile(String icon, String title, String text, + {Color color = kTextSubColor}) { + return Row( + children: [ + Image.asset( + icon, + width: 40.w, + height: 40.w, + ), + 20.w.widthBox, + title.text.size(24.sp).color(kTextSubColor).make(), + Spacer(), + text.text.size(24.sp).color(color).make(), + ], + ); + } } diff --git a/lib/models/manager/facilities/facilities_inspect_report_page.dart b/lib/models/manager/facilities/facilities_inspect_report_page.dart index e471f0a..0c36221 100644 --- a/lib/models/manager/facilities/facilities_inspect_report_page.dart +++ b/lib/models/manager/facilities/facilities_inspect_report_page.dart @@ -1,5 +1,13 @@ +import 'dart:io'; + +import 'package:aku_community_manager/models/manager/facilities/facilities_map.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/ui/widgets/app_widgets/aku_pick_image_widget.dart'; +import 'package:aku_community_manager/ui/widgets/app_widgets/aku_single_check_button.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:velocity_x/velocity_x.dart'; class FacilitiesInspectReportPage extends StatefulWidget { FacilitiesInspectReportPage({Key key}) : super(key: key); @@ -11,11 +19,189 @@ class FacilitiesInspectReportPage extends StatefulWidget { class _FacilitiesInspectReportPageState extends State { + List _selfPhotos; + List _scenePhotos; @override Widget build(BuildContext context) { return AkuScaffold( title: '检查报告', - body: ListView(), + body: ListView( + children: [ + _basicMessageCard(), + _descriptionCard('title', 0), + _scenePhotoCard(), + _selfPhotoCard(), + ], + ), + ); + } + + Widget _basicMessageCard() { + return Column( + children: [ + Row( + children: [ + '基础信息'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), + Spacer(), + '检查中' + .text + .size(30.sp) + .color(FacilitiesMap.insepectColor[2]) + .bold + .make() + ], + ), + 16.w.heightBox, + _buildTile(R.ASSETS_MESSAGE_IC_PEOPLE_PNG, '检查人', '杨建'), + 12.w.heightBox, + _buildTile(R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话', '15013103152'), + 12.w.heightBox, + _buildTile(R.ASSETS_MANAGE_ADDRESS_PNG, '检查场地', '户外3号篮球场'), + 12.w.heightBox, + _buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '20200202020202020'), + ], + ) + .box + .width(double.infinity) + .padding(EdgeInsets.symmetric(vertical: 34.w, horizontal: 32.w)) + .color(Colors.white) + .make(); + } + + Widget _buildTile(String icon, String title, String text, + {Color color = kTextSubColor}) { + return Row( + children: [ + Image.asset( + icon, + width: 40.w, + height: 40.w, + ), + 20.w.widthBox, + title.text.size(24.sp).color(kTextSubColor).make(), + Spacer(), + text.text.size(24.sp).color(color).make(), + ], ); } + + Widget _descriptionCard( + String title, + int index, + ) { + return Column( + children: [ + Row( + children: [ + '2.$title'.text.color(kTextPrimaryColor).size(32.sp).make() + ], + ), + 32.w.heightBox, + Row( + children: [ + AkuSingleCheckButton( + text: '正常', + value: 0, + gropValue: 1, + onPressed: () { + setState(() {}); + }, + ), + 80.w.widthBox, + AkuSingleCheckButton( + text: '异常', + value: 1, + gropValue: 2, + onPressed: () { + setState(() {}); + }, + ), + ], + ), + 32.w.heightBox, + Container( + width: 686.w, + height: 120.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + border: Border.all( + width: 2.w, + color: Color(0xFFE8E8E8), + ), + ), + child: TextField( + minLines: 5, + maxLines: 10, + autofocus: false, + onChanged: (value) {}, + decoration: InputDecoration( + hintText: '请详细描述异常情况', + hintStyle: TextStyle( + fontSize: 28.sp, + color: kTextSubColor, + ), + contentPadding: + EdgeInsets.symmetric(vertical: 16.w, horizontal: 24.w), + border: InputBorder.none, + isDense: true, + ), + ), + ), + ], + ) + .box + .padding(EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w)) + .color(Colors.white) + .make(); + } + + Widget _selfPhotoCard() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + '3.巡更人员自拍人脸'.text.color(kTextPrimaryColor).size(32.sp).bold.make() + ], + ), + 32.w.heightBox, + AkuPickImageWidget( + description: '上传自拍', + onChanged: (files) { + _selfPhotos = files; + setState(() {}); + }, + ), + ], + ) + .box + .color(Colors.white) + .padding(EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w)) + .make(); + } + + Widget _scenePhotoCard() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Row( + // children: [ + // '3.巡更人员拍摄现场'.text.color(kTextPrimaryColor).size(32.sp).bold.make() + // ], + // ), + 32.w.heightBox, + AkuPickImageWidget( + description: '上传现场照片', + onChanged: (files) { + _scenePhotos = files; + setState(() {}); + }, + ) + ], + ) + .box + .color(Colors.white) + .padding(EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w)) + .make(); + } } diff --git a/lib/models/manager/facilities/facilities_page.dart b/lib/models/manager/facilities/facilities_page.dart index a204305..f181efa 100644 --- a/lib/models/manager/facilities/facilities_page.dart +++ b/lib/models/manager/facilities/facilities_page.dart @@ -45,7 +45,7 @@ class _FacilitiesPageState extends State ), body: TabBarView( controller: _tabController, - children: List.generate(_tabs.length, (index) => FacilitiesView()), + children: List.generate(_tabs.length, (index) => FacilitiesView(index: index,)), ), ); } diff --git a/lib/models/manager/facilities/facilities_view.dart b/lib/models/manager/facilities/facilities_view.dart index 14eda5b..a9c1c0e 100644 --- a/lib/models/manager/facilities/facilities_view.dart +++ b/lib/models/manager/facilities/facilities_view.dart @@ -1,8 +1,10 @@ import 'package:aku_community_manager/models/manager/facilities/facilities_card.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class FacilitiesView extends StatefulWidget { - FacilitiesView({Key key}) : super(key: key); + final int index; + FacilitiesView({Key key, this.index}) : super(key: key); @override _FacilitiesViewState createState() => _FacilitiesViewState(); @@ -12,8 +14,9 @@ class _FacilitiesViewState extends State { @override Widget build(BuildContext context) { return ListView( + padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w), children: [ - // FacilitiesCard(), + FacilitiesCard(), ], ); } diff --git a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart index be49a84..85aeb46 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart @@ -114,7 +114,7 @@ class _InspectionPointInputPageState extends State { ); } - Widget _scenePhotoCard() { + Widget _selfPhotoCard() { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -138,13 +138,13 @@ class _InspectionPointInputPageState extends State { .make(); } - Widget _selfPhotoCard() { + Widget _scenePhotoCard() { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ - '3.巡更人员自拍人脸'.text.color(kTextPrimaryColor).size(32.sp).bold.make() + '3.巡更人员拍摄现场'.text.color(kTextPrimaryColor).size(32.sp).bold.make() ], ), 32.w.heightBox, diff --git a/lib/ui/widgets/app_widgets/aku_pick_image_widget.dart b/lib/ui/widgets/app_widgets/aku_pick_image_widget.dart index 16f2f19..7b1f05b 100644 --- a/lib/ui/widgets/app_widgets/aku_pick_image_widget.dart +++ b/lib/ui/widgets/app_widgets/aku_pick_image_widget.dart @@ -13,7 +13,10 @@ import 'package:aku_community_manager/utils/extension/list_extension.dart'; class AkuPickImageWidget extends StatefulWidget { final double size; final Function(List files) onChanged; - AkuPickImageWidget({Key key, this.size, this.onChanged}) : super(key: key); + final String description; + AkuPickImageWidget( + {Key key, this.size, this.onChanged, this.description = '上传照片'}) + : super(key: key); @override _AkuPickImageWidgetState createState() => _AkuPickImageWidgetState(); @@ -56,7 +59,11 @@ class _AkuPickImageWidgetState extends State { color: Color(0xFF999999), ), 4.w.heightBox, - '上传图片'.text.color(kTextSubColor).size(22.sp).bold.make(), + widget.description.text + .color(kTextSubColor) + .size(22.sp) + .bold + .make(), ], ), ),