import request from '@/utils/request'

// 列表
export const getCardList = query => {
  return request({
    url: '/wpr/card/list',
    method: 'get',
    params: query
  });
}

// 新增
export const addCard = data => {
  return request({
    url: '/wpr/card/add',
    method: 'post',
    data
  }) 
}

// 修改
export const editCard = data => {
  return request({
    url: '/wpr/card/edit',
    method: 'put',
    data
  }) 
}

// 删除
export const deleteCard = farmerIds => {
  return request({
    url: '/wpr/card/delete/',
    method: 'delete',
    params: farmerIds
  }) 
}

// 详情
export const getCardDetail = query => {
  return request({
    url: '/wpr/card/info',
    method: 'get',
    params: query
  }) 
}

// 充值
export const rechargeCard = data => {
  return request({
    url: '/wpr/card/recharge',
    method: 'post',
    data
  }) 
}

// 充值记录
export const getRechargercdList = query => {
  return request({
    url: '/wpr/rechargercd/list',
    method: 'get',
    params: query
  }) 
}