This commit is contained in:
duanliang
2025-04-22 22:05:44 +08:00
parent d8a7a0f53e
commit 3bff33bf03
21 changed files with 318 additions and 119 deletions

View File

@@ -61,7 +61,7 @@
class="video-item"
v-for="(item, index) in videoList"
:key="index"
@click="handleItemVideo(item.hlsUrl, 100, item.cameraIndexCode)"
@click="handleItemVideo(item.hlsUrl, 100, item.cameraIndexCode,item)"
>
<div class="video-item__inner">
<div
@@ -110,6 +110,10 @@
<source type="application/x-mpegURL" />
</video>
<div class="action-box">
<div class="action-item">
<span class="item-sc" @click="handleCollect(thisVideo.cameraIndexCode, thisVideo.isCollect, index)" v-if="thisVideo.isCollect==0">关注</span>
<span class="item-sc" @click="handleCollect(thisVideo.cameraIndexCode, thisVideo.isCollect, index)" v-else="thisVideo.isCollect==1">取消关注</span>
</div>
<div class="action-item">
<img src="@/assets/images/plus.png" title="焦距变大" @click="handleAction(Z00M_IN)" />
<span>聚焦</span>
@@ -142,7 +146,7 @@
class="item"
v-for="(item, index) in videoList"
:key="index"
@click="handleItemVideo(item.hlsUrl, 101, item.handleItemVideo)"
@click="handleItemVideo(item.hlsUrl, 101, item.handleItemVideo,item)"
>
<div>
<p class="item-title--primary">
@@ -176,7 +180,7 @@
<el-pagination background layout="prev, pager, next" :total="1000" />
</div> -->
</div>
<VideoDialog v-model="show" :cameraIndexCode="cameraIndexCode" :isCollect="isCollect" :src="videoSrc" />
<VideoDialog v-model="show" :cameraIndexCode="cameraIndexCode" :isDiy="isDiy" :isCollect="isCollect" :src="videoSrc" />
</template>
<script setup>
@@ -238,8 +242,11 @@
isCollect: status == 0 ? 1 : 0
})
if (status == 0) {
thisVideo.value.isCollect=1
videoList.value[index].isCollect = 1
} else {
thisVideo.value.isCollect=0
videoList.value[index].isCollect = 0
}
pubSub.publish('videoCollect', id)
@@ -272,6 +279,7 @@
initVideo()
}
let isCollect = ref(0)
let isDiy = ref(0)
let videoSrc = ref('')
const handleCamera = async (itemCode,resource) => {
show.value = true
@@ -281,6 +289,7 @@
})
cameraIndexCode.value = itemCode;
isCollect.value = resource.isCollect
isDiy.value = resource.isDiy
videoSrc.value = res.data.url
}
//清除 hls
@@ -339,7 +348,7 @@
break;
default:
console.log('无法恢复的错误,销毁播放器');
hls.destroy();
// hls.destroy();
break;
}
}
@@ -358,7 +367,9 @@
}
}
const handleItemVideo = (url, type, code) => {
let thisVideo = ref(null)
const handleItemVideo = (url, type, code,item) => {
thisVideo.value = item
videoLog.value = 2
cameraIndexCode.value = code
setTimeout(() => {
@@ -446,6 +457,9 @@
</script>
<style></style>
<style scoped lang="scss">
.item-sc{
padding:vw(10);
}
.empty-box{
display:flex;
align-items: center;