coupon.js 707 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * 用户优惠券仓库
  3. */
  4. const state = {
  5. activeCouponList: [], // 未使用
  6. expiredCouponList: [], // 已过期
  7. usedCouponList: [] // 已使用
  8. }
  9. const mutations = {
  10. // 更新未使用优惠券
  11. updateActive(state, list) {
  12. state.activeCouponList = list
  13. },
  14. // 更新已过期优惠券
  15. updateExpired(state, list) {
  16. state.expiredCouponList = list
  17. },
  18. // 更新已使用优惠券
  19. updateUsed(state, list) {
  20. state.usedCouponList = list
  21. }
  22. }
  23. const actions = {
  24. // 查询优惠券
  25. fetchCouponList() {},
  26. // 领取优惠券
  27. receiveCoupon() {}
  28. }
  29. export default {
  30. namespaced: true,
  31. state,
  32. mutations,
  33. actions
  34. }