coupon_model_page.dart 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. class CouponModelPage {
  2. List<Records> records;
  3. int total;
  4. int size;
  5. int current;
  6. bool searchCount;
  7. int pages;
  8. CouponModelPage(
  9. {this.records,
  10. this.total,
  11. this.size,
  12. this.current,
  13. this.searchCount,
  14. this.pages});
  15. CouponModelPage.fromJson(Map<String, dynamic> json) {
  16. if (json['records'] != null) {
  17. records = new List<Records>();
  18. json['records'].forEach((v) {
  19. records.add(new Records.fromJson(v));
  20. });
  21. }
  22. total = json['total'];
  23. size = json['size'];
  24. current = json['current'];
  25. searchCount = json['searchCount'];
  26. pages = json['pages'];
  27. }
  28. Map<String, dynamic> toJson() {
  29. final Map<String, dynamic> data = new Map<String, dynamic>();
  30. if (this.records != null) {
  31. data['records'] = this.records.map((v) => v.toJson()).toList();
  32. }
  33. data['total'] = this.total;
  34. data['size'] = this.size;
  35. data['current'] = this.current;
  36. data['searchCount'] = this.searchCount;
  37. data['pages'] = this.pages;
  38. return data;
  39. }
  40. }
  41. class Records {
  42. int id;
  43. int createTime;
  44. String createBy;
  45. int updateTime;
  46. String updateBy;
  47. String userId;
  48. int orderId;
  49. int couponId;
  50. int usedFlag;
  51. String orderNo;
  52. Coupon coupon;
  53. Records(
  54. {this.id,
  55. this.createTime,
  56. this.createBy,
  57. this.updateTime,
  58. this.updateBy,
  59. this.userId,
  60. this.orderId,
  61. this.couponId,
  62. this.usedFlag,
  63. this.orderNo,
  64. this.coupon});
  65. Records.fromJson(Map<String, dynamic> json) {
  66. id = json['id'];
  67. createTime = json['createTime'];
  68. createBy = json['createBy'];
  69. updateTime = json['updateTime'];
  70. updateBy = json['updateBy'];
  71. userId = json['userId'];
  72. orderId = json['orderId'];
  73. couponId = json['couponId'];
  74. usedFlag = json['usedFlag'];
  75. orderNo = json['orderNo'];
  76. coupon =
  77. json['coupon'] != null ? new Coupon.fromJson(json['coupon']) : null;
  78. }
  79. Map<String, dynamic> toJson() {
  80. final Map<String, dynamic> data = new Map<String, dynamic>();
  81. data['id'] = this.id;
  82. data['createTime'] = this.createTime;
  83. data['createBy'] = this.createBy;
  84. data['updateTime'] = this.updateTime;
  85. data['updateBy'] = this.updateBy;
  86. data['userId'] = this.userId;
  87. data['orderId'] = this.orderId;
  88. data['couponId'] = this.couponId;
  89. data['usedFlag'] = this.usedFlag;
  90. data['orderNo'] = this.orderNo;
  91. if (this.coupon != null) {
  92. data['coupon'] = this.coupon.toJson();
  93. }
  94. return data;
  95. }
  96. }
  97. class Coupon {
  98. int id;
  99. int createTime;
  100. String createBy;
  101. int updateTime;
  102. String updateBy;
  103. String name;
  104. int type;
  105. double discount;
  106. double price;
  107. double fullReduction;
  108. int scenario;
  109. int validity;
  110. int statuz;
  111. int checkFalg;
  112. String reason;
  113. String remark;
  114. Coupon(
  115. {this.id,
  116. this.createTime,
  117. this.createBy,
  118. this.updateTime,
  119. this.updateBy,
  120. this.name,
  121. this.type,
  122. this.discount,
  123. this.price,
  124. this.fullReduction,
  125. this.scenario,
  126. this.validity,
  127. this.statuz,
  128. this.checkFalg,
  129. this.reason,
  130. this.remark});
  131. Coupon.fromJson(Map<String, dynamic> json) {
  132. id = json['id'];
  133. createTime = json['createTime'];
  134. createBy = json['createBy'];
  135. updateTime = json['updateTime'];
  136. updateBy = json['updateBy'];
  137. name = json['name'];
  138. type = json['type'];
  139. discount = json['discount'];
  140. price = json['price'];
  141. fullReduction = json['fullReduction'];
  142. scenario = json['scenario'];
  143. validity = json['validity'];
  144. statuz = json['statuz'];
  145. checkFalg = json['checkFalg'];
  146. reason = json['reason'];
  147. remark = json['remark'];
  148. }
  149. Map<String, dynamic> toJson() {
  150. final Map<String, dynamic> data = new Map<String, dynamic>();
  151. data['id'] = this.id;
  152. data['createTime'] = this.createTime;
  153. data['createBy'] = this.createBy;
  154. data['updateTime'] = this.updateTime;
  155. data['updateBy'] = this.updateBy;
  156. data['name'] = this.name;
  157. data['type'] = this.type;
  158. data['discount'] = this.discount;
  159. data['price'] = this.price;
  160. data['fullReduction'] = this.fullReduction;
  161. data['scenario'] = this.scenario;
  162. data['validity'] = this.validity;
  163. data['statuz'] = this.statuz;
  164. data['checkFalg'] = this.checkFalg;
  165. data['reason'] = this.reason;
  166. data['remark'] = this.remark;
  167. return data;
  168. }
  169. }