* dev: 更新装修管理页面点击事件 update decoration model qr page add animated bar 更新扫一扫页面 更新装修管理详情页面 update decoration detail page 更新退出按钮UI # Conflicts: # lib/main.darthmxc
commit
bfedcf1351
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,47 @@
|
||||
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;
|
||||
final bool checked;
|
||||
const DecorationCheckCardWidget(
|
||||
{Key key, @required this.type, this.checked = false})
|
||||
: 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: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8),
|
||||
width: 3.w,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
color: checked ? Color(0xFFFFF3CC) : Colors.white,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
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:flutter/material.dart';
|
||||
|
||||
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||
|
||||
class DecorationCheckRow extends StatefulWidget {
|
||||
final List<CHECK_TYPE> details;
|
||||
final Function(List<CHECK_TYPE> details) onChange;
|
||||
final bool canTap;
|
||||
DecorationCheckRow(
|
||||
{Key key, @required this.details, this.onChange, this.canTap = false})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_DecorationCheckRowState createState() => _DecorationCheckRowState();
|
||||
}
|
||||
|
||||
class _DecorationCheckRowState extends State<DecorationCheckRow> {
|
||||
List<CHECK_TYPE> _tempCheckDetails = [];
|
||||
List<CHECK_TYPE> _checkedDetails = [];
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tempCheckDetails = widget.details;
|
||||
widget.details.forEach((element) {
|
||||
_checkedDetails.add(element);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 160.w,
|
||||
child: ListView.separated(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: !widget.canTap
|
||||
? null
|
||||
: () {
|
||||
widget.onChange(_checkedDetails);
|
||||
setState(() {
|
||||
_checkedDetails.indexOf(_tempCheckDetails[index]) != -1
|
||||
? _checkedDetails.remove(_tempCheckDetails[index])
|
||||
: _checkedDetails.add(_tempCheckDetails[index]);
|
||||
});
|
||||
},
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: DecorationCheckCardWidget(
|
||||
type: _tempCheckDetails[index],
|
||||
checked: !widget.canTap
|
||||
? false
|
||||
: _checkedDetails.indexOf(_tempCheckDetails[index]) != -1,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: _tempCheckDetails.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,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,188 @@
|
||||
import 'package:aku_community_manager/const/resource.dart';
|
||||
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/fix/fix_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
|
||||
import 'package:aku_community_manager/provider/fix_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DecorationDepartmentPage extends StatefulWidget {
|
||||
final DecorationModel model;
|
||||
DecorationDepartmentPage({Key key, @required this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DecorationDepartmentPageState createState() =>
|
||||
_DecorationDepartmentPageState();
|
||||
}
|
||||
|
||||
class _DecorationDepartmentPageState extends State<DecorationDepartmentPage> {
|
||||
FixerModel _pickedFixer;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final fixProvider = Provider.of<FixProvider>(context);
|
||||
|
||||
return AkuScaffold(
|
||||
title: '装修指派',
|
||||
body: ListView.builder(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.w),
|
||||
itemBuilder: (context, index) {
|
||||
return _buildItem(fixProvider.propertyModels[index], index);
|
||||
},
|
||||
itemCount: fixProvider.propertyModels.length,
|
||||
),
|
||||
bottom: AkuMaterialButton(
|
||||
height: 96.w,
|
||||
onPressed: _pickedFixer == null
|
||||
? null
|
||||
: () {
|
||||
widget.model.cycleCheck.authPerson = _pickedFixer;
|
||||
Get.back();
|
||||
},
|
||||
color: AppStyle.primaryColor,
|
||||
nullColor: AppStyle.primaryColor.withOpacity(0.5),
|
||||
child: Text(
|
||||
'选择完成',
|
||||
style: TextStyle(
|
||||
color: _pickedFixer == null
|
||||
? AppStyle.minorTextColor
|
||||
: AppStyle.primaryTextColor,
|
||||
fontSize: 32.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildItem(FixerTypedModel model, int index) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: index == 0
|
||||
? BorderSide.none
|
||||
: BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
|
||||
bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
|
||||
),
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.white,
|
||||
child: ExpandablePanel(
|
||||
controller: ExpandableController(initialExpanded: true),
|
||||
header: Container(
|
||||
height: 96.w,
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
child: Text(
|
||||
model.typeName,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
collapsed: SizedBox(),
|
||||
expanded: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Divider(
|
||||
color: Color(0xFFE8E8E8),
|
||||
height: 1.w,
|
||||
thickness: 1.w,
|
||||
),
|
||||
...model.fixers.map((e) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
AkuMaterialButton(
|
||||
height: 96.w,
|
||||
onPressed: () {
|
||||
if (_pickedFixer?.name != e.name) {
|
||||
_pickedFixer = e;
|
||||
} else {
|
||||
_pickedFixer = null;
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
AkuBox.w(72),
|
||||
Checkbox(
|
||||
checkColor: AppStyle.primaryTextColor,
|
||||
activeColor: AppStyle.primaryColor,
|
||||
value: _pickedFixer?.name == e.name,
|
||||
onChanged: (state) {
|
||||
if (_pickedFixer == null) {
|
||||
_pickedFixer = e;
|
||||
} else {
|
||||
_pickedFixer = null;
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
Image.asset(
|
||||
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
e.name,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
R.ASSETS_MESSAGE_IC_PHONE_PNG,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
e.phone,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
AkuBox.w(101),
|
||||
],
|
||||
),
|
||||
),
|
||||
model.fixers.last == e
|
||||
? SizedBox()
|
||||
: Divider(
|
||||
indent: 32.w,
|
||||
endIndent: 32.w,
|
||||
height: 1.w,
|
||||
thickness: 1.w,
|
||||
color: Color(0xFFE8E8E8),
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList()
|
||||
],
|
||||
),
|
||||
theme: ExpandableThemeData(
|
||||
tapHeaderToExpand: true,
|
||||
iconPlacement: ExpandablePanelIconPlacement.right,
|
||||
iconPadding: EdgeInsets.only(top: 32.w, right: 32.w),
|
||||
iconSize: 32.w,
|
||||
iconColor: AppStyle.minorTextColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,630 @@
|
||||
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: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_department_page.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.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/tools/screen_tool.dart';
|
||||
import 'package:aku_community_manager/const/resource.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/show_bottom_sheet.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DecorationManagerDetailPage extends StatefulWidget {
|
||||
final DecorationModel model;
|
||||
DecorationManagerDetailPage({Key key, @required this.model})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_DecorationManagerDetailStatePage createState() =>
|
||||
_DecorationManagerDetailStatePage();
|
||||
}
|
||||
|
||||
class _DecorationManagerDetailStatePage
|
||||
extends State<DecorationManagerDetailPage> {
|
||||
bool get isWaitHandOut => widget.model.type == DecorationType.WAIT_HAND_OUT;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '装修详情',
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.w),
|
||||
children: [
|
||||
_buildInfo(),
|
||||
widget.model.workFinishCheck == null
|
||||
? SizedBox()
|
||||
: _buildFinishWorkCheck(),
|
||||
_buildCycleCheck(),
|
||||
widget.model.type == DecorationType.WAIT_HAND_OUT
|
||||
? SizedBox()
|
||||
: _buildCheckDetail(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildInfo() {
|
||||
return AkuTitleBox(
|
||||
title: '装修信息',
|
||||
spacing: 24,
|
||||
suffix: Text(
|
||||
DecorationUIUtil(context).getTagName(
|
||||
widget.model.type,
|
||||
widget.model.statusType,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: DecorationUIUtil(context).getTagColor(
|
||||
widget.model.type,
|
||||
widget.model.statusType,
|
||||
),
|
||||
fontSize: 24.w,
|
||||
),
|
||||
),
|
||||
children: [
|
||||
_buildInfoCard(
|
||||
tag: '家',
|
||||
midTop: widget.model.userHomeModel.plot,
|
||||
midBottom: widget.model.userHomeModel.detailAddr,
|
||||
name: '业主:' + widget.model.userHomeModel.userName,
|
||||
phone: widget.model.userHomeModel.phone,
|
||||
rightTopWidget: Placeholder(),
|
||||
),
|
||||
AkuBox.h(16),
|
||||
_buildInfoCard(
|
||||
tag: '装',
|
||||
midTop: widget.model.decorationTeamModel.name,
|
||||
name: '负责人:' + widget.model.decorationTeamModel.userName,
|
||||
phone: widget.model.decorationTeamModel.phone,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_buildInfoCard({
|
||||
String tag,
|
||||
String midTop,
|
||||
String midBottom,
|
||||
String name,
|
||||
String phone,
|
||||
Widget rightTopWidget = const SizedBox(),
|
||||
}) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
AkuBox.w(32),
|
||||
Container(
|
||||
height: 96.w,
|
||||
width: 96.w,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
tag,
|
||||
style: TextStyle(
|
||||
color: AppStyle.secondaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 32.sp,
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFE9F2FF),
|
||||
borderRadius: BorderRadius.circular(48.w),
|
||||
),
|
||||
),
|
||||
AkuBox.w(24),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
midTop,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
midBottom == null
|
||||
? SizedBox()
|
||||
: Text(
|
||||
midBottom,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
Divider(
|
||||
height: 1.w,
|
||||
thickness: 1.w,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AkuBox.h(88),
|
||||
AkuBox.w(32),
|
||||
Image.asset(
|
||||
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
R.ASSETS_MESSAGE_IC_PHONE_PNG,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
'电话:$phone',
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
AkuBox.w(42),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
height: 248.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFF9F9F9),
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: -30.w,
|
||||
right: -30.w,
|
||||
width: 140.w,
|
||||
height: 140.w,
|
||||
child: rightTopWidget,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_buildFinishWorkCheck() {
|
||||
return AkuTitleBox(
|
||||
title: '完工检查',
|
||||
spacing: 24,
|
||||
children: [
|
||||
_buildRow(
|
||||
title: '开始装修时间',
|
||||
subTitle: DateUtil.formatDate(
|
||||
widget.model.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,
|
||||
onChange: (details) {},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_buildCycleCheck() {
|
||||
return AkuTitleBox(
|
||||
title: '周期检查',
|
||||
spacing: 24,
|
||||
children: [
|
||||
_buildRow(
|
||||
title: '开始装修时间',
|
||||
subTitle: DateUtil.formatDate(
|
||||
widget.model.decorationDate,
|
||||
format: 'yyyy-MM-dd',
|
||||
),
|
||||
),
|
||||
_buildRow(
|
||||
title: '接受人',
|
||||
subTitle: widget.model.cycleCheck?.authPerson?.name,
|
||||
onTap: isWaitHandOut
|
||||
? () {
|
||||
Get.to(DecorationDepartmentPage(
|
||||
model: widget.model,
|
||||
)).then((value) => setState(() {}));
|
||||
}
|
||||
: null,
|
||||
),
|
||||
_buildRow(title: '所属项目', subTitle: '装修管理'),
|
||||
_buildRow(
|
||||
title: '开始日期',
|
||||
subTitle: DateUtil.formatDate(
|
||||
widget.model.cycleCheck?.startDate,
|
||||
format: 'yyyy-MM-dd',
|
||||
),
|
||||
onTap: isWaitHandOut
|
||||
? () {
|
||||
showAkuSheet(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AkuBox.h(96),
|
||||
AkuBackButton.text(),
|
||||
Spacer(),
|
||||
Text(
|
||||
'开始日期',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
AkuMaterialButton(
|
||||
minWidth: (64 + 56).w,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Text(
|
||||
'确定',
|
||||
style: TextStyle(
|
||||
color: AppStyle.secondaryColor,
|
||||
fontSize: 28.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 500.w,
|
||||
child: CupertinoDatePicker(
|
||||
onDateTimeChanged: (dateTime) {
|
||||
widget.model.cycleCheck.startDate = dateTime;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
).then((value) {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
: null,
|
||||
),
|
||||
_buildRow(
|
||||
title: '检查周期',
|
||||
subTitle: widget.model.cycleCheck.checkCycle == null
|
||||
? null
|
||||
: '${widget.model.cycleCheck.checkCycle}天',
|
||||
onTap: isWaitHandOut
|
||||
? () {
|
||||
showAkuSheet(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AkuBox.h(96),
|
||||
AkuBackButton.text(),
|
||||
Spacer(),
|
||||
Text(
|
||||
'检查周期',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
AkuMaterialButton(
|
||||
minWidth: (64 + 56).w,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Text(
|
||||
'确定',
|
||||
style: TextStyle(
|
||||
color: AppStyle.secondaryColor,
|
||||
fontSize: 28.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 500.w,
|
||||
child: CupertinoPicker(
|
||||
children: [
|
||||
Center(
|
||||
child: Text('1天'),
|
||||
),
|
||||
Center(
|
||||
child: Text('3天'),
|
||||
),
|
||||
Center(
|
||||
child: Text('7天'),
|
||||
),
|
||||
Center(
|
||||
child: Text('14天'),
|
||||
),
|
||||
Center(
|
||||
child: Text('30天'),
|
||||
),
|
||||
],
|
||||
itemExtent: 88.w,
|
||||
onSelectedItemChanged: (int value) {
|
||||
int realValue = 0;
|
||||
switch (value) {
|
||||
case 0:
|
||||
realValue = 1;
|
||||
break;
|
||||
case 1:
|
||||
realValue = 3;
|
||||
break;
|
||||
case 2:
|
||||
realValue = 7;
|
||||
break;
|
||||
case 3:
|
||||
realValue = 14;
|
||||
break;
|
||||
case 4:
|
||||
realValue = 30;
|
||||
break;
|
||||
}
|
||||
widget.model.cycleCheck.checkCycle = realValue;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
).then((value) {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
: null,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 28.w,
|
||||
),
|
||||
child: Text(
|
||||
'检查内容',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
DecorationCheckRow(
|
||||
details: [
|
||||
CHECK_TYPE.ELECTRIC,
|
||||
CHECK_TYPE.WATER,
|
||||
CHECK_TYPE.WALL,
|
||||
CHECK_TYPE.DOOR_AND_WINDOWS,
|
||||
CHECK_TYPE.SECURITY,
|
||||
],
|
||||
onChange: (details) {
|
||||
widget.model.cycleCheck.checkDetails = details;
|
||||
},
|
||||
canTap: isWaitHandOut,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_buildCheckDetail() {
|
||||
return AkuTitleBox(
|
||||
title: '执行信息',
|
||||
spacing: 24,
|
||||
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,
|
||||
VoidCallback onTap,
|
||||
}) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: 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(
|
||||
TextUtil.isEmpty(subTitle) ? '请选择' : subTitle,
|
||||
style: TextStyle(
|
||||
color: TextUtil.isEmpty(subTitle)
|
||||
? AppStyle.minorTextColor
|
||||
: AppStyle.primaryTextColor,
|
||||
fontSize: 28.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
onTap == null ? SizedBox() : AkuBox.w(24),
|
||||
onTap == null
|
||||
? SizedBox()
|
||||
: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 32.w,
|
||||
color: AppStyle.minorTextColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
||||
import 'package:aku_community_manager/provider/user_provider.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DecorationUIUtil {
|
||||
BuildContext context;
|
||||
USER_ROLE get role =>
|
||||
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
|
||||
|
||||
DecorationUIUtil(this.context);
|
||||
String getTagName(DecorationType type, DecorationStatusType statusType) {
|
||||
Map<DecorationType, String> managerMap = {
|
||||
DecorationType.WAIT_HAND_OUT: '待指派',
|
||||
DecorationType.HAND_OUT: '已指派',
|
||||
DecorationType.DONE: '已执行',
|
||||
};
|
||||
|
||||
Map<DecorationType, String> fixerMap = {
|
||||
DecorationType.HAND_OUT: '待执行',
|
||||
DecorationType.DONE: '已执行',
|
||||
};
|
||||
|
||||
Map<DecorationStatusType, String> defaultMap = {
|
||||
DecorationStatusType.DONE: '装修完成',
|
||||
DecorationStatusType.PROGRESS: '装修中',
|
||||
};
|
||||
|
||||
switch (role) {
|
||||
case USER_ROLE.MANAGER:
|
||||
return managerMap[type];
|
||||
break;
|
||||
case USER_ROLE.PROPERTY:
|
||||
return fixerMap[type];
|
||||
break;
|
||||
default:
|
||||
return defaultMap[statusType];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Color getTagColor(DecorationType type, DecorationStatusType statusType) {
|
||||
if (role == USER_ROLE.MANAGER || role == USER_ROLE.PROPERTY) {
|
||||
if (type == DecorationType.WAIT_HAND_OUT ||
|
||||
type == DecorationType.HAND_OUT) {
|
||||
return Color(0xFFFF4501);
|
||||
} else
|
||||
return AppStyle.minorTextColor;
|
||||
} else {
|
||||
if (statusType == DecorationStatusType.PROGRESS) {
|
||||
return Color(0xFFFF4501);
|
||||
} else
|
||||
return Color(0xFF32B814);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue