couponCenterData.js
1.39 KB
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
/*
* Created by shipfi on 2016/5/31.
*/
import {
COUPON_CENTER_LIST,
COUPON_CENTER_DETAIL,
MATCH_NET_LIST,
COUPON_TAB,
COUPON_EXCHANGE,
COUPON_CENTER_LIST_CLEAR
} from '../mutationTypes';
const state = {
couponCenterList: [],
couponCenterDetail: {},
matchNetList: [],
couponTab: {},
couponExchange: {}
};
const mutations = {
//获取优惠券中心列表
[COUPON_CENTER_LIST](state, action){
state.couponCenterList = state.couponCenterList.concat(action.couponCenterList);
state.couponCenterCount = action.couponCenterList.count;
},
//获取优惠券详情
[COUPON_CENTER_DETAIL](state, action){
state.couponCenterDetail = action.couponCenterDetail;
},
//获取优惠券适用网点
[MATCH_NET_LIST](state, action){
state.matchNetList = state.matchNetList.concat(action.matchNetList);
state.matchNetCount = action.matchNetList.count;
},
//获取优惠券中心标题背景
[COUPON_TAB](state, action){
state.couponTab = action.couponTab;
},
//优惠券兑换
[COUPON_EXCHANGE](state, action){
state.couponExchange = action.couponExchange;
},
//清除优惠券中心列表
[COUPON_CENTER_LIST_CLEAR](state,action){
state.couponCenterList = [];
state.couponCenterCount ='';
}
};
export default {
state,
mutations
};