|
|
|
import 'package:huixiang/data/coupon_list.dart';
|
|
|
|
import 'package:huixiang/data/promotion_info.dart';
|
|
|
|
import 'package:huixiang/data/set_meal_data.dart';
|
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
|
|
|
part 'shopping_cart.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable(explicitToJson: true)
|
|
|
|
class ShoppingCart {
|
|
|
|
dynamic cartSum = 0;
|
|
|
|
int? selectDiscount = 0;
|
|
|
|
int? numberOfPeople = 0;
|
|
|
|
int? selected = 0;
|
|
|
|
List<SkuItemList>? shoppingCartSkuItemList = [];
|
|
|
|
dynamic storeId = 0;
|
|
|
|
String? storeName = '';
|
|
|
|
String? tableId = '';
|
|
|
|
List<PromotionInfo>? promotionInfoList;
|
|
|
|
List<CouponList>? couponList;
|
|
|
|
|
|
|
|
ShoppingCart();
|
|
|
|
|
|
|
|
factory ShoppingCart.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$ShoppingCartFromJson(json);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => _$ShoppingCartToJson(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(explicitToJson: true)
|
|
|
|
class SkuItemList {
|
|
|
|
int? buyNum = 0;
|
|
|
|
String? createTime = '';
|
|
|
|
dynamic groupId = 0;
|
|
|
|
dynamic id = 0;
|
|
|
|
List<PlatterList>? platterList = [];
|
|
|
|
List<SetMealData>? setMealDataList = [];
|
|
|
|
String? productId = '';
|
|
|
|
String? productName = '';
|
|
|
|
int? selected = 0;
|
|
|
|
String? skuImg = '';
|
|
|
|
String? skuName = '';
|
|
|
|
String? skuPrice = '';
|
|
|
|
int? skuStock = 0;
|
|
|
|
dynamic storeId = 0;
|
|
|
|
dynamic tableId = 0;
|
|
|
|
|
|
|
|
SkuItemList();
|
|
|
|
|
|
|
|
factory SkuItemList.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$SkuItemListFromJson(json);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => _$SkuItemListToJson(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(explicitToJson: true)
|
|
|
|
class PlatterList {
|
|
|
|
bool? deleted = false;
|
|
|
|
int? id = 0;
|
|
|
|
int? productId = 0;
|
|
|
|
bool? required = false;
|
|
|
|
int? skuId = 0;
|
|
|
|
|
|
|
|
PlatterList();
|
|
|
|
|
|
|
|
factory PlatterList.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$PlatterListFromJson(json);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => _$PlatterListToJson(this);
|
|
|
|
}
|