import request from '@/utils/request'

// 查询字典数据详细
export function getData(query) {
  return request({
    url: '/app-api/system/dict-data/page',
    method: 'get',
    params: query
  })
}

export function getEcash(query) {
  return request({
    url: '/app-api/ecw/currency-ecash/page',
    method: 'get',
    params: query
  })
}

export function getTradeCityList(query) {
  return request({
    url: '/app-api/ecw/region/getTradeCityList',
    method: 'get',
    params: query
  })
}

export function getProductAttrList(query) {
  return request({
    url: '/app-api/ecw/product-attr/list',
    method: 'get',
    params: query
  })
}

export function getChannelList(query) {
  return request({
    url: '/app-api/ecw/channel/select',
    method: 'get',
    params: query
  })
}

export function getCurrencyList(query) {
  return request({
    url: '/app-api/ecw/currency/list',
    method: 'get',
    params: query
  })
}

export function calculationPrice(data) {
  return request({
    url: '/app-api/product/line/price/calculation',
    method: 'post',
    data
  })
}

export function getOpenedRouterList(data) {
  return request({
    url: '/app-api/ecw/warehouse/openedRouterList',
    method: 'post',
    data
  })
}

// 获得产品分页
export function getProductPage(query) {
  return request({
    url: '/app-api/ecw/product/page',
    method: 'get',
    params: query
  })
}

// 获得产品
export function getProduct(id) {
  return request({
    url: '/app-api/ecw/product/get?id=' + id,
    method: 'get'
  })
}

// 获得国家树
export function getListTree(query) {
  return request({
    url: '/app-api/ecw/region/getListTree',
    method: 'get',
    params: query
  })
}

// 获得须知
export function getNeedKnow(query) {
  return request({
    url: '/app-api/system/need-know/getByKey',
    method: 'get',
    params: query
  })
}

// 获得所有计量单位
export function getUnitList() {
  return request({
    url: '/app-api/app/unit/list',
    method: 'get'
  })
}

// 下载需知
export function download(query) {
  return request({
    url: '/admin-api/system/need-know/download',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 校验手机号
export function validatorPhone(query) {
  return request({
    url: '/app-api/param/validator/mobile',
    method: 'get',
    params: query
  })
}

// 校验手机号
export function checkKycStatus(query) {
  return request({
    url: '/app-api/my/order/getKycStatus',
    method: 'get',
    params: query
  })
}
// 获取城市
export function getCityData(query) {
  return request({
    url: '/app-api/ecw/region/get',
    method: 'get',
    params: query
  })
}
