添加设施检查提交页面 修复高德地图兼容性问题导致闪退

hmxc
张萌 4 years ago
parent c336776930
commit 24b0c657ed

@ -9,7 +9,8 @@ import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class FacilitiesCard extends StatefulWidget { class FacilitiesCard extends StatefulWidget {
FacilitiesCard({Key key}) : super(key: key); final int index;
FacilitiesCard({Key key, this.index}) : super(key: key);
@override @override
_FacilitiesCardState createState() => _FacilitiesCardState(); _FacilitiesCardState createState() => _FacilitiesCardState();
@ -25,9 +26,8 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
children: [ children: [
'户外2号篮球场'.text.color(kTextPrimaryColor).size(32.sp).bold.make(), '户外2号篮球场'.text.color(kTextPrimaryColor).size(32.sp).bold.make(),
Spacer(), Spacer(),
'待检查' FacilitiesMap.inspectStatus[widget.index + 1].text
.text .color(FacilitiesMap.insepectColor[widget.index + 1])
.color(FacilitiesMap.insepectColor[1])
.size(28.sp) .size(28.sp)
.bold .bold
.make(), .make(),
@ -37,29 +37,32 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
AkuDivider.horizontal(), AkuDivider.horizontal(),
24.w.heightBox, 24.w.heightBox,
_buildTile(R.ASSETS_MANAGE_ADDRESS_PNG, '场地地址', '1号楼4单元门口'), _buildTile(R.ASSETS_MANAGE_ADDRESS_PNG, '场地地址', '1号楼4单元门口'),
15.w.heightBox, ..._midTile(),
_buildTile( ...widget.index != 0
R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'), ? []
40.w.heightBox, : [
Row( 40.w.heightBox,
children: [ Row(
Spacer(), children: [
AkuMaterialButton( Spacer(),
radius: 74.w, AkuMaterialButton(
height: 52.w, radius: 74.w,
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w), height: 52.w,
color: Color(0xFFFFC40C), padding: EdgeInsets.symmetric(
onPressed: () { vertical: 8.w, horizontal: 24.w),
Get.to(() => FacilitiesInspectReportPage()); color: Color(0xFFFFC40C),
}, onPressed: () {
child: '扫码报告' Get.to(() => FacilitiesInspectReportPage());
.text },
.size(26.sp) child: '扫码报告'
.color(kTextPrimaryColor) .text
.bold .size(26.sp)
.make()) .color(kTextPrimaryColor)
], .bold
), .make())
],
),
],
], ],
) )
.box .box
@ -73,6 +76,39 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
}); });
} }
_midTile() {
switch (widget.index) {
case 0:
return [
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '任务时间', '2020-10-1 19:00-20:300'),
];
case 1:
return [
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '未完成原因', '超时',
color: Colors.red),
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'),
];
case 2:
return [
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '场地情况', '正常',
color: Color(0xFF3F8FFE)),
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'),
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '检查提交时间', '2020-10-1 19:00'),
];
default:
return [];
}
}
Widget _buildTile(String icon, String title, String text, Widget _buildTile(String icon, String title, String text,
{Color color = kTextSubColor}) { {Color color = kTextSubColor}) {
return Row( return Row(

@ -5,6 +5,7 @@ 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_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/app_widgets/aku_single_check_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
@ -28,14 +29,26 @@ class _FacilitiesInspectReportPageState
body: ListView( body: ListView(
children: [ children: [
_basicMessageCard(), _basicMessageCard(),
_descriptionCard('title', 0), _descriptionCard('场地情况', 0),
_scenePhotoCard(), _scenePhotoCard(),
_selfPhotoCard(), _selfPhotoCard(),
], ],
), ),
bottom: _bottomSubmitButton(),
); );
} }
Widget _bottomSubmitButton() {
return AkuButton(
onPressed: () {},
width: double.infinity,
height: 100.w,
child: '立即提交'.text.color(kTextPrimaryColor).bold.size(32.sp).make(),
color: Color(0xFFFFC40C),
padding: EdgeInsets.symmetric(vertical: 26.w),
).pOnly(bottom: MediaQuery.of(context).padding.bottom);
}
Widget _basicMessageCard() { Widget _basicMessageCard() {
return Column( return Column(
children: [ children: [
@ -85,6 +98,8 @@ class _FacilitiesInspectReportPageState
); );
} }
int _scene = 0;
Widget _descriptionCard( Widget _descriptionCard(
String title, String title,
int index, int index,
@ -102,8 +117,9 @@ class _FacilitiesInspectReportPageState
AkuSingleCheckButton( AkuSingleCheckButton(
text: '正常', text: '正常',
value: 0, value: 0,
gropValue: 1, gropValue: _scene,
onPressed: () { onPressed: () {
_scene = 0;
setState(() {}); setState(() {});
}, },
), ),
@ -111,8 +127,9 @@ class _FacilitiesInspectReportPageState
AkuSingleCheckButton( AkuSingleCheckButton(
text: '异常', text: '异常',
value: 1, value: 1,
gropValue: 2, gropValue: _scene,
onPressed: () { onPressed: () {
_scene = 1;
setState(() {}); setState(() {});
}, },
), ),

@ -16,7 +16,9 @@ class _FacilitiesViewState extends State<FacilitiesView> {
return ListView( return ListView(
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w), padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w),
children: [ children: [
FacilitiesCard(), FacilitiesCard(
index: widget.index,
),
], ],
); );
} }

@ -49,7 +49,7 @@ class _BorrowItemDetailPageState extends State<BorrowItemDetailPage> {
return AkuScaffold( return AkuScaffold(
title: '物品详情', title: '物品详情',
actions: [ actions: [
userProvider.userInfoModel.role == USER_ROLE.MANAGER userProvider.infoModel.canOperation
? AkuMaterialButton( ? AkuMaterialButton(
minWidth: 120.w, minWidth: 120.w,
onPressed: () async { onPressed: () async {
@ -138,7 +138,7 @@ class _BorrowItemDetailPageState extends State<BorrowItemDetailPage> {
_buildRow( _buildRow(
'出借状态', '出借状态',
Text( Text(
'未出借', _detailModel.borrowed ? '已出借' : '未出借',
style: TextStyle( style: TextStyle(
color: _isEditing color: _isEditing
? AppStyle.minorTextColor ? AppStyle.minorTextColor

@ -28,8 +28,6 @@ class BorrowManagerCard extends StatefulWidget {
} }
class _BorrowManagerCardState extends State<BorrowManagerCard> { class _BorrowManagerCardState extends State<BorrowManagerCard> {
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(

Loading…
Cancel
Save