coupon.service.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * 这是所有模块公用业务逻辑的服务
  3. */
  4. export default class CouponService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'CouponService'
  8. }
  9. // 领券中心
  10. GetCouponCenterInfo(data = {}) {
  11. return this.AjaxService.get({
  12. url: '/coupon/center',
  13. data,
  14. isLoading: false,
  15. })
  16. }
  17. // 领取优惠券
  18. ReceiveCoupon(data = {}) {
  19. return this.AjaxService.post({
  20. url: '/coupon/collar',
  21. data,
  22. isLoading: false,
  23. })
  24. }
  25. // 首页优惠券弹窗展示
  26. CouponActivityPopup(data = {}) {
  27. return this.AjaxService.get({
  28. url: '/coupon/display',
  29. data,
  30. isLoading: false,
  31. })
  32. }
  33. // 优惠券部分商品数据
  34. ProductInfoByCoupon(data = {}) {
  35. return this.AjaxService.get({
  36. url: '/coupon/product/page',
  37. data,
  38. isLoading: false,
  39. })
  40. }
  41. // 统计已领取优惠券数量
  42. CouponReceiveCount(data = {}) {
  43. return this.AjaxService.get({
  44. url: '/coupon/receive/count',
  45. data,
  46. isLoading: false,
  47. })
  48. }
  49. // 已领取优惠券中心
  50. CouponReceiveList(data = {}) {
  51. return this.AjaxService.get({
  52. url: '/coupon/receive/list',
  53. data,
  54. isLoading: false,
  55. })
  56. }
  57. // 商品详情优惠券
  58. GetCouponByProduct(data = {}) {
  59. return this.AjaxService.get({
  60. url: '/coupon/product/detail',
  61. data,
  62. isLoading: false,
  63. })
  64. }
  65. // 根据商品id列表获取优惠券
  66. GetCouponByProductIds(data = {}) {
  67. return this.AjaxService.get({
  68. url: '/coupon/productIds',
  69. data,
  70. isLoading: false,
  71. })
  72. }
  73. }