From 2134b44689c9b605ff3948c50774e9916d2a3bbd Mon Sep 17 00:00:00 2001 From: duanliang <540489889@qq.com> Date: Fri, 30 May 2025 22:05:42 +0800 Subject: [PATCH] =?UTF-8?q?bug=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/VideoDialog/index.vue | 35 +++++++++++----------- src/views/collect/components/video-box.vue | 22 +++++++++++--- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/components/VideoDialog/index.vue b/src/components/VideoDialog/index.vue index 3f397a0..d3e5f35 100644 --- a/src/components/VideoDialog/index.vue +++ b/src/components/VideoDialog/index.vue @@ -49,8 +49,8 @@
-
收藏
-
取消收藏
+
收藏
+
取消收藏
@@ -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 { diff --git a/src/views/collect/components/video-box.vue b/src/views/collect/components/video-box.vue index c2481d7..da8298e 100644 --- a/src/views/collect/components/video-box.vue +++ b/src/views/collect/components/video-box.vue @@ -14,7 +14,7 @@ width:(100/grad)+'%' }"> -
+
-->
- +