import request from '@/utils/request'

/**
 * 下载文件 用于excel导出
 * @param url
 * @param parameter
 * @returns {*}
 */
export function downFilePost(url, parameter) {
  return request({
    url: url,
    data: parameter,
    method: 'post',
    responseType: 'blob',
    timeout: 12000000, // 请求超时时间
  })
}

export function downFile(url, parameter) {
  return request({
    url: url,
    data: parameter,
    method: 'get',
    responseType: 'blob',
    timeout: 12000000, // 请求超时时间
  })
}

// 获取达人top3
export function getTopPromoterByItemId(query) {
  return request({
    url: '/isv/supply_chain/getTopPromoterByItemId',
    method: 'get',
    params: query
  })
}


// 获取达人数据列表
export function getOrderList(query) {
  return request({
    url: '/isv/supply_chain/orderList',
    method: 'get',
    params: query
  })
}


// 达人带货详情
export function getOrderDetail(query) {
  return request({
    url: '/isv/supply_chain/anchorOrderDetail',
    method: 'get',
    params: query
  })
}

// 订单统计
export function getOrderStatistics(query) {
  return request({
    url: '/isv/supply_chain/orderStatistics',
    method: 'get',
    params: query
  })
}


// 商品列表
export function getItemList(query) {
  return request({
    url: '/isv/supply_chain/itemList',
    method: 'get',
    params: query
  })
}

export function getShopList(query) {
  return request({
    url: '/isv/supply_chain/shopList',
    method: 'get',
    params: query
  })
}

export function getShopDetail(query) {
  return request({
    url: '/isv/supply_chain/shopDetail',
    method: 'get',
    params: query
  })
}

// 商品详情
export function getItemDetail(query) {
  return request({
    url: '/isv/supply_chain/itemDetail',
    method: 'get',
    params: query
  })
}

// 产品服务费列表
export function getItemServiceCharge(query) {
  return request({
    url: '/isv/supply_chain/itemServiceCharge',
    method: 'get',
    params: query
  })
}

//供应链列表-渠道&社群(人员列表)
export function getSupplyChainUserList(query) {
  return request({
    url: '/isv/supply_chain/getSupplyChainUserList',
    method: 'get',
    params: query
  })
}

//供应链列表-招商
export function getSupplyChainCourtshipList(query) {
  return request({
    url: '/isv/supply_chain/getSupplyChainCourtshipUserList',
    method: 'get',
    params: query
  })
}

//供应链列表-招商管理页面
export function getAdminReportList(query) {
  return request({
    url: '/isv/supply_chain/adminReportList',
    method: 'get',
    params: query
  })
}


//供应链列表-招商管理人员详情
export function getUserItemDetail(query) {
  return request({
    url: '/isv/supply_chain/userItemDetail',
    method: 'get',
    params: query
  })
}


//供应链列表-招商认领列表
export function getBindUserItemList(query) {
  return request({
    url: '/isv/supply_chain/bindUserItemList',
    method: 'get',
    params: query
  })
}

//供应链列表-招商认领列表（解绑接口）
export function getUnbindUser(query) {
  return request({
    url: '/isv/supply_chain/unbindUser',
    method: 'get',
    params: query
  })
}

//供应链列表-招商认领列表（绑定接口）
export function getBindUser(query) {
  return request({
    url: '/isv/supply_chain/bindUser',
    method: 'get',
    params: query
  })
}

//供应链列表-商品数量
export function getItemBindSummary(query) {
  return request({
    url: '/isv/supply_chain/itemBindSummary',
    method: 'get',
    params: query
  })
}


//供应链列表-总计
export function getUserItemTotal(query) {
  return request({
    url: '/isv/supply_chain/userItemTotal',
    method: 'get',
    params: query
  })
}

//查询商品列表
export function getQueryProductListl(query) {
  return request({
    url: '/itemCollectSamples/queryProductList',
    method: 'get',
    params: query
  })
}


//查询渠道列表
export function getBdReportList(query) {
  return request({
    url: '/isv/supply_chain/bdReportList',
    method: 'get',
    params: query
  })
}

export function getBdReportListV2(query) {
  return request({
    url: '/isv/supply_chain/bdReportListV2',
    method: 'get',
    params: query
  })
}

export function submitPromotersCount(query) {
  return request({
    url: '/kuaishou/promoter/addPromotersCount',
    method: 'get',
    params: query
  })
}

//查询渠道详情
export function getBdDetailList(query) {
  return request({
    url: '/isv/supply_chain/bdDetailList',
    method: 'get',
    params: query
  })
}

export function getBdDetailListV2(query) {
  return request({
    url: '/isv/supply_chain/bdDetailListV2',
    method: 'get',
    params: query
  })
}


export function getBdTotalV2(query) {
  return request({
    url: '/isv/supply_chain/bdTotalV2',
    method: 'get',
    params: query
  })
}

//查询渠道详情汇总
export function getBdTotal(query) {
  return request({
    url: '/isv/supply_chain/bdTotal',
    method: 'get',
    params: query
  })
}

//查询渠道详情-导出
export function exportBdDetail(query) {
  return request({
    url: '/isv/supply_chain/exportBdDetail',
    method: 'get',
    params: query
  })
}

//达人带货详情-领样申请校验
export function samplesCheck(query) {
  return request({
    url: '/itemCollectSamples/samplesCheck',
    method: 'get',
    params: query
  })
}











