|
@@ -4,7 +4,7 @@ const {
|
|
|
listByDevice
|
|
|
} = require('../../utils/api.js');
|
|
|
|
|
|
-import timeUtil from '../../utils/time_util.js';
|
|
|
+import time_util from '../../utils/time_util.js';
|
|
|
import strings from '../../utils/strings.js';
|
|
|
import store from '../../utils/store.js';
|
|
|
import route_constant from '../../utils/route_constant.js';
|
|
@@ -587,11 +587,12 @@ Page({
|
|
|
var deviceList = that.getDeviceList();
|
|
|
var deviceListSelect = that.getDeviceListSelect();
|
|
|
if (deviceListSelect != null && deviceList.length > deviceListSelect) {
|
|
|
- var currentDevice = deviceList[deviceListSelect];
|
|
|
- await that.disconnect(currentDevice);
|
|
|
that.setData({
|
|
|
deviceListSelect: null,
|
|
|
});
|
|
|
+ var currentDevice = deviceList[deviceListSelect];
|
|
|
+ await BtHelper.getInstance().disconnect(currentDevice);
|
|
|
+ // await time_util.delayMills(500);
|
|
|
}
|
|
|
|
|
|
device.name = device.devName;
|
|
@@ -602,6 +603,17 @@ Page({
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
+ var deviceList = that.getDeviceList();
|
|
|
+ var deviceListSelect = that.getDeviceListSelect();
|
|
|
+ if (deviceListSelect != null && deviceList.length > deviceListSelect) {
|
|
|
+ that.setData({
|
|
|
+ deviceListSelect: null,
|
|
|
+ });
|
|
|
+ var currentDevice = deviceList[deviceListSelect];
|
|
|
+ await BtHelper.getInstance().disconnect(currentDevice);
|
|
|
+ // await time_util.delayMills(500);
|
|
|
+ }
|
|
|
+
|
|
|
device.name = device.devName;
|
|
|
BtHelper.getInstance().connect(device, function (isConnected, d) {
|
|
|
if (isConnected) {
|
|
@@ -994,7 +1006,7 @@ Page({
|
|
|
},
|
|
|
|
|
|
getGreetBuNickName(nickName) {
|
|
|
- var greeting = timeUtil.getGreet();
|
|
|
+ var greeting = time_util.getGreet();
|
|
|
if (nickName != "" && nickName != "未登录") {
|
|
|
greeting = greeting + ',' + nickName;;
|
|
|
}
|