feat:对接全屏弹框
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
() => dataRes.value,
|
||||
(val) => {
|
||||
if (val) {
|
||||
console.log(val, '首页接受数据')
|
||||
switch (val.type) {
|
||||
case 'userPortrait':
|
||||
homeStore.setUserPortraitData(val.data)
|
||||
|
||||
@@ -211,13 +211,15 @@
|
||||
})
|
||||
let hlsRefs = []
|
||||
let hlsRef = null
|
||||
// const postVideoRemain = async () => {
|
||||
// setInterval(() => {
|
||||
// postVideoRemainApi({
|
||||
// cameraIndexCode: videoList.value.map((item) => item.cameraIndexCode)
|
||||
// })
|
||||
// }, 3000)
|
||||
// }
|
||||
let timer = null
|
||||
|
||||
const postVideoRemain = async () => {
|
||||
timer = setInterval(() => {
|
||||
postVideoRemainApi({
|
||||
cameraIndexCode: videoList.value.map((item) => item.cameraIndexCode)
|
||||
})
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
const initVideo = () => {
|
||||
clearHlsRefs()
|
||||
@@ -337,6 +339,7 @@
|
||||
let res = await getVideoListApi(params)
|
||||
total.value = res.total
|
||||
if (res.data.length > 0) {
|
||||
postVideoRemain()
|
||||
videoList.value = res.data
|
||||
nextTick(() => {
|
||||
videoList.value.forEach(async (x, index) => {
|
||||
@@ -354,6 +357,8 @@
|
||||
hlsRefs.push(hls)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
if (timer) clearInterval(timer)
|
||||
}
|
||||
loading.value = false
|
||||
} catch (error) {
|
||||
@@ -398,6 +403,7 @@
|
||||
})
|
||||
onUnmounted(() => {
|
||||
clearHlsRefs()
|
||||
if (timer) clearInterval(timer)
|
||||
pubSub.unsubscribe(monitorChange)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user