export const getHomeData = {
  url: '/homePage/platformStatistics',
  method: 'GET'
}

export const merchantStatistics = {
  url: '/homePage/merchantStatistics',
  method: 'GET'
}
export const getMerchantInfo = {
  url: '/homePage/getMerchantInfo',
  method: 'GET'
}
export const repairHeadImg = {
  url: '/homePage/repairHeadImg',
  method: 'PUT',
  dealUrl: (url, headImg) => {
    return `${url}?headImg=${headImg}`
  }
}
export const queryIdCard = {
  url: '/homePage/queryIdCard',
  method: 'GET'
}
export const getBankList = {
  url: '/home/common/getBankList',
  method: 'GET'
}

export const getAssetsInfo = {
  url: '/home/common/getAssetsInfo',
  method: 'GET',
  dealReqData: ({ type }) => {
    return { type }
  }
}

export const adminBindCard = {
  url: '/home/common/bindCard',
  method: 'POST',
  dealReqData: ({ realName, idNo, phone, bank, bankCode, openBranch, cardNo, type, companyName, uniqeCode }) => {
    return { realName, idNo, phone, bank, bankCode, openBranch, cardNo, type, companyName, uniqeCode }
  }
}

export const adminBindVerifyCode = {
  url: '/home/common/verifyCode',
  method: 'POST',
  dealReqData: ({ realName, idNo, phone, bankCode, openBranch, cardNo, authAmt, orderNo, type, companyName, uniqeCode }) => {
    return { realName, idNo, phone, bankCode, openBranch, cardNo, authAmt, orderNo, type, companyName, uniqeCode }
  }
}

export const adminWithdraw = {
  url: '/home/common/withdraw',
  method: 'POST',
  dealReqData: ({ type, amt }) => {
    return { type, amt }
  }
}

export const adminUnbindCard = {
  url: '/home/common/unbindCard',
  method: 'DELETE',
  dealReqData: ({ type }) => {
    return { type }
  }
}

export const getTop5GoodList = {
  url: '/home/goodsSalesList',
  method: 'GET'
}

export const getAllGoodListByBrand = {
  url: '/home/common/goodsListByBrand',
  method: 'GET',
  dealReqData: ({ brandId }) => {
    return { brandId }
  }
}

// 销量趋势
export const getSaledTend = {
  url: '/home/common/salesTrend',
  method: 'GET',
  dealReqData: ({ brandId, goodsNo }) => {
    return { brandId, goodsNo }
  }
}

// 销量统计
export const getSalesStatistics = {
  url: '/home/common/salesStatistics',
  method: 'GET',
  dealReqData: ({ brandId, type, startTime, endTime }) => {
    return { brandId, type, startTime, endTime }
  }
}

// 区域总销量统计
export const getAreaStatistics = {
  url: '/home/common/areaStatistics',
  method: 'GET',
  dealReqData: ({ brandId, goodsNo, province, city }) => {
    return { brandId, goodsNo, province, city }
  }
}
