点赞bug

This commit is contained in:
花有清香月有阴
2022-02-18 16:03:18 +08:00
parent f189e13195
commit 9221b97d91

View File

@@ -43,21 +43,37 @@
<div class="rightFlex"> <div class="rightFlex">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/2.png" alt="" class="img2" @click="poupShow = true" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/2.png" alt="" class="img2" @click="poupShow = true" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" class="img3" @click="like" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" class="img3" @click="like" v-if="detail.upFlag == 0" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/33.png" alt="" class="img3" @click="like" v-if="detail.upFlag == 1" />
</div> </div>
</div> </div>
</div> </div>
<div class="reply"> <div class="reply" v-if="tabCurrent1 == 0">
<div class="replyTop" @click="deleShowBtn(item)"> <div class="replyTop" @click="deleShowBtn(item)">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" />
<span class="people"> <span class="people">
<span v-for="(items, index) in detail.comments || detail.villagerCircleInfo.comments" :key="index" v-if="index < 3">{{ items.replyUserName }}</span> <span v-for="(items, index) in detail.comments" :key="index" v-if="index < 3">{{ items.replyUserName }}</span>
{{ detail.villagerCircleInfo ? detail.villagerCircleInfo.comments.length : detail.comments.length }}</span {{ detail.comments.length }}</span
> >
</div> </div>
<div class="replyCont" @click="deleShowBtn(item)" v-for="(item, i) in detail.comments || detail.villagerCircleInfo.comments" :key="i"> <div class="replyCont" @click="deleShowBtn(item)" v-for="(item, i) in detail.comments" :key="i">
<span class="nameLeft">{{ item.replyUserName }} : </span>
<span class="contRight"> {{ item.content }}</span>
</div>
</div>
<div class="reply" v-if="tabCurrent1 == 1">
<div class="replyTop" @click="deleShowBtn(item)">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" />
<span class="people">
<span v-for="(items, index) in detail.villagerCircleInfo.comments" :key="index" v-if="index < 3">{{ items.replyUserName }}</span>
{{ detail.villagerCircleInfo.comments.length }}</span
>
</div>
<div class="replyCont" @click="deleShowBtn(item)" v-for="(item, i) in detail.villagerCircleInfo.comments" :key="i">
<span class="nameLeft">{{ item.replyUserName }} : </span> <span class="nameLeft">{{ item.replyUserName }} : </span>
<span class="contRight"> {{ item.content }}</span> <span class="contRight"> {{ item.content }}</span>
</div> </div>
@@ -172,7 +188,7 @@ export default {
.then((res) => { .then((res) => {
this.$hideLoading() this.$hideLoading()
if (res.code === 0) { if (res.code === 0) {
this.$u.toast(detail.upFlag == 0 ? '点赞成功' : '取消点赞成功') this.$u.toast(this.detail.upFlag == 0 ? '点赞成功' : '取消点赞成功')
this.getDetail() this.getDetail()
setTimeout(() => { setTimeout(() => {
this.flagLike = false this.flagLike = false
@@ -189,10 +205,10 @@ export default {
this.$instance this.$instance
.post(`/app/appvillagercirclecomment/delete?ids=${this.deleId}`) .post(`/app/appvillagercirclecomment/delete?ids=${this.deleId}`)
.then((res) => { .then((res) => {
if (res?.data) { if (res.code == 0) {
this.deleShow = false this.deleShow = false
this.modalShow = false
this.deleId = '' this.deleId = ''
this.modalShow = false
this.getDetail() this.getDetail()
} }
}) })
@@ -203,8 +219,7 @@ export default {
}, },
deleShowBtn(item) { deleShowBtn(item) {
// this.deleId = item.id this.deleId = item.id
this.deleId = '999'
this.deleShow = true this.deleShow = true
}, },