update decoration model

hmxc
小赖 4 years ago
parent 0bdb559a09
commit deb19085eb

@ -4,6 +4,23 @@ import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
class DecorationData {
static List<DecorationModel> allModels = [
DecorationModel(
type: DecorationType.WAIT_HAND_OUT,
statusType: DecorationStatusType.PROGRESS,
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
userHomeModel: UserHomeModel(
userName: '林居明',
plot: '深圳华茂悦峰',
detailAddr: '2幢-2单元-501室',
phone: '19995430126',
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
userName: '李惠政',
phone: '19298540192',
),
),
DecorationModel(
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
type: DecorationType.DONE,
statusType: DecorationStatusType.DONE,
userHomeModel: UserHomeModel(
@ -11,7 +28,6 @@ class DecorationData {
plot: '深圳华茂悦峰',
detailAddr: '1幢-1单元-302室',
phone: '18201939840',
decorationStatus: false,
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
@ -19,7 +35,6 @@ class DecorationData {
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,
@ -31,7 +46,6 @@ class DecorationData {
],
),
workFinishCheck: WorkFinishCheck(
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkDetails: [

@ -53,6 +53,7 @@ Map<CHECK_TYPE, String> checkAssetMap = {
class DecorationModel {
DecorationType type;
DecorationStatusType statusType;
DateTime decorationDate;
UserHomeModel userHomeModel;
DecorationTeamModel decorationTeamModel;
CycleCheck cycleCheck;
@ -71,6 +72,7 @@ class DecorationModel {
@required this.statusType,
@required this.userHomeModel,
@required this.decorationTeamModel,
@required this.decorationDate,
this.cycleCheck,
this.workFinishCheck,
this.checkInfomations,
@ -83,13 +85,11 @@ class UserHomeModel {
String detailAddr;
String userName;
String phone;
bool decorationStatus;
UserHomeModel({
this.plot,
this.detailAddr,
this.userName,
this.phone,
this.decorationStatus,
});
}
@ -107,7 +107,6 @@ class DecorationTeamModel {
///
class CycleCheck {
DateTime decorationDate;
FixerModel authPerson;
DateTime startDate;
@ -115,7 +114,6 @@ class CycleCheck {
int checkCycle;
List<CHECK_TYPE> checkDetails;
CycleCheck({
this.decorationDate,
this.authPerson,
this.startDate,
this.checkCycle,
@ -124,12 +122,10 @@ class CycleCheck {
}
class WorkFinishCheck {
DateTime decorationDate;
FixerModel authPerson;
DateTime startDate;
List<CHECK_TYPE> checkDetails;
WorkFinishCheck({
this.decorationDate,
this.authPerson,
this.startDate,
this.checkDetails,

@ -6,7 +6,9 @@ import 'package:aku_community_manager/tools/screen_tool.dart';
class DecorationCheckCardWidget extends StatelessWidget {
final CHECK_TYPE type;
const DecorationCheckCardWidget({Key key, @required this.type})
final bool checked;
const DecorationCheckCardWidget(
{Key key, @required this.type, this.checked = false})
: super(key: key);
@override
@ -34,10 +36,11 @@ class DecorationCheckCardWidget extends StatelessWidget {
),
decoration: BoxDecoration(
border: Border.all(
color: Color(0xFFE8E8E8),
color: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8),
width: 3.w,
),
borderRadius: BorderRadius.circular(8.w),
color: checked ? Color(0xFFFFF3CC) : Colors.white,
),
);
}

@ -1,12 +1,31 @@
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 {
import 'package:aku_community_manager/tools/screen_tool.dart';
class DecorationCheckRow extends StatefulWidget {
final List<CHECK_TYPE> details;
const DecorationCheckRow({Key key, @required this.details}) : super(key: key);
final Function(List<CHECK_TYPE> details) onChange;
DecorationCheckRow({Key key, @required this.details, this.onChange})
: 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) {
@ -15,11 +34,28 @@ class DecorationCheckRow extends StatelessWidget {
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return DecorationCheckCardWidget(
type: details[index],
return GestureDetector(
onTap: widget.onChange == null
? null
: () {
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.onChange == null
? false
: _checkedDetails.indexOf(_tempCheckDetails[index]) != -1,
),
),
);
},
itemCount: details.length,
itemCount: _tempCheckDetails.length,
separatorBuilder: (context, index) {
return AkuBox.w(16);
},

@ -38,7 +38,7 @@ class _DecorationManagerCardState extends State<DecorationManagerCard> {
AkuBox.w(16),
Text(
DateUtil.formatDate(
widget.model.cycleCheck.decorationDate,
widget.model.decorationDate,
format: 'yyyy-MM-dd HH:mm:ss',
),
style: TextStyle(

@ -203,7 +203,7 @@ class _DecorationManagerDetailStatePage
_buildRow(
title: '开始装修时间',
subTitle: DateUtil.formatDate(
widget.model.workFinishCheck.decorationDate,
widget.model.decorationDate,
format: 'yyyy-MM-dd',
),
),
@ -231,7 +231,10 @@ class _DecorationManagerDetailStatePage
),
),
),
DecorationCheckRow(details: widget.model.workFinishCheck.checkDetails),
DecorationCheckRow(
details: widget.model.workFinishCheck.checkDetails,
onChange: (details) {},
),
],
);
}
@ -244,7 +247,7 @@ class _DecorationManagerDetailStatePage
_buildRow(
title: '开始装修时间',
subTitle: DateUtil.formatDate(
widget.model.cycleCheck.decorationDate,
widget.model.decorationDate,
format: 'yyyy-MM-dd',
),
),

Loading…
Cancel
Save