models.dart 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. //登录
  2. class Login{
  3. bool success;
  4. int code;
  5. String msg;
  6. LoginMap data;
  7. Login({this.success,this.code,this.msg,this.data});
  8. factory Login.fromJson(Map<String,dynamic> json){
  9. LoginMap tempData = LoginMap.fromJson(json['data']);
  10. return Login(
  11. success: json['success'],
  12. code:json['code'],
  13. msg:json['msg'],
  14. data:tempData
  15. );
  16. }
  17. }
  18. class LoginMap {
  19. String avatarUrl;
  20. String nickName;
  21. int roleType;
  22. String userId;
  23. int status;
  24. String token;
  25. LoginMap({
  26. this.userId,
  27. this.avatarUrl,
  28. this.nickName,
  29. this.roleType,
  30. this.status,
  31. this.token
  32. });
  33. factory LoginMap.fromJson(Map < String, dynamic > json) {
  34. return LoginMap(
  35. avatarUrl: json['avatarUrl'],
  36. nickName: json['nickName'],
  37. roleType: json['roleType'],
  38. userId: json['userId'],
  39. status: json['status'],
  40. token: json['token'],
  41. );
  42. }
  43. }
  44. //接单页列表
  45. class OrderListObj {
  46. List < OrderList > orderList;
  47. bool hasNextPage;
  48. OrderListObj({
  49. this.hasNextPage,
  50. this.orderList
  51. });
  52. factory OrderListObj.fromJson(Map < String, dynamic > json) {
  53. List list = json['items'] as List;
  54. List < OrderList > tempOrderList = list.map((i) => OrderList.fromJson(i)).toList();
  55. return OrderListObj(
  56. hasNextPage: json['hasNextPage'],
  57. orderList: tempOrderList
  58. );
  59. }
  60. }
  61. class OrderList {
  62. int id;
  63. int orderNo;
  64. String createTime;
  65. String startAddress;
  66. String endAddress;
  67. String itemName;
  68. int itemNo;
  69. String sendPhone;
  70. String sendAddress;
  71. String getPhone;
  72. String getAddress;
  73. OrderList({
  74. this.id,
  75. this.orderNo,
  76. this.createTime,
  77. this.startAddress,
  78. this.endAddress,
  79. this.itemName,
  80. this.itemNo,
  81. this.sendPhone,
  82. this.sendAddress,
  83. this.getPhone,
  84. this.getAddress
  85. });
  86. factory OrderList.fromJson(Map < String, dynamic > json) {
  87. return OrderList(
  88. id: json['id'],
  89. orderNo: json['orderNo'],
  90. createTime: json['createTime'],
  91. startAddress: json['startAddress'],
  92. endAddress: json['endAddress'],
  93. itemName: json['itemName'],
  94. itemNo: json['itemNo'],
  95. sendPhone: json['sendPhone'],
  96. sendAddress: json['sendAddress'],
  97. getPhone: json['getPhone'],
  98. getAddress: json['getAddress']
  99. );
  100. }
  101. }
  102. //获取站点
  103. class Station{
  104. bool success;
  105. int code;
  106. String msg;
  107. List<StationList> data;
  108. Station({this.success,this.code,this.msg,this.data});
  109. factory Station.fromJson(Map<String,dynamic> json){
  110. List list = json['data'] as List;
  111. print(list);
  112. List<StationList> tempList = list.map((i)=>StationList.fromJson(i)).toList();
  113. print(tempList);
  114. return Station(
  115. success: json['success'],
  116. code:json['code'],
  117. msg:json['msg'],
  118. data:tempList
  119. );
  120. }
  121. }
  122. class StationList{
  123. String code;
  124. int id;
  125. String name;
  126. int stationStatus;
  127. int status;
  128. StationList({this.code,this.id,this.name,this.stationStatus,this.status});
  129. factory StationList.fromJson(Map<String,dynamic> json){
  130. return StationList(
  131. code:json['code'],
  132. id:json['id'],
  133. name:json['name'],
  134. stationStatus: json['stationStatus'],
  135. status: json['status']
  136. );
  137. }
  138. }
  139. //站点线路
  140. class StationLine{
  141. bool success;
  142. int code;
  143. String msg;
  144. List<LineObj> data;
  145. StationLine({this.success,this.code,this.msg,this.data});
  146. factory StationLine.fromJson(Map<String,dynamic> json){
  147. var list = json['data'] as List;
  148. List<LineObj> tempList = list.map((i)=>LineObj.fromJson(i)).toList();
  149. return StationLine(
  150. success: json['success'],
  151. code:json['code'],
  152. msg:json['msg'],
  153. data:tempList
  154. );
  155. }
  156. }
  157. class LineObj{
  158. String code;
  159. int id;
  160. String name;
  161. LineObj({this.code,this.name,this.id});
  162. factory LineObj.fromJson(Map<String,dynamic> json){
  163. return LineObj(
  164. code:json['code'],
  165. id:json['id'],
  166. name:json['name']
  167. );
  168. }
  169. }