关注bug 修改
This commit is contained in:
@@ -36,13 +36,13 @@
|
||||
</div>
|
||||
<div class="action-item">
|
||||
<div
|
||||
v-if="colletCond == 1"
|
||||
v-if="isCollect == 1"
|
||||
class="video-follow"
|
||||
@click.stop="handleCollect()"
|
||||
>取消关注
|
||||
</div>
|
||||
<div
|
||||
v-if="colletCond == 0"
|
||||
v-if="isCollect == 0"
|
||||
class="video-unfollow"
|
||||
@click.stop="handleCollect()"
|
||||
>关注
|
||||
@@ -97,10 +97,13 @@
|
||||
() => props.isCollect,
|
||||
(val) => {
|
||||
if (val) {
|
||||
console.log(val,'val 2222222222222222222222')
|
||||
colletCond.value = val
|
||||
// setTimeout(() => {
|
||||
// init()
|
||||
// }, 1000)
|
||||
}else{
|
||||
colletCond.value = 0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -109,16 +112,18 @@
|
||||
)
|
||||
// 关注
|
||||
const handleCollect = async (id, status, index) => {
|
||||
// console.log(props.isCollect,777788888)
|
||||
await postVideoCollectApi({
|
||||
cameraIndexCode:props.cameraIndexCode,
|
||||
isCollect: colletCond.value == 0 ? 1 : 0
|
||||
isCollect: props.isCollect == 0 ? 1 : 0
|
||||
})
|
||||
if (colletCond.value == 0) {
|
||||
colletCond.value = 1
|
||||
if (props.isCollect == 0) {
|
||||
props.isCollect = 1
|
||||
} else {
|
||||
colletCond.value = 0
|
||||
props.isCollect = 0
|
||||
}
|
||||
pubSub.publish('videoCollect', props.cameraIndexCode)
|
||||
modelValue.value = false
|
||||
}
|
||||
const handleAction = async (e) => {
|
||||
if (e == STOP) {
|
||||
@@ -177,6 +182,7 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<video-dialog v-model="videoShow" :src="src" :cameraIndexCode="cameraIndexCode" />
|
||||
<video-dialog v-model="videoShow" :src="src" :isCollect="isCollect" :cameraIndexCode="cameraIndexCode" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -45,7 +45,7 @@
|
||||
import pubSub from 'pubsub-js'
|
||||
|
||||
let modelValue = defineModel()
|
||||
|
||||
let isCollect = ref(0)
|
||||
let list = ref([])
|
||||
let hlsRefs = []
|
||||
let total = ref(0)
|
||||
@@ -68,8 +68,17 @@
|
||||
}
|
||||
}
|
||||
)
|
||||
const onVideoCollect = () => {
|
||||
pubSub.subscribe('videoCollect', () => {
|
||||
console.log(1111111111111111111111)
|
||||
clearHlsRefs()
|
||||
getVideoList()
|
||||
})
|
||||
}
|
||||
const handleItem = (item) => {
|
||||
console.log(item,'iscollect')
|
||||
src.value = item.hlsUrl
|
||||
isCollect.value = item.isCollect
|
||||
cameraIndexCode.value = item.cameraIndexCode
|
||||
videoShow.value = true
|
||||
}
|
||||
@@ -125,7 +134,9 @@
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {})
|
||||
onMounted(() => {
|
||||
onVideoCollect()
|
||||
})
|
||||
onUnmounted(() => {})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ let isCollect = ref(0)
|
||||
|
||||
const postVideoRemain = () => {
|
||||
timer = setInterval(() => {
|
||||
if(!list.value.length) return false;
|
||||
postVideoRemainApi({
|
||||
cameraIndexCode: list.value.map((item) => item.cameraIndexCode)
|
||||
})
|
||||
@@ -99,8 +100,15 @@ let isCollect = ref(0)
|
||||
pageSize: 5
|
||||
})
|
||||
list.value = res.data
|
||||
console.log(list.value,'list.valuelist.valuelist.valuelist.value')
|
||||
console.log(list.value,'ddsdsdsfdd')
|
||||
if(list.value.length){
|
||||
postVideoRemain()
|
||||
}else{
|
||||
console.log('清除定时器')
|
||||
//清除定时器
|
||||
if (timer) clearInterval(timer)
|
||||
}
|
||||
// console.log(list.value,'list.valuelist.valuelist.valuelist.value')
|
||||
// nextTick(() => {
|
||||
// list.value.forEach(async (item, index) => {
|
||||
// var video = document.getElementById(`video${index}`)
|
||||
@@ -135,6 +143,7 @@ let isCollect = ref(0)
|
||||
const onVideoCollect = () => {
|
||||
pubSub.subscribe('videoCollect', () => {
|
||||
clearHlsRefs()
|
||||
// getVideoList()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
navLeft.value = res.data
|
||||
|
||||
current.value = res.data[0].id
|
||||
title.value = navLeft.value[current.value].name
|
||||
title.value = navLeft.value[0].name
|
||||
pubSub.publish('scenicChange', navLeft.value[0])
|
||||
otherLeftNav.value = [
|
||||
// {
|
||||
@@ -287,6 +287,7 @@
|
||||
...spotRes.data
|
||||
]
|
||||
current.value = navLeft.value[0].id
|
||||
title.value = navLeft.value[0].name
|
||||
break
|
||||
case '/sceneTesting':
|
||||
title.value = '三峡之巅-安全检测'
|
||||
@@ -337,9 +338,10 @@
|
||||
isBack.value = true
|
||||
let hotelRes = await getHotelListApi({ hotelStadiumType: 1 })
|
||||
navLeft.value = hotelRes.data.slice(0, 3)
|
||||
current.vlaue = navLeft.value[0].id
|
||||
otherLeftNav.value = hotelRes.data.slice(3, hotelRes.data.length - 1)
|
||||
let venueRes = await getHotelListApi({ hotelStadiumType: 2 })
|
||||
console.log(venueRes,'venueRes')
|
||||
// console.log(venueRes,'venueRes')
|
||||
navRight.value = venueRes.data.slice(0, 3)
|
||||
otherRightNav.value = venueRes.data.slice(3, venueRes.data.length - 1)
|
||||
pubSub.publish('hotelChange', hotelRes.data[0])
|
||||
|
||||
@@ -468,12 +468,12 @@
|
||||
right:vw(20);
|
||||
top:50%;
|
||||
transform: translateY(-50%);
|
||||
padding: vw(16);
|
||||
padding: vw(12);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #0a4190;
|
||||
border-radius: vw(8);
|
||||
font-size:vw(24);
|
||||
font-size:vw(22);
|
||||
color:#fff;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user