修复了一些问题

hmxc
张萌 4 years ago
parent ad9d4febc9
commit 9d14c37c82

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

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

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

Loading…
Cancel
Save