coupons.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import fly from "./main";
  2. import store from "@/store/index"
  3. //优惠券领取列表
  4. export function getCouponReceiveList($limit = 0) {
  5. let $params = {}
  6. $params['limit'] = $limit
  7. $params['status'] = 1
  8. $params['access_token'] = wx.getStorageSync('token')
  9. return fly.post('coupon/coupon-receive-list', $params)
  10. }
  11. //已优惠券列表
  12. export function getCouponList($limit = 0) {
  13. let $params = {}
  14. $params['limit'] = $limit
  15. $params['access_token'] = wx.getStorageSync('token')
  16. return fly.post('coupon/coupon-list', $params)
  17. }
  18. //已过期优惠券列表
  19. export function getOverdueCouponList($limit = 0) {
  20. let $params = {}
  21. $params['limit'] = $limit
  22. $params['access_token'] = wx.getStorageSync('token')
  23. return fly.post('coupon/coupon-expire-list', $params)
  24. }
  25. //待领取优惠券
  26. export function couponReceive($id) {
  27. let $params = {}
  28. $params['coupon_category_id'] = $id
  29. $params['access_token'] = wx.getStorageSync('token')
  30. return fly.post('coupon/coupon-receive', $params)
  31. }
  32. //首次登录领取优惠券
  33. export function couponReceiveFirst() {
  34. let $params = {
  35. "access_token": wx.getStorageSync('token'),
  36. "coupon_category_id": 1,
  37. }
  38. return fly.post('coupon/coupon-receive', $params)
  39. }