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

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

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

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

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

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

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

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

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

// 会员出库统计
export const getMemberStorageSellStatistics = (params) => {
  return http.post('/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('/member/getMemberTradeStatistics', params)
}

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

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

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

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

// 会员交易记录开票
export function pickInvoice (params, type, buyer, tax_num, phone, email) {
  return http.post('/member/pickInvoice', {
    orderIdList: params,
    invoice_type: type,
    invoice_buyer: buyer,
    invoice_buyer_tax_num: tax_num,
    invoice_buyer_phone: phone,
    invoice_buyer_email: email
  })
}

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

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