order.service.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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: false ,
  15. })
  16. }
  17. /* 查询订单详情 */
  18. QueryOrderDetails (data = {}) {
  19. return this.AjaxService.get({
  20. url:'/order/club/detail',
  21. data,
  22. isLoading: true ,
  23. })
  24. }
  25. /* 操作取消订单 */
  26. CancelOrder (data = {}) {
  27. return this.AjaxService.post({
  28. url:'/order/club/cancel',
  29. data,
  30. isLoading: true ,
  31. })
  32. }
  33. /* 操作删除订单 */
  34. DeleteOrder (data = {}) {
  35. return this.AjaxService.post({
  36. url:'/order/club/delete',
  37. data,
  38. isLoading: true ,
  39. })
  40. }
  41. /* 确认订单操作 */
  42. AffirmOrder (data = {}) {
  43. return this.AjaxService.post({
  44. url:'/order/club/confirm',
  45. data,
  46. isLoading: true ,
  47. })
  48. }
  49. /* 确认收货操作 */
  50. ConfirmReceipt (data = {}) {
  51. return this.AjaxService.post({
  52. url:'/order/club/receive',
  53. data,
  54. isLoading: true ,
  55. })
  56. }
  57. /* 订单物流信息 */
  58. QueryLogistics (data = {}) {
  59. return this.AjaxService.get({
  60. url:'/order/club/logistics',
  61. data,
  62. isLoading: true ,
  63. })
  64. }
  65. /**
  66. *获取订单分享码
  67. * @param orderID
  68. */
  69. QueryOrderShareCode (data = {}) {
  70. return this.AjaxService.get({
  71. url:'/order/club/share/code',
  72. data,
  73. isLoading: false ,
  74. })
  75. }
  76. /**
  77. *校验订单分享码
  78. * @param orderID
  79. */
  80. OrderShareCode (data = {}) {
  81. return this.AjaxService.get({
  82. url:'/order/club/share/code/check',
  83. data,
  84. isLoading: true,
  85. isStatus: true ,
  86. })
  87. }
  88. /**
  89. *订单分享权限初始化
  90. * @param orderID
  91. */
  92. OrderShareCodeIdentity (data = {}) {
  93. return this.AjaxService.get({
  94. url:'/order/club/share/code/identity',
  95. data,
  96. isLoading: true,
  97. isStatus: true ,
  98. })
  99. }
  100. /**
  101. *机构搜索订单
  102. *@param searchWord 关键词
  103. *@param userId 用户ID
  104. *@param pageNum 页码
  105. *@param pageSize 条数
  106. */
  107. SearchOrderInfo (data = {}) {
  108. return this.AjaxService.get({
  109. url:'/order/club/search',
  110. data,
  111. isLoading: true ,
  112. })
  113. }
  114. /**
  115. *搜索订单历史记录
  116. * @param orderID
  117. */
  118. SearchOrderHistory (data = {}) {
  119. return this.AjaxService.get({
  120. url:'/order/club/search/history',
  121. data,
  122. isLoading: false ,
  123. })
  124. }
  125. /**
  126. *清楚订单历史记录
  127. * @param orderID
  128. */
  129. ClearOrderHistory (data = {}) {
  130. return this.AjaxService.get({
  131. url:'/order/club/search/history/delete',
  132. data,
  133. isLoading: 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. })
  149. }
  150. /**
  151. *@机构-购物车商品数量
  152. *@param userId 用户ID
  153. */
  154. ShoppingCartCount (data = {}) {
  155. return this.AjaxService.get({
  156. url:'/order/club/cart/organizeCount',
  157. data,
  158. isLoading: false ,
  159. })
  160. }
  161. /**
  162. *@机构-购物车去结算确认订单初始化数据
  163. *@param userId 用户ID
  164. *@param source 来源
  165. *@param productIds 商品IDs
  166. */
  167. CartCreateOrderInfo (data = {}) {
  168. return this.AjaxService.get({
  169. url:'/order/club/cart/settlement',
  170. data,
  171. isLoading: true ,
  172. })
  173. }
  174. /**
  175. *@确认订单-获取邮费信息
  176. *@param productIds 商品ID【”,”分割】
  177. *@param totalPrice 商品总额
  178. *@param userId 用户ID
  179. *@param townID 地址区ID
  180. */
  181. GetOrderPostage (data = {}) {
  182. return this.AjaxService.get({
  183. url:'/order/club/postage',
  184. data,
  185. isLoading: false ,
  186. })
  187. }
  188. /**
  189. *@确认订单-获取发票信息
  190. *@param userId 用户ID
  191. */
  192. GetFindInvoice (data = {}) {
  193. return this.AjaxService.get({
  194. url:'/order/club/invoice',
  195. data,
  196. isLoading: false ,
  197. })
  198. }
  199. /**
  200. *@确认订单-保存发票信息
  201. *@param userId 用户ID
  202. */
  203. UpdateInvoice (data = {}) {
  204. return this.AjaxService.post({
  205. url:'/order/club/invoice/update',
  206. data,
  207. isLoading: true ,
  208. })
  209. }
  210. /* 提交订单 购买资质的验证 */
  211. createdOrderCerify (data = {}) {
  212. return this.AjaxService.post({
  213. url:'/order/submit/verify',
  214. data,
  215. isLoading: false ,
  216. })
  217. }
  218. /* 提交订单 orderId 订单ID */
  219. CreatedOrderSubmit (data = {}) {
  220. return this.AjaxService.post({
  221. url:'/order/submit/generate',
  222. data,
  223. isLoading: 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. })
  233. }
  234. /* 余额抵扣 orderId 订单ID */
  235. OrderBalanceDeduction (data = {}) {
  236. return this.AjaxService.post({
  237. url:'/order/pay/balance/deduction',
  238. data,
  239. isLoading: false ,
  240. })
  241. }
  242. /* 分享订单初始化查询 orderId 订单ID */
  243. OrderCommodityData (data = {}) {
  244. return this.AjaxService.get({
  245. url:'/order/club/share/product',
  246. data,
  247. isLoading: true ,
  248. })
  249. }
  250. /*二手订单 打款供应商 */
  251. confirmpayment (data = {}) {
  252. return this.AjaxService.post({
  253. url:'/order/club/second/payment/confirm',
  254. data,
  255. isLoading: true ,
  256. })
  257. }
  258. /**
  259. * @组合商品多商品立即购买
  260. * @param:userId 用户ID(必填)
  261. * @param:productInfo 用户ID(必填)
  262. * @param:source 来源 1 WWW 2 小程序
  263. */
  264. OrderClubProductSupporting (data = {}) {
  265. return this.AjaxService.get({
  266. url:'/order/club/product/buynow',
  267. data,
  268. isLoading: true ,
  269. })
  270. }
  271. /**
  272. * @机构个人中心订单状态数量
  273. * @param:userId 用户ID(必填)
  274. */
  275. UserClubOrderCount (data = {}) {
  276. return this.AjaxService.get({
  277. url:'/order/club/count',
  278. data,
  279. isLoading: false ,
  280. })
  281. }
  282. }