coupon.js 1.95 KB
Newer Older
1 2 3
import request from "@/utils/request";

// 查询列表
lixiaomin committed
4
export function listCoupon(pageNum,pageSize,data) {
5
  return request({
lixiaomin committed
6
    url: "/coupon/list?pageNum=" + pageNum+ "&pageSize="+pageSize,
lixiaomin committed
7 8
    method: "post",
    data: data,
9 10 11 12 13
  });
}


// 新增
lixiaomin committed
14
export function addCoupon(data) {
15
  return request({
lixiaomin committed
16 17
    url: "/coupon",
    method: "put",
18 19 20 21 22
    data: data,
  });
}

// 修改
lixiaomin committed
23
export function updateCoupon(data) {
24
  return request({
lixiaomin committed
25 26
    url: "/coupon",
    method: "post",
27 28 29 30 31
    data: data,
  });
}

// 删除
lixiaomin committed
32
export function delCoupon(id) {
33
  return request({
lixiaomin committed
34
    url: "/coupon/" + id,
35 36 37 38
    method: "delete",
  });
}

lixiaomin committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
// 下架
export function offlineCoupon(id) {
  return request({
    url: "/coupon/offline/" + id,
    method: "get",
  });
}

// 上架
export function onlineCoupon(id) {
  return request({
    url: "/coupon/online/" + id,
    method: "get",
  });
}

55
// 用户领取优惠券列表
lixiaomin committed
56
export function getCouponInfoList(pageNum,pageSize,data) {
lixiaomin committed
57
  return request({
lixiaomin committed
58
    url: "/coupon-user/list?pageNum=" + pageNum+ "&pageSize="+pageSize,
lixiaomin committed
59 60 61 62 63
    method: "post",
    data: data,
  });
}

64 65 66 67 68 69 70 71
// 用户下单总量和下单总金额
export function getCusOrderNum(custId) {
  return request({
    url: "/system/customer/order-simple-stat/" + custId,
    method: "get",
  });
}

72 73 74 75 76 77 78 79
// 获取优惠券详情
export function getCouponDetail(id) {
  return request({
    url: "/coupon/detail/" + id,
    method: "get",
  });
}

lixiaomin committed
80 81 82 83 84 85 86 87
// 获取短信模板
export function getMessageMoudle() {
  return request({
    url: "/v1/message/moudle",
    method: "get",
  });
}

lixiaomin committed
88 89 90 91 92 93 94 95 96
// 赠送优惠券
export function giveCoupon(data) {
  return request({
    url: "/coupon-user/give",
    method: "post",
    data: data,
  });
}

lixiaomin committed
97 98 99 100 101 102 103 104
// 优惠券修改前校验
export function updateCheck(id) {
  return request({
    url: "/coupon/update/check/"+id,
    method: "post",
  });
}

lixiaomin committed
105 106 107 108 109 110 111 112 113
// 获取有效优惠券
export function effective() {
  return request({
    url: "/coupon/list/effective",
    method: "get",
  });
}


lixiaomin committed
114

115