<template>
|
<div class="VideoSurveillance">
|
<div class="Portraitscreen" v-if="!isMobile">
|
<div class="video_top">
|
<span style="color: #fff; font-size: 10rem; font-weight: bold"
|
>监控系统</span
|
>
|
</div>
|
<div class="videobox">
|
<div class="video_l">
|
<span style="color: #fff; font-size: 5rem; font-weight: bold"
|
>视频监控左侧</span
|
>
|
<img src="@/assets/imgs/right.png" alt="" />
|
</div>
|
<div class="video_r">
|
<span style="color: #fff; font-size: 5rem; font-weight: bold"
|
>视频监控右侧</span
|
>
|
<img src="@/assets/imgs/left.png" alt="" />
|
</div>
|
</div>
|
<div class="video_bottom">
|
<img src="@/assets/imgs/zuo.png" alt="" />
|
<img
|
src="@/assets/imgs/播放.png"
|
v-if="!isPlaying"
|
alt=""
|
@click="playVideo"
|
/>
|
<img src="@/assets/imgs/暂停.png" alt="" v-else @click="playVideo" />
|
<img src="@/assets/imgs/you.png" alt="" />
|
</div>
|
</div>
|
|
<div class="Landscapescreen" v-else>
|
<div class="video_top">
|
<span style="color: #fff; font-size: 5rem; font-weight: bold"
|
>监控系统</span
|
>
|
</div>
|
<div class="videobox">
|
<div class="video_l">
|
<span style="color: #fff; font-size: 2.5rem; font-weight: bold"
|
>视频监控左侧</span
|
>
|
<img src="@/assets/imgs/right.png" alt="" />
|
</div>
|
<div class="video_r">
|
<span style="color: #fff; font-size: 2.5rem; font-weight: bold"
|
>视频监控右侧</span
|
>
|
<img src="@/assets/imgs/left.png" alt="" />
|
</div>
|
</div>
|
<div class="video_bottom">
|
<img src="@/assets/imgs/zuo.png" alt="" />
|
<img
|
src="@/assets/imgs/播放.png"
|
alt=""
|
v-if="!isPlaying"
|
@click="playVideo"
|
/>
|
<img src="@/assets/imgs/暂停.png" alt="" v-else @click="playVideo" />
|
<img src="@/assets/imgs/you.png" alt="" />
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
import { ref, onMounted, onUnmounted, nextTick } from "vue";
|
import { useRouter } from "vue-router";
|
const router = useRouter();
|
const isMobile = ref(false);
|
//是否在播放
|
const isPlaying = ref(false);
|
|
const playVideo = () => {
|
isPlaying.value = !isPlaying.value;
|
// 播放视频的逻辑
|
console.log("播放视频");
|
};
|
onMounted(() => {
|
// 监听窗口大小变化
|
window.addEventListener("resize", () => {
|
nextTick(() => {
|
if (window.innerWidth > 1080) {
|
isMobile.value = true;
|
} else {
|
isMobile.value = false;
|
}
|
});
|
});
|
// 初始化时判断窗口大小
|
if (window.innerWidth > 1080) {
|
// 如果窗口宽度小于1080px,执行相应的操作
|
isMobile.value = true;
|
} else {
|
// 如果窗口宽度大于等于1080px,执行相应的操作
|
isMobile.value = false;
|
}
|
});
|
</script>
|
|
<style lang="scss" scoped>
|
.VideoSurveillance {
|
width: 100%;
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
background-color: rgba(26, 74, 143, 0.9);
|
.Portraitscreen {
|
width: 100%;
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
.videobox {
|
width: 100%;
|
height: 50%;
|
justify-content: space-around;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
.video_l {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
width: 70rem;
|
border: 0.75rem solid rgba(255, 255, 255, 0.8);
|
}
|
.video_r {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
width: 70rem;
|
border: 0.75rem solid rgba(255, 255, 255, 0.8);
|
}
|
}
|
.video_bottom {
|
width: 80%;
|
height: 20%;
|
display: flex;
|
justify-content: space-around;
|
align-items: center;
|
background-color: rgba(26, 74, 143, 0.2);
|
img {
|
width: 15rem;
|
height: 15rem;
|
// border-radius: 50%;
|
cursor: pointer;
|
}
|
}
|
}
|
.Landscapescreen {
|
width: 100%;
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
.videobox {
|
width: 100%;
|
height: 50%;
|
justify-content: space-around;
|
display: flex;
|
align-items: center;
|
.video_l {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
width: 50rem;
|
border: 0.5rem solid rgba(255, 255, 255, 0.8);
|
}
|
.video_r {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
width: 50rem;
|
border: 0.5rem solid rgba(255, 255, 255, 0.8);
|
}
|
}
|
.video_bottom {
|
width: 80%;
|
height: 20%;
|
display: flex;
|
justify-content: space-around;
|
align-items: center;
|
background-color: rgba(26, 74, 143, 0.2);
|
margin-top: 5rem;
|
img {
|
width: 10rem;
|
height: 10rem;
|
// border-radius: 50%;
|
cursor: pointer;
|
}
|
}
|
}
|
}
|
</style>
|