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