import request from '@/utils/request'

// 查询注册送券活动优惠券明细列表
export function listCouponItem(query) {
  return request({
    url: '/mapi/activity/couponItem/list',
    method: 'get',
    params: query
  })
}

// 查询注册送券活动优惠券明细详细
export function getCouponItem(id) {
  return request({
    url: '/mapi/activity/couponItem/' + id,
    method: 'get'
  })
}

// 新增注册送券活动优惠券明细
export function addCouponItem(data) {
  return request({
    url: '/mapi/activity/couponItem',
    method: 'post',
    data: data
  })
}

export function editStock(data) {
  return request({
    url: '/mapi/activity/couponItem/editStock',
    method: 'post',
    data: data
  })
}

// 修改注册送券活动优惠券明细
export function updateCouponItem(data) {
  return request({
    url: '/mapi/activity/couponItem',
    method: 'put',
    data: data
  })
}

// 删除注册送券活动优惠券明细
export function delCouponItem(id) {
  return request({
    url: '/mapi/activity/couponItem/' + id,
    method: 'delete'
  })
}


// 修改注册送券活动优惠券明细状态
export function updateCouponItemStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/activity/couponItem/updateStatus',
    method: 'post',
    data: data
  })
}
