From f3f3e71ff3bb51f5ae96d4c1ba42d601e61f7ec3 Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Fri, 1 Aug 2025 04:27:32 +0300 Subject: [PATCH] =?UTF-8?q?ocr=E8=AF=86=E5=88=ABUI=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E4=B8=8D=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/devicesSearch/ocrSearch.nvue | 40 ++++++-------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/src/pages/devicesSearch/ocrSearch.nvue b/src/pages/devicesSearch/ocrSearch.nvue index 2034e4a..f14b353 100644 --- a/src/pages/devicesSearch/ocrSearch.nvue +++ b/src/pages/devicesSearch/ocrSearch.nvue @@ -323,9 +323,6 @@ export default { } } try { - // 在Android上尝试全屏模式 - this.setFullscreenMode(true); - // 显示相机界面 this.showCamera = true; // 等待UI更新 @@ -335,7 +332,6 @@ export default { } catch (error) { console.error('打开相机失败:', error); this.showCamera = false; - this.setFullscreenMode(false); uni.showToast({ title: error.message || '打开相机失败', icon: 'none', @@ -360,24 +356,10 @@ export default { const screenHeight = systemInfo.screenHeight; const statusBarHeight = systemInfo.statusBarHeight || 0; - // 判断平台和设备,动态调整配置 + // 相机预览配置 - 始终使用全屏背景模式 let cameraY = 0; let cameraHeight = screenHeight; - let toBack = false; - - // Android设备处理导航栏遮挡问题 - if (systemInfo.platform === 'android') { - // 对于Android,尝试避开导航栏 - const navigationBarHeight = 44; - cameraY = statusBarHeight + navigationBarHeight; - cameraHeight = screenHeight - cameraY; - toBack = false; - } else { - // iOS或其他平台,使用全屏预览 - cameraY = 0; - cameraHeight = screenHeight; - toBack = true; - } + let toBack = true; // 设置为背景层,让UI元素显示在上方 console.log('屏幕信息:', { platform: systemInfo.platform, @@ -583,8 +565,6 @@ export default { this.showCamera = false; this.cameraStarted = false; this.resetFocusState(); - // 恢复全屏模式 - this.setFullscreenMode(false); } }, @@ -966,8 +946,6 @@ export default { } // 重置聚焦状态 this.resetFocusState(); - // 恢复全屏模式 - this.setFullscreenMode(false); } } } @@ -1021,7 +999,7 @@ export default { width: 100vw; height: 100vh; background-color: #000000; - z-index: 99999; + z-index: 1000; /* 降低层级,让UI元素显示在上方 */ } .top-tip { @@ -1029,7 +1007,7 @@ export default { top: 120rpx; left: 50%; transform: translateX(-50%); - z-index: 10; + z-index: 10001; /* 提高层级,确保显示在相机之上 */ width: 100%; text-align: center; } @@ -1049,7 +1027,7 @@ export default { top: 200rpx; left: 50%; transform: translateX(-50%); - z-index: 10; + z-index: 10001; /* 提高层级 */ text-align: center; } @@ -1067,7 +1045,7 @@ export default { top: 50%; left: 50%; transform: translate(-50%, -50%); - z-index: 10; + z-index: 10001; /* 提高取景框层级 */ } .viewfinder { @@ -1151,7 +1129,7 @@ export default { position: absolute; width: 60rpx; height: 60rpx; - z-index: 15; + z-index: 10002; /* 聚焦指示器最高层级 */ } .focus-ring { @@ -1194,7 +1172,7 @@ export default { justify-content: space-between; align-items: center; padding: 0 100rpx; - z-index: 10; + z-index: 10001; /* 提高底部控制按钮层级 */ } .control-btn { @@ -1262,7 +1240,7 @@ export default { display: flex; justify-content: center; align-items: center; - z-index: 20; + z-index: 10003; /* 加载层级最高 */ } .loading-content {