order.service.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * 这是与购物有关的业务逻辑的服务
  3. */
  4. export default class OrderService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'OrderService'
  8. }
  9. /**
  10. *@机构-确认订单初始化数据
  11. *@param userId 用户ID
  12. *@param count 商品数量
  13. *@param productIds 商品IDs
  14. */
  15. CreateOrderInfo (data = {}) {
  16. return this.AjaxService.get({ url:'/order/confirm', data, isLoading: true })
  17. }
  18. /**
  19. *@确认订单-获取邮费信息
  20. *@param productIds 商品ID【”,”分割】
  21. *@param totalPrice 商品总额
  22. *@param userId 用户ID
  23. *@param townID 地址区ID
  24. */
  25. GetOrderPostage (data = {}) {
  26. return this.AjaxService.get({ url:'/order/postage', data, isLoading: false })
  27. }
  28. /* 提交订单 orderId 订单ID */
  29. CreatedOrderSubmit (data = {}) {
  30. return this.AjaxService.post({ url:'/order/submit', data, isLoading: true })
  31. }
  32. /* 订单支付,效验付款规则 orderId 订单ID */
  33. OrderPaymentValidation (data = {}) {
  34. return this.AjaxService.get({ url:'/order/paymentValidation', data, isLoading: false })
  35. }
  36. /* 余额抵扣 orderId 订单ID */
  37. OrderBalanceDeduction (data = {}) {
  38. return this.AjaxService.post({ url:'/order/balanceDeduction', data, isLoading: false })
  39. }
  40. /* 分享订单初始化查询 orderId 订单ID */
  41. OrderCommodityData (data = {}) {
  42. return this.AjaxService.get({ url:'/order/commodityData', data, isLoading: true })
  43. }
  44. }