|
@@ -129,7 +129,7 @@ Page({
|
|
|
onDeviceLoad() {
|
|
|
var that = this;
|
|
|
// BtHelper.getInstance().initBluetoothAdapter();
|
|
|
- var l = wx.getStorageSync("deviceList") || "";
|
|
|
+ var l = wx.getStorageSync("deviceList");
|
|
|
if (!strings.isEmpty(l)) {
|
|
|
try {
|
|
|
var list = JSON.parse(l);
|
|
@@ -445,8 +445,7 @@ Page({
|
|
|
if (!strings.isEmpty(deviceList)) {
|
|
|
for (var i = 0; i < deviceList.length; i++) {
|
|
|
if (deviceList[i].connectType == 3) {
|
|
|
- console.log("gasdfqwwerqewrqwerqr==22222===" + i);
|
|
|
- console.log("gasdfqwwerqewrqwerqr==3333===" + JSON.stringify(deviceList[i]));
|
|
|
+
|
|
|
let topic = `/AIrSMArT_${deviceList[i].deviceId.split("BLUFI_")[1]}/status/onoffline`;
|
|
|
app.subscribe(topic);
|
|
|
}
|
|
@@ -816,6 +815,7 @@ Page({
|
|
|
if (onlyCancel) {
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
const id = that.data.deviceList[index].deviceId;
|
|
|
const deviceList = that.data.deviceList.filter((item, i) => {
|
|
|
return id !== item.deviceId
|
|
@@ -846,6 +846,7 @@ Page({
|
|
|
const deviceList = that.data.deviceList.filter((item, i) => {
|
|
|
return id !== item.deviceId
|
|
|
});
|
|
|
+
|
|
|
wx.setStorageSync("deviceList", JSON.stringify(deviceList));
|
|
|
that.setData({
|
|
|
deviceList,
|