修复有时候蓝牙配对成功依然提示未连接的异常
This commit is contained in:
@ -37,7 +37,8 @@
|
||||
<view class="row">
|
||||
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
|
||||
<view class="txt">
|
||||
<view class="bigTxt" v-show="getMode('main')!='关闭'||getMode('fu')!='关闭'">{{formData.xuhang}}</view>
|
||||
<view class="bigTxt" v-show="getMode('main')!='关闭'||getMode('fu')!='关闭'">{{formData.xuhang}}
|
||||
</view>
|
||||
<view class="smallTxt">续航时间</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -209,7 +210,7 @@
|
||||
apiType: 'listA'
|
||||
}],
|
||||
title: 'BJQ6155',
|
||||
height:90
|
||||
height: 90
|
||||
|
||||
},
|
||||
lightMode: {
|
||||
@ -340,8 +341,8 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.Status.navbar.height = uni.getSystemInfoSync().statusBarHeight + 44;
|
||||
},
|
||||
this.Status.navbar.height = uni.getSystemInfoSync().statusBarHeight + 44;
|
||||
},
|
||||
onUnload() {
|
||||
ble.removeAllCallback(pagePath);
|
||||
},
|
||||
@ -375,14 +376,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
let f = ble.data.LinkedList.find((v) => {
|
||||
if (v.macAddress == device.deviceMac) {
|
||||
// console.log("找到设备了", v);
|
||||
these.formData.deviceId = v.deviceId;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
let f = these.getDevice();
|
||||
if (!f) {
|
||||
|
||||
these.getDetail();
|
||||
@ -591,7 +585,7 @@
|
||||
}
|
||||
if (res.deviceId == these.formData.deviceId) {
|
||||
this.formData.bleStatu = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
@ -665,12 +659,23 @@
|
||||
})
|
||||
},
|
||||
getDevice: function() {
|
||||
// console.log("LinkedList=", ble.data.LinkedList);
|
||||
// console.log("formData=", these.formData);
|
||||
let f = ble.data.LinkedList.find((v) => {
|
||||
return v.macAddress == these.device.deviceMac;
|
||||
let flag = v.macAddress == these.device.deviceMac;
|
||||
if (!flag && v.device) {
|
||||
flag = v.device.id == these.device.id;
|
||||
}
|
||||
if (flag) {
|
||||
these.formData.deviceId = v.deviceId;
|
||||
}
|
||||
return flag;
|
||||
});
|
||||
|
||||
// #ifdef WEB
|
||||
f = {
|
||||
deviceId: '123'
|
||||
}
|
||||
// #endif
|
||||
|
||||
return f;
|
||||
},
|
||||
bleValueNotify: function(receive, device, path, recArr) {
|
||||
@ -1658,8 +1663,8 @@
|
||||
unitName: these.formData.textLines[2],
|
||||
code: ""
|
||||
};
|
||||
usrApi.sendUsr(json).catch(ex=>{
|
||||
console.error("ex=",ex);
|
||||
usrApi.sendUsr(json).catch(ex => {
|
||||
console.error("ex=", ex);
|
||||
});
|
||||
|
||||
hideLoading(these);
|
||||
@ -1743,12 +1748,14 @@
|
||||
getDetail() {
|
||||
var these = this;
|
||||
usrApi.getDetail(this.device.id).then(res => {
|
||||
|
||||
|
||||
if (res && res.code == 200) {
|
||||
res = res.data;
|
||||
let personnelInfo = res.personnelInfo;
|
||||
if (personnelInfo) {
|
||||
these.formData.textLines=[personnelInfo.position, personnelInfo.name,personnelInfo.unitName];
|
||||
if (personnelInfo) {
|
||||
these.formData.textLines = [personnelInfo.position, personnelInfo.name, personnelInfo
|
||||
.unitName
|
||||
];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user