profile.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. const mockjs = require("mockjs");
  2. const basicGoods = [
  3. {
  4. id: "1234561",
  5. name: "矿泉水 550ml",
  6. barcode: "12421432143214321",
  7. price: "2.00",
  8. num: "1",
  9. amount: "2.00"
  10. },
  11. {
  12. id: "1234562",
  13. name: "凉茶 300ml",
  14. barcode: "12421432143214322",
  15. price: "3.00",
  16. num: "2",
  17. amount: "6.00"
  18. },
  19. {
  20. id: "1234563",
  21. name: "好吃的薯片",
  22. barcode: "12421432143214323",
  23. price: "7.00",
  24. num: "4",
  25. amount: "28.00"
  26. },
  27. {
  28. id: "1234564",
  29. name: "特别好吃的蛋卷",
  30. barcode: "12421432143214324",
  31. price: "8.50",
  32. num: "3",
  33. amount: "25.50"
  34. }
  35. ];
  36. const basicProgress = [
  37. {
  38. key: "1",
  39. time: "2017-10-01 14:10",
  40. rate: "联系客户",
  41. status: "processing",
  42. operator: "取货员 ID1234",
  43. cost: "5mins"
  44. },
  45. {
  46. key: "2",
  47. time: "2017-10-01 14:05",
  48. rate: "取货员出发",
  49. status: "success",
  50. operator: "取货员 ID1234",
  51. cost: "1h"
  52. },
  53. {
  54. key: "3",
  55. time: "2017-10-01 13:05",
  56. rate: "取货员接单",
  57. status: "success",
  58. operator: "取货员 ID1234",
  59. cost: "5mins"
  60. },
  61. {
  62. key: "4",
  63. time: "2017-10-01 13:00",
  64. rate: "申请审批通过",
  65. status: "success",
  66. operator: "系统",
  67. cost: "1h"
  68. },
  69. {
  70. key: "5",
  71. time: "2017-10-01 12:00",
  72. rate: "发起退货申请",
  73. status: "success",
  74. operator: "用户",
  75. cost: "5mins"
  76. }
  77. ];
  78. const advancedOperation1 = [
  79. {
  80. key: "op1",
  81. type: "订购关系生效",
  82. name: "曲丽丽",
  83. status: "agree",
  84. updatedAt: "2017-10-03 19:23:12",
  85. memo: "-"
  86. },
  87. {
  88. key: "op2",
  89. type: "财务复审",
  90. name: "付小小",
  91. status: "reject",
  92. updatedAt: "2017-10-03 19:23:12",
  93. memo: "不通过原因"
  94. },
  95. {
  96. key: "op3",
  97. type: "部门初审",
  98. name: "周毛毛",
  99. status: "agree",
  100. updatedAt: "2017-10-03 19:23:12",
  101. memo: "-"
  102. },
  103. {
  104. key: "op4",
  105. type: "提交订单",
  106. name: "林东东",
  107. status: "agree",
  108. updatedAt: "2017-10-03 19:23:12",
  109. memo: "很棒"
  110. },
  111. {
  112. key: "op5",
  113. type: "创建订单",
  114. name: "汗牙牙",
  115. status: "agree",
  116. updatedAt: "2017-10-03 19:23:12",
  117. memo: "-"
  118. }
  119. ];
  120. const advancedOperation2 = [
  121. {
  122. key: "op1",
  123. type: "订购关系生效",
  124. name: "曲丽丽",
  125. status: "agree",
  126. updatedAt: "2017-10-03 19:23:12",
  127. memo: "-"
  128. }
  129. ];
  130. const advancedOperation3 = [
  131. {
  132. key: "op1",
  133. type: "创建订单",
  134. name: "汗牙牙",
  135. status: "agree",
  136. updatedAt: "2017-10-03 19:23:12",
  137. memo: "-"
  138. }
  139. ];
  140. const getProfileAdvancedData = {
  141. advancedOperation1,
  142. advancedOperation2,
  143. advancedOperation3
  144. };
  145. const { Random } = mockjs;
  146. module.exports = {
  147. "GET /api/profile/advanced": getProfileAdvancedData,
  148. "GET /api/profile/basic": (req, res) => {
  149. const { id } = req.query;
  150. const application = {
  151. id,
  152. status: "已取货",
  153. orderNo: Random.id(),
  154. childOrderNo: Random.id()
  155. };
  156. const userInfo = {
  157. name: Random.cname(),
  158. tel: "18100000000",
  159. delivery: "菜鸟物流",
  160. addr: "浙江省杭州市西湖区万塘路18号",
  161. remark: "备注"
  162. };
  163. res.json({
  164. userInfo,
  165. application,
  166. basicGoods,
  167. basicProgress
  168. });
  169. }
  170. };