mine.js
936 Bytes
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
export default function() {
return {
namespaced: true,
state: {
animate: false,
rollNoticeList: [],
},
mutations: {
addList(state, { list }) {
state.rollNoticeList = state.rollNoticeList.concat(list);
},
startAnimate(state) {
state.animate = true;
},
animateHandler(state) {
state.rollNoticeList.push(state.rollNoticeList[0]);
state.rollNoticeList.shift();
state.animate = false;
}
},
actions: {
async fetchRollBoardList({ commit }) {
const result = await this.$api.get('/api/ufo/mine/rollBoardList', {});
if (result.code === 200) {
commit('addList', { list: result.data });
}
},
showMarquee({ commit }) {
console.log('fff');
commit('startAnimate');
setTimeout(() => {
commit('animateHandler');
}, 800);
},
},
};
}