import request from '@/utils/request'

// api地址
const api = {
  list: 'coupon/list',
  serveList:'coupon/server',
  receive:'myCoupon/receive',
  myCouponList:'myCoupon/list'
}

// 优惠券列表
export const list = (param, option) => {
  const options = {
    isPrompt: true, //（默认 true 说明：本接口抛出的错误是否提示）
    load: true, //（默认 true 说明：本接口是否提示加载动画）
    ...option
  }
  return request.get(api.list, param, options)
}
// 服务类优惠券
export const serveList = (param) => {
  return request.get(api.serveList, param)
}
// 领券
export const receive=(data)=>{
  return request.post(api.receive, data)
}
//我的优惠券
export const myCouponList=(data)=>{
  return request.post(api.myCouponList, data)
}