order.service.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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 orderID
  100. */
  101. OrderShareCodeIdentity (data = {}) {
  102. return this.AjaxService.get({
  103. url:'/order/club/share/code/identity',
  104. data,
  105. isLoading: true,
  106. isStatus: true ,
  107. isHost:true
  108. })
  109. }
  110. /**
  111. *机构搜索订单
  112. *@param searchWord 关键词
  113. *@param userId 用户ID
  114. *@param pageNum 页码
  115. *@param pageSize 条数
  116. */
  117. SearchOrderInfo (data = {}) {
  118. return this.AjaxService.get({
  119. url:'/order/club/search',
  120. data,
  121. isLoading: true ,
  122. isHost:true
  123. })
  124. }
  125. /**
  126. *搜索订单历史记录
  127. * @param orderID
  128. */
  129. SearchOrderHistory (data = {}) {
  130. return this.AjaxService.get({
  131. url:'/order/club/search/history',
  132. data,
  133. isLoading: false ,
  134. isHost:true
  135. })
  136. }
  137. /**
  138. *清楚订单历史记录
  139. * @param orderID
  140. */
  141. ClearOrderHistory (data = {}) {
  142. return this.AjaxService.get({
  143. url:'/order/club/search/history/delete',
  144. data,
  145. isLoading: true ,
  146. isHost:true
  147. })
  148. }
  149. /**
  150. *@机构-商品立即购买确认订单初始化数据
  151. *@param userId 用户ID
  152. *@param productCount 商品数量
  153. *@param productId 商品ID
  154. *@param source 来源
  155. */
  156. ProductCreateOrderInfo (data = {}) {
  157. return this.AjaxService.get({
  158. url:'/order/club/product/settlement',
  159. data,
  160. isLoading: true ,
  161. isHost:true
  162. })
  163. }
  164. /**
  165. *@机构-购物车去结算确认订单初始化数据
  166. *@param userId 用户ID
  167. *@param source 来源
  168. *@param productIds 商品IDs
  169. */
  170. CartCreateOrderInfo (data = {}) {
  171. return this.AjaxService.get({
  172. url:'/order/club/cart/settlement',
  173. data,
  174. isLoading: true ,
  175. isHost:true
  176. })
  177. }
  178. /**
  179. *@确认订单-获取邮费信息
  180. *@param productIds 商品ID【”,”分割】
  181. *@param totalPrice 商品总额
  182. *@param userId 用户ID
  183. *@param townID 地址区ID
  184. */
  185. GetOrderPostage (data = {}) {
  186. return this.AjaxService.get({
  187. url:'/order/club/postage',
  188. data,
  189. isLoading: false ,
  190. isHost:true
  191. })
  192. }
  193. /**
  194. *@确认订单-获取发票信息
  195. *@param userId 用户ID
  196. */
  197. GetFindInvoice (data = {}) {
  198. return this.AjaxService.get({
  199. url:'/order/club/invoice',
  200. data,
  201. isLoading: false ,
  202. isHost:true
  203. })
  204. }
  205. /**
  206. *@确认订单-保存发票信息
  207. *@param userId 用户ID
  208. */
  209. UpdateInvoice (data = {}) {
  210. return this.AjaxService.post({
  211. url:'/order/club/invoice/update',
  212. data,
  213. isLoading: true ,
  214. isHost:true
  215. })
  216. }
  217. /* 提交订单 orderId 订单ID */
  218. CreatedOrderSubmit (data = {}) {
  219. return this.AjaxService.post({
  220. url:'/order/submit/generate',
  221. data,
  222. isLoading: true ,
  223. isHost:true
  224. })
  225. }
  226. /* 订单支付,效验付款规则 orderId 订单ID */
  227. OrderPaymentValidation (data = {}) {
  228. return this.AjaxService.get({
  229. url:'/order/pay/check',
  230. data,
  231. isLoading: false ,
  232. isHost:true
  233. })
  234. }
  235. /* 余额抵扣 orderId 订单ID */
  236. OrderBalanceDeduction (data = {}) {
  237. return this.AjaxService.post({
  238. url:'/order/pay/balance/deduction',
  239. data,
  240. isLoading: false ,
  241. isHost:true
  242. })
  243. }
  244. /* 分享订单初始化查询 orderId 订单ID */
  245. OrderCommodityData (data = {}) {
  246. return this.AjaxService.get({
  247. url:'/order/club/share/product',
  248. data,
  249. isLoading: true ,
  250. isHost:true
  251. })
  252. }
  253. /*二手订单 打款供应商 */
  254. confirmpayment (data = {}) {
  255. return this.AjaxService.post({
  256. url:'/order/club/second/payment/confirm',
  257. data,
  258. isLoading: true ,
  259. isHost:true
  260. })
  261. }
  262. }