import request from '@/services/http.request.js'

/* 领券中心 */
export function fetchCouponCenterInfo(params) {
    return request({
        url: '/coupon/center',
        method: 'GET',
        params
    })
}

/* 领取优惠券 */
export function receiveCoupon(data) {
    return request({
        url: '/coupon/collar',
        method: 'POST',
        data
    })
}

/* 验证优惠券弹窗 */
export function checkCouponAlert(params) {
    return request({
        url: '/coupon/display',
        method: 'GET',
        params
    })
}

/* 获取优惠券可用商品列表 */
export function fetchProductByCoupon(params) {
    return request({
        url: '/coupon/product/page',
        method: 'GET',
        params
    })
}

/* 统计已领取优惠券数量 */
export function fetchReceivedCouponCount(params) {
    return request({
        url: '/coupon/receive/count',
        method: 'GET',
        params
    })
}

/* 获取已领取优惠券列表 */
export function fetchReceivedCouponList(params) {
    return request({
        url: '/coupon/receive/list',
        method: 'GET',
        params
    })
}

/* 获取商品可用优惠券 */
export function fetchCouponListByProductId(params) {
    return request({
        url: '/coupon/product/detail',
        method: 'GET',
        params
    })
}

/* 根据商品id列表获取优惠券 */
export function fetchCouponListByProductIds(params) {
    return request({
        url: '/coupon/productIds',
        method: 'GET',
        params
    })
}
