import request from '@/utils/request'

// 查询优惠券列表
export function listStoreCoupon(query) {
  return request({
    url: '/live/coupon/list',
    method: 'get',
    params: query
  })
}

// 查询优惠券详细
export function getStoreCoupon(couponId) {
  return request({
    url: '/live/coupon/' + couponId,
    method: 'get'
  })
}

// 新增优惠券
export function addStoreCoupon(data) {
  return request({
    url: '/live/coupon',
    method: 'post',
    data: data
  })
}
export function publishCoupon(data) {
  return request({
    url: '/live/coupon/publish',
    method: 'post',
    data: data
  })
}

export function batchPublishCoupon(data) {
  return request({
    url: '/live/coupon/batchPublish',
    method: 'post',
    data: data
  })
}



// 修改优惠券
export function updateStoreCoupon(data) {
  return request({
    url: '/live/coupon',
    method: 'put',
    data: data
  })
}

// 删除优惠券
export function delStoreCoupon(couponId) {
  return request({
    url: '/live/coupon/' + couponId,
    method: 'delete'
  })
}

// 导出优惠券
export function exportStoreCoupon(query) {
  return request({
    url: '/live/coupon/export',
    method: 'get',
    params: query
  })
}

export function listLiveCoupon(query) {
  return request({
    url: '/live/coupon/listLiveCoupon',
    method: 'get',
    params: query
  })
}

export function listCoupon(query) {
  return request({
    url: '/live/coupon/listCoupon',
    method: 'get',
    params: query
  })
}
export function addLiveCoupon(data) {
  return request({
    url: '/live/coupon/addLiveCoupon',
    method: 'post',
    data: data
  })
}

export function handleDeleteSelected(data) {
  return request({
    url: '/live/coupon/handleDeleteSelected',
    method: 'post',
    data: data
  })
}

export function handleIsShowChange(data) {
  return request({
    url: '/live/coupon/handleIsShowChange',
    method: 'post',
    data: data
  })
}

// 删除直播商品
export function delLiveCoupon(data) {
  return request({
    url: '/live/coupon/delLiveCoupon',
    method: 'post',
    data: data
  })
}
// 删除直播商品
export function updateLiveCouponBind(data) {
  return request({
    url: '/live/coupon/updateLiveCouponBind',
    method: 'post',
    data: data
  })
}

// 查询直播抽奖配置列表  未开启
export function listLiveCouponOn(query) {
  return request({
    url: '/live/coupon/listOn',
    method: 'get',
    params: query
  })
}

