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.
 
 
 
 
 
 

103 lines
3.5 KiB

import 'package:huixiang/retrofit/data/store.dart';
class Coupon {
Coupon();
Coupon.test(this.couponName, this.status, this.isEx);
String id;
String createTime;
String createUser;
String updateTime;
String updateUser;
int bizType;
String fullAmount;
String discountAmount;
int discountPercent;
String bizId;
String publishStartTime;
String publishEndTime;
String useStartTime;
String useEndTime;
String promotionId;
bool centreDisplay;
bool allProduct;
String tenantCode;
String tenantName;
int isDelete;
String couponName;
String couponImg;
String couponDescription;
String memberCouponId;
String receiveTime;
String storeId;
dynamic useTime;
int status;
List<Store> storeList;
bool isEx = false;
factory Coupon.fromJson(Map<String, dynamic> json) => Coupon()
..id = json['id'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
..bizType = json['bizType'] as int
..fullAmount = json['fullAmount'] as String
..discountAmount = json['discountAmount'] as String
..discountPercent = json['discountPercent'] as int
..bizId = json['bizId'] as String
..publishStartTime = json['publishStartTime'] as String
..publishEndTime = json['publishEndTime'] as String
..useStartTime = json['useStartTime'] as String
..useEndTime = json['useEndTime'] as String
..promotionId = json['promotionId'] as String
..centreDisplay = json['centreDisplay'] as bool
..allProduct = json['allProduct'] as bool
..tenantCode = json['tenantCode'] as String
..tenantName = json['tenantName'] as String
..isDelete = json['isDelete'] as int
..couponName = json['couponName'] as String
..couponImg = json['couponImg'] as String
..couponDescription = json['couponDescription'] as String
..memberCouponId = json['memberCouponId'] as String
..receiveTime = json['receiveTime'] as String
..storeId = json['storeId'] as String
..useTime = json['useTime']
..status = json['status']
..storeList = (json['storeList'] as List<dynamic>)
.map((e) => Store.fromJson(e))
.toList();
Map<String, dynamic> toJson() => <String, dynamic>{
'id': this.id,
'createTime': this.createTime,
'createUser': this.createUser,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
'bizType': this.bizType,
'fullAmount': this.fullAmount,
'discountAmount': this.discountAmount,
'discountPercent': this.discountPercent,
'bizId': this.bizId,
'publishStartTime': this.publishStartTime,
'publishEndTime': this.publishEndTime,
'useStartTime': this.useStartTime,
'useEndTime': this.useEndTime,
'promotionId': this.promotionId,
'centreDisplay': this.centreDisplay,
'allProduct' : this.allProduct,
'tenantCode': this.tenantCode,
'tenantName': this.tenantName,
'isDelete': this.isDelete,
'couponName': this.couponName,
'couponImg': this.couponImg,
'couponDescription': this.couponDescription,
'memberCouponId': this.memberCouponId,
'receiveTime': this.receiveTime,
'storeId': this.storeId,
'useTime': this.useTime,
'status': this.status,
'storeList': (this.storeList != null && this.storeList.length > 0) ? this.storeList.map((e) => e.toJson()).toList() : []
};
}