1
0
forked from dyf/APP

加入6107设备页面、蓝牙配对模式修复首次进入找不到设备的问题

This commit is contained in:
liub
2026-01-12 16:18:27 +08:00
parent 78adc0bfed
commit 98162ca214
11 changed files with 1804 additions and 73 deletions

View File

@ -72,10 +72,10 @@
@click="MainModeSetting('hight','staticBattery')">
<view class="p100 center">高档</view>
</view>
<!-- <view class="item " :class="formData.modeCurr=='close'?'active':''"
@click="MainModeSetting('close','staticBattery')">
<view class="p100 center">关闭</view>
@ -343,6 +343,7 @@
these.showBleUnConnect();
console.error("111111");
these.getDetail();
return;
}
@ -356,13 +357,14 @@
}
these.formData.blename = f.name ? f.name : "Unname";
these.formData.deviceName = device.deviceName;
these.formData.bleStatu = false;
these.formData.deviceId = f.deviceId;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
these.setBleFormData();
console.error("222222");
these.getDetail();
@ -574,7 +576,7 @@
getDetail() {
var that = this;
usrApi.getDetail(this.device.id).then(res => {
console.log("res=", res);
console.log("获取人员信息=", res);
if (res && res.code == 200) {
res = res.data;
let personnelInfo = res.personnelInfo;
@ -583,8 +585,24 @@
that.formData.name = personnelInfo.name;
that.formData.job = personnelInfo.position;
that.formData.id = personnelInfo.code
return;
}
}
let phone = uni.getStorageSync('phone');
if (phone === '17671332251') {
console.log("default=",that.device);
that.formData.company = '湖北消防总队';
that.formData.name = '胡红军';
that.formData.job = '中队长';
let arr=that.device.bluetoothName.split('-');
if(arr.length>1){
that.formData.id =arr[arr.length-1];
}else{
that.formData.id =that.device.bluetoothName;
}
}
});
},
@ -602,19 +620,19 @@
},
MainModeSetting: function(type, byteType) {
if (this.formData.modeCurr == type) {
type='close';
type = 'close';
}
showLoading(this, {
text: "请稍候..."
});
let task = () => {
let dataValue = 0x00;
let btype = 0x00;
switch (type) {
case "smalllow":
dataValue = 0x68;
break;
break;
case "low": //低档
dataValue = 0x67;
break;
@ -1094,9 +1112,9 @@
hideLoading(these);
return;
}
console.log("baseURL=",baseURL);
console.log("token",token);
console.log("clientID",clientid);
console.log("baseURL=", baseURL);
console.log("token", token);
console.log("clientID", clientid);
uni.uploadFile({
// url: 'http://114.55.111.217/video/upload',
url: baseURL + "/app/video/upload",
@ -1124,10 +1142,10 @@
});
Promise.all([p1, p2]).then((arr) => {
let res = arr[1];
res = JSON.parse(res.data);
if (res.data) {
these.videoHexArray = res.data;
updateLoading(these, {