视频切换的问题

This commit is contained in:
aixianling
2024-08-23 18:09:52 +08:00
parent 397ab462e8
commit 10649673b2
2 changed files with 31 additions and 21 deletions

View File

@@ -38,7 +38,7 @@ export default {
]
},
curI: 0,
curJ: 0
curJ: {},
}
},
computed: {
@@ -47,6 +47,7 @@ export default {
const list = []
let group = []
for (const e of v.stores) {
v.curJ[e.storeCode] = 0
if (group.length < 4) {
group.push(e)
} else {
@@ -54,7 +55,9 @@ export default {
group = [e]
}
}
if (group.length > 0) list.push(group.reverse())
if (group.length > 0) {
list.push(group.reverse())
}
return list
},
},
@@ -157,14 +160,14 @@ export default {
<template>
<section class="AppStoresTable" @click="dialog=false">
<el-carousel indicator-position="outside" :height="height" :autoplay="search.changeWay==1" @change="v=>curI=(v||0)" :interval="60000">
<el-carousel indicator-position="outside" :height="height" :autoplay="search.changeWay==1" @change="v=>curI=(v||0)" :interval="60000" arrow="never">
<el-carousel-item v-for="(group,i) in storeList" :key="i">
<div class="layout">
<div class="store" v-for="store in group" :key="store.storeCode">
<div class="headerTitle" v-text="store.storeName" @click="gotoDetail(store)"/>
<el-carousel indicator-position="none" height="250px" @change="v=>curJ=(v||0)" :autoplay="false">
<el-carousel indicator-position="none" height="250px" @change="v=>curJ[store.storeCode]=(v||0)" :autoplay="false">
<el-carousel-item v-for="(url,j) in store.camera" :key="[i,j].join('_')">
<hls-player v-if="`${i}_${j}`==`${curI}_${curJ}`" :id="`hls_player_${store.storeCode}_${i}_${j}`" :url="url"/>
<hls-player v-if="`${i}_${j}`==`${curI}_${curJ[store.storeCode]}`" :id="`hls_player_${store.storeCode}_${i}_${j}`" :url="url"/>
</el-carousel-item>
</el-carousel>
<div class="subTitle" v-text="'品类销售情况'"/>