优化代码

This commit is contained in:
aixianling
2023-03-21 11:35:03 +08:00
parent 901fc767fb
commit ebb738e41b

View File

@@ -38,7 +38,8 @@
</div>
</div>
<div class="item-content">
<span hover-stop-propagation v-if="item.themeId" @click.stop="$linkTo('./TopicDetail?themeId=' + item.themeId + '&name=' + item.topicName)">#{{ item.topicName }}</span>
<span hover-stop-propagation v-if="item.themeId"
@click.stop="$linkTo('./TopicDetail?themeId=' + item.themeId + '&name=' + item.topicName)">#{{ item.topicName }}</span>
<text>{{ item.content }}</text>
</div>
<div class="item-imgs" v-if="item.files.length">
@@ -46,7 +47,8 @@
</div>
<p>{{ item.createTime }}</p>
<div class="item-bottom">
<button hover-stop-propagation @click.stop="onBtnClick" open-type="share" :data-content="item.content" :data-themeid="item.themeId" :data-id="item.id" :data-name="item.topicName">
<button hover-stop-propagation @click.stop="onBtnClick" open-type="share" :data-content="item.content" :data-themeid="item.themeId" :data-id="item.id"
:data-name="item.topicName">
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-zhuanfa.png"/>
<i>{{ item.sharedCount }}</i>
</button>
@@ -188,7 +190,6 @@
this.currIndex = index
this.isMore = false
this.current = 1
this.$nextTick(() => {
this.getList()
})
@@ -196,10 +197,9 @@
getList() {
if (this.isMore) return
this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/list`, null, {
withoutToken: this.token ? false : true,
withoutToken: !this.token,
params: {
current: this.current,
size: 10,
@@ -207,7 +207,6 @@
}
}).then(res => {
if (res.code === 0) {
this.$hideLoading()
if (this.current > 1) {
this.list = [...this.list, ...res.data.records.map(e => {
return {
@@ -234,9 +233,7 @@
} else {
this.isMore = true
}
}).catch(() => {
this.$hideLoading()
})
}).finally(() => this.$hideLoading())
}
},