/**
 * 这是所有模块公用业务逻辑的服务
 */
export default class CouponService {
    constructor(AjaxService) {
        Object.assign(this, { AjaxService })
        this.name = 'CouponService'
    }
    // 领券中心
    GetCouponCenterInfo(data = {}) {
        return this.AjaxService.get({
            url: '/coupon/center',
            data,
            isLoading: false,
        })
    }
    // 领取优惠券
    ReceiveCoupon(data = {}) {
        return this.AjaxService.post({
            url: '/coupon/collar',
            data,
            isLoading: false,
        })

    }
    // 首页优惠券弹窗展示
    CouponActivityPopup(data = {}) {
        return this.AjaxService.get({
            url: '/coupon/display',
            data,
            isLoading: false,
        })
    }
    // 优惠券部分商品数据
    ProductInfoByCoupon(data = {}) {
        return this.AjaxService.get({
            url: '/coupon/product/page',
            data,
            isLoading: false,
        })
    }
    // 统计已领取优惠券数量
    CouponReceiveCount(data = {}) {
        return this.AjaxService.get({
            url: '/coupon/receive/count',
            data,
            isLoading: false,
        })
    }
    // 已领取优惠券中心
    CouponReceiveList(data = {}) {
        return this.AjaxService.get({
            url: '/coupon/receive/list',
            data,
            isLoading: false,
        })
    }
    // 商品详情优惠券
    GetCouponByProduct(data = {}) {
        return this.AjaxService.get({
            url: '/coupon/product/detail',
            data,
            isLoading: false,
        })
    }
    // 根据商品id列表获取优惠券
    GetCouponByProductIds(data = {}) {
        return this.AjaxService.get({
            url: '/coupon/productIds',
            data,
            isLoading: false,
        })
    }
}
