coupon.js 1.69 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
import request from '@/utils/request'

// 创建优惠券信息
export function createCoupon(data) {
  return request({
    url: '/product/coupon/createOrUpdate',
    method: 'post',
    data: data
  })
}

// 更新优惠券信息
export function updateCoupon(data) {
  return request({
    url: '/product/coupon/update',
    method: 'put',
    data: data
  })
}

// 删除优惠券信息
export function deleteCoupon(id) {
  return request({
    url: '/product/coupon/delete?id=' + id,
    method: 'delete'
  })
}

// 获得优惠券信息
export function getCoupon(id) {
  return request({
    url: '/product/coupon/get?couponId=' + id,
    method: 'get'
  })
}

// 获得优惠券信息分页
export function getCouponPage(query) {
  return request({
    url: '/product/coupon/page',
    method: 'get',
    params: query
  })
}

// 获得优惠券下拉
export function getCouponSelect(query) {
  return request({
    url: '/product/coupon/select',
    method: 'get',
    params: query
  })
}

// 导出优惠券信息 Excel
export function exportCouponExcel(query) {
  return request({
    url: '/product/coupon/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获得用户可用优惠券
export function getCustomerAvailableCouponList(data){
  return request({
    url: '/product/coupon/customer/available/couponList',
    method: 'post',
    data
  })
}

// 更新优惠券有效期
export function updateEndtime(data){
  return request({
    url: '/product/coupon/update/endTime',
    method: 'put',
    data
  })
}

// 更新投放状态
export function updatePutonStatus(data){
  return request({
    url: '/product/coupon/update/putonStatus',
    method: 'put',
    data
  })
}