import request from '@/utils/request'

// 查询全场折扣活动列表
export function listDiscountInfo(query) {
  return request({
    url: '/mapi/activity/discountInfo/list',
    method: 'get',
    params: query
  })
}

// 查询全场折扣活动详细
export function getDiscountInfo(id) {
  return request({
    url: '/mapi/activity/discountInfo/getInfo',
    method: 'get',
    params:{id:id}
  })
}

// 新增全场折扣活动
export function addDiscountInfo(data) {
  return request({
    url: '/mapi/activity/discountInfo',
    method: 'post',
    data: data
  })
}

// 修改全场折扣活动
export function updateDiscountInfo(data) {
  return request({
    url: '/mapi/activity/discountInfo',
    method: 'put',
    data: data
  })
}

// 删除全场折扣活动
export function delDiscountInfo(id) {
  return request({
    url: '/mapi/activity/discountInfo/' + id,
    method: 'delete'
  })
}


// 修改全场折扣活动状态
export function updateDiscountInfoStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/activity/discountInfo/updateStatus',
    method: 'post',
    data: data
  })
}
