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.
149 lines
4.4 KiB
149 lines
4.4 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 { |
|
String cartSum; |
|
int numberOfPeople; |
|
int selected; |
|
List<ShoppingCartSkuItemListBean> shoppingCartSkuItemList; |
|
String storeId; |
|
String storeName; |
|
String 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<String, dynamic> 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; |
|
String groupId; |
|
String id; |
|
List<PlatterListBean> platterList; |
|
String productId; |
|
String productName; |
|
String skuId; |
|
int selected; |
|
String skuImg; |
|
String skuName; |
|
String skuPrice; |
|
int skuStock; |
|
String storeId; |
|
String 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 = []..addAll( |
|
(map['platterList'] as List ?? []).map((o) => PlatterListBean.fromJson(o)) |
|
); |
|
shoppingCartSkuItemListBean.productId = map['productId']; |
|
shoppingCartSkuItemListBean.skuId = map['skuId']; |
|
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, |
|
"skuId": skuId, |
|
"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; |
|
String 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, |
|
}; |
|
} |