-
Notifications
You must be signed in to change notification settings - Fork 114
/
index.vue
74 lines (71 loc) · 1.38 KB
/
index.vue
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
<template lang="pug">
.container
.topic-wrap
a.topic-item(
:href="topic.link",
v-for="topic of topics",
:key="topic.id")
.topic-title {{topic.c}} {{topic.t}}
.topic-info
.topic-info-item {{topic.un}}
.topic-info-item {{topic.cn}}
.topic-info-item
img.topic-info-icon(src="/static/assets/quan_hit.png")
span.topic-info-text {{topic.vc}}
.topic-info-item
img.topic-info-icon(src="/static/assets/quan_comment.png")
span.topic-info-text {{topic.rc}}
</template>
<script>
import wx from 'wx'
import { mapState, mapActions } from 'vuex'
export default {
computed: {
...mapState([
'topics'
])
},
mounted () {
wx.startPullDownRefresh()
},
async onPullDownRefresh () {
await this.getTopics(true)
wx.stopPullDownRefresh()
},
onReachBottom () {
this.getTopics()
},
methods: {
...mapActions([
'getTopics'
])
}
}
</script>
<style lang="less">
.topic-item {
padding: 10px;
border-bottom: 1px solid #eee;
}
.topic-title {
font-size: 16px;
}
.topic-info {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 10px;
}
.topic-info-item {
margin-left: 10px;
font-size: 12px;
color: #aaa;
display: flex;
align-items: center;
}
.topic-info-icon {
width: 15px;
height: 15px;
margin-right: 4px;
}
</style>