修复100J低电量提示可能重复
This commit is contained in:
@ -466,7 +466,6 @@
|
|||||||
deviceInfo: {},
|
deviceInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onUnload() {},
|
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
const eventChannel = this.getOpenerEventChannel();
|
const eventChannel = this.getOpenerEventChannel();
|
||||||
var these = this;
|
var these = this;
|
||||||
@ -488,12 +487,12 @@
|
|||||||
these.Status.apiType = data.apiType;
|
these.Status.apiType = data.apiType;
|
||||||
these.Status.isRightIconVisible = these.Status.apiType === 'listA';
|
these.Status.isRightIconVisible = these.Status.apiType === 'listA';
|
||||||
|
|
||||||
this.mqttClient = new MqttClient();
|
these.mqttClient = new MqttClient();
|
||||||
|
|
||||||
this.mqttClient.connect(() => {
|
these.mqttClient.connect(() => {
|
||||||
// 订阅来自设备的状态更新
|
// 订阅来自设备的状态更新
|
||||||
const statusTopic = `status/894078/HBY100/${data.data.deviceImei}`;
|
const statusTopic = `status/894078/HBY100/${data.data.deviceImei}`;
|
||||||
this.mqttClient.subscribe(statusTopic, (payload) => {
|
these.mqttClient.subscribe(statusTopic, (payload) => {
|
||||||
try {
|
try {
|
||||||
// 解析MQTT返回的payload
|
// 解析MQTT返回的payload
|
||||||
const payloadObj = typeof payload === 'string' ? JSON.parse(
|
const payloadObj = typeof payload === 'string' ? JSON.parse(
|
||||||
@ -615,8 +614,8 @@
|
|||||||
if (these.Status.apiType === 'listA') {
|
if (these.Status.apiType === 'listA') {
|
||||||
these.fetchDeviceDetail(data.data.id)
|
these.fetchDeviceDetail(data.data.id)
|
||||||
} else {
|
} else {
|
||||||
this.activePermissions = data.data.permission ? data.data.permission.split(',') : [];
|
these.activePermissions = data.data.permission ? data.data.permission.split(',') : [];
|
||||||
console.log(this.activePermissions, 'this.activePermissions');
|
console.log(these.activePermissions, 'activePermissions');
|
||||||
these.fetchDeviceDetail(data.data.deviceId)
|
these.fetchDeviceDetail(data.data.deviceId)
|
||||||
}
|
}
|
||||||
// 尝试连接蓝牙:需先扫描获取 BLE deviceId,不能直接用 MAC;延迟 500ms 确保蓝牙适配器就绪
|
// 尝试连接蓝牙:需先扫描获取 BLE deviceId,不能直接用 MAC;延迟 500ms 确保蓝牙适配器就绪
|
||||||
|
|||||||
Reference in New Issue
Block a user