点赞bug
This commit is contained in:
@@ -120,10 +120,11 @@ export default {
|
||||
this.flag = true
|
||||
this.$instance.post(`/app/appcontentinfo/supportById?id=${id}`).then(res=> {
|
||||
if(res?.code==0) {
|
||||
this.flag = false
|
||||
this.list[index].upStatus = 1
|
||||
this.$u.toast(`点赞成功`)
|
||||
}
|
||||
})
|
||||
}).finally(() => this.flag = false)
|
||||
},
|
||||
toPages(url,status) {
|
||||
if(!this.user.idNumber) {
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
<div class="handpick">
|
||||
<div class="list" v-for="(item,index) in list" :key="index">
|
||||
<div class="top">
|
||||
<div class="left" @click="$linkTo(`./pickDetail?id=${item.id}`)">{{ item.content }}</div>
|
||||
<div class="left" @click="$linkTo(`./pickDetail?id=${item.id}`)">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
<div class="right" @click="upCount(item.id, index)">
|
||||
<img :src="item.upStatus == 0 ? 'https://cdn.cunwuyun.cn/wxmp/fengdu/zan.png' : 'https://cdn.cunwuyun.cn/wxmp/fengdu/zan-active.png'" alt="">
|
||||
<div>
|
||||
@@ -74,15 +76,17 @@ export default {
|
||||
},
|
||||
// 点赞
|
||||
upCount(id,index) {
|
||||
console.log(id,index);
|
||||
if (this.flag) return
|
||||
|
||||
this.flag = true
|
||||
this.$instance.post(`/app/appcontentinfo/supportById?id=${id}`).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.flag = false
|
||||
this.list[index].upStatus = 1
|
||||
this.$u.toast(`点赞成功`)
|
||||
}
|
||||
})
|
||||
}).finally(() => this.flag = false)
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
|
||||
Reference in New Issue
Block a user