From 07064b4b85e6bdcd3e1d5342edee0ffff42fbdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=BE=AE=E4=B8=80=E7=AC=91?= <709648985@qq.com> Date: Wed, 10 Sep 2025 10:42:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=AE=8C=E6=88=90=E8=BF=94=E5=9B=9E=E9=94=AE?= =?UTF-8?q?=EF=BC=8C=E9=A6=96=E9=A1=B5=E6=9C=AA=E5=88=B7=E6=96=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/common/qrcode/qrcode.vue | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pages/common/qrcode/qrcode.vue b/pages/common/qrcode/qrcode.vue index fd8689a..d3137e3 100644 --- a/pages/common/qrcode/qrcode.vue +++ b/pages/common/qrcode/qrcode.vue @@ -86,14 +86,29 @@ } catch (error) {} } }, - }, - onLoad(options) { - if (options.deviceId) { - this.deviceId = decodeURIComponent(options.deviceId); - } else { - this.deviceId = '未获取到设备ID'; - } + }, + // 处理返回键 + onBackPress() { + // 如果绑定成功了,返回时也要刷新首页 + if (this.isSuccess) { + uni.$emit('refreshDeviceList'); } + return false; // 允许正常返回 + }, + // 页面卸载时处理 + onUnload() { + // 如果绑定成功了,卸载时也要刷新首页 + if (this.isSuccess) { + uni.$emit('refreshDeviceList'); + } + }, + onLoad(options) { + if (options.deviceId) { + this.deviceId = decodeURIComponent(options.deviceId); + } else { + this.deviceId = '未获取到设备ID'; + } + } } From d7a91a6df25614e9bb70dc590029d072c0b99ffc Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Wed, 10 Sep 2025 10:47:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=80=82=E9=85=8D=E7=81=AF=E5=85=89?= =?UTF-8?q?=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/6170/deviceControl/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/6170/deviceControl/index.vue b/pages/6170/deviceControl/index.vue index c1466a6..13de058 100644 --- a/pages/6170/deviceControl/index.vue +++ b/pages/6170/deviceControl/index.vue @@ -1625,7 +1625,7 @@ /* 弹窗主体 */ .agreement-popup { width: 100%; - height: 50%; + /* height: 50%; */ background-color: rgb(42, 42, 42); border-radius: 60rpx 60rpx 0rpx 0rpx; padding: 40rpx; From 48da6d0e1c1e12ca7498de81fc19290236550988 Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Thu, 11 Sep 2025 14:21:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?6170=E4=B8=8A=E4=BC=A0=E5=8A=A0=E8=A3=81?= =?UTF-8?q?=E5=89=AA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/6155/ImgCrop.vue | 4 ++- pages/6170/deviceControl/index.vue | 48 ++++++++++++++++++------------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/pages/6155/ImgCrop.vue b/pages/6155/ImgCrop.vue index e06f20f..173d3f2 100644 --- a/pages/6155/ImgCrop.vue +++ b/pages/6155/ImgCrop.vue @@ -58,7 +58,9 @@ // 处理像素数据并发送 const eventChannel = these.getOpenerEventChannel(); console.log("res.data.length="+res.data.length); - + eventChannel.emit('ImgCutOverPath', { + picPath: e.tempFilePath + }); eventChannel.emit('ImgCutOver',{piexls:res.data,picPath:e.tempFilePath}); diff --git a/pages/6170/deviceControl/index.vue b/pages/6170/deviceControl/index.vue index 13de058..6a5d9ea 100644 --- a/pages/6170/deviceControl/index.vue +++ b/pages/6170/deviceControl/index.vue @@ -630,11 +630,9 @@ sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success: (res) => { - // 将选择的图片赋值给selectedImage const file = res.tempFiles[0]; const fileSize = file.size || 0; if (fileSize > 2 * 1024 * 1024) { - console.log(`文件过大: ${fileSize} 字节`); // 调试日志 uni.showToast({ title: '图片大小不能超过2MB', icon: 'none', @@ -642,13 +640,19 @@ }); return; } - this.selectedImage = res.tempFilePaths[0]; - console.log('选择的图片:', res); - }, - fail: (err) => { - uni.showToast({ - title: '选择图片失败', - icon: 'none' + let that = this; + uni.navigateTo({ + url: "/pages/6155/ImgCrop", + events: { + ImgCutOverPath :function (data) { + that.selectedImage = data.picPath; + } + }, + success(ev) { + ev.eventChannel.emit('checkImg', { + data: res.tempFiles[0].path, + }); + } }); } }); @@ -1156,24 +1160,30 @@ // 1设备切换灯光实时返回 switch (deviceState[0]) { case 1: - this.currentMainMode = this.getMainLightModeLabel(deviceState[ - 1]); + this.currentMainMode = this.getMainLightModeLabel( + deviceState[ + 1]); this.sliderValue = deviceState[2]; this.deviceInfo.batteryRemainingTime = deviceState[3]; break; // 12为设备实时上报 case 12: - this.currentMainMode = this.getMainLightModeLabel(deviceState[ - 1]); - this.isLaserOn = deviceState[2] === 1; //第3位表示当时激光灯档位 - this.currentlaserMode = this.isLaserOn ? "开启" : "关闭"; + this.currentMainMode = this.getMainLightModeLabel( + deviceState[ + 1]); + this.isLaserOn = deviceState[2] === 1; //第3位表示当时激光灯档位 + this.currentlaserMode = this.isLaserOn ? "开启" : "关闭"; if (this.deviceInfo) { - this.deviceInfo.batteryPercentage = deviceState[3]; //第4位电量百分比 - this.deviceInfo.chargeState = deviceState[4]; //第5位为充电状态(0没有充电,1正在充电,2为已充满) - this.deviceInfo.batteryRemainingTime = deviceState[5]; //第6位200代表电池剩余续航时间200分钟 + this.deviceInfo.batteryPercentage = deviceState[ + 3]; //第4位电量百分比 + this.deviceInfo.chargeState = deviceState[ + 4]; //第5位为充电状态(0没有充电,1正在充电,2为已充满) + this.deviceInfo.batteryRemainingTime = deviceState[ + 5]; //第6位200代表电池剩余续航时间200分钟 } setTimeout(() => { - if (this.deviceInfo.batteryPercentage <20 && this.deviceInfo.chargeState == 0) { + if (this.deviceInfo.batteryPercentage < 20 && + this.deviceInfo.chargeState == 0) { this.popupType = 'bettery'; this.popupMessage = '请及时充电'; this.showPopupFlag = true;