parent
ebf7e230d0
commit
02bb4572b7
@ -0,0 +1,221 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NewRenovationListModel {
|
||||
int id;
|
||||
String roomName;
|
||||
int status;
|
||||
String constructionUnit;
|
||||
String director;
|
||||
String directorTel;
|
||||
String expectedBegin;
|
||||
String expectedEnd;
|
||||
String actualBegin;
|
||||
String actualEnd;
|
||||
String rejectReason;
|
||||
String reviewerName;
|
||||
String auditDate;
|
||||
String trackerName;
|
||||
String applicationCheckDate;
|
||||
int isQualified;
|
||||
String createName;
|
||||
String createDate;
|
||||
List<CheckVoList> checkVoList;
|
||||
|
||||
NewRenovationListModel(
|
||||
{this.id,
|
||||
this.roomName,
|
||||
this.status,
|
||||
this.constructionUnit,
|
||||
this.director,
|
||||
this.directorTel,
|
||||
this.expectedBegin,
|
||||
this.expectedEnd,
|
||||
this.actualBegin,
|
||||
this.actualEnd,
|
||||
this.rejectReason,
|
||||
this.reviewerName,
|
||||
this.auditDate,
|
||||
this.trackerName,
|
||||
this.applicationCheckDate,
|
||||
this.isQualified,
|
||||
this.createName,
|
||||
this.createDate,
|
||||
this.checkVoList});
|
||||
|
||||
NewRenovationListModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
roomName = json['roomName'];
|
||||
status = json['status'];
|
||||
constructionUnit = json['constructionUnit'];
|
||||
director = json['director'];
|
||||
directorTel = json['directorTel'];
|
||||
expectedBegin = json['expectedBegin'];
|
||||
expectedEnd = json['expectedEnd'];
|
||||
actualBegin = json['actualBegin'];
|
||||
actualEnd = json['actualEnd'];
|
||||
rejectReason = json['rejectReason'];
|
||||
reviewerName = json['reviewerName'];
|
||||
auditDate = json['auditDate'];
|
||||
trackerName = json['trackerName'];
|
||||
applicationCheckDate = json['applicationCheckDate'];
|
||||
isQualified = json['isQualified'];
|
||||
createName = json['createName'];
|
||||
createDate = json['createDate'];
|
||||
if (json['checkVoList'] != null) {
|
||||
checkVoList = new List<CheckVoList>();
|
||||
json['checkVoList'].forEach((v) {
|
||||
checkVoList.add(new CheckVoList.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['roomName'] = this.roomName;
|
||||
data['status'] = this.status;
|
||||
data['constructionUnit'] = this.constructionUnit;
|
||||
data['director'] = this.director;
|
||||
data['directorTel'] = this.directorTel;
|
||||
data['expectedBegin'] = this.expectedBegin;
|
||||
data['expectedEnd'] = this.expectedEnd;
|
||||
data['actualBegin'] = this.actualBegin;
|
||||
data['actualEnd'] = this.actualEnd;
|
||||
data['rejectReason'] = this.rejectReason;
|
||||
data['reviewerName'] = this.reviewerName;
|
||||
data['auditDate'] = this.auditDate;
|
||||
data['trackerName'] = this.trackerName;
|
||||
data['applicationCheckDate'] = this.applicationCheckDate;
|
||||
data['isQualified'] = this.isQualified;
|
||||
data['createName'] = this.createName;
|
||||
data['createDate'] = this.createDate;
|
||||
if (this.checkVoList != null) {
|
||||
data['checkVoList'] = this.checkVoList.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
String get expectBginString =>
|
||||
DateUtil.formatDateStr(this.expectedBegin, format: 'yyyy-MM-dd HH:mm');
|
||||
|
||||
String get expectEndString =>
|
||||
DateUtil.formatDateStr(this.expectedEnd, format: 'yyyy-MM-dd HH:mm');
|
||||
|
||||
String get actualBginString => DateUtil.formatDateStr(this.actualBegin ?? '',
|
||||
format: 'yyyy-MM-dd HH:mm');
|
||||
|
||||
String get actualEndString =>
|
||||
DateUtil.formatDateStr(this.actualEnd ?? '', format: 'yyyy-MM-dd HH:mm');
|
||||
String get expectSlot =>
|
||||
'${expectBginString}-${DateUtil.formatDateStr(this.expectedEnd, format: 'HH:mm')}';
|
||||
String get actualSlot =>
|
||||
'${actualBginString}-${DateUtil.formatDateStr(this.actualEnd ?? '', format: 'HH:mm')}';
|
||||
|
||||
String get qualitfied {
|
||||
switch (this.isQualified) {
|
||||
case 1:
|
||||
return '合格';
|
||||
case 2:
|
||||
return '不合格';
|
||||
default:
|
||||
return '未知';
|
||||
}
|
||||
}
|
||||
|
||||
String get statusString {
|
||||
switch (this.status) {
|
||||
// case 1:
|
||||
// return '申请中';
|
||||
// case 2:
|
||||
// return '装修中';
|
||||
// case 3:
|
||||
// return '申请驳回';
|
||||
// // case 4:
|
||||
// // return '装修中';
|
||||
// case 5:
|
||||
// return '申请完工检查';
|
||||
case 6:
|
||||
return '完工检查中';
|
||||
case 7:
|
||||
return '检查通过';
|
||||
case 8:
|
||||
return '检查不通过';
|
||||
default:
|
||||
return '未知';
|
||||
}
|
||||
}
|
||||
|
||||
Color get statusColor {
|
||||
switch (this.status) {
|
||||
// case 1:
|
||||
// return kPrimaryColor;
|
||||
// case 2:
|
||||
// return Colors.green;
|
||||
// case 3:
|
||||
// return Colors.red;
|
||||
// // case 4:
|
||||
// // return ktextPrimary;
|
||||
// case 5:
|
||||
// return kPrimaryColor;
|
||||
case 6:
|
||||
return kTextSubColor;
|
||||
|
||||
case 7:
|
||||
return Colors.green;
|
||||
case 8:
|
||||
return Colors.red;
|
||||
default:
|
||||
return kTextPrimaryColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class CheckVoList {
|
||||
int id;
|
||||
int decorationNewId;
|
||||
String detail;
|
||||
int isQualified;
|
||||
String createName;
|
||||
String createDate;
|
||||
|
||||
CheckVoList(
|
||||
{this.id,
|
||||
this.decorationNewId,
|
||||
this.detail,
|
||||
this.isQualified,
|
||||
this.createName,
|
||||
this.createDate});
|
||||
|
||||
CheckVoList.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
decorationNewId = json['decorationNewId'];
|
||||
detail = json['detail'];
|
||||
isQualified = json['isQualified'];
|
||||
createName = json['createName'];
|
||||
createDate = json['createDate'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['decorationNewId'] = this.decorationNewId;
|
||||
data['detail'] = this.detail;
|
||||
data['isQualified'] = this.isQualified;
|
||||
data['createName'] = this.createName;
|
||||
data['createDate'] = this.createDate;
|
||||
return data;
|
||||
}
|
||||
|
||||
String get qualitfied {
|
||||
switch (this.isQualified) {
|
||||
case 1:
|
||||
return '合格';
|
||||
case 2:
|
||||
return '不合格';
|
||||
default:
|
||||
return '未知';
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
import 'package:aku_community_manager/models/manager/new_renovation/new_renovation_list_model.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/aku_divider.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/new_renovation/new_renovation_detail_page.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/new_renovation/new_renovation_finsih_submit_page.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_row_tile.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/car_bottom_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
|
||||
|
||||
class NewRenovationCard extends StatefulWidget {
|
||||
final NewRenovationListModel model;
|
||||
final VoidCallback callRefresh;
|
||||
NewRenovationCard({
|
||||
Key key,
|
||||
this.model,
|
||||
this.callRefresh,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_NewRenovationCardState createState() => _NewRenovationCardState();
|
||||
}
|
||||
|
||||
class _NewRenovationCardState extends State<NewRenovationCard> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(() => NewRenovationDetailPage(
|
||||
model: widget.model,
|
||||
));
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(24.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.model.roomName,
|
||||
style: TextStyle(
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: kTextPrimaryColor,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
widget.model.statusString.text
|
||||
.size(30.sp)
|
||||
.color(widget.model.statusColor)
|
||||
.bold
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
16.w.heightBox,
|
||||
AkuDivider.horizontal(),
|
||||
24.w.heightBox,
|
||||
...<Widget>[
|
||||
AkuRowTile(
|
||||
assetPath: R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
title: '装修公司',
|
||||
content: widget.model.constructionUnit.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
),
|
||||
AkuRowTile(
|
||||
assetPath: R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
title: '负责人姓名',
|
||||
content: widget.model.director.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
),
|
||||
AkuRowTile(
|
||||
assetPath: R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
title: '负责人电话',
|
||||
content: widget.model.directorTel.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
),
|
||||
AkuRowTile(
|
||||
assetPath: R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
title: '预计装修时间',
|
||||
content: widget.model.expectSlot.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
),
|
||||
..._nullableRowTile(
|
||||
widget.model.actualEnd.isEmptyOrNull,
|
||||
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
'实际装修时间',
|
||||
widget.model.actualSlot.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make()),
|
||||
..._nullableRowTile(
|
||||
widget.model.isQualified == null,
|
||||
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
'检查情况',
|
||||
widget.model.qualitfied.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make())
|
||||
].sepWidget(separate: 12.w.heightBox),
|
||||
..._bottomWidgets(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _bottomWidgets() {
|
||||
return (widget.model.status != 6)
|
||||
? []
|
||||
: [
|
||||
40.w.heightBox,
|
||||
Row(
|
||||
children: [Spacer(), ..._getButtons()],
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
List<Widget> _getButtons() {
|
||||
List<CardBottomButton> buttons = [];
|
||||
switch (widget.model.status) {
|
||||
case 6:
|
||||
buttons = [
|
||||
CardBottomButton.yellow(
|
||||
text: '提交报告',
|
||||
onPressed: () async {
|
||||
Get.to(() => NewRenovationFinishSubmitPage(
|
||||
id: widget.model.id,
|
||||
callRefresh: () {
|
||||
widget.callRefresh();
|
||||
},
|
||||
));
|
||||
})
|
||||
];
|
||||
break;
|
||||
default:
|
||||
buttons = [];
|
||||
}
|
||||
return buttons;
|
||||
}
|
||||
|
||||
_nullableRowTile(
|
||||
bool isNull, String assetPath, String title, Widget content) {
|
||||
return isNull
|
||||
? []
|
||||
: [
|
||||
AkuRowTile(assetPath: assetPath, title: title, content: content),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,211 @@
|
||||
import 'package:aku_community_manager/models/manager/new_renovation/new_renovation_list_model.dart';
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:aku_community_manager/tools/aku_divider.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_row_tile.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
|
||||
|
||||
class NewRenovationDetailPage extends StatefulWidget {
|
||||
final NewRenovationListModel model;
|
||||
NewRenovationDetailPage({Key key, this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
_NewRenovationDetailPageState createState() =>
|
||||
_NewRenovationDetailPageState();
|
||||
}
|
||||
|
||||
class _NewRenovationDetailPageState extends State<NewRenovationDetailPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '装修详情',
|
||||
body: ListView(
|
||||
padding: EdgeInsets.all(32.w),
|
||||
children: [
|
||||
_renovationInfo(),
|
||||
40.w.heightBox,
|
||||
_contentWidget(),
|
||||
..._checkWidge(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _contentWidget() {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
|
||||
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
'装修反馈'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
16.w.heightBox,
|
||||
AkuDivider.horizontal(),
|
||||
20.w.heightBox,
|
||||
(widget.model.rejectReason ?? '')
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(kTextPrimaryColor)
|
||||
.make(),
|
||||
...widget.model.auditDate.isEmptyOrNull
|
||||
? []
|
||||
: [
|
||||
40.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
widget.model.auditDate.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
],
|
||||
...widget.model.checkVoList.isEmpty ? [] : [..._checkWidge()]
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _checkWidge() {
|
||||
return widget.model.checkVoList
|
||||
.map((e) => Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.w)),
|
||||
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
||||
child: Column(
|
||||
children: [
|
||||
16.w.heightBox,
|
||||
AkuDivider.horizontal(),
|
||||
20.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
'完工检查${widget.model.checkVoList.indexOf(e)}'
|
||||
.text
|
||||
.size(32.sp)
|
||||
.color(kTextPrimaryColor)
|
||||
.bold
|
||||
.make(),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
12.w.heightBox,
|
||||
e.qualitfied.text
|
||||
.size(28.sp)
|
||||
.color(e.isQualified == 1 ? Colors.green : Colors.red)
|
||||
.make(),
|
||||
20.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
(e.createDate)
|
||||
.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
.toList();
|
||||
}
|
||||
|
||||
Widget _renovationInfo() {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(24.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.model.roomName,
|
||||
style: TextStyle(
|
||||
fontSize: 32.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: kTextPrimaryColor,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
widget.model.statusString.text
|
||||
.size(30.sp)
|
||||
.color(widget.model.statusColor)
|
||||
.bold
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
16.w.heightBox,
|
||||
AkuDivider.horizontal(),
|
||||
24.w.heightBox,
|
||||
...<Widget>[
|
||||
AkuRowTile(
|
||||
assetPath: R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
title: '装修公司',
|
||||
content: widget.model.constructionUnit.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
),
|
||||
AkuRowTile(
|
||||
assetPath: R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
title: '负责人姓名',
|
||||
content: widget.model.director.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
),
|
||||
AkuRowTile(
|
||||
assetPath: R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
title: '负责人电话',
|
||||
content: widget.model.directorTel.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
),
|
||||
AkuRowTile(
|
||||
assetPath: R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
title: '预计装修时间',
|
||||
content: widget.model.expectSlot.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make(),
|
||||
),
|
||||
..._nullableRowTile(
|
||||
widget.model.actualEnd.isEmptyOrNull,
|
||||
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
||||
'实际装修时间',
|
||||
widget.model.actualSlot.text
|
||||
.size(24.sp)
|
||||
.color(kTextSubColor)
|
||||
.make())
|
||||
].sepWidget(separate: 12.w.heightBox),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_nullableRowTile(
|
||||
bool isNull, String assetPath, String title, Widget content) {
|
||||
return isNull
|
||||
? []
|
||||
: [
|
||||
AkuRowTile(assetPath: assetPath, title: title, content: content),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
import 'package:aku_community_manager/const/api.dart';
|
||||
import 'package:aku_community_manager/style/app_style.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/bee_text_field.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
|
||||
import 'package:aku_community_manager/utils/network/base_model.dart';
|
||||
import 'package:aku_community_manager/utils/network/net_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class NewRenovationFinishSubmitPage extends StatefulWidget {
|
||||
final int id;
|
||||
final VoidCallback callRefresh;
|
||||
NewRenovationFinishSubmitPage({Key key, @required this.id, this.callRefresh}) : super(key: key);
|
||||
|
||||
@override
|
||||
_NewRenovationFinishSubmitPageState createState() =>
|
||||
_NewRenovationFinishSubmitPageState();
|
||||
}
|
||||
|
||||
class _NewRenovationFinishSubmitPageState
|
||||
extends State<NewRenovationFinishSubmitPage> {
|
||||
int _isQualified = 1;
|
||||
TextEditingController _detailController;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_detailController = TextEditingController();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_detailController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '完工检查',
|
||||
body: ListView(
|
||||
padding: EdgeInsets.all(32.w),
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(24.w),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_headWidget(),
|
||||
40.w.heightBox,
|
||||
BeeTextField(
|
||||
controller: _detailController,
|
||||
hintText: '请输入具体检查情况',
|
||||
onChange: () {
|
||||
setState(() {});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottom: AkuBottomButton(
|
||||
title: '立即提交',
|
||||
onTap: () async {
|
||||
BaseModel baseModel =
|
||||
await NetUtil().post(API.manage.submitRenovation,
|
||||
params: {
|
||||
"decorationNewId": widget.id,
|
||||
"detail": _detailController.text,
|
||||
"isQualified": _isQualified,
|
||||
},
|
||||
showMessage: true);
|
||||
if (baseModel.status ?? false) {
|
||||
Get.back();
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _headWidget() {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
'检查结果'.text.size(32.sp).bold.color(kTextPrimaryColor).make(),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
20.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
AkuSingleCheckButton(
|
||||
text: '合格',
|
||||
value: 1,
|
||||
gropValue: _isQualified,
|
||||
onPressed: () {
|
||||
_isQualified = 1;
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
40.w.widthBox,
|
||||
AkuSingleCheckButton(
|
||||
text: '不合格',
|
||||
value: 2,
|
||||
gropValue: _isQualified,
|
||||
onPressed: () {
|
||||
_isQualified = 2;
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/new_renovation/new_renovation_view.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
class NewRenovationPage extends StatefulWidget {
|
||||
NewRenovationPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_NewRenovationState createState() => _NewRenovationState();
|
||||
}
|
||||
|
||||
class _NewRenovationState extends State<NewRenovationPage>
|
||||
with TickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
List<String> _tabs = ['检查中', '检查通过','检查不通过'];
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: _tabs.length, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '装修管理',
|
||||
appBarBottom: PreferredSize(preferredSize: Size.fromHeight(88.w),child: AkuTabBar(controller: _tabController, tabs: _tabs),),
|
||||
body: TabBarView(
|
||||
controller: _tabController,
|
||||
children: List.generate(_tabs.length, (index) => NewRenovationView(index:index+6))),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
import 'package:aku_community_manager/const/api.dart';
|
||||
import 'package:aku_community_manager/models/manager/new_renovation/new_renovation_list_model.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/new_renovation/new_renovation_card.dart';
|
||||
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class NewRenovationView extends StatefulWidget {
|
||||
final int index;
|
||||
NewRenovationView({Key key, this.index}) : super(key: key);
|
||||
|
||||
@override
|
||||
_NewRenovationState createState() => _NewRenovationState();
|
||||
}
|
||||
|
||||
class _NewRenovationState extends State<NewRenovationView>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
EasyRefreshController _refreshController;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_refreshController = EasyRefreshController();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_refreshController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeListView(
|
||||
path: API.manage.newRenovationList,
|
||||
controller: _refreshController,
|
||||
extraParams: {"userDecorationNewStatus": widget.index},
|
||||
convert: (models) {
|
||||
return models.tableList
|
||||
.map((e) => NewRenovationListModel.fromJson(e))
|
||||
.toList();
|
||||
},
|
||||
builder: (items) {
|
||||
return ListView.separated(
|
||||
padding: EdgeInsets.all(32.w),
|
||||
itemBuilder: (context, index) {
|
||||
return NewRenovationCard(
|
||||
model: items[index],
|
||||
callRefresh: () {
|
||||
_refreshController.callRefresh();
|
||||
},
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, __) {
|
||||
return 24.w.heightBox;
|
||||
},
|
||||
itemCount: items.length);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
class AkuInputRow extends StatefulWidget {
|
||||
|
||||
final String title;
|
||||
final List<TextInputFormatter> formatters;
|
||||
final TextEditingController controller;
|
||||
final String hintText;
|
||||
AkuInputRow({Key key, this.title, this.formatters, this.controller, this.hintText}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AkuInputRowState createState() => _AkuInputRowState();
|
||||
}
|
||||
|
||||
class _AkuInputRowState extends State<AkuInputRow> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
widget.title.text.size(28.sp).color(kTextPrimaryColor).make(),
|
||||
32.w.heightBox,
|
||||
TextField(
|
||||
inputFormatters: widget.formatters,
|
||||
controller: widget.controller,
|
||||
textAlign: TextAlign.start,
|
||||
onChanged: (value) {
|
||||
setState(() {});
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
hintText: widget.hintText ?? '',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFE8E8E8), width: 2.w),
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 36.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: kTextPrimaryColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class AkuRowTile extends StatelessWidget {
|
||||
final String assetPath;
|
||||
final String title;
|
||||
final Widget content;
|
||||
const AkuRowTile({Key key, this.assetPath, this.title, this.content})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
assetPath,
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
),
|
||||
12.w.widthBox,
|
||||
title.text.size(24.sp).color(kTextSubColor).make(),
|
||||
Spacer(),
|
||||
content,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
class BeeTextField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final VoidCallback onChange;
|
||||
final String hintText;
|
||||
final int minLines;
|
||||
final int maxLines;
|
||||
BeeTextField(
|
||||
{Key key,
|
||||
@required this.controller,
|
||||
this.onChange,
|
||||
@required this.hintText,
|
||||
this.minLines,
|
||||
this.maxLines})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_BeeTextFieldState createState() => _BeeTextFieldState();
|
||||
}
|
||||
|
||||
class _BeeTextFieldState extends State<BeeTextField> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
border: Border.all(
|
||||
width: 2.w,
|
||||
color: Color(0xFFE8E8E8),
|
||||
),
|
||||
),
|
||||
child: TextField(
|
||||
minLines: widget.minLines ?? 5,
|
||||
maxLines: widget.maxLines ?? 10,
|
||||
autofocus: false,
|
||||
onChanged: (value) {
|
||||
if (widget.onChange != null) {
|
||||
widget.onChange();
|
||||
}
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
hintText: widget.hintText,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 28.sp,
|
||||
color: kTextSubColor,
|
||||
),
|
||||
contentPadding:
|
||||
EdgeInsets.symmetric(vertical: 16.w, horizontal: 24.w),
|
||||
border: InputBorder.none,
|
||||
isDense: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
import 'package:aku_community_manager/style/app_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class CardBottomButton extends StatelessWidget {
|
||||
final String text;
|
||||
final Color textColor;
|
||||
final Color bgColor;
|
||||
final bool hasBorder;
|
||||
final VoidCallback onPressed;
|
||||
const CardBottomButton(
|
||||
{Key key,
|
||||
this.text,
|
||||
this.textColor,
|
||||
this.bgColor,
|
||||
this.hasBorder = false,
|
||||
this.onPressed})
|
||||
: super(key: key);
|
||||
CardBottomButton.white({
|
||||
Key key,
|
||||
this.text,
|
||||
this.onPressed,
|
||||
}) : this.bgColor = Colors.white,
|
||||
this.textColor = kTextPrimaryColor,
|
||||
this.hasBorder = true,
|
||||
super(key: key);
|
||||
CardBottomButton.yellow({
|
||||
Key key,
|
||||
this.text,
|
||||
this.onPressed,
|
||||
}) : this.bgColor = Color(0xFFFFC40C),
|
||||
this.textColor = kTextPrimaryColor,
|
||||
this.hasBorder = false,
|
||||
super(key: key);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialButton(
|
||||
onPressed: this.onPressed,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(74.w),
|
||||
side: this.hasBorder
|
||||
? BorderSide(color: Color(0xFF999999), width: 2.w)
|
||||
: BorderSide.none),
|
||||
child: text.text.size(26.sp).color(this.textColor).bold.make(),
|
||||
color: this.bgColor,
|
||||
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w),
|
||||
height: 52.w,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue