import http from '@/utils/request'
export function apiMember (url, params) {
  return http.post(`/admin/member/${url}`, params)
}
export function createMember (params) {
  return http.post('/admin/member/createMember', params)
}
// 获取会员类型列表
export function getMemberType (params) {
  return http.post('/admin/member/getMemberTypeList', params)
}

// 通过当前会员类型ID查询可升级的会员类型
export function getMemberUpgradeList (params) {
  return http.post('/admin/member/getMemberUpgradeList', params)
}

// 获取单个会员信息
export const getSingleMember = (id) => {
  return http.post(`/admin/member/${id}`)
}
// 获取会员检票列表
export const getMemberCheckLog = (params) => {
  return http.post('/admin/member/getMemberCheckLog', params)
}
// 获取会员交易列表
export const getMemberTradeList = (params) => {
  return http.post('/admin/member/getMemberTradeList', params)
}

// 获取单个会员交易记录
export function getMemberTradeById (id) {
  return http.post(`/admin/member/getMemberTrade/${id}`)
}

// 会员出库
export const iccardStorageSell = (params) => {
  return http.post('/admin/member/memberStorageSell', params)
}

// 会员出库记录
export const iccardCheckoutLog = (params) => {
  return http.post('/admin/member/getMemberStorageSellLog', params)
}

// 会员入库接口
export const iccardStorage = (params) => {
  return http.post('/admin/member/iccardStorage', params)
}
// 入库记录查询
export const getMemberStorageLogList = (params) => {
  return http.post('/admin/member/getMemberStorageLogList', params)
}
// 入库统计
export const getMemberStorageStatistics = (params) => {
  return http.post('/admin/member/getMemberStorageStatistics', params)
}
// 获取一张入库卡的信息
export const getIccardInfo = (no) => {
  return http.post(`//admin/member/getMemberInfoByICCard/${no}`)
}
// IC卡激活
export const iccardActivation = (params) => {
  return http.post('/admin/member/iccardActivation', params)
}

// 获取会员来园次数统计
export const getMemberVisitCountStatistics = (params) => {
  return http.post('/admin/member/getMemberVisitCountStatistics', params)
}

// 会员检票统计
export const getMemberCheckStatistics = (params) => {
  return http.post('/admin/member/getMemberCheckStatistics', params)
}

// 会员出库统计
export const getMemberStorageSellStatistics = (params) => {
  return http.post('/admin/member/getMemberStorageSellStatistics', params)
}

// 导出会员列表
export function exportMemberList (params) {
  return http.post('/exportMission/exportMemberList', params)
}

// 导出会员入园次数
export function exportMemberVisitCountStatistics (params) {
  return http.post('/exportMission/exportMemberVisitCountStatistics', params)
}
// 导出会员通关统计
export function exportMemberCheckStatistics (params) {
  return http.post('/exportMission/exportMemberCheckStatistics', params)
}

// 导出会员通关记录
export function exportMemberCheckList (params) {
  return http.post('/exportMission/exportMemberCheckList', params)
}

// 会员交易统计
export function getMemberTradeStatistics (params) {
  return http.post('/admin/member/getMemberTradeStatistics', params)
}

// 会员来园次数比例统计
export function getMemberVisitsPercentStatistics (params) {
  return http.post('/admin/member/getMemberVisitsPercentStatistics', params)
}

// 会员来园次数统计
export function getMemberVisitsStatistics (params) {
  return http.post('/admin/member/getMemberVisitsStatistics', params)
}

// 修改会员对应景点的过闸次数
export const updateCheckTimes = (params) => {
  return http.post('/admin/member/updateCheckTimes', params)
}
// 会员检票（过闸）更新记录
export const getUpdateCheckTimesLogs = (params) => {
  return http.post('/admin/member/getUpdateCheckTimesLogs', params)
}

// 获取系统储值卡
export function getMemberFromMemberSystem (params) {
  return http.post('/admin/member/getMemberFromMemberSystem', params)
}

// 会员交易记录开票
export function pickInvoice (params, type, buyer, tax_num, phone, email) {
  return http.post('/admin/member/pickInvoice', {
    orderIdList: params,
    invoiceType: type,
    invoiceBuyer: buyer,
    invoiceBuyerTaxNum: tax_num,
    invoiceBuyerPhone: phone,
    invoiceBuyerEmail: email
  })
}

// 会员检票
export function checkMember (params) {
  return http.post('/admin/member/checkMember', params)
}

// 查看会员修改记录
export function getMemberUpdateLogList (memberId) {
  return http.post(`/admin/member/getMemberUpdateLogList?memberId=${memberId}`)
}
