hyzp_ybqx-Commit001:代码刚转换好,编译通过

This commit is contained in:
WinUser01
2021-12-09 20:24:36 +08:00
commit 8c74b14e5c
800 changed files with 66912 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
class CateModel {
List<CateItemModel> result;
CateModel({this.result});
CateModel.fromJson(Map<String, dynamic> json) {
if (json['result'] != null) {
result = new List<CateItemModel>();
json['result'].forEach((v) {
result.add(new CateItemModel.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.result != null) {
data['result'] = this.result.map((v) => v.toJson()).toList();
}
return data;
}
}
class CateItemModel {
String sId;
String title;
Object status;
String pic;
String pid;
String sort;
CateItemModel({this.sId, this.title, this.status, this.pic, this.pid, this.sort});
CateItemModel.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
title = json['title'];
status = json['status'];
pic = json['pic'];
pid = json['pid'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
data['title'] = this.title;
data['status'] = this.status;
data['pic'] = this.pic;
data['pid'] = this.pid;
data['sort'] = this.sort;
return data;
}
}
+48
View File
@@ -0,0 +1,48 @@
// FocusModel.fromJson(json);
class FocusModel {
List<FocusItemModel> result;
FocusModel({this.result});
FocusModel.fromJson(Map<String, dynamic> json) {
if (json['result'] != null) {
result = new List<FocusItemModel>();
json['result'].forEach((v) {
result.add(new FocusItemModel.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.result != null) {
data['result'] = this.result.map((v) => v.toJson()).toList();
}
return data;
}
}
class FocusItemModel {
String sId;
String title;
String status;
String pic;
String url;
FocusItemModel({this.sId, this.title, this.status, this.pic, this.url});
FocusItemModel.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
title = json['title'];
status = json['status'];
pic = json['pic'];
url = json['url'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
data['title'] = this.title;
data['status'] = this.status;
data['pic'] = this.pic;
data['url'] = this.url;
return data;
}
}
+133
View File
@@ -0,0 +1,133 @@
class OrderModel {
bool success;
String message;
List<Result> result;
OrderModel({this.success, this.message, this.result});
OrderModel.fromJson(Map<String, dynamic> json) {
success = json['success'];
message = json['message'];
if (json['result'] != null) {
result = new List<Result>();
json['result'].forEach((v) {
result.add(new Result.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['success'] = this.success;
data['message'] = this.message;
if (this.result != null) {
data['result'] = this.result.map((v) => v.toJson()).toList();
}
return data;
}
}
class Result {
String sId;
String uid;
String name;
String phone;
String address;
String allPrice;
int payStatus;
int orderStatus;
List<OrderItem> orderItem;
Result(
{this.sId,
this.uid,
this.name,
this.phone,
this.address,
this.allPrice,
this.payStatus,
this.orderStatus,
this.orderItem});
Result.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
uid = json['uid'];
name = json['name'];
phone = json['phone'];
address = json['address'];
allPrice = json['all_price'];
payStatus = json['pay_status'];
orderStatus = json['order_status'];
if (json['order_item'] != null) {
orderItem = new List<OrderItem>();
json['order_item'].forEach((v) {
orderItem.add(new OrderItem.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
data['uid'] = this.uid;
data['name'] = this.name;
data['phone'] = this.phone;
data['address'] = this.address;
data['all_price'] = this.allPrice;
data['pay_status'] = this.payStatus;
data['order_status'] = this.orderStatus;
if (this.orderItem != null) {
data['order_item'] = this.orderItem.map((v) => v.toJson()).toList();
}
return data;
}
}
class OrderItem {
String sId;
String orderId;
String productTitle;
String productId;
int productPrice;
String productImg;
int productCount;
String selectedAttr;
int addTime;
OrderItem(
{this.sId,
this.orderId,
this.productTitle,
this.productId,
this.productPrice,
this.productImg,
this.productCount,
this.selectedAttr,
this.addTime});
OrderItem.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
orderId = json['order_id'];
productTitle = json['product_title'];
productId = json['product_id'];
productPrice = json['product_price'];
productImg = json['product_img'];
productCount = json['product_count'];
selectedAttr = json['selected_attr'];
addTime = json['add_time'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
data['order_id'] = this.orderId;
data['product_title'] = this.productTitle;
data['product_id'] = this.productId;
data['product_price'] = this.productPrice;
data['product_img'] = this.productImg;
data['product_count'] = this.productCount;
data['selected_attr'] = this.selectedAttr;
data['add_time'] = this.addTime;
return data;
}
}
+133
View File
@@ -0,0 +1,133 @@
class ProductContentModel {
ProductContentitem result;
ProductContentModel({this.result});
ProductContentModel.fromJson(Map<String, dynamic> json) {
result =
json['result'] != null ? new ProductContentitem.fromJson(json['result']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.result != null) {
data['result'] = this.result.toJson();
}
return data;
}
}
class ProductContentitem {
String sId;
String title;
String cid;
Object price; //注意
String oldPrice;
Object isBest;
Object isHot;
Object isNew;
String status;
String pic;
String content;
String cname;
List<Attr> attr;
String subTitle;
Object salecount;
//新增
int count;
String selectedAttr;
ProductContentitem(
{this.sId,
this.title,
this.cid,
this.price,
this.oldPrice,
this.isBest,
this.isHot,
this.isNew,
this.status,
this.pic,
this.content,
this.cname,
this.attr,
this.subTitle,
this.salecount,
this.count,
this.selectedAttr
});
ProductContentitem.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
title = json['title'];
cid = json['cid'];
price = json['price'];
oldPrice = json['old_price'];
isBest = json['is_best'];
isHot = json['is_hot'];
isNew = json['is_new'];
status = json['status'];
pic = json['pic'];
content = json['content'];
cname = json['cname'];
if (json['attr'] != null) {
attr = new List<Attr>();
json['attr'].forEach((v) {
attr.add(new Attr.fromJson(v));
});
}
subTitle = json['sub_title'];
salecount = json['salecount'];
//新增
count=1;
selectedAttr='';
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
data['title'] = this.title;
data['cid'] = this.cid;
data['price'] = this.price;
data['old_price'] = this.oldPrice;
data['is_best'] = this.isBest;
data['is_hot'] = this.isHot;
data['is_new'] = this.isNew;
data['status'] = this.status;
data['pic'] = this.pic;
data['content'] = this.content;
data['cname'] = this.cname;
if (this.attr != null) {
data['attr'] = this.attr.map((v) => v.toJson()).toList();
}
data['sub_title'] = this.subTitle;
data['salecount'] = this.salecount;
return data;
}
}
class Attr {
String cate;
List<String> list;
List<Map> attrList;
Attr({this.cate, this.list});
Attr.fromJson(Map<String, dynamic> json) {
cate = json['cate'];
list = json['list'].cast<String>();
attrList=[];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['cate'] = this.cate;
data['list'] = this.list;
return data;
}
}
+63
View File
@@ -0,0 +1,63 @@
class ProductModel {
List<ProductItemModel> result;
ProductModel({this.result});
ProductModel.fromJson(Map<String, dynamic> json) {
if (json['result'] != null) {
result = new List<ProductItemModel>();
json['result'].forEach((v) {
result.add(new ProductItemModel.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.result != null) {
data['result'] = this.result.map((v) => v.toJson()).toList();
}
return data;
}
}
class ProductItemModel {
String sId;
String title;
String cid;
Object price; //所有的类型都继承 Object
String oldPrice;
String pic;
String sPic;
ProductItemModel(
{this.sId,
this.title,
this.cid,
this.price,
this.oldPrice,
this.pic,
this.sPic});
ProductItemModel.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
title = json['title'];
cid = json['cid'];
price = json['price'];
oldPrice = json['old_price'];
pic = json['pic'];
sPic = json['s_pic'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
data['title'] = this.title;
data['cid'] = this.cid;
data['price'] = this.price;
data['old_price'] = this.oldPrice;
data['pic'] = this.pic;
data['s_pic'] = this.sPic;
return data;
}
}