order.service.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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({
  12. url:'/order/club/list',
  13. data,
  14. isLoading: true ,
  15. isHost:true
  16. })
  17. }
  18. /* 查询订单详情 */
  19. QueryOrderDetails (data = {}) {
  20. return this.AjaxService.get({
  21. url:'/order/club/detail',
  22. data,
  23. isLoading: true ,
  24. isHost:true
  25. })
  26. }
  27. /* 操作取消订单 */
  28. CancelOrder (data = {}) {
  29. return this.AjaxService.post({
  30. url:'/order/club/cancel',
  31. data,
  32. isLoading: true ,
  33. isHost:true
  34. })
  35. }
  36. /* 操作删除订单 */
  37. DeleteOrder (data = {}) {
  38. return this.AjaxService.post({
  39. url:'/order/club/delete',
  40. data,
  41. isLoading: true ,
  42. isHost:true
  43. })
  44. }
  45. /* 确认订单操作 */
  46. AffirmOrder (data = {}) {
  47. return this.AjaxService.post({
  48. url:'/order/club/confirm',
  49. data,
  50. isLoading: true ,
  51. isHost:true
  52. })
  53. }
  54. /* 确认收货操作 */
  55. ConfirmReceipt (data = {}) {
  56. return this.AjaxService.post({
  57. url:'/order/club/receive',
  58. data,
  59. isLoading: true ,
  60. isHost:true
  61. })
  62. }
  63. /* 订单物流信息 */
  64. QueryLogistics (data = {}) {
  65. return this.AjaxService.get({
  66. url:'/order/club/logistics',
  67. data,
  68. isLoading: true ,
  69. isHost:true
  70. })
  71. }
  72. /**
  73. *获取订单分享码
  74. * @param orderID
  75. */
  76. QueryOrderShareCode (data = {}) {
  77. return this.AjaxService.get({
  78. url:'/order/club/share/code',
  79. data,
  80. isLoading: true ,
  81. isHost:true
  82. })
  83. }
  84. /**
  85. *校验订单分享码
  86. * @param orderID
  87. */
  88. OrderShareCode (data = {}) {
  89. return this.AjaxService.get({
  90. url:'/order/club/share/code/check',
  91. data,
  92. isLoading: true,
  93. isStatus: true ,
  94. isHost:true
  95. })
  96. }
  97. /**
  98. *机构搜索订单
  99. *@param searchWord 关键词
  100. *@param userId 用户ID
  101. *@param pageNum 页码
  102. *@param pageSize 条数
  103. */
  104. SearchOrderInfo (data = {}) {
  105. return this.AjaxService.get({
  106. url:'/order/club/search',
  107. data,
  108. isLoading: true ,
  109. isHost:true
  110. })
  111. }
  112. /**
  113. *搜索订单历史记录
  114. * @param orderID
  115. */
  116. SearchOrderHistory (data = {}) {
  117. return this.AjaxService.get({
  118. url:'/order/club/search/history',
  119. data,
  120. isLoading: false ,
  121. isHost:true
  122. })
  123. }
  124. /**
  125. *清楚订单历史记录
  126. * @param orderID
  127. */
  128. ClearOrderHistory (data = {}) {
  129. return this.AjaxService.get({
  130. url:'/order/club/search/history/delete',
  131. data,
  132. isLoading: true ,
  133. isHost:true
  134. })
  135. }
  136. /**
  137. *@机构-商品立即购买确认订单初始化数据
  138. *@param userId 用户ID
  139. *@param productCount 商品数量
  140. *@param productId 商品ID
  141. *@param source 来源
  142. */
  143. ProductCreateOrderInfo (data = {}) {
  144. return this.AjaxService.get({
  145. url:'/order/club/product/settlement',
  146. data,
  147. isLoading: true ,
  148. isHost:true
  149. })
  150. }
  151. /**
  152. *@机构-购物车去结算确认订单初始化数据
  153. *@param userId 用户ID
  154. *@param source 来源
  155. *@param productIds 商品IDs
  156. */
  157. CartCreateOrderInfo (data = {}) {
  158. return this.AjaxService.get({
  159. url:'/order/club/cart/settlement',
  160. data,
  161. isLoading: true ,
  162. isHost:true
  163. })
  164. }
  165. /**
  166. *@确认订单-获取邮费信息
  167. *@param productIds 商品ID【”,”分割】
  168. *@param totalPrice 商品总额
  169. *@param userId 用户ID
  170. *@param townID 地址区ID
  171. */
  172. GetOrderPostage (data = {}) {
  173. return this.AjaxService.get({
  174. url:'/order/club/postage',
  175. data,
  176. isLoading: false ,
  177. isHost:true
  178. })
  179. }
  180. /**
  181. *@确认订单-获取发票信息
  182. *@param userId 用户ID
  183. */
  184. GetFindInvoice (data = {}) {
  185. return this.AjaxService.get({
  186. url:'/order/club/invoice',
  187. data,
  188. isLoading: false ,
  189. isHost:true
  190. })
  191. }
  192. /**
  193. *@确认订单-保存发票信息
  194. *@param userId 用户ID
  195. */
  196. UpdateInvoice (data = {}) {
  197. return this.AjaxService.post({
  198. url:'/order/club/invoice/update',
  199. data,
  200. isLoading: true ,
  201. isHost:true
  202. })
  203. }
  204. /* 提交订单 orderId 订单ID */
  205. CreatedOrderSubmit (data = {}) {
  206. return this.AjaxService.post({
  207. url:'/order/submit/generate',
  208. data,
  209. isLoading: true ,
  210. isHost:true
  211. })
  212. }
  213. /* 订单支付,效验付款规则 orderId 订单ID */
  214. OrderPaymentValidation (data = {}) {
  215. return this.AjaxService.get({
  216. url:'/order/pay/check',
  217. data,
  218. isLoading: false ,
  219. isHost:true
  220. })
  221. }
  222. /* 余额抵扣 orderId 订单ID */
  223. OrderBalanceDeduction (data = {}) {
  224. return this.AjaxService.post({
  225. url:'/order/pay/balance/deduction',
  226. data,
  227. isLoading: false ,
  228. isHost:true
  229. })
  230. }
  231. /* 分享订单初始化查询 orderId 订单ID */
  232. OrderCommodityData (data = {}) {
  233. return this.AjaxService.get({
  234. url:'/order/club/share/product',
  235. data,
  236. isLoading: true ,
  237. isHost:true
  238. })
  239. }
  240. /*二手订单 打款供应商 */
  241. confirmpayment (data = {}) {
  242. return this.AjaxService.post({
  243. url:'/order/club/second/payment/confirm',
  244. data,
  245. isLoading: true ,
  246. isHost:true
  247. })
  248. }
  249. }