ocr识别UI层级不展示问题修复
This commit is contained in:
		
							parent
							
								
									6a02be057f
								
							
						
					
					
						commit
						f3f3e71ff3
					
				| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue