This commit is contained in:
hayu 2025-08-29 11:22:33 +08:00
parent 461bb7fd56
commit 9c7d3da158
1 changed files with 9 additions and 2 deletions

View File

@ -186,7 +186,9 @@ export default {
isOverToday: false, isOverToday: false,
isShow: false, isShow: false,
message: '', message: '',
position: 'bottom' // 'top' | 'bottom' position: 'bottom',
screenHeight: null,
screenWidth: null,
} }
}, },
onBackPress(options) { onBackPress(options) {
@ -244,6 +246,11 @@ export default {
const systemInfo = uni.getSystemInfoSync(); const systemInfo = uni.getSystemInfoSync();
console.log('设备信息:', systemInfo); console.log('设备信息:', systemInfo);
this.systemInfo = systemInfo; this.systemInfo = systemInfo;
//
const screenHeight = systemInfo.screenHeight; // 1000
const screenWidth = systemInfo.screenWidth; // 600
this.screenHeight = screenHeight;
this.screenWidth = screenWidth;
} catch (error) { } catch (error) {
console.error('获取设备信息失败:', error); console.error('获取设备信息失败:', error);
} }
@ -510,7 +517,7 @@ export default {
// //
console.log('拍照前聚焦...'); console.log('拍照前聚焦...');
console.log('开始拍照...'); console.log('开始拍照...');
CameraPreview.takePicture({width:640, height:540, quality: 50}, async (base64PictureData) => { CameraPreview.takePicture({width:this.screenWidth, height:this.screenHeight, quality: 50}, async (base64PictureData) => {
console.log('拍照返回数据',base64PictureData); console.log('拍照返回数据',base64PictureData);
await this.processImage(base64PictureData); await this.processImage(base64PictureData);
}); });