This commit is contained in:
yanran200730
2023-03-20 14:34:31 +08:00
parent 599c10cd7d
commit 42e406ff82
4 changed files with 92 additions and 21 deletions

View File

@@ -11,6 +11,7 @@
class="item"
v-for="(item, index) in list"
:key="index"
hover-class="text-hover"
@click="$linkTo('./Detail?isFrom=topic&id=' + item.id + '&name=' + name + '&themeId=' + themeId)">
<div class="item-top">
<image :src="item.createUserAvatar || 'https://cdn.cunwuyun.cn/wxmp/fengdu/avatar.png'" />
@@ -23,15 +24,22 @@
<text>{{ item.content }}</text>
</div>
<div class="item-imgs" v-if="item.files.length">
<image mode="aspectFill" v-for="(item, index) in item.files" :key="index" :src="item.url" />
<image mode="aspectFill" @click.stop="previewImage(e.url, item.files)" v-for="(item, index) in item.files" :key="index" :src="item.url" />
</div>
<p>{{ item.createTime }}</p>
<div class="item-bottom">
<div>
<button
hover-stop-propagation
@click.stop=""
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>
</div>
<div>
</button>
<div hover-stop-propagation @click.stop="reciate(item.id, item.appreciateStatus)">
<image :src="item.appreciateStatus ? 'https://cdn.cunwuyun.cn/wxmp/fengdu/zan-active.png' : 'https://cdn.cunwuyun.cn/wxmp/fengdu/zan.png'" />
<i>{{ item.appreciateCount }}</i>
</div>
@@ -91,6 +99,23 @@
})
},
reciate (id, appreciateStatus) {
this.$instance.post(`/app/appneighborhoodassistance/appreciate?id=${id}`).then(res => {
if (res.code === 0) {
this.$toast(appreciateStatus ? '取消点赞' : '点赞成功')
this.changeTab(this.currIndex)
}
})
},
previewImage (url, files) {
uni.previewImage({
current: url,
urls: files.map(v => v.url)
})
},
getList () {
if (this.isMore) return
@@ -131,6 +156,19 @@
onReachBottom () {
this.getList()
},
onShareAppMessage (e) {
this.$instance.post(`/app/appneighborhoodassistance/share?id=${e.target.dataset.id}`).then(res => {
if (res.code === 0) {
this.changeTab(this.currIndex)
}
})
return {
title: e.target.dataset.content,
path: `/pages/AppCircle/Detail?id=${e.target.dataset.id}&themeId=${e.target.dataset.themeid}&name=${e.target.dataset.name}`
}
}
}
</script>
@@ -223,7 +261,7 @@
height: 88px;
border-top: 1px solid #eeeeee;
div {
div, button {
display: flex;
align-items: center;
justify-content: center;