order.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. import request from '@/sheep/request';
  2. export default {
  3. // 订单详情
  4. detail: (id) =>
  5. request({
  6. url: 'order.order/detail',
  7. method: 'GET',
  8. params: {
  9. id: id,
  10. },
  11. }),
  12. // 发票详情
  13. invoice: (id) =>
  14. request({
  15. url: 'order.invoice/detail',
  16. method: 'GET',
  17. params: {
  18. id: id,
  19. },
  20. }),
  21. // 获取支付结果
  22. // payResult: (id) =>
  23. // request({
  24. // url: 'order/order/' + id,
  25. // method: 'GET',
  26. // custom: {
  27. // showLoading: false,
  28. // },
  29. // }),
  30. // 订单item详情
  31. itemDetail: (params) =>
  32. request({
  33. url: 'order.order/itemDetail',
  34. method: 'GET',
  35. params,
  36. custom: {
  37. showLoading: false,
  38. },
  39. }),
  40. // 订单列表
  41. list: (params) =>
  42. request({
  43. url: 'order.order',
  44. method: 'GET',
  45. params,
  46. custom: {
  47. showLoading: false,
  48. },
  49. }),
  50. // 计算订单信息
  51. calc: (data) =>
  52. request({
  53. url: 'order.order/calc',
  54. method: 'POST',
  55. data,
  56. }),
  57. // 创建订单
  58. create: (data) =>
  59. request({
  60. url: 'order.order/create',
  61. method: 'POST',
  62. data,
  63. }),
  64. //订单可用优惠券
  65. coupons: (data) =>
  66. request({
  67. url: 'order.order/coupons',
  68. method: 'POST',
  69. data,
  70. }),
  71. // 确认收货
  72. confirm: (id) =>
  73. request({
  74. url: 'order.order/confirm',
  75. method: 'POST',
  76. params: {
  77. id: id,
  78. },
  79. }),
  80. // 评价订单
  81. comment: (id, data) =>
  82. request({
  83. url: 'order.order/comment',
  84. method: 'POST',
  85. params: {
  86. id: id,
  87. },
  88. data,
  89. }),
  90. // 申请退款
  91. applyRefund: (id) =>
  92. request({
  93. url: 'order.order/applyRefund',
  94. method: 'POST',
  95. params: {
  96. id: id,
  97. },
  98. }),
  99. // 取消订单
  100. cancel: (id) =>
  101. request({
  102. url: 'order.order/cancel',
  103. method: 'POST',
  104. params: {
  105. id: id,
  106. },
  107. }),
  108. // 删除订单
  109. delete: (id) =>
  110. request({
  111. url: 'order.order/delete',
  112. method: 'DELETE',
  113. params: {
  114. id: id,
  115. },
  116. }),
  117. // 售后
  118. aftersale: {
  119. // 申请售后
  120. apply: (data) =>
  121. request({
  122. url: 'order.aftersale/add',
  123. method: 'POST',
  124. data,
  125. }),
  126. list: (params) =>
  127. request({
  128. url: 'order.aftersale',
  129. method: 'GET',
  130. params,
  131. custom: {
  132. showLoading: false,
  133. },
  134. }),
  135. //取消售后
  136. cancel: (id) =>
  137. request({
  138. url: 'order.aftersale/cancel',
  139. method: 'POST',
  140. params: {
  141. id: id,
  142. },
  143. }),
  144. //删除售后单
  145. delete: (id) =>
  146. request({
  147. url: 'order.aftersale/delete',
  148. method: 'DELETE',
  149. params: {
  150. id: id,
  151. },
  152. }),
  153. // 售后详情
  154. detail: (id) =>
  155. request({
  156. url: 'order.aftersale/detail',
  157. method: 'GET',
  158. params: {
  159. id: id,
  160. },
  161. }),
  162. },
  163. //订单包裹
  164. express: {
  165. detail: (id, orderId) =>
  166. request({
  167. url: 'order.express/detail',
  168. method: 'GET',
  169. params: {
  170. id: id,
  171. order_id: orderId,
  172. },
  173. }),
  174. list: (orderId) =>
  175. request({
  176. url: 'order.express',
  177. method: 'GET',
  178. params: {
  179. order_id: orderId,
  180. },
  181. custom: {
  182. showLoading: false,
  183. },
  184. }),
  185. },
  186. };