index.js
1.32 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
60
61
62
63
64
65
66
67
68
import actions from './actions';
import mutations from './mutations';
function handleNum(n) {
return n > 99 ? '99+' : n;
}
export default function() {
return {
namespaced: true,
state: {
fetching: false,
yohoList: {
notuse: {
couponList: [],
pageNum: 0,
pageSize: 10,
total: 0,
page: 0,
filterId: 0,
},
use: {
couponList: [],
pageNum: 0,
pageSize: 10,
total: 0,
page: 0,
filterId: 0,
},
overtime: {
couponList: [],
pageNum: 0,
pageSize: 10,
total: 0,
page: 0,
filterId: 0,
},
},
num: {
notuse: 0,
use: 0,
overtime: 0,
},
ufoList: [],
filterList: [],
},
actions,
mutations,
getters: {
getNum(state) {
return [
handleNum(state.num.notuse),
handleNum(state.num.use),
handleNum(state.num.overtime),
];
},
getNotUseList(state) {
return state.yohoList.notuse.couponList;
},
getUseList(state) {
return state.yohoList.use.couponList;
},
getOvertimeList(state) {
return state.yohoList.overtime.couponList;
},
},
};
}