models.dart 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. //登录
  2. class Login {
  3. bool success;
  4. int code;
  5. String msg;
  6. LoginMap data;
  7. Login({
  8. this.success,
  9. this.code,
  10. this.msg,
  11. this.data
  12. });
  13. factory Login.fromJson(Map < String, dynamic > json) {
  14. LoginMap tempData = LoginMap.fromJson(json['data']);
  15. return Login(
  16. success: json['success'],
  17. code: json['code'],
  18. msg: json['msg'],
  19. data: tempData
  20. );
  21. }
  22. }
  23. class LoginMap {
  24. String avatarUrl;
  25. String nickName;
  26. int roleType;
  27. String userId;
  28. int status;
  29. String token;
  30. LoginMap({
  31. this.userId,
  32. this.avatarUrl,
  33. this.nickName,
  34. this.roleType,
  35. this.status,
  36. this.token
  37. });
  38. factory LoginMap.fromJson(Map < String, dynamic > json) {
  39. return LoginMap(
  40. avatarUrl: json['avatarUrl'],
  41. nickName: json['nickName'],
  42. roleType: json['roleType'],
  43. userId: json['userId'],
  44. status: json['status'],
  45. token: json['token'],
  46. );
  47. }
  48. }
  49. //接单页列表
  50. class OrderListObj {
  51. bool success;
  52. int code;
  53. String msg;
  54. OrderListData data;
  55. OrderListObj({
  56. this.success,
  57. this.code,
  58. this.msg,
  59. this.data
  60. });
  61. factory OrderListObj.fromJson(Map < String, dynamic > json) {
  62. return OrderListObj(
  63. success: json['success'],
  64. code: json['code'],
  65. msg: json['msg'],
  66. data: OrderListData.fromJson(json['data'])
  67. );
  68. }
  69. }
  70. class OrderListData {
  71. bool hasNextPage;
  72. List < OrderList > items;
  73. int limit;
  74. int page;
  75. int totalCount;
  76. int totalPage;
  77. OrderListData({
  78. this.hasNextPage,
  79. this.items,
  80. this.limit,
  81. this.page,
  82. this.totalCount,
  83. this.totalPage
  84. });
  85. factory OrderListData.fromJson(Map < String, dynamic > json) {
  86. List list = json['items'] as List;
  87. List < OrderList > tempOrderList = list.map((i) => OrderList.fromJson(i)).toList();
  88. return OrderListData(
  89. hasNextPage: json['hasNextPage'],
  90. items: tempOrderList,
  91. limit: json['limit'],
  92. page: json['page'],
  93. totalCount: json['totalCount'],
  94. totalPage: json['totalPage']
  95. );
  96. }
  97. }
  98. class OrderList {
  99. String orderNo;
  100. int createTime;
  101. String goods;
  102. int goodsQuantity;
  103. String receiptCompanyAddress;
  104. String receiptCompanyName;
  105. String receiptCompanyPhone;
  106. String sendCompanyAddress;
  107. String sendCompanyName;
  108. String sendCompanyPhone;
  109. OrderList({
  110. this.orderNo,
  111. this.createTime,
  112. this.goods,
  113. this.goodsQuantity,
  114. this.receiptCompanyAddress,
  115. this.receiptCompanyName,
  116. this.receiptCompanyPhone,
  117. this.sendCompanyAddress,
  118. this.sendCompanyName,
  119. this.sendCompanyPhone
  120. });
  121. factory OrderList.fromJson(Map < String, dynamic > json) {
  122. return OrderList(
  123. orderNo: json['orderNo'],
  124. createTime: json['createTime'],
  125. goods: json['goods'],
  126. goodsQuantity: json['goodsQuantity'],
  127. receiptCompanyAddress: json['receiptCompanyAddress'],
  128. receiptCompanyName: json['receiptCompanyName'],
  129. receiptCompanyPhone: json['receiptCompanyPhone'],
  130. sendCompanyAddress: json['sendCompanyAddress'],
  131. sendCompanyName: json['sendCompanyName'],
  132. sendCompanyPhone: json['sendCompanyPhone']
  133. );
  134. }
  135. }
  136. //获取站点
  137. class Station {
  138. bool success;
  139. int code;
  140. String msg;
  141. List < StationList > data;
  142. Station({
  143. this.success,
  144. this.code,
  145. this.msg,
  146. this.data
  147. });
  148. factory Station.fromJson(Map < String, dynamic > json) {
  149. List list = json['data'] as List;
  150. print(list.toString());
  151. List < StationList > tempList = list.map((i) => StationList.fromJson(i)).toList();
  152. return Station(
  153. success: json['success'],
  154. code: json['code'],
  155. msg: json['msg'],
  156. data: tempList
  157. );
  158. }
  159. }
  160. class StationList {
  161. String code;
  162. int id;
  163. String name;
  164. int stationStatus;
  165. int status;
  166. StationList({
  167. this.code,
  168. this.id,
  169. this.name,
  170. this.stationStatus,
  171. this.status
  172. });
  173. factory StationList.fromJson(Map < String, dynamic > json) {
  174. return StationList(
  175. code: json['code'],
  176. id: json['id'],
  177. name: json['name'],
  178. stationStatus: json['stationStatus'],
  179. status: json['status']
  180. );
  181. }
  182. }
  183. //站点线路
  184. class StationLine {
  185. bool success;
  186. int code;
  187. String msg;
  188. List < LineObj > data;
  189. StationLine({
  190. this.success,
  191. this.code,
  192. this.msg,
  193. this.data
  194. });
  195. factory StationLine.fromJson(Map < String, dynamic > json) {
  196. var list = json['data'] as List;
  197. List < LineObj > tempList = list.map((i) => LineObj.fromJson(i)).toList();
  198. return StationLine(
  199. success: json['success'],
  200. code: json['code'],
  201. msg: json['msg'],
  202. data: tempList
  203. );
  204. }
  205. }
  206. class LineObj {
  207. String code;
  208. int id;
  209. String name;
  210. LineObj({
  211. this.code,
  212. this.name,
  213. this.id
  214. });
  215. factory LineObj.fromJson(Map < String, dynamic > json) {
  216. return LineObj(
  217. code: json['code'],
  218. id: json['id'],
  219. name: json['name']
  220. );
  221. }
  222. }
  223. //修改密码
  224. class UpdataPasswrod {
  225. bool success;
  226. int code;
  227. String msg;
  228. String data;
  229. UpdataPasswrod({
  230. this.success,
  231. this.code,
  232. this.msg,
  233. this.data
  234. });
  235. factory UpdataPasswrod.fromJson(Map < String, dynamic > json) {
  236. return UpdataPasswrod(
  237. success: json['success'],
  238. code: json['code'],
  239. msg: json['msg'],
  240. data: json['data']
  241. );
  242. }
  243. }