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); });