关注bug 修改

This commit is contained in:
duanliang
2025-03-25 12:41:26 +08:00
parent 0f87b8d052
commit 3f03c23970
6 changed files with 44 additions and 16 deletions

View File

@@ -36,13 +36,13 @@
</div>
<div class="action-item">
<div
v-if="colletCond == 1"
v-if="isCollect == 1"
class="video-follow"
@click.stop="handleCollect()"
>取消关注
</div>
<div
v-if="colletCond == 0"
v-if="isCollect == 0"
class="video-unfollow"
@click.stop="handleCollect()"
>关注
@@ -97,11 +97,14 @@
() => props.isCollect,
(val) => {
if (val) {
console.log(val,'val 2222222222222222222222')
colletCond.value = val
// setTimeout(() => {
// init()
// }, 1000)
}
}else{
colletCond.value = 0
}
},
{
immediate: true
@@ -109,16 +112,18 @@
)
// 关注
const handleCollect = async (id, status, index) => {
// console.log(props.isCollect,777788888)
await postVideoCollectApi({
cameraIndexCode:props.cameraIndexCode,
isCollect: colletCond.value == 0 ? 1 : 0
isCollect: props.isCollect == 0 ? 1 : 0
})
if (colletCond.value == 0) {
colletCond.value = 1
if (props.isCollect == 0) {
props.isCollect = 1
} else {
colletCond.value = 0
props.isCollect = 0
}
pubSub.publish('videoCollect', props.cameraIndexCode)
modelValue.value = false
}
const handleAction = async (e) => {
if (e == STOP) {
@@ -177,6 +182,7 @@
}
})
}
onMounted(()=>{
})