6170上传加裁剪功能
This commit is contained in:
@ -58,7 +58,9 @@
|
|||||||
// 处理像素数据并发送
|
// 处理像素数据并发送
|
||||||
const eventChannel = these.getOpenerEventChannel();
|
const eventChannel = these.getOpenerEventChannel();
|
||||||
console.log("res.data.length="+res.data.length);
|
console.log("res.data.length="+res.data.length);
|
||||||
|
eventChannel.emit('ImgCutOverPath', {
|
||||||
|
picPath: e.tempFilePath
|
||||||
|
});
|
||||||
|
|
||||||
eventChannel.emit('ImgCutOver',{piexls:res.data,picPath:e.tempFilePath});
|
eventChannel.emit('ImgCutOver',{piexls:res.data,picPath:e.tempFilePath});
|
||||||
|
|
||||||
|
@ -630,11 +630,9 @@
|
|||||||
sizeType: ['original', 'compressed'],
|
sizeType: ['original', 'compressed'],
|
||||||
sourceType: ['album', 'camera'],
|
sourceType: ['album', 'camera'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// 将选择的图片赋值给selectedImage
|
|
||||||
const file = res.tempFiles[0];
|
const file = res.tempFiles[0];
|
||||||
const fileSize = file.size || 0;
|
const fileSize = file.size || 0;
|
||||||
if (fileSize > 2 * 1024 * 1024) {
|
if (fileSize > 2 * 1024 * 1024) {
|
||||||
console.log(`文件过大: ${fileSize} 字节`); // 调试日志
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '图片大小不能超过2MB',
|
title: '图片大小不能超过2MB',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@ -642,13 +640,19 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.selectedImage = res.tempFilePaths[0];
|
let that = this;
|
||||||
console.log('选择的图片:', res);
|
uni.navigateTo({
|
||||||
},
|
url: "/pages/6155/ImgCrop",
|
||||||
fail: (err) => {
|
events: {
|
||||||
uni.showToast({
|
ImgCutOverPath :function (data) {
|
||||||
title: '选择图片失败',
|
that.selectedImage = data.picPath;
|
||||||
icon: 'none'
|
}
|
||||||
|
},
|
||||||
|
success(ev) {
|
||||||
|
ev.eventChannel.emit('checkImg', {
|
||||||
|
data: res.tempFiles[0].path,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1156,24 +1160,30 @@
|
|||||||
// 1设备切换灯光实时返回
|
// 1设备切换灯光实时返回
|
||||||
switch (deviceState[0]) {
|
switch (deviceState[0]) {
|
||||||
case 1:
|
case 1:
|
||||||
this.currentMainMode = this.getMainLightModeLabel(deviceState[
|
this.currentMainMode = this.getMainLightModeLabel(
|
||||||
1]);
|
deviceState[
|
||||||
|
1]);
|
||||||
this.sliderValue = deviceState[2];
|
this.sliderValue = deviceState[2];
|
||||||
this.deviceInfo.batteryRemainingTime = deviceState[3];
|
this.deviceInfo.batteryRemainingTime = deviceState[3];
|
||||||
break;
|
break;
|
||||||
// 12为设备实时上报
|
// 12为设备实时上报
|
||||||
case 12:
|
case 12:
|
||||||
this.currentMainMode = this.getMainLightModeLabel(deviceState[
|
this.currentMainMode = this.getMainLightModeLabel(
|
||||||
1]);
|
deviceState[
|
||||||
this.isLaserOn = deviceState[2] === 1; //第3位表示当时激光灯档位
|
1]);
|
||||||
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
this.isLaserOn = deviceState[2] === 1; //第3位表示当时激光灯档位
|
||||||
|
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
||||||
if (this.deviceInfo) {
|
if (this.deviceInfo) {
|
||||||
this.deviceInfo.batteryPercentage = deviceState[3]; //第4位电量百分比
|
this.deviceInfo.batteryPercentage = deviceState[
|
||||||
this.deviceInfo.chargeState = deviceState[4]; //第5位为充电状态(0没有充电,1正在充电,2为已充满)
|
3]; //第4位电量百分比
|
||||||
this.deviceInfo.batteryRemainingTime = deviceState[5]; //第6位200代表电池剩余续航时间200分钟
|
this.deviceInfo.chargeState = deviceState[
|
||||||
|
4]; //第5位为充电状态(0没有充电,1正在充电,2为已充满)
|
||||||
|
this.deviceInfo.batteryRemainingTime = deviceState[
|
||||||
|
5]; //第6位200代表电池剩余续航时间200分钟
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.deviceInfo.batteryPercentage <20 && this.deviceInfo.chargeState == 0) {
|
if (this.deviceInfo.batteryPercentage < 20 &&
|
||||||
|
this.deviceInfo.chargeState == 0) {
|
||||||
this.popupType = 'bettery';
|
this.popupType = 'bettery';
|
||||||
this.popupMessage = '请及时充电';
|
this.popupMessage = '请及时充电';
|
||||||
this.showPopupFlag = true;
|
this.showPopupFlag = true;
|
||||||
|
Reference in New Issue
Block a user