完成7305,添加在详情页去绑定蓝牙设备
This commit is contained in:
@ -44,21 +44,21 @@ class BleReceive {
|
||||
}
|
||||
|
||||
|
||||
ReceiveData(receive,f,path) {
|
||||
ReceiveData(receive,f,path,recArr) {
|
||||
if(f && f.macAddress && f.device && f.device.id){
|
||||
let data={};
|
||||
if(f.device.detailPageUrl=='/pages/6155/deviceDetail'){
|
||||
// console.log("该设备是6155");
|
||||
data= this.Receive_6155(receive,f,path);
|
||||
data= this.Receive_6155(receive,f,path,recArr);
|
||||
}
|
||||
|
||||
if(f.device.detailPageUrl=='/pages/650/HBY650'){
|
||||
// console.log("该设备是650");
|
||||
data= this.Receive_650(receive,f,path);
|
||||
data= this.Receive_650(receive,f,path,recArr);
|
||||
}
|
||||
if(f.device.detailPageUrl=='/pages/670/HBY670'){
|
||||
// console.log("该设备是670");
|
||||
data= this.Receive_670(receive,f,path);
|
||||
data= this.Receive_670(receive,f,path,recArr);
|
||||
}
|
||||
// console.log("收到数据并处理完毕,",data);
|
||||
return data;
|
||||
@ -70,7 +70,7 @@ class BleReceive {
|
||||
|
||||
}
|
||||
|
||||
Receive_650(receive,f,path) {
|
||||
Receive_650(receive,f,path,recArr) {
|
||||
console.log("通用程序正在处理650的数据",receive);
|
||||
|
||||
var parseData = () => {
|
||||
@ -253,8 +253,8 @@ class BleReceive {
|
||||
|
||||
}
|
||||
|
||||
Receive_670(receive,f,path){
|
||||
|
||||
Receive_670(receive,f,path,recArr){
|
||||
console.log("pagh=",path);
|
||||
var todo = (bytes) =>{
|
||||
// console.log("todo",receive);
|
||||
let receiveData = {};
|
||||
@ -316,6 +316,21 @@ class BleReceive {
|
||||
receiveData.staticWarn = staticWarn;
|
||||
receiveData.fourGStrenth = fourGStrenth;
|
||||
receiveData.SOS=sosTxt;
|
||||
|
||||
this.setBleFormData(receiveData,f);
|
||||
console.log("recArr=",recArr);
|
||||
let recCnt=recArr.find(v=>{
|
||||
return v.key == f.device.detailPageUrl;
|
||||
});
|
||||
if(!recCnt){
|
||||
if (this.formData.staticWarn) { //有静止报警
|
||||
uni.showModal({
|
||||
title:"警告",
|
||||
content:"设备静止报警中",
|
||||
showCancel:false
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch(error) {
|
||||
console.log('数据解析错误:', error);
|
||||
}
|
||||
@ -394,7 +409,7 @@ class BleReceive {
|
||||
|
||||
return data;
|
||||
}
|
||||
Receive_6155(receive,f,path) {
|
||||
Receive_6155(receive,f,path,recArr) {
|
||||
let bytes=receive.bytes;
|
||||
if (bytes[0] == 0xFB && bytes[1] == 0x64 && bytes.length >= 8) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user