parent
8314325dd2
commit
fdf33b205b
@ -0,0 +1,75 @@
|
||||
class BussinessAndFixModel {
|
||||
int id;
|
||||
int dispatchId;
|
||||
String reportDetail;
|
||||
String repairDate;
|
||||
int status;
|
||||
List<ImgUrls> imgUrls;
|
||||
int type;
|
||||
|
||||
BussinessAndFixModel(
|
||||
{this.id,
|
||||
this.dispatchId,
|
||||
this.reportDetail,
|
||||
this.repairDate,
|
||||
this.status,
|
||||
this.imgUrls,
|
||||
this.type});
|
||||
|
||||
BussinessAndFixModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
dispatchId = json['dispatchId'];
|
||||
reportDetail = json['reportDetail'];
|
||||
repairDate = json['repairDate'];
|
||||
status = json['status'];
|
||||
if (json['imgUrls'] != null) {
|
||||
imgUrls = new List<ImgUrls>();
|
||||
json['imgUrls'].forEach((v) {
|
||||
imgUrls.add(new ImgUrls.fromJson(v));
|
||||
});
|
||||
}
|
||||
type = json['type'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['dispatchId'] = this.dispatchId;
|
||||
data['reportDetail'] = this.reportDetail;
|
||||
data['repairDate'] = this.repairDate;
|
||||
data['status'] = this.status;
|
||||
if (this.imgUrls != null) {
|
||||
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['type'] = this.type;
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
class AkuMap {
|
||||
static String fixStatus(bool canOpention, bool canPickup, int status) {
|
||||
if (canOpention) {
|
||||
switch (status) {
|
||||
case 1:
|
||||
return '待派单';
|
||||
break;
|
||||
case 2:
|
||||
return '已派单';
|
||||
case 3:
|
||||
return '处理中';
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return '已处理';
|
||||
case 7:
|
||||
return '已作废';
|
||||
case 8:
|
||||
return '已取消';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
} else if (canPickup) {
|
||||
switch (status) {
|
||||
case 2:
|
||||
return '已派单';
|
||||
case 3:
|
||||
return '处理中';
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return '已处理';
|
||||
case 7:
|
||||
return '已作废';
|
||||
case 8:
|
||||
return '已取消';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
switch (status) {
|
||||
case 1:
|
||||
case 2:
|
||||
return '未处理';
|
||||
case 3:
|
||||
return '处理中';
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return '已处理';
|
||||
case 7:
|
||||
return '已作废';
|
||||
case 8:
|
||||
return '已取消';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
import 'package:aku_community_manager/const/api.dart';
|
||||
import 'package:aku_community_manager/models/manager/bussiness_and_fix_model.dart';
|
||||
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_fix_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:velocity_x/velocity_x.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
class BussinessAndFixView extends StatefulWidget {
|
||||
final int status;
|
||||
BussinessAndFixView({Key key, this.status}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BussinessAndFixViewState createState() => _BussinessAndFixViewState();
|
||||
}
|
||||
|
||||
class _BussinessAndFixViewState extends State<BussinessAndFixView>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
EasyRefreshController _easyRefreshController;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return BeeListView(
|
||||
path: API.manage.repairList,
|
||||
extraParams: {
|
||||
'repairStatus': widget.status,
|
||||
},
|
||||
controller: _easyRefreshController,
|
||||
convert: (models) {
|
||||
return models.tableList
|
||||
.map((e) => BussinessAndFixModel.fromJson(e))
|
||||
.toList();
|
||||
},
|
||||
builder: (items) {
|
||||
return ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
return BusinessFixCard(model: items[index]);
|
||||
},
|
||||
separatorBuilder: (_, __) {
|
||||
return 16.w.heightBox;
|
||||
},
|
||||
itemCount: items.length);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
}
|
Loading…
Reference in new issue