bug 修改
This commit is contained in:
@@ -49,8 +49,8 @@
|
||||
|
||||
</div>
|
||||
<div class="action-item">
|
||||
<div class="video-follow" @click="handleCollectAdd(cameraIndexCode, isDiy, index)" v-if="isDayCurr==0">收藏</div>
|
||||
<div class="video-follow" @click="handleCollectAdd(cameraIndexCode, isDiy, index)" v-else="isDayCurr==1">取消收藏</div>
|
||||
<div class="video-follow" @click="handleCollectAdd(cameraIndexCode, isDiy, index)" v-if="isDiy==0">收藏</div>
|
||||
<div class="video-follow" @click="handleCollectAdd(cameraIndexCode, isDiy, index)" v-else="isDiy==1">取消收藏</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -98,38 +98,36 @@
|
||||
let videoRef = ref()
|
||||
let webRtcServer = null
|
||||
let hlsRef = null
|
||||
|
||||
let colletCond = ref(props.isCollect)
|
||||
let isDayCurr = ref(props.isDiy)
|
||||
watch(
|
||||
() => props.isCollect,
|
||||
() =>modelValue.value,
|
||||
(val) => {
|
||||
if (val) {
|
||||
// colletCond.value = val
|
||||
// setTimeout(() => {
|
||||
// init()
|
||||
// }, 1000)
|
||||
}else{
|
||||
// colletCond.value = 0
|
||||
}
|
||||
// colletCond.value = props.isCollect
|
||||
// isDayCurr.value = props.isDiy
|
||||
console.log(props.isDiy,'val[0].value')
|
||||
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
let colletCond = ref(props.isCollect)
|
||||
let isDayCurr = ref(props.isDiy)
|
||||
const emit = defineEmits(['isDiyChange']);
|
||||
// 收藏
|
||||
const handleCollectAdd = async (id, status, index) => {
|
||||
await getColletDiyApi({
|
||||
cameraIndexCode:id,
|
||||
isDiy: isDayCurr.value == 0 ? 1 : 0
|
||||
cameraIndexCode:props.cameraIndexCode,
|
||||
isDiy: props.isDiy == 0 ? 1 : 0
|
||||
})
|
||||
if(isDayCurr.value==1){
|
||||
|
||||
if(props.isDiy==1){
|
||||
isDayCurr.value=0
|
||||
// modelValue.value = false
|
||||
}else{
|
||||
isDayCurr.value=1
|
||||
}
|
||||
pubSub.publish('videoIsDiy',{isDiy:isDayCurr.value,cameraIndexCode:props.cameraIndexCode} )
|
||||
emit('isDiyChange', isDayCurr.value);
|
||||
pubSub.publish('videoIsDiy',{isDiy:props.isDiy,cameraIndexCode:props.cameraIndexCode} )
|
||||
|
||||
}
|
||||
// 关注
|
||||
@@ -138,6 +136,7 @@
|
||||
cameraIndexCode:props.cameraIndexCode,
|
||||
isCollect: colletCond.value == 0 ? 1 : 0
|
||||
})
|
||||
|
||||
if (colletCond.value == 0) {
|
||||
colletCond.value = 1
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user