list.vue
2.35 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
97
98
99
100
101
102
103
104
105
106
107
108
<template>
<div class="list-comp">
<div class="title">邀请记录</div>
<div class="header">
<div style="width: 25%; text-align: left;">我邀请的好友</div>
<div style="width: 55%; text-align: center;">注册时间</div>
<div style="width: 20%; text-align: right;">我的佣金</div>
</div>
<Scroll ref="scroll" class="list" :options="scrollOptions" :data="list" v-if="list.length" @pulling-up="onPullingUp">
<div class="item" v-for="item in list">
<div class="name" style="width: 25%; text-align: center; text-overflow:ellipsis; overflow: hidden; white-space: nowrap;">{{item.nickname}}</div>
<div class="date" style="width: 55%; text-align: center;">{{item.dateStr}}</div>
<div class="amount" style="width: 20%; text-align: center;">{{item.amountStr}}</div>
</div>
</Scroll>
<div class="empty" v-else>
快去邀请好友吧!
</div>
<div>
</div>
</div>
</template>
<script>
import {Scroll} from 'cube-ui';
import {createNamespacedHelpers} from 'vuex';
const {mapState, mapActions} = createNamespacedHelpers('gain');
export default {
data() {
return {
scrollOptions: {
pullUpLoad: true
}
};
},
mounted() {
this.fetchList();
},
methods: {
...mapActions(['fetchList']),
async onPullingUp() {
const result = await this.fetchList();
if (!result) {
this.$refs.scroll.$forceUpdate();
}
}
},
computed: {
...mapState(['list'])
},
components: {
Scroll
}
};
</script>
<style lang="scss" scoped>
.list-comp {
padding: 40px 30px 30px;
margin-bottom: 98px;
.title {
font-size: 34px;
color: #222;
text-align: center;
font-weight: 600;
margin-bottom: 20px;
}
.header {
display: flex;
font-size: 28px;
color: #b0b0b0;
justify-content: space-between;
height: 100px;
line-height: 100px;
border-bottom: 0.5PX solid #b0b0b0;
}
.list {
max-height: 1010px;
}
.item {
height: 100px;
font-size: 28px;
color: #444;
display: flex;
border-bottom: 0.5PX solid #b0b0b0;
line-height: 100px;
}
.empty {
width: 100%;
height: 350px;
font-size: 28px;
color: #b0b0b0;
line-height: 350px;
text-align: center;
}
}
</style>