蓝牙接收数据统一处理修改
This commit is contained in:
@ -1,8 +1,26 @@
|
|||||||
class BleReceive {
|
class BleReceive {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.StorageKey = "linkedDevices";
|
this.StorageKey = "linkedDevices";
|
||||||
|
this.ReceiveDic=[
|
||||||
|
{
|
||||||
|
url:'/pages/6155/deviceDetail',
|
||||||
|
method:this.Receive_6155
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url:'/pages/7305/BJQ7305',
|
||||||
|
method:this.Receive_6155
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url:'/pages/650/HBY650',
|
||||||
|
method:this.Receive_650
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url:'/pages/670/HBY670',
|
||||||
|
method:this.Receive_670
|
||||||
}
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
getCurrentPagePath() {
|
getCurrentPagePath() {
|
||||||
|
|
||||||
@ -50,19 +68,31 @@ class BleReceive {
|
|||||||
ReceiveData(receive,f,path,recArr) {
|
ReceiveData(receive,f,path,recArr) {
|
||||||
if(f && f.macAddress && f.device && f.device.id){
|
if(f && f.macAddress && f.device && f.device.id){
|
||||||
let data={};
|
let data={};
|
||||||
if(f.device.detailPageUrl=='/pages/6155/deviceDetail'){
|
|
||||||
// console.log("该设备是6155");
|
|
||||||
data= this.Receive_6155(receive,f,path,recArr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(f.device.detailPageUrl=='/pages/650/HBY650'){
|
let rec=this.ReceiveDic.find(r=>{
|
||||||
// console.log("该设备是650");
|
return r.url==f.device.detailPageUrl;
|
||||||
data= this.Receive_650(receive,f,path,recArr);
|
})
|
||||||
}
|
if(rec){
|
||||||
if(f.device.detailPageUrl=='/pages/670/HBY670'){
|
data=rec.method(receive,f,path,recArr);
|
||||||
// console.log("该设备是670");
|
|
||||||
data= this.Receive_670(receive,f,path,recArr);
|
|
||||||
}
|
}
|
||||||
|
// if(f.device.detailPageUrl=='/pages/6155/deviceDetail'){
|
||||||
|
// // console.log("该设备是6155");
|
||||||
|
// data= this.Receive_6155(receive,f,path,recArr);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if(f.device.detailPageUrl=='/pages/7305/BJQ7305'){
|
||||||
|
// // console.log("该设备是7305");
|
||||||
|
// 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,recArr);
|
||||||
|
// }
|
||||||
|
// if(f.device.detailPageUrl=='/pages/670/HBY670'){
|
||||||
|
// // console.log("该设备是670");
|
||||||
|
// data= this.Receive_670(receive,f,path,recArr);
|
||||||
|
// }
|
||||||
// console.log("收到数据并处理完毕,",data);
|
// console.log("收到数据并处理完毕,",data);
|
||||||
return data;
|
return data;
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user