product.service.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * 这是与购物有关的业务逻辑的服务
  3. */
  4. export default class ProductService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'ProductService'
  8. }
  9. /**
  10. * @商城首页-常用商品列表
  11. * @param:userId 用户ID(未登录传0或者''),
  12. * @param:preferredFlag 新品上线(001) 优惠商品(010) 常用商品(100),,
  13. * @param:pageNum 页码
  14. * @param:pageSize 每页条数
  15. */
  16. queryProductPreferred (data = {}) {
  17. return this.AjaxService.get({ url:'/product/preferred', data, isLoading: false })
  18. }
  19. /**
  20. * @商品列表-查询商品价格
  21. * @param:userId 用户ID(未登录传0或者'')
  22. * @param:productID 商品ID','符号拼接
  23. */
  24. querySearchProductPrice (data = {}) {
  25. return this.AjaxService.get({ url:'/product/listPrice', data, isLoading: false })
  26. }
  27. /**
  28. * @商品详情-查询商品详情
  29. * @param:userId 用户ID(未登录传0或者'')
  30. * @param:productIds 商品ID
  31. */
  32. queryProductDetils (data = {}) {
  33. return this.AjaxService.get({ url:'/product/details', data, isLoading: false })
  34. }
  35. /* 余额抵扣 orderId 订单ID */
  36. OrderBalanceDeduction (data = {}) {
  37. return this.AjaxService.post({ url:'/order/balanceDeduction', data, isLoading: false })
  38. }
  39. }