|
@@ -89,6 +89,7 @@ Page({
|
|
|
// }],
|
|
|
_willConnectBle: null,
|
|
|
_hasShowModal: null,
|
|
|
+ _clickOtherDevice:false,
|
|
|
// deviceList: [{
|
|
|
// "connectType": 3,
|
|
|
// "devName": "猫王小王子OTR-X",
|
|
@@ -644,7 +645,9 @@ Page({
|
|
|
console.log("断开连接2", device)
|
|
|
|
|
|
device.name = device.devName;
|
|
|
+ that.data._clickOtherDevice = true;
|
|
|
BtHelper.getInstance().connect(device, function (isConnected, d) {
|
|
|
+ that.data._clickOtherDevice = false;
|
|
|
if (isConnected) {
|
|
|
device.state = "online";
|
|
|
that.addBlueDevice(device);
|
|
@@ -666,9 +669,10 @@ Page({
|
|
|
deviceListSelect: null,
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+ that.data._clickOtherDevice = true;
|
|
|
device.name = device.devName;
|
|
|
BtHelper.getInstance().connect(device, function (isConnected, d) {
|
|
|
+ that.data._clickOtherDevice = false;
|
|
|
if (isConnected) {
|
|
|
device.state = "online";
|
|
|
that.addBlueDevice(device);
|
|
@@ -861,6 +865,10 @@ Page({
|
|
|
},
|
|
|
disconnectDev(event, device) {
|
|
|
let _this = this;
|
|
|
+ if (_this.data._clickOtherDevice) {
|
|
|
+ _this.data._clickOtherDevice = false
|
|
|
+ return;
|
|
|
+ }
|
|
|
console.log("断开连接--", event.commonValue, event.deviceId);
|
|
|
if (event.deviceId === device.deviceId && event.commonValue === "offline" && !_this.data._hasShowModal) {
|
|
|
_this.data._hasShowModal = true
|