You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

146 lines
4.2 KiB

/// cartSum : 0
/// numberOfPeople : 0
/// selected : 0
/// shoppingCartSkuItemList : [{"buyNum":0,"createTime":"","groupId":0,"id":0,"platterList":[{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}],"productId":0,"productName":"","selected":0,"skuImg":"","skuName":"","skuPrice":0,"skuStock":0,"storeId":0,"tableId":0}]
/// storeId : 0
/// storeName : ""
/// tableId : 0
class ShoppingCart {
int cartSum;
int numberOfPeople;
int selected;
List<ShoppingCartSkuItemListBean> shoppingCartSkuItemList;
int storeId;
String storeName;
int tableId;
static ShoppingCart fromJson(Map<String, dynamic> map) {
if (map == null) return null;
ShoppingCart shoppingCartBean = ShoppingCart();
shoppingCartBean.cartSum = map['cartSum'];
shoppingCartBean.numberOfPeople = map['numberOfPeople'];
shoppingCartBean.selected = map['selected'];
shoppingCartBean.shoppingCartSkuItemList = []..addAll(
(map['shoppingCartSkuItemList'] as List ?? []).map((o) => ShoppingCartSkuItemListBean.fromJson(o))
);
shoppingCartBean.storeId = map['storeId'];
shoppingCartBean.storeName = map['storeName'];
shoppingCartBean.tableId = map['tableId'];
return shoppingCartBean;
}
Map toJson() => {
"cartSum": cartSum,
"numberOfPeople": numberOfPeople,
"selected": selected,
"shoppingCartSkuItemList": shoppingCartSkuItemList,
"storeId": storeId,
"storeName": storeName,
"tableId": tableId,
};
}
/// buyNum : 0
/// createTime : ""
/// groupId : 0
/// id : 0
/// platterList : [{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}]
/// productId : 0
/// productName : ""
/// selected : 0
/// skuImg : ""
/// skuName : ""
/// skuPrice : 0
/// skuStock : 0
/// storeId : 0
/// tableId : 0
class ShoppingCartSkuItemListBean {
int buyNum;
String createTime;
int groupId;
int id;
List<PlatterListBean> platterList;
int productId;
String productName;
int selected;
String skuImg;
String skuName;
int skuPrice;
int skuStock;
int storeId;
int tableId;
static ShoppingCartSkuItemListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
ShoppingCartSkuItemListBean shoppingCartSkuItemListBean = ShoppingCartSkuItemListBean();
shoppingCartSkuItemListBean.buyNum = map['buyNum'];
shoppingCartSkuItemListBean.createTime = map['createTime'];
shoppingCartSkuItemListBean.groupId = map['groupId'];
shoppingCartSkuItemListBean.id = map['id'];
shoppingCartSkuItemListBean.platterList = List()..addAll(
(map['platterList'] as List ?? []).map((o) => PlatterListBean.fromJson(o))
);
shoppingCartSkuItemListBean.productId = map['productId'];
shoppingCartSkuItemListBean.productName = map['productName'];
shoppingCartSkuItemListBean.selected = map['selected'];
shoppingCartSkuItemListBean.skuImg = map['skuImg'];
shoppingCartSkuItemListBean.skuName = map['skuName'];
shoppingCartSkuItemListBean.skuPrice = map['skuPrice'];
shoppingCartSkuItemListBean.skuStock = map['skuStock'];
shoppingCartSkuItemListBean.storeId = map['storeId'];
shoppingCartSkuItemListBean.tableId = map['tableId'];
return shoppingCartSkuItemListBean;
}
Map toJson() => {
"buyNum": buyNum,
"createTime": createTime,
"groupId": groupId,
"id": id,
"platterList": platterList,
"productId": productId,
"productName": productName,
"selected": selected,
"skuImg": skuImg,
"skuName": skuName,
"skuPrice": skuPrice,
"skuStock": skuStock,
"storeId": storeId,
"tableId": tableId,
};
}
/// deleted : true
/// id : 0
/// productId : 0
/// required : true
/// skuId : 0
class PlatterListBean {
bool deleted;
int id;
int productId;
bool required;
int skuId;
static PlatterListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
PlatterListBean platterListBean = PlatterListBean();
platterListBean.deleted = map['deleted'];
platterListBean.id = map['id'];
platterListBean.productId = map['productId'];
platterListBean.required = map['required'];
platterListBean.skuId = map['skuId'];
return platterListBean;
}
Map toJson() => {
"deleted": deleted,
"id": id,
"productId": productId,
"required": required,
"skuId": skuId,
};
}