/** * 用户优惠券仓库 */ const state = { activeCouponList: [], // 未使用 expiredCouponList: [], // 已过期 usedCouponList: [] // 已使用 } const mutations = { // 更新未使用优惠券 updateActive(state, list) { state.activeCouponList = list }, // 更新已过期优惠券 updateExpired(state, list) { state.expiredCouponList = list }, // 更新已使用优惠券 updateUsed(state, list) { state.usedCouponList = list } } const actions = { // 查询优惠券 fetchCouponList() {}, // 领取优惠券 receiveCoupon() {} } export default { namespaced: true, state, mutations, actions }