parent
c463a0d2f7
commit
4398886847
After Width: | Height: | Size: 736 B |
After Width: | Height: | Size: 818 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,118 @@
|
||||
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
|
||||
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
|
||||
|
||||
class DecorationData {
|
||||
static List<DecorationModel> allModels = [
|
||||
DecorationModel(
|
||||
type: DecorationType.DONE,
|
||||
statusType: DecorationStatusType.DONE,
|
||||
userHomeModel: UserHomeModel(
|
||||
userName: '李慧珍',
|
||||
plot: '深圳华茂悦峰',
|
||||
detailAddr: '1幢-1单元-302室',
|
||||
phone: '18201939840',
|
||||
decorationStatus: false,
|
||||
),
|
||||
decorationTeamModel: DecorationTeamModel(
|
||||
name: '深圳莫川装修有限公司',
|
||||
userName: '李惠政',
|
||||
phone: '19298540192',
|
||||
),
|
||||
cycleCheck: CycleCheck(
|
||||
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
|
||||
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
|
||||
startDate: DateTime(2020, 1, 23, 20, 23, 0),
|
||||
checkCycle: 7,
|
||||
checkDetails: [
|
||||
CHECK_TYPE.ELECTRIC,
|
||||
CHECK_TYPE.WATER,
|
||||
CHECK_TYPE.WALL,
|
||||
CHECK_TYPE.DOOR_AND_WINDOWS,
|
||||
],
|
||||
),
|
||||
workFinishCheck: WorkFinishCheck(
|
||||
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
|
||||
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
|
||||
startDate: DateTime(2020, 1, 23, 20, 23, 0),
|
||||
checkDetails: [
|
||||
CHECK_TYPE.ELECTRIC,
|
||||
CHECK_TYPE.WATER,
|
||||
CHECK_TYPE.WALL,
|
||||
CHECK_TYPE.DOOR_AND_WINDOWS,
|
||||
CHECK_TYPE.SECURITY,
|
||||
],
|
||||
),
|
||||
checkInfomations: [
|
||||
CheckInfomation(
|
||||
checkDate: DateTime(2020, 3, 20, 12, 00),
|
||||
info: '正常',
|
||||
checkType: '完工检查',
|
||||
details: [
|
||||
CheckDetail(type: CHECK_TYPE.ELECTRIC),
|
||||
CheckDetail(type: CHECK_TYPE.WATER),
|
||||
CheckDetail(type: CHECK_TYPE.WALL),
|
||||
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
|
||||
],
|
||||
),
|
||||
CheckInfomation(
|
||||
checkDate: DateTime(2020, 2, 14, 12, 00),
|
||||
info: '正常',
|
||||
checkType: '周期检查',
|
||||
details: [
|
||||
CheckDetail(type: CHECK_TYPE.ELECTRIC),
|
||||
CheckDetail(type: CHECK_TYPE.WATER),
|
||||
CheckDetail(type: CHECK_TYPE.WALL),
|
||||
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
|
||||
],
|
||||
),
|
||||
CheckInfomation(
|
||||
checkDate: DateTime(2020, 2, 7, 12, 00),
|
||||
info: '厨房水路异常',
|
||||
checkType: '周期检查',
|
||||
details: [
|
||||
CheckDetail(type: CHECK_TYPE.ELECTRIC),
|
||||
CheckDetail(type: CHECK_TYPE.WATER, status: false),
|
||||
CheckDetail(type: CHECK_TYPE.WALL),
|
||||
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
|
||||
],
|
||||
),
|
||||
CheckInfomation(
|
||||
checkDate: DateTime(2020, 1, 30, 12, 00),
|
||||
info: '正常',
|
||||
checkType: '周期检查',
|
||||
details: [
|
||||
CheckDetail(type: CHECK_TYPE.ELECTRIC),
|
||||
CheckDetail(type: CHECK_TYPE.WATER),
|
||||
CheckDetail(type: CHECK_TYPE.WALL),
|
||||
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
|
||||
],
|
||||
),
|
||||
CheckInfomation(
|
||||
checkDate: DateTime(2020, 1, 23, 12, 00),
|
||||
info: '正常',
|
||||
checkType: '周期检查',
|
||||
details: [
|
||||
CheckDetail(type: CHECK_TYPE.ELECTRIC),
|
||||
CheckDetail(type: CHECK_TYPE.WATER),
|
||||
CheckDetail(type: CHECK_TYPE.WALL),
|
||||
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
];
|
||||
|
||||
static List<DecorationModel> getModels(DecorationType type) {
|
||||
return allModels.where((element) => element.type == type).toList();
|
||||
}
|
||||
|
||||
static List<DecorationModel> getTypeModels(DecorationStatusType type) {
|
||||
return allModels.where((element) => element.statusType == type).toList();
|
||||
}
|
||||
|
||||
static List<DecorationModel> get allPropertyModels {
|
||||
return allModels
|
||||
.where((element) => element.type != DecorationType.WAIT_HAND_OUT)
|
||||
.toList();
|
||||
}
|
||||
}
|
@ -0,0 +1,182 @@
|
||||
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:aku_community_manager/tools/widget_tool.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
|
||||
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||
import 'package:aku_community_manager/const/resource.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DecorationManagerCard extends StatefulWidget {
|
||||
final DecorationModel model;
|
||||
DecorationManagerCard({Key key, @required this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DecorationManagerCardState createState() => _DecorationManagerCardState();
|
||||
}
|
||||
|
||||
class _DecorationManagerCardState extends State<DecorationManagerCard> {
|
||||
USER_ROLE get role =>
|
||||
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 16.w),
|
||||
padding: EdgeInsets.all(24.w),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AkuChipBox(title: '装修管理'),
|
||||
AkuBox.w(16),
|
||||
Text(
|
||||
DateUtil.formatDate(
|
||||
widget.model.cycleCheck.decorationDate,
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 22.w,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
_getTagName(),
|
||||
style: TextStyle(
|
||||
color: _getTagColor(),
|
||||
fontSize: 24.w,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
AkuBox.h(24),
|
||||
_buildTile(
|
||||
R.ASSETS_MANAGE_HOME_PNG,
|
||||
'小区名称',
|
||||
widget.model.userHomeModel.plot,
|
||||
),
|
||||
AkuBox.h(12),
|
||||
_buildTile(
|
||||
R.ASSETS_MANAGE_ADDRESS_PNG,
|
||||
'详细地址',
|
||||
widget.model.userHomeModel.detailAddr,
|
||||
),
|
||||
AkuBox.h(12),
|
||||
_buildTile(
|
||||
R.ASSETS_MANAGE_DECORATION_PNG,
|
||||
'装修公司',
|
||||
widget.model.decorationTeamModel.name,
|
||||
),
|
||||
AkuBox.h(12),
|
||||
_buildTile(
|
||||
R.ASSETS_MANAGE_STATUS_PNG,
|
||||
'装修状态',
|
||||
widget.model.statusTypeValue,
|
||||
),
|
||||
Divider(
|
||||
height: 48.w,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: AkuMaterialButton(
|
||||
onPressed: () {},
|
||||
height: 64.w,
|
||||
minWidth: 160.w,
|
||||
color: AppStyle.primaryColor,
|
||||
child: Text(
|
||||
'查看详情',
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 28.w,
|
||||
),
|
||||
),
|
||||
radius: 4.w,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildTile(String path, String title, String subTitle) {
|
||||
return Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
path,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: AppStyle.minorTextColor,
|
||||
fontSize: 28.sp,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
subTitle,
|
||||
style: TextStyle(
|
||||
color: AppStyle.primaryTextColor,
|
||||
fontSize: 28.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_getTagName() {
|
||||
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[widget.model.type];
|
||||
break;
|
||||
case USER_ROLE.PROPERTY:
|
||||
return fixerMap[widget.model.type];
|
||||
break;
|
||||
default:
|
||||
return defaultMap[widget.model.statusType];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Color _getTagColor() {
|
||||
if (role == USER_ROLE.MANAGER || role == USER_ROLE.PROPERTY) {
|
||||
if (widget.model.type == DecorationType.WAIT_HAND_OUT ||
|
||||
widget.model.type == DecorationType.HAND_OUT) {
|
||||
return Color(0xFFFF4501);
|
||||
} else
|
||||
return AppStyle.minorTextColor;
|
||||
} else {
|
||||
if (widget.model.statusType == DecorationStatusType.PROGRESS) {
|
||||
return Color(0xFFFF4501);
|
||||
} else
|
||||
return Color(0xFF32B814);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AkuChipBox extends StatelessWidget {
|
||||
final String title;
|
||||
const AkuChipBox({Key key, @required this.title}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: AppStyle.secondaryColor,
|
||||
fontSize: 20.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(vertical: 6.w, horizontal: 16.w),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(2.w),
|
||||
border: Border.all(width: 2.w, color: AppStyle.secondaryColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue