|
@@ -556,7 +556,7 @@ Page({
|
|
|
|
|
|
///点击item
|
|
|
// [{"deviceId":"BLUFI_7cdfa1fcbb24","name":"BLUFI_7cdfa1fcbb24","state":"online","ProdModel":"MW-2AX(WIFI-N)","devName":"猫王小王子OTR-X"}]
|
|
|
- onTapItem(e) {
|
|
|
+ async onTapItem(e) {
|
|
|
var that = this;
|
|
|
var isLogin = that.getIsLogin();
|
|
|
if (!isLogin) {
|
|
@@ -583,6 +583,17 @@ Page({
|
|
|
if (index === deviceListSelect && device.state === "online") {
|
|
|
route_util.jumpParam('/pages/deviceDetail/detail', JSON.stringify(device))
|
|
|
} else if (device.state === "offline") {
|
|
|
+
|
|
|
+ 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,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
device.name = device.devName;
|
|
|
BtHelper.getInstance().connect(device, function (isConnected, d) {
|
|
|
if (isConnected) {
|