修复了一些问题

hmxc
张萌 4 years ago
parent ad9d4febc9
commit 9d14c37c82

@ -47,11 +47,7 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
16.w.heightBox,
AkuButton(
return AkuButton(
onPressed: () {
Get.to(
InspectionManageDetailsPage(
@ -65,8 +61,7 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 40.w),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFFFFFFF)),
borderRadius: BorderRadius.circular(8.w), color: Color(0xFFFFFFFF)),
child: Column(children: [
Container(
height: 93.w,
@ -209,8 +204,6 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
)
]),
),
),
],
);
}
}

@ -83,10 +83,18 @@ class _InspectionManageDetailsPageState
onRefresh: () async {
_detailModel =
await ManageFunc.getInspectionDetail(widget.executeId);
ManageFunc.getInspectionPoint(widget.executeId).then((value) {
_pointModels =
value.map((e) => InspectionPointModel.fromJson(e)).toList();
});
await ManageFunc.getInspectionPoint(_detailModel.inspectionPlanId)
.then(
(value) {
if (value == null) {
_pointModels = [];
} else {
_pointModels = value
.map((e) => InspectionPointModel.fromJson(e))
.toList();
}
},
);
_onload = false;
setState(() {});
},
@ -108,6 +116,11 @@ class _InspectionManageDetailsPageState
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
'巡检站点'.text.black.size(32.sp).bold.make(),
..._pointModels
?.map((e) => _buildInspectionTile(
e.name, e.checkNum, e.id))
?.toList() ??
[]
].sepWidget(separate: 16.w.heightBox),
),
)
@ -118,7 +131,12 @@ class _InspectionManageDetailsPageState
onPressed: () {},
padding: EdgeInsets.symmetric(vertical: 26.w),
color: kPrimaryColor,
child: '开始巡检'.text.black.bold.size(32.sp).make(),
child: (widget.inspectionStatus == 1 ? '开始巡检' : '立即扫码')
.text
.black
.bold
.size(32.sp)
.make(),
).pOnly(bottom: MediaQuery.of(context).padding.bottom));
}
@ -217,7 +235,7 @@ class _InspectionManageDetailsPageState
Text('规定巡检时间', style: _textstyle),
Spacer(),
Text(
'${DateUtil.formatDateStr(_detailModel.beginDate, format: "yyyy-MM-dd HH:mm")}${_detailModel?.endDate == null ? '' : DateUtil.formatDateStr(_detailModel.endDate, format: "HH:mm")}',
'${DateUtil.formatDateStr(_detailModel.beginDate, format: "yyyy-MM-dd HH:mm")}${_detailModel?.endDate == null ? '' : ''}${_detailModel?.endDate == null ? '' : DateUtil.formatDateStr(_detailModel.endDate, format: "HH:mm")}',
style: AppStyle().primaryStyle,
),
],

@ -43,12 +43,12 @@ class _InspectionMangeViewState extends State<InspectionMangeView> {
},
builder: (items) {
return ListView.separated(
padding: EdgeInsets.symmetric(horizontal: 32.w),
padding: EdgeInsets.fromLTRB(32.w, 16.w, 32.w, 16.w),
itemBuilder: (context, index) {
return InspectionManageCard(cardModel: items[index]);
},
separatorBuilder: (context, index) {
return 8.w.heightBox;
return 16.w.heightBox;
},
itemCount: items.length,
);

Loading…
Cancel
Save