import request from '@/utils/request'
import { data } from 'jquery'

// 登录方法
export function login(username, password, code, uuid) {
  const data = {
    username,
    password,
    code,
    uuid
  }
  return request({
    url: '/login',
    method: 'post',
    data: data
  })
}

// 获取用户详细信息

export function getIssueList() {
  return request({
    url: '/coupon/issue/listByLogin',
    method: 'get'
  })
}

export function getGradeList() {
  return request({
    url: '/customer/setting/listByLogin',
    method: 'get'
  })
}

export function getLabelList() {
  return request({
    url: '/label/rule/listByLogin',
    method: 'get'
  })
}

// 新增 导入数据
export function importExcel(data) {
  return request({
    url: '/customer/cardImport/importCardExcel',
    method: 'post',
    data: data
  })
}

export function getImportList(data) {
  return request({
    url: '/customer/cardImport/list',
    method: 'get',
    params: data
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    method: 'get'
  })
}


// 获取验证码
export function updateImportList(data) {
  return request({
    url: '/customer/cardImport/updateCardList',
    method: 'post',
    data: data
  })
}

// 删除客户电子会员卡（储蓄卡）
export function delImportList(data) {
  return request({
    url: '/customer/cardImport/deleteIds',
    method: 'post',
    data: data
  })
}

// 修改单条导入记录
export function upImport(data) {
  return request({
    url: '/customer/cardImport',
    method: 'put',
    data: data
  })
}
