From 9ebcba0036e835c586d4f6d1cd6e9bdbdce757db Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 4 Sep 2025 10:49:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=9B=B4=E6=96=B0OCR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/dateUpdate/index.vue | 10 ++++------ src/pages/standardBox/codeList.vue | 12 ++++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/pages/dateUpdate/index.vue b/src/pages/dateUpdate/index.vue index 8bcde77..5857512 100644 --- a/src/pages/dateUpdate/index.vue +++ b/src/pages/dateUpdate/index.vue @@ -264,12 +264,10 @@ const getDeviceInfo = () => { try { const systemInfoData = uni.getSystemInfoSync(); console.log('设备信息:', systemInfoData); - systemInfo.value = systemInfoData; + // systemInfo.value = systemInfoData; // 获取屏幕高度和宽度 - const screenHeight = systemInfoData.screenHeight; - const screenWidth = systemInfoData.screenWidth; - this.screenHeight = screenHeight; - this.screenWidth = screenWidth; + screenHeight.value = systemInfoData.screenHeight + screenWidth.value = systemInfoData.screenWidth } catch (error) { console.error('获取设备信息失败:', error); } @@ -646,7 +644,7 @@ const takePicture = async () => { if (!CameraPreview) { throw new Error('相机插件不可用'); } - CameraPreview.takePicture({width:this.screenWidth, height:this.screenHeight, quality: 50}, async (base64PictureData) => { + CameraPreview.takePicture({width:screenWidth.value, height:screenHeight.value, quality: 50}, async (base64PictureData) => { console.log('拍照返回数据',base64PictureData); await processImage(base64PictureData); }); diff --git a/src/pages/standardBox/codeList.vue b/src/pages/standardBox/codeList.vue index 0dac19d..363679e 100644 --- a/src/pages/standardBox/codeList.vue +++ b/src/pages/standardBox/codeList.vue @@ -354,12 +354,12 @@ const getDeviceInfo = () => { try { const systemInfoData = uni.getSystemInfoSync(); console.log('设备信息:', systemInfoData); - systemInfo.value = systemInfoData; + // systemInfo.value = systemInfoData; // 获取屏幕高度和宽度 - const screenHeight = systemInfoData.screenHeight; // 屏幕高度:1000 - const screenWidth = systemInfoData.screenWidth; // 屏幕宽度:600 - this.screenHeight = screenHeight; - this.screenWidth = screenWidth; + // const screenHeight = systemInfoData.screenHeight; // 屏幕高度:1000 + // const screenWidth = systemInfoData.screenWidth; // 屏幕宽度:600 + screenHeight.value = systemInfoData.screenHeight + screenWidth.value = systemInfoData.screenWidth } catch (error) { console.error('获取设备信息失败:', error); } @@ -532,7 +532,7 @@ const takePicture = async () => { if (!CameraPreview) { throw new Error('相机插件不可用'); } - CameraPreview.takePicture({width:this.screenWidth, height:this.screenHeight, quality: 50}, async (base64PictureData) => { + CameraPreview.takePicture({width:screenWidth.value, height:screenHeight.value, quality: 50}, async (base64PictureData) => { console.log('拍照返回数据',base64PictureData); await processImage(base64PictureData); });