update fixed detail page

hmxc
张萌 4 years ago
parent c1eb0b20a8
commit 5420ad4058

@ -1,8 +1,8 @@
class FixedDetailModel { class FixedDetailModel {
AppReportRepairVo appReportRepairVo; AppReportRepairVo appReportRepairVo;
List<AppProcessRecordVo> appProcessRecordVo; List<AppProcessRecordVo> appProcessRecordVo;
List<String> appMaintenanceResultVo; // Null appMaintenanceResultVo;
List<String> appDispatchListVo; // List<AppDispatchListVo> appDispatchListVo;
FixedDetailModel( FixedDetailModel(
{this.appReportRepairVo, {this.appReportRepairVo,
@ -20,8 +20,13 @@ class FixedDetailModel {
appProcessRecordVo.add(new AppProcessRecordVo.fromJson(v)); appProcessRecordVo.add(new AppProcessRecordVo.fromJson(v));
}); });
} }
appMaintenanceResultVo = json['appMaintenanceResultVo'].cast<String>(); appMaintenanceResultVo = json['appMaintenanceResultVo'];
appDispatchListVo = json['appDispatchListVo'].cast<String>(); if (json['appDispatchListVo'] != null) {
appDispatchListVo = new List<AppDispatchListVo>();
json['appDispatchListVo'].forEach((v) {
appDispatchListVo.add(new AppDispatchListVo.fromJson(v));
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -34,7 +39,10 @@ class FixedDetailModel {
this.appProcessRecordVo.map((v) => v.toJson()).toList(); this.appProcessRecordVo.map((v) => v.toJson()).toList();
} }
data['appMaintenanceResultVo'] = this.appMaintenanceResultVo; data['appMaintenanceResultVo'] = this.appMaintenanceResultVo;
data['appDispatchListVo'] = this.appDispatchListVo; if (this.appDispatchListVo != null) {
data['appDispatchListVo'] =
this.appDispatchListVo.map((v) => v.toJson()).toList();
}
return data; return data;
} }
} }
@ -44,7 +52,7 @@ class AppReportRepairVo {
int type; int type;
int status; int status;
String reportDetail; String reportDetail;
List<String> imgUrls; List<ImgUrls> imgUrls;
AppReportRepairVo( AppReportRepairVo(
{this.id, this.type, this.status, this.reportDetail, this.imgUrls}); {this.id, this.type, this.status, this.reportDetail, this.imgUrls});
@ -54,7 +62,12 @@ class AppReportRepairVo {
type = json['type']; type = json['type'];
status = json['status']; status = json['status'];
reportDetail = json['reportDetail']; reportDetail = json['reportDetail'];
imgUrls = json['imgUrls'].cast<String>(); if (json['imgUrls'] != null) {
imgUrls = new List<ImgUrls>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgUrls.fromJson(v));
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -63,7 +76,37 @@ class AppReportRepairVo {
data['type'] = this.type; data['type'] = this.type;
data['status'] = this.status; data['status'] = this.status;
data['reportDetail'] = this.reportDetail; data['reportDetail'] = this.reportDetail;
data['imgUrls'] = this.imgUrls; if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
return data;
}
}
class ImgUrls {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrls.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data; return data;
} }
} }
@ -86,3 +129,36 @@ class AppProcessRecordVo {
return data; return data;
} }
} }
class AppDispatchListVo {
int code;
String orderDate;
int type;
String operatorName;
String distributorName;
AppDispatchListVo(
{this.code,
this.orderDate,
this.type,
this.operatorName,
this.distributorName});
AppDispatchListVo.fromJson(Map<String, dynamic> json) {
code = json['code'];
orderDate = json['orderDate'];
type = json['type'];
operatorName = json['operatorName'];
distributorName = json['distributorName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['code'] = this.code;
data['orderDate'] = this.orderDate;
data['type'] = this.type;
data['operatorName'] = this.operatorName;
data['distributorName'] = this.distributorName;
return data;
}
}

@ -1,8 +1,8 @@
import 'package:akuCommunity/constants/api.dart'; import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/fixed_detail_model.dart'; import 'package:akuCommunity/model/manager/fixed_detail_model.dart';
import 'package:akuCommunity/utils/network/base_model.dart'; import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart'; import 'package:akuCommunity/utils/network/net_util.dart';
import 'package:dio/dio.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.dart';
class ManagerFunc { class ManagerFunc {
@ -46,14 +46,13 @@ class ManagerFunc {
return baseModel; return baseModel;
} }
static Future<FixedDetailModel> reportRepairFindBYLD(int id) async{ static Future<FixedDetailModel> reportRepairFindBYLD(int id) async {
BaseModel baseModel = await NetUtil().post( Response response = await NetUtil().dio.get(
API.manager.reportRepairFindBYLD, API.manager.reportRepairFindBYLD,
params: { queryParameters: {
'repairId':id, 'repairId': id,
}, },
showMessage: false,
); );
return FixedDetailModel.fromJson(baseModel.data); return FixedDetailModel.fromJson(response.data);
} }
} }

@ -4,12 +4,13 @@ import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/utils/bee_map.dart'; import 'package:akuCommunity/utils/bee_map.dart';
import 'package:akuCommunity/widget/bee_divider.dart'; import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/horizontal_image_view.dart'; import 'package:akuCommunity/widget/views/horizontal_image_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/const/resource.dart';
class FixedDetailPage extends StatefulWidget { class FixedDetailPage extends StatefulWidget {
final int id; final int id;
@ -23,6 +24,7 @@ class FixedDetailPage extends StatefulWidget {
} }
class _FixedDetailPageState extends State<FixedDetailPage> { class _FixedDetailPageState extends State<FixedDetailPage> {
bool _onLoading = true;
EasyRefreshController _easyRefreshController; EasyRefreshController _easyRefreshController;
FixedDetailModel _model; FixedDetailModel _model;
Color _getColor(int state) { Color _getColor(int state) {
@ -43,14 +45,17 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
Widget _buildHead(FixedDetailModel model) { Widget _buildHead(FixedDetailModel model) {
return Container( return Container(
decoration: BoxDecoration(
color: kForeGroundColor, borderRadius: BorderRadius.circular(8.w)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.fromLTRB(28.w, 20.w, 20.w, 24.w), padding: EdgeInsets.fromLTRB(28.w, 20.w, 20.w, 24.w),
child: Row( child: Row(
children: [ children: [
'报修信息'.text.black.size(32.sp).bold.make(), '报修信息'.text.black.size(32.sp).bold.make(),
8.widthBox, 8.w.widthBox,
Container( Container(
padding: padding:
EdgeInsets.symmetric(horizontal: 20.w, vertical: 4.w), EdgeInsets.symmetric(horizontal: 20.w, vertical: 4.w),
@ -84,7 +89,7 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
indent: 24.w, indent: 24.w,
endIndent: 20.w, endIndent: 20.w,
), ),
24.heightBox, 24.w.heightBox,
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 28.w), padding: EdgeInsets.symmetric(horizontal: 28.w),
child: model.appReportRepairVo.reportDetail.text.black child: model.appReportRepairVo.reportDetail.text.black
@ -95,47 +100,72 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
), ),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 8.w), padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 8.w),
child: HorizontalImageView(model.appReportRepairVo.imgUrls), child: HorizontalImageView(
model.appReportRepairVo.imgUrls.map((e) => e.url).toList()),
) )
], ],
), ),
); );
} }
Widget _buildEmpty() {
return Container();
}
Widget _reparCard(){
return Container(
padding: EdgeInsets.symmetric(
horizontal: 28.w,
vertical: 24.w
),
decoration: BoxDecoration(
color: kForeGroundColor,
borderRadius: BorderRadius.circular(8.w)
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'维修信息'.text.black.size(32.sp).bold.make(),
24.w.heightBox,
BeeDivider.horizontal()
],
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '报事报修', title: '报事报修',
body: Column( body: EasyRefresh(
children: [ firstRefresh: true,
EasyRefresh( controller: _easyRefreshController,
firstRefresh: true, onRefresh: () async {
controller: _easyRefreshController, _model = await ManagerFunc.reportRepairFindBYLD(widget.id);
onRefresh: () async { _onLoading = false;
_model = await ManagerFunc.reportRepairFindBYLD(widget.id); },
}, header: MaterialHeader(),
child: ListView( child: _onLoading
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 36.w), ? _buildEmpty()
children: [ : ListView(
_buildHead(_model), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 36.w),
].sepWidget(separate: 16.heightBox), children: [
), _buildHead(_model),
).expand(), ].sepWidget(separate: 16.w.heightBox),
Padding( ),
padding: EdgeInsets.only( ),
bottom: MediaQuery.of(context).padding.bottom + 39.w), bottomNavi: Padding(
child: MaterialButton( padding: EdgeInsets.only(
shape: RoundedRectangleBorder( bottom: MediaQuery.of(context).padding.bottom + 39.w),
borderRadius: BorderRadius.circular(48.w)), child: MaterialButton(
color: kPrimaryColor, shape:
padding: EdgeInsets.symmetric(horizontal: 278.w, vertical: 26.w), RoundedRectangleBorder(borderRadius: BorderRadius.circular(48.w)),
elevation: 0, color: kPrimaryColor,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, padding: EdgeInsets.symmetric(horizontal: 278.w, vertical: 26.w),
onPressed: () {}, elevation: 0,
child: '确认完成'.text.black.size(32.sp).bold.make(), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
), onPressed: () {},
) child: '确认完成'.text.black.size(32.sp).bold.make(),
], ),
), ),
); );
} }

Loading…
Cancel
Save