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