优化视频聊天页

This commit is contained in:
tangxinyue 2026-06-18 17:17:59 +08:00
parent fe48026d19
commit b90c0c6774
2 changed files with 55 additions and 15 deletions

View File

@ -115,7 +115,7 @@
<image class="title-img" src="/static/image/index/qita.png"></image>
<view class="video-help-box">
<template v-for="item in otherList" :key="item.id">
<view class="video-help-item" :style="{ width: (windowWidth - 32) / 4 + 'px' }"
<view class="video-help-item" :style="{ width: (windowWidth - 36) / 4 + 'px' }"
@click="clickMenu(item)" v-if="isShowBankIdCard(item)">
<image class="video-help-img" :src="item.icon"></image>
<text class="video-help-title">{{ item.name }}</text>
@ -277,7 +277,7 @@ const otherList = [{
},
{
icon: "/static/image/index/qita/danliao.png",
name: "视频单聊",
name: "视频聊天",
path: "/pages/other/video-chat/video-chat"
},
{

View File

@ -622,6 +622,12 @@ onShow(() => {
// #ifdef APP-PLUS
util.setAndroidSystemBarColor('#FFFFFF')
// 强制隐藏安卓底部的系统虚拟导航栏(实现全面屏沉浸)
// if (plus.navigator.hideSystemNavigation) {
// plus.navigator.hideSystemNavigation()
// }
// 保存定时器引用,以便在页面卸载时清理
statusBarTimer = setTimeout(() => {
plus.navigator.setStatusBarStyle("light");
@ -629,6 +635,31 @@ onShow(() => {
// #endif
})
// #ifdef APP-PLUS
// const restoreSystemNavigation = () => {
// if (plus.os.name === 'Android') {
// try {
// const main = plus.android.runtimeMainActivity();
// if (main) {
// const window = main.getWindow();
// const decorView = window.getDecorView();
// const View = plus.android.importClass("android.view.View");
// const uiOptions = decorView.getSystemUiVisibility();
// // 移除隐藏导航栏的 flag,保留其他的(如状态栏文字颜色设定)
// const newUiOptions = uiOptions & ~View.SYSTEM_UI_FLAG_HIDE_NAVIGATION & ~View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
// decorView.setSystemUiVisibility(newUiOptions);
// // 重新恢复底部导航栏的透明背景(与 pages.json 全局设定保持一致)
// const Color = plus.android.importClass("android.graphics.Color");
// window.setNavigationBarColor(Color.TRANSPARENT);
// }
// } catch (e) {
// console.log('恢复系统导航栏失败:', e);
// }
// }
// }
// #endif
// 页面隐藏时清理定时器,防止返回时出错
onHide(() => {
// 清理状态栏定时器
@ -649,6 +680,11 @@ onHide(() => {
stopTimer() // 停止计时
// #ifdef APP-PLUS
// restoreSystemNavigation()
// #endif
console.log('🚪 页面隐藏,已清理定时器和状态')
})
@ -667,6 +703,10 @@ onUnmounted(() => {
data.dragState.longPressTimer = null
}
// #ifdef APP-PLUS
// restoreSystemNavigation()
// #endif
console.log('🧹 页面卸载,已清理所有定时器')
})