5.8
pengwei
2025-05-08 b281791abab23d672922b7e9b7d1b51e348ed710
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<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>