list.vue
1.9 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
<div>
<Scroll ref="recyclelist" class="list" :on-fetch="onFetch">
<div >
<NoticeItem v-for="(item, index) in noticeList" :key="index" :data="item"></NoticeItem>
</div>
</Scroll>
</div>
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
const { mapState, mapActions } = createNamespacedHelpers('gain');
import NoticeItem from './noticeItem';
import {
Style,
Scroll,
RecycleList
} from 'cube-ui';
// import { resolve } from 'dns';
export default {
components: {
NoticeItem,
Scroll,
RecycleList,
Style
},
data(){
return {
scrollOptions: {
bounce: {
top: false
},
pullUpLoad: true
},
fixed: false
};
},
mounted(){
// this.fetchList
},
methods:{
// async onPullingUp() {
// const result = await this.fetchList();
// if (!result) {
// this.$refs.scroll.$forceUpdate();
// }
// },
onFetch(){
let items = []
return new Promise((resolve) => {
setTimeout(() => {
for(let i = 0; i < 50; i++){
items.push({
id:i,
contents:'【税率调整】您的商品AIR JORDAN 4 RESET PUSH NONEKJG 2017已经被用户下单,请及时发货'+i,
time:'2018.08.08 17:20'
})
}
resolve(items)
}, 1000)
})
}
},
// async fetchList({ commit, state }) {
// let page = state.page;
// const result = await this.$api.get('/api/union/inviteList', {
// page: page,
// size: state.size
// });
// if (result.code === 200) {
// commit('addList', { list: result.data.list });
// commit('changePage', { page: ++page });
// }
// return result.data ? result.data.length : 0;
// }
}
</script>