2023-03-16 17:11:40 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="Topic">
|
2023-03-20 10:02:00 +08:00
|
|
|
<div
|
|
|
|
|
class="Topic-item"
|
|
|
|
|
v-for="(item, index) in list"
|
|
|
|
|
:key="index"
|
|
|
|
|
hover-class="text-hover"
|
|
|
|
|
@click="$linkTo('./TopicDetail?themeId=' + item.id + '&name=' + item.title)">
|
2023-03-17 10:48:17 +08:00
|
|
|
<h2>#{{item.title}}</h2>
|
2023-03-16 17:41:40 +08:00
|
|
|
<span>去看看</span>
|
|
|
|
|
</div>
|
2023-03-16 17:11:40 +08:00
|
|
|
<AiLogin ref="login"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'Topic',
|
2023-03-16 17:41:40 +08:00
|
|
|
appName: '更多话题',
|
2023-03-16 17:11:40 +08:00
|
|
|
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
2023-03-17 10:48:17 +08:00
|
|
|
current: 1,
|
|
|
|
|
pages: 2,
|
|
|
|
|
list: []
|
2023-03-16 17:11:40 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
2023-03-17 10:48:17 +08:00
|
|
|
this.getList()
|
2023-03-16 17:11:40 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
2023-03-17 10:48:17 +08:00
|
|
|
getList() {
|
|
|
|
|
if (this.current > this.pages) return
|
2023-03-20 10:02:00 +08:00
|
|
|
this.$instance.post(`/app/appneighborhoodassistancetheme/list?current=${this.current}&size=20`).then(res => {
|
2023-03-17 10:48:17 +08:00
|
|
|
if (res.code === 0 && res.data) {
|
|
|
|
|
const list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
|
|
|
|
|
this.pages = Math.ceil(res.data.total / 10)
|
|
|
|
|
this.list = list
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
toTopicDetail(id) {
|
|
|
|
|
uni.navigateTo({url: `./TopicDetail?id=${id}`})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
this.current ++
|
|
|
|
|
this.getList()
|
2023-03-16 17:11:40 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.Topic {
|
2023-03-16 17:41:40 +08:00
|
|
|
min-height: 100vh;
|
|
|
|
|
background: #fff;
|
2023-03-16 17:11:40 +08:00
|
|
|
padding-bottom: 40px;
|
2023-03-16 17:41:40 +08:00
|
|
|
border-top: 24px solid #f4f6fa;
|
|
|
|
|
box-sizing: border-box;
|
2023-03-16 17:11:40 +08:00
|
|
|
|
|
|
|
|
div {
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
2023-03-16 17:41:40 +08:00
|
|
|
|
|
|
|
|
.Topic-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
2023-03-20 10:02:00 +08:00
|
|
|
padding: 20px 32px;
|
2023-03-16 17:41:40 +08:00
|
|
|
|
|
|
|
|
h2 {
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
color: #333333;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
span {
|
|
|
|
|
width: 126px;
|
|
|
|
|
height: 52px;
|
|
|
|
|
line-height: 52px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-radius: 26px;
|
|
|
|
|
border: 2px solid #2d7dffff;
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
color: #2D7DFF;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-16 17:11:40 +08:00
|
|
|
}
|
|
|
|
|
</style>
|