完成7305,添加在详情页去绑定蓝牙设备
This commit is contained in:
@ -293,6 +293,7 @@
|
||||
these = this;
|
||||
recei = BleReceive.getBleReceive();
|
||||
ble = BleTool.getBleTool();
|
||||
console.log("650")
|
||||
ble.addReceiveCallback(these.bleValueNotify);
|
||||
let eventChannel = this.getOpenerEventChannel();
|
||||
|
||||
@ -312,12 +313,7 @@
|
||||
if (!f) {
|
||||
|
||||
|
||||
these.showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
});
|
||||
these.showBleUnConnect();
|
||||
return;
|
||||
}
|
||||
let form = f.formData;
|
||||
@ -555,12 +551,7 @@
|
||||
these.setBleFormData();
|
||||
});
|
||||
} else {
|
||||
these.showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
});
|
||||
these.showBleUnConnect();
|
||||
hideLoading(these);
|
||||
}
|
||||
}
|
||||
@ -569,6 +560,34 @@
|
||||
|
||||
|
||||
},
|
||||
showBleUnConnect(){
|
||||
|
||||
this.showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
buttonText:'去连接',
|
||||
okCallback:function(){
|
||||
console.log("1111");
|
||||
uni.navigateTo({
|
||||
url:"/pages/common/addBLE/addEquip",
|
||||
events: {
|
||||
BindOver: function(data) {
|
||||
console.log(data)
|
||||
}
|
||||
},
|
||||
success: function(res) {
|
||||
// 通过eventChannel向被打开页面传送数据
|
||||
res.eventChannel.emit('detailData', { data: these.device })
|
||||
},
|
||||
fail(ex){
|
||||
console.log("跳转失败",ex);
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
LampToggle: function() {
|
||||
|
||||
this.formData.cMode = !this.formData.cMode;
|
||||
@ -1143,12 +1162,7 @@
|
||||
|
||||
let f = this.getDevice();
|
||||
if (!f) {
|
||||
these.showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
});
|
||||
these.showBleUnConnect();
|
||||
return;
|
||||
}
|
||||
showLoading(this, {
|
||||
|
||||
Reference in New Issue
Block a user