import request from '@/utils/request'

// 创建营销活动
export function createActiveMain(data) {
  return request({
    url: '/member/active-main/create',
    method: 'post',
    data: data
  })
}

// 参加营销活动
export function attendActive(data) {
  return request({
    url: '/base/customer-active/attendActive',
    method: 'post',
    data: data
  })
}

// 获得营销活动分页
export function joinActive(params) {
  return request({
    url: '/base/customer-active/list',
    method: 'get',
    params
  })
}

// 更新营销活动
export function updateActiveMain(data) {
  return request({
    url: '/member/active-main/update',
    method: 'put',
    data: data
  })
}

// 删除营销活动
export function deleteActiveMain(id) {
  return request({
    url: '/member/active-main/delete?id=' + id,
    method: 'delete'
  })
}

// 获得营销活动
export function getActiveMain(id) {
  return request({
    url: '/member/active-main/get?id=' + id,
    method: 'get'
  })
}

// 获得营销活动分页
export function getActiveMainPage(params) {
  return request({
    url: '/member/active-main/page',
    method: 'get',
    params
  })
}
// 导出营销活动 Excel
export function exportActiveMainExcel(params) {
  return request({
    url: '/member/active-main/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
