order.service.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /**
  2. * 这是与购物有关的业务逻辑的服务
  3. */
  4. export default class OrderService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'OrderService'
  8. }
  9. /* 查询订单列表 */
  10. QueryOrderList (data = {}) {
  11. return this.AjaxService.get({ url:'/order/list', data, isLoading: true })
  12. }
  13. /* 查询订单详情 */
  14. QueryOrderDetails (data = {}) {
  15. return this.AjaxService.get({ url:'/order/detail', data, isLoading: true })
  16. }
  17. /* 操作取消订单 */
  18. CancelOrder (data = {}) {
  19. return this.AjaxService.get({ url:'/order/cancel', data, isLoading: true })
  20. }
  21. /* 操作删除订单 */
  22. DeleteOrder (data = {}) {
  23. return this.AjaxService.get({ url:'/order/delete', data, isLoading: true })
  24. }
  25. /* 确认订单操作 */
  26. AffirmOrder (data = {}) {
  27. return this.AjaxService.post({ url:'/order/affirmOrder', data, isLoading: true })
  28. }
  29. /* 确认收货操作 */
  30. ConfirmReceipt (data = {}) {
  31. return this.AjaxService.get({ url:'/order/affirm', data, isLoading: true })
  32. }
  33. /* 确认收货操作 */
  34. QueryLogistics (data = {}) {
  35. return this.AjaxService.get({ url:'/order/logistics', data, isLoading: true })
  36. }
  37. /**
  38. *获取订单分享码
  39. * @param orderID
  40. */
  41. QueryOrderShareCode (data = {}) {
  42. return this.AjaxService.get({ url:'/order/share', data, isLoading: true })
  43. }
  44. /**
  45. *获取订单分享码
  46. * @param orderID
  47. */
  48. OrderShareCode (data = {}) {
  49. return this.AjaxService.get({ url:'/order/shareCode', data, isLoading: true,isStatus: true })
  50. }
  51. /**
  52. *机构搜索订单
  53. *@param searchWord 关键词
  54. *@param userId 用户ID
  55. *@param pageNum 页码
  56. *@param pageSize 条数
  57. */
  58. SearchOrderInfo (data = {}) {
  59. return this.AjaxService.get({ url:'/order/search', data, isLoading: true })
  60. }
  61. /**
  62. *搜索订单历史记录
  63. * @param orderID
  64. */
  65. SearchOrderHistory (data = {}) {
  66. return this.AjaxService.get({ url:'/order/searchHistory', data, isLoading: false })
  67. }
  68. /**
  69. *清楚订单历史记录
  70. * @param orderID
  71. */
  72. ClearOrderHistory (data = {}) {
  73. return this.AjaxService.get({ url:'/order/searchHistory/delete', data, isLoading: true })
  74. }
  75. /**
  76. *@机构-商品立即购买确认订单初始化数据
  77. *@param userId 用户ID
  78. *@param productCount 商品数量
  79. *@param productId 商品ID
  80. *@param source 来源
  81. */
  82. ProductCreateOrderInfo (data = {}) {
  83. return this.AjaxService.get({
  84. url:'/order/club/product/settlement',
  85. data,
  86. isLoading: true ,
  87. isHost:true
  88. })
  89. }
  90. /**
  91. *@机构-购物车去结算确认订单初始化数据
  92. *@param userId 用户ID
  93. *@param source 来源
  94. *@param productIds 商品IDs
  95. */
  96. CartCreateOrderInfo (data = {}) {
  97. return this.AjaxService.get({
  98. url:'/order/club/cart/settlement',
  99. data,
  100. isLoading: true ,
  101. isHost:true
  102. })
  103. }
  104. /**
  105. *@确认订单-获取邮费信息
  106. *@param productIds 商品ID【”,”分割】
  107. *@param totalPrice 商品总额
  108. *@param userId 用户ID
  109. *@param townID 地址区ID
  110. */
  111. GetOrderPostage (data = {}) {
  112. return this.AjaxService.get({
  113. url:'/order/club/postage',
  114. data,
  115. isLoading: false ,
  116. isHost:true
  117. })
  118. }
  119. /**
  120. *@确认订单-获取发票信息
  121. *@param userId 用户ID
  122. */
  123. GetFindInvoice (data = {}) {
  124. return this.AjaxService.get({
  125. url:'/order/club/invoice',
  126. data,
  127. isLoading: false ,
  128. isHost:true
  129. })
  130. }
  131. /**
  132. *@确认订单-保存发票信息
  133. *@param userId 用户ID
  134. */
  135. UpdateInvoice (data = {}) {
  136. return this.AjaxService.post({
  137. url:'/order/club/invoice/update',
  138. data,
  139. isLoading: true ,
  140. isHost:true
  141. })
  142. }
  143. /* 提交订单 orderId 订单ID */
  144. CreatedOrderSubmit (data = {}) {
  145. return this.AjaxService.post({
  146. url:'/order/submit/generate',
  147. data,
  148. isLoading: true ,
  149. isHost:true
  150. })
  151. }
  152. /* 订单支付,效验付款规则 orderId 订单ID */
  153. OrderPaymentValidation (data = {}) {
  154. return this.AjaxService.get({ url:'/order/paymentValidation', data, isLoading: false })
  155. }
  156. /* 余额抵扣 orderId 订单ID */
  157. OrderBalanceDeduction (data = {}) {
  158. return this.AjaxService.post({ url:'/order/balanceDeduction', data, isLoading: false })
  159. }
  160. /* 分享订单初始化查询 orderId 订单ID */
  161. OrderCommodityData (data = {}) {
  162. return this.AjaxService.get({ url:'/order/commodityData', data, isLoading: true })
  163. }
  164. /*二手订单 打款供应商 */
  165. confirmpayment (data = {}) {
  166. return this.AjaxService.post({ url:'/order/affirm/payment', data, isLoading: true })
  167. }
  168. }