This commit is contained in:
2025-12-29 16:41:28 +08:00
parent 6241504095
commit 1c908284e6
4 changed files with 53 additions and 23 deletions
+13 -3
View File
@@ -2,10 +2,15 @@
<transition name="video-fade">
<div v-if="isVisible" id="videoComponent">
<video
@click="
() => {
console.log('aa');
videoRef!.muted = false;
}
"
ref="videoRef"
class="video"
:src="src"
muted
autoplay
preload="auto"
playsinline
@@ -51,15 +56,21 @@
onMounted(() => {
if (videoRef.value) {
// 显式静音
videoRef.value.muted = true;
videoRef.value.muted = false;
// 尝试播放
const playPromise = videoRef.value.play();
const v = videoRef.value;
if (playPromise !== undefined) {
playPromise.catch((error) => {
console.warn('自动播放尝试失败,请检查视频源:', error);
v.muted = true;
v.play().catch((error) => {
console.warn('再次自动播放尝试失败,直接关闭遮罩:', error);
// 如果依然无法播放,直接销毁遮罩
isVisible.value = false;
});
});
}
}
});
@@ -84,7 +95,6 @@
width: 100vw;
height: 100vh;
overflow: hidden;
pointer-events: none;
z-index: 99999;
background-color: #000;
+1 -1
View File
@@ -34,7 +34,7 @@
</div>
</div>
<VideoComponent v-if="videoUrl" :src="videoUrl" />
<VideoComponent @click.stop v-if="videoUrl" :src="videoUrl" />
</div>
</template>
<script setup lang="ts">
+22
View File
@@ -210,6 +210,16 @@ export function infoContentSpecial(res: any) {
<div style="margin: 0 10px;font-size: 16px">${res.type === '1' ? '油田医院' : res.type === '4' ? 'AED' : '健康小屋'}</div>
<div class="top-left-a-right"></div>
</div>
${
res.type !== '3'
? `
<div class="modal-item" style="justify-content: flex-start">
<div class="item-one" style="width: auto !important;">${res.type === '1' ? '医院' : 'AED'}名称:</div>
<div class="item-two" style="text-align: left: color: #5CFBFF; flex: 1">${res.name || '--'}</div>
</div>
`
: ''
}
<div class="modal-item" style="justify-content: flex-start">
<div class="item-one" style="width: auto !important;">地点:</div>
<div class="item-two" style="text-align: left: color: #5CFBFF; flex: 1">${res.address || '--'}</div>
@@ -236,6 +246,18 @@ export function infoContentSpecial(res: any) {
`
: ''
}
${
res.type === '3'
? `
<div class="modal-item" style="">
<div style="display: flex; flex: 1">
<div class="item-one" style="width: auto !important;">单位:</div>
<div class="item-two" style="text-align: left: color: #5CFBFF; flex: 1">${res.name || '--'}</div>
</div>
</div>
`
: ''
}
${
res.type === '4'
? `
+8 -10
View File
@@ -50,12 +50,14 @@
v-if="randCodeData.requestCodeSuccess"
:src="randCodeData.randCodeImage"
@click="handleChangeCheckCode"
alt=""
/>
<img
v-else
:src="codeImg"
style="margin-top: 2px; max-width: initial"
@click="handleChangeCheckCode"
alt=""
/>
</div>
</div>
@@ -207,11 +209,7 @@
const requestFull = () => {
const docElm = document.documentElement as any;
const requestMethod =
docElm.requestFullscreen ||
docElm.mozRequestFullScreen ||
docElm.webkitRequestFullScreen ||
docElm.msRequestFullscreen;
const requestMethod = docElm.requestFullscreen || docElm.mozRequestFullScreen || docElm.webkitRequestFullScreen || docElm.msRequestFullscreen;
if (requestMethod) {
// 返回 promise 以便捕获可能的拒绝
@@ -264,11 +262,11 @@
goPath = PageEnum.BASE_HOME;
}
try {
await requestFull();
} catch (screenError) {
console.warn('自动进入全屏失败,请手动按 F11:', screenError);
}
// try {
// await requestFull();
// } catch (screenError) {
// console.warn('自动进入全屏失败,请手动按 F11:', screenError);
// }
notification.success({
message: t('login.loginSuccessTitle'),