|
@@ -6,6 +6,7 @@ const {
|
|
|
|
|
|
import timeUtil from '../../utils/time_util.js';
|
|
import timeUtil from '../../utils/time_util.js';
|
|
import strings from '../../utils/strings.js';
|
|
import strings from '../../utils/strings.js';
|
|
|
|
+import store from '../../utils/store.js';
|
|
import route_constant from '../../utils/route_constant.js';
|
|
import route_constant from '../../utils/route_constant.js';
|
|
import route_util from '../../utils/route_util.js';
|
|
import route_util from '../../utils/route_util.js';
|
|
import {
|
|
import {
|
|
@@ -129,12 +130,11 @@ Page({
|
|
onDeviceLoad() {
|
|
onDeviceLoad() {
|
|
var that = this;
|
|
var that = this;
|
|
// BtHelper.getInstance().initBluetoothAdapter();
|
|
// BtHelper.getInstance().initBluetoothAdapter();
|
|
- var l = wx.getStorageSync("deviceList");
|
|
|
|
|
|
+ var l = store.getStore("deviceList");
|
|
if (!strings.isEmpty(l)) {
|
|
if (!strings.isEmpty(l)) {
|
|
try {
|
|
try {
|
|
- var list = JSON.parse(l);
|
|
|
|
- that.updateDeviceList(list, true);
|
|
|
|
- } catch (e) { }
|
|
|
|
|
|
+ that.updateDeviceList(l, true);
|
|
|
|
+ } catch (e) {}
|
|
// that.tryConnectBle()
|
|
// that.tryConnectBle()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -820,7 +820,8 @@ Page({
|
|
const deviceList = that.data.deviceList.filter((item, i) => {
|
|
const deviceList = that.data.deviceList.filter((item, i) => {
|
|
return id !== item.deviceId
|
|
return id !== item.deviceId
|
|
});
|
|
});
|
|
- wx.setStorageSync("deviceList", JSON.stringify(deviceList));
|
|
|
|
|
|
+
|
|
|
|
+ store.setStore("deviceList", deviceList);
|
|
that.setData({
|
|
that.setData({
|
|
deviceList,
|
|
deviceList,
|
|
});
|
|
});
|
|
@@ -847,7 +848,7 @@ Page({
|
|
return id !== item.deviceId
|
|
return id !== item.deviceId
|
|
});
|
|
});
|
|
|
|
|
|
- wx.setStorageSync("deviceList", JSON.stringify(deviceList));
|
|
|
|
|
|
+ store.setStore("deviceList", deviceList);
|
|
that.setData({
|
|
that.setData({
|
|
deviceList,
|
|
deviceList,
|
|
thisDeviceMac: null
|
|
thisDeviceMac: null
|
|
@@ -1039,8 +1040,8 @@ Page({
|
|
});
|
|
});
|
|
finalList = finalList.concat(onNoLineWifiList);
|
|
finalList = finalList.concat(onNoLineWifiList);
|
|
finalList = finalList.concat(onNoLineBlueList);
|
|
finalList = finalList.concat(onNoLineBlueList);
|
|
- // 更新缓存
|
|
|
|
- wx.setStorageSync("deviceList", JSON.stringify(finalList));
|
|
|
|
|
|
+
|
|
|
|
+ store.setStore("deviceList", deviceList);
|
|
that.setData({
|
|
that.setData({
|
|
deviceList: finalList
|
|
deviceList: finalList
|
|
});
|
|
});
|