This commit is contained in:
parent
af7b61a290
commit
fc7b1fc82b
|
|
@ -178,6 +178,8 @@ const pluginCheckRetries = ref(0)
|
||||||
const maxRetries = ref(5)
|
const maxRetries = ref(5)
|
||||||
const focusTimeout = ref(null)
|
const focusTimeout = ref(null)
|
||||||
const systemInfo = ref(null)
|
const systemInfo = ref(null)
|
||||||
|
const screenHeight=ref(null)
|
||||||
|
const screenWidth=ref(null)
|
||||||
|
|
||||||
const currentDate = ref('')
|
const currentDate = ref('')
|
||||||
const minDate = ref('')
|
const minDate = ref('')
|
||||||
|
|
@ -263,6 +265,11 @@ const getDeviceInfo = () => {
|
||||||
const systemInfoData = uni.getSystemInfoSync();
|
const systemInfoData = uni.getSystemInfoSync();
|
||||||
console.log('设备信息:', systemInfoData);
|
console.log('设备信息:', systemInfoData);
|
||||||
systemInfo.value = systemInfoData;
|
systemInfo.value = systemInfoData;
|
||||||
|
// 获取屏幕高度和宽度
|
||||||
|
const screenHeight = systemInfoData.screenHeight;
|
||||||
|
const screenWidth = systemInfoData.screenWidth;
|
||||||
|
this.screenHeight = screenHeight;
|
||||||
|
this.screenWidth = screenWidth;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取设备信息失败:', error);
|
console.error('获取设备信息失败:', error);
|
||||||
}
|
}
|
||||||
|
|
@ -639,7 +646,7 @@ const takePicture = async () => {
|
||||||
if (!CameraPreview) {
|
if (!CameraPreview) {
|
||||||
throw new Error('相机插件不可用');
|
throw new Error('相机插件不可用');
|
||||||
}
|
}
|
||||||
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 processImage(base64PictureData);
|
await processImage(base64PictureData);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,9 @@ export default {
|
||||||
focusTimeout: null,
|
focusTimeout: null,
|
||||||
// 设备信息
|
// 设备信息
|
||||||
systemInfo: null,
|
systemInfo: null,
|
||||||
isOverToday: false
|
isOverToday: false,
|
||||||
|
screenHeight: null,
|
||||||
|
screenWidth: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onBackPress(options) {
|
onBackPress(options) {
|
||||||
|
|
@ -230,6 +232,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);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,8 @@ const pluginCheckRetries = ref(0)
|
||||||
const maxRetries = ref(5)
|
const maxRetries = ref(5)
|
||||||
const focusTimeout = ref(null)
|
const focusTimeout = ref(null)
|
||||||
const systemInfo = ref(null)
|
const systemInfo = ref(null)
|
||||||
|
const screenHeight = ref(null)
|
||||||
|
const screenWidth = ref(null)
|
||||||
|
|
||||||
const getCodeList = () => {
|
const getCodeList = () => {
|
||||||
console.log(boxInfo.value)
|
console.log(boxInfo.value)
|
||||||
|
|
@ -351,6 +353,11 @@ const getDeviceInfo = () => {
|
||||||
const systemInfoData = uni.getSystemInfoSync();
|
const systemInfoData = uni.getSystemInfoSync();
|
||||||
console.log('设备信息:', systemInfoData);
|
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;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取设备信息失败:', error);
|
console.error('获取设备信息失败:', error);
|
||||||
}
|
}
|
||||||
|
|
@ -523,7 +530,7 @@ const takePicture = async () => {
|
||||||
if (!CameraPreview) {
|
if (!CameraPreview) {
|
||||||
throw new Error('相机插件不可用');
|
throw new Error('相机插件不可用');
|
||||||
}
|
}
|
||||||
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 processImage(base64PictureData);
|
await processImage(base64PictureData);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue