蓝牙接收数据统一处理修改
This commit is contained in:
@ -1,9 +1,27 @@
|
||||
class BleReceive {
|
||||
constructor() {
|
||||
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() {
|
||||
|
||||
const pages = getCurrentPages();
|
||||
@ -50,19 +68,31 @@ class BleReceive {
|
||||
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,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);
|
||||
let rec=this.ReceiveDic.find(r=>{
|
||||
return r.url==f.device.detailPageUrl;
|
||||
})
|
||||
if(rec){
|
||||
data=rec.method(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);
|
||||
return data;
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user