更新装修管理详情页面

hmxc
小赖 4 years ago
parent 1113679ad7
commit 488c6a2337

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -1,5 +1,6 @@
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/const/resource.dart';
enum DecorationType { enum DecorationType {
/// ///
@ -41,6 +42,14 @@ Map<String, CHECK_TYPE> checkTypeStringMap = {
'安防': CHECK_TYPE.SECURITY, '安防': CHECK_TYPE.SECURITY,
}; };
Map<CHECK_TYPE, String> checkAssetMap = {
CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG,
CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG,
CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG,
CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG,
CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG,
};
class DecorationModel { class DecorationModel {
DecorationType type; DecorationType type;
DecorationStatusType statusType; DecorationStatusType statusType;
@ -152,6 +161,7 @@ class CheckInfomation {
class CheckDetail { class CheckDetail {
CHECK_TYPE type; CHECK_TYPE type;
bool status; bool status;
String get assetpath => checkAssetMap[type];
CheckDetail({ CheckDetail({
@required this.type, @required this.type,
this.status = true, this.status = true,

@ -20,6 +20,16 @@ class AppStyle {
/// ///
static const backgroundColor = Color(0xFFF9F9F9); static const backgroundColor = Color(0xFFF9F9F9);
///
static const successColor = Color(0xFF32B814);
static const subSuccessColor = Color(0xFFE5FFDF);
///
static const failColor = Color(0xFFFF4501);
static const subFailColor = Color(0xFFFFE5DB);
/// ///
final barTitleStyle = TextStyle( final barTitleStyle = TextStyle(
color: primaryTextColor, color: primaryTextColor,

@ -0,0 +1,44 @@
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
class DecorationCheckCardWidget extends StatelessWidget {
final CHECK_TYPE type;
const DecorationCheckCardWidget({Key key, @required this.type})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
height: 160.w,
width: 124.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
checkAssetMap[type],
height: 56.w,
width: 56.w,
),
AkuBox.h(4),
Text(
checkTypeMap[type],
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
],
),
decoration: BoxDecoration(
border: Border.all(
color: Color(0xFFE8E8E8),
width: 3.w,
),
borderRadius: BorderRadius.circular(8.w),
),
);
}
}

@ -0,0 +1,29 @@
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:flutter/material.dart';
class DecorationCheckRow extends StatelessWidget {
final List<CHECK_TYPE> details;
const DecorationCheckRow({Key key, @required this.details}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
height: 160.w,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return DecorationCheckCardWidget(
type: details[index],
);
},
itemCount: details.length,
separatorBuilder: (context, index) {
return AkuBox.w(16);
},
),
);
}
}

@ -0,0 +1,109 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:flutter/material.dart';
class DecorationCheckBox extends StatefulWidget {
final bool initValue;
final Function(bool state) onChange;
DecorationCheckBox({Key key, this.initValue = true, this.onChange})
: super(key: key);
@override
_DecorationCheckBoxState createState() => _DecorationCheckBoxState();
}
class _DecorationCheckBoxState extends State<DecorationCheckBox> {
bool _nowValue;
@override
void initState() {
super.initState();
_nowValue = widget.initValue;
}
@override
Widget build(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
_buildBox(
rawChecked: true,
color: AppStyle.successColor,
subColor: AppStyle.subSuccessColor,
title: '正常',
icon: Icons.check,
),
AkuBox.w(56),
_buildBox(
rawChecked: false,
color: AppStyle.failColor,
subColor: AppStyle.subFailColor,
title: '异常',
icon: Icons.check,
),
],
);
}
_buildBox(
{bool rawChecked,
Color color,
Color subColor,
String title,
IconData icon}) {
final checked = _nowValue == rawChecked;
return GestureDetector(
onTap: widget.onChange == null
? null
: () {
setState(() {
_nowValue = rawChecked;
});
widget.onChange(_nowValue);
},
child: Material(
color: Colors.transparent,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
AnimatedContainer(
height: 40.w,
width: 40.w,
curve: Curves.easeInOutCubic,
child: _buildIcon(icon, color, checked),
duration: Duration(milliseconds: 300),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.w),
border: Border.all(
color: checked ? color : Color(0xFFE8E8E8),
),
color: checked ? subColor : subColor.withOpacity(0),
),
),
AkuBox.w(16),
AkuBox.h(96),
_buildText(title, color, checked),
],
),
),
);
}
_buildText(String title, Color color, bool checked) {
return Text(
title,
style: TextStyle(
color: checked ? color : AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
);
}
_buildIcon(IconData icon, Color color, bool checked) {
return Icon(
icon,
color: checked ? color : Color(0xFFE8E8E8),
size: 32.w,
);
}
}

@ -1,11 +1,15 @@
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.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_community_manager/ui/widgets/inner/aku_title_box.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
import 'package:common_utils/common_utils.dart';
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DecorationManagerDetailPage extends StatefulWidget { class DecorationManagerDetailPage extends StatefulWidget {
@ -195,7 +199,40 @@ class _DecorationManagerDetailStatePage
return AkuTitleBox( return AkuTitleBox(
title: '完工检查', title: '完工检查',
spacing: 24, spacing: 24,
children: [], children: [
_buildRow(
title: '开始装修时间',
subTitle: DateUtil.formatDate(
widget.model.workFinishCheck.decorationDate,
format: 'yyyy-MM-dd',
),
),
_buildRow(
title: '接受人',
subTitle: widget.model.workFinishCheck.authPerson.name,
),
_buildRow(title: '所属项目', subTitle: '装修管理'),
_buildRow(
title: '开始日期',
subTitle: DateUtil.formatDate(
widget.model.workFinishCheck.startDate,
format: 'yyyy-MM-dd',
),
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 28.w,
),
child: Text(
'检查内容',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
),
),
),
DecorationCheckRow(details: widget.model.workFinishCheck.checkDetails),
],
); );
} }
@ -203,7 +240,40 @@ class _DecorationManagerDetailStatePage
return AkuTitleBox( return AkuTitleBox(
title: '周期检查', title: '周期检查',
spacing: 24, spacing: 24,
children: [], children: [
_buildRow(
title: '开始装修时间',
subTitle: DateUtil.formatDate(
widget.model.cycleCheck.decorationDate,
format: 'yyyy-MM-dd',
),
),
_buildRow(
title: '接受人',
subTitle: widget.model.cycleCheck.authPerson.name,
),
_buildRow(title: '所属项目', subTitle: '装修管理'),
_buildRow(
title: '开始日期',
subTitle: DateUtil.formatDate(
widget.model.cycleCheck.startDate,
format: 'yyyy-MM-dd',
),
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 28.w,
),
child: Text(
'检查内容',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
),
),
),
DecorationCheckRow(details: widget.model.cycleCheck.checkDetails),
],
); );
} }
@ -211,7 +281,158 @@ class _DecorationManagerDetailStatePage
return AkuTitleBox( return AkuTitleBox(
title: '执行信息', title: '执行信息',
spacing: 24, spacing: 24,
children: [], children: widget.model.checkInfomations.map((e) {
return Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color(0xFFE8E8E8),
width: 1.w,
),
),
),
child: ExpandablePanel(
theme: ExpandableThemeData(
tapHeaderToExpand: true,
iconPlacement: ExpandablePanelIconPlacement.right,
iconPadding: EdgeInsets.only(top: 32.w),
iconSize: 32.w,
iconColor: AppStyle.minorTextColor,
),
header: Row(
children: [
AkuBox.h(96),
Text(
'${DateUtil.formatDate(e.checkDate, format: 'yyyy-MM-dd')} ' +
e.checkType,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
),
),
Spacer(),
Text(
e.checkAllResult ? '正常' : '异常',
style: TextStyle(
color: e.checkAllResult
? Color(0xFF32B814)
: Color(0xFFFF4501),
fontSize: 28.sp,
),
),
],
),
expanded: Column(
mainAxisSize: MainAxisSize.min,
children: [
...e.details.map((e) {
return Container(
height: 96.w,
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Color(0xFFE8E8E8),
width: 1.w,
),
),
),
child: Row(
children: [
AkuBox.w(48),
Image.asset(
e.assetpath,
height: 40.w,
),
Text(
e.typeValue,
style: TextStyle(
fontSize: 28.sp,
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
),
),
Spacer(),
DecorationCheckBox(
initValue: e.status,
),
Spacer(),
],
),
);
}).toList(),
Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
width: 1.w,
color: Color(0xFFE8E8E8),
),
),
),
height: 96.w,
padding: EdgeInsets.symmetric(horizontal: 32.w),
alignment: Alignment.centerLeft,
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: '检查描述:',
style: TextStyle(
color: AppStyle.minorTextColor,
),
),
TextSpan(
text: e.info,
),
],
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
),
),
),
),
],
),
),
);
}).toList(),
);
}
_buildRow({
String title,
String subTitle,
}) {
return Container(
decoration: BoxDecoration(
border:
Border(bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w)),
),
child: InkWell(
child: Row(
children: [
AkuBox.h(96),
Text(
title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
),
),
Spacer(),
Text(
subTitle,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
],
),
),
); );
} }
} }

Loading…
Cancel
Save