|
@@ -127,6 +127,7 @@ Page({
|
|
|
///主动去连接连接
|
|
|
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
|
|
|
wx.hideLoading();
|
|
|
+ console.log("gadsfasdfadfaf===坎坎坷坷==" + JSON.stringify(options));
|
|
|
if (options.result) {
|
|
|
if (that.data.isOnBluetooth) {
|
|
|
return;
|
|
@@ -137,26 +138,19 @@ Page({
|
|
|
});
|
|
|
|
|
|
setTimeout(() => {
|
|
|
- var name = that.data.devicesList[0].name;
|
|
|
+ that.data.isSubmit = false;
|
|
|
that.setData({
|
|
|
- isSubmit: false,
|
|
|
islanya: false,
|
|
|
devicesList: [],
|
|
|
isOnBluetooth: false,
|
|
|
});
|
|
|
var param = JSON.stringify(that.data.connectDevice);
|
|
|
- var isLexin = name.indexOf(lexin_devices.leXin) !== -1;
|
|
|
- if (isLexin) {
|
|
|
- wx.navigateTo({
|
|
|
- url: '../deviceConnect3/deviceConnect3?deviceId=' + options.data.deviceId + '&name=' + options.data.name + "¶m=" + param,
|
|
|
- });
|
|
|
- } else {
|
|
|
- var url = "../deviceConnect4/deviceConnect4";
|
|
|
- var param = "?deviceId=" + options.data.deviceId + '&name=' + options.data.name + "¶m=" + param;
|
|
|
- route_util.jumpParams(url, param);
|
|
|
- }
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../deviceConnect3/deviceConnect3?deviceId=' + options.data.deviceId + '&name=' + options.data.name + "¶m=" + param,
|
|
|
+ });
|
|
|
}, 200);
|
|
|
} else {
|
|
|
+ that.data.isSubmit = false;
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '连接失败',
|
|
@@ -194,13 +188,22 @@ Page({
|
|
|
return;
|
|
|
};
|
|
|
|
|
|
+ var name = devicesList[0].name;
|
|
|
+ var deviceId = devicesList[0].deviceId;
|
|
|
+ var isJungzheng1 = junzheng_util.isJungzheng1(name);
|
|
|
+ var isJungzheng2 = junzheng_util.isJungzheng2(name);
|
|
|
+
|
|
|
+ if (isJungzheng1 || isJungzheng2) {
|
|
|
+ var url = "../deviceConnect4/deviceConnect4";
|
|
|
+ var param = "?deviceId=" + deviceId + '&name=' + name;
|
|
|
+ route_util.jumpParams(url, param);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (that.data.isSubmit) {
|
|
|
return;
|
|
|
};
|
|
|
-
|
|
|
- that.setData({
|
|
|
- isSubmit: true
|
|
|
- });
|
|
|
+ that.data.isSubmit = true;
|
|
|
|
|
|
// 停止搜索
|
|
|
xBlufi.notifyStartDiscoverBle({
|
|
@@ -208,13 +211,14 @@ Page({
|
|
|
});
|
|
|
|
|
|
//开始连接
|
|
|
- let name = devicesList[0].name;
|
|
|
+ var name = devicesList[0].name;
|
|
|
// console.log('点击了,蓝牙准备连接的deviceId:' + devicesList[0].deviceId)
|
|
|
xBlufi.notifyConnectBle({
|
|
|
isStart: true,
|
|
|
- deviceId: devicesList[0].deviceId,
|
|
|
- name
|
|
|
+ name: name,
|
|
|
+ deviceId: deviceId,
|
|
|
});
|
|
|
+
|
|
|
wx.showLoading({
|
|
|
title: '请稍后',
|
|
|
});
|