import request, { postBlob, getBlob, handleImport } from '@/utils/request'


export function promotionGroupListPageV2(data) {
  return request({
    url: `/promotion/group/list/pageV2?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function promotionGroupPageExport(data, name) {
  return postBlob({
    url: '/promotion/group/pageExport',
    data,
    name
  })
}



// 获取活动统计
export function getActivityCount(params) {
  return request({
    url: '/promotion/group/count',
    method: 'get',
    params
  })
}

// 获取活动列表
export function getActivityList(params) {
  return request({
    url: '/promotion/group/list',
    method: 'get',
    params
  })
}

// 更改活动状态
export function changeStatus(params) {
  return request({
    url: '/promotion/group/status/update',
    method: 'post',
    params
  })
}

// 添加活动
export function addActivity(params) {
  return request({
    url: '/promotion/group/add',
    method: 'post',
    data: params
  })
}

// 编辑活动
export function editActivity(params) {
  return request({
    url: '/promotion/group/update',
    method: 'post',
    data: params
  })
}

// 获取分类列表
export function getClassifyList(params) {
  return request({
    url: '/goods/category/list',
    method: 'get',
    params
  })
}

// 获取商品列表
export function getGoodsList(params) {
  return request({
    url: '/goods/list/page',
    method: 'get',
    params
  })
}

// 获取活动详情
export function getActivityDetail(params) {
  return request({
    url: '/promotion/group/detail',
    method: 'get',
    params
  })
}

// 获取团长列表
export function getHeadList(params) {
  return request({
    url: '/promotion/user/list',
    method: 'get',
    params
  })
}

// 修改团长团购价
export function editHead(params) {
  return request({
    url: '/promotion/user/update',
    method: 'post',
    data: params
  })
}

// 获取详情列表
export function getDetailList(params) {
  return request({
    url: '/promotion/group/pt/detail',
    method: 'get',
    params
  })
}

// 获取分享列表
export function getShareList(params) {
  return request({
    url: '/promotion/group/pt/visitlist',
    method: 'get',
    params
  })
}

// 获取订单列表
export function getOrderList(params) {
  return request({
    url: '/promotion/group/pt/orderlist',
    method: 'get',
    params
  })
}

// 获取会员列表
export function getMemberList(params) {
  return request({
    url: '/member/list/page',
    method: 'get',
    params
  })
}