修复670灯光问题

This commit is contained in:
liub
2025-12-03 10:20:11 +08:00
parent cd6d529523
commit e2d07e984f
6 changed files with 38 additions and 17 deletions

View File

@ -799,7 +799,7 @@
return className;
},
handleRightClick: function(s, e) {
if (s === 0) {
console.log("消息");
uni.navigateTo({
@ -832,9 +832,8 @@
},
initMQ() {
return new Promise((resolve, reject) => {
return new Promise((resolve, reject) => {
if (mqttClient) {
// console.log("无需再次初始化")
resolve();
@ -953,7 +952,7 @@
if ("sta_LightGrade" in json) {
let lightingLevelText = json.sta_LightGrade === 1 ? 'hight' : json.sta_LightGrade === 2 ? 'low' :
let lightingLevelText = json.sta_LightGrade === 1 ? 'qiang' : json.sta_LightGrade === 2 ? 'ruo' :
'close';
receiveData.lightCurr = lightingLevelText;
}

View File

@ -602,7 +602,7 @@
}
console.log("f=", f);
if (f.macAddress) {
if (f && f.macAddress) {
if (f.macAddress != these.device.deviceMac) {
@ -650,7 +650,7 @@
}
return false;
});
if (!f.macAddress) {
if (!(f && f.macAddress)) {
removeLink();
updateLoading(these, {
text: "出现错误,未收到设备Mac地址"

View File

@ -398,9 +398,25 @@
// 处理新的扫码结果
const cleanedResult = res.result.trim();
console.log('扫码结果:', cleanedResult);
let url=`/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(cleanedResult)}`;
try{
let json=JSON.parse(cleanedResult);
if('imei' in json){
url=`/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(json.imei)}`;
}else if('blue' in json){
if(!json.blue.includes(':')){
json.blue=json.blue.replace(
/(.{2})/g, '$1:')
.slice(0, -1)
}
url=`/pages/common/addBLE/LinkBle?mac=${encodeURIComponent(json.blue)}`;
}
}catch(ex){
}
// 跳转并传递扫描结果
uni.navigateTo({
url: `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(cleanedResult)}`
url: url
});
},
fail: (err) => {
@ -461,7 +477,7 @@
// 关闭所有滑动项
this.$refs.swipeAction.closeAll();
ble && ble.DropDevice(data.id);
ble && ble.DropDevice(null,data.id);
} else {
uni.showToast({
title: res.msg,
@ -980,6 +996,8 @@
margin-left: 15rpx;
padding: 10rpx 0rpx;
font-size: 28rpx;
text-align: left;
text-indent: 5rpx;
}
.svg {