1
This commit is contained in:
@ -37,13 +37,25 @@
|
||||
<text class="value">{{ deviceInfo.deviceName }}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">IMEI</text>
|
||||
<text class="lbl">设备IMEI</text>
|
||||
<text class="value">{{ deviceInfo.deviceImei }}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">Mac地址</text>
|
||||
<text class="value">{{device.deviceMac}}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">蓝牙名称</text>
|
||||
<text class="value valueFont">{{device.bluetoothName}}</text>
|
||||
</view>
|
||||
<view class="item" @click.top="bleStatuToggle">
|
||||
<text class="lbl">蓝牙状态</text>
|
||||
<text class="value" :class="formData.bleStatu?'green':'red'">{{device.getbleStatu}}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">设备状态</text>
|
||||
<text class="value">{{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus
|
||||
=== 2 ? '故障' : '在线' }}</text>
|
||||
<text class="value"
|
||||
:class="deviceInfo.onlineStatus===0?'red':'green'">{{ deviceInfo.onlineStatus === 0 ? '离线': '在线' }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label" style="display: flex; align-items: center;">定位信息</text>
|
||||
@ -440,7 +452,7 @@
|
||||
alarmStatus: null,
|
||||
detailPageUrl: "/pages/650/HBY650",
|
||||
showConfirm: false,
|
||||
deviceId:''
|
||||
deviceId: ''
|
||||
},
|
||||
permissions: [],
|
||||
audioData: {
|
||||
@ -589,30 +601,32 @@
|
||||
these.fetchDeviceDetail(data.data.id)
|
||||
} else {
|
||||
this.activePermissions = data.data.permission ? data.data.permission.split(',') : [];
|
||||
console.log(this.activePermissions,'this.activePermissions');
|
||||
console.log(this.activePermissions, 'this.activePermissions');
|
||||
these.fetchDeviceDetail(data.data.deviceId)
|
||||
}
|
||||
|
||||
// 尝试连接蓝牙
|
||||
if (data.data.deviceMac) {
|
||||
// 假设 deviceMac 是蓝牙的 deviceId
|
||||
bleTool.LinkBlue(data.data.deviceMac).then(() => {
|
||||
console.log("100J 蓝牙连接成功");
|
||||
this.bleStateRecovry({
|
||||
deviceId: data.data.deviceMac
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log("100J 蓝牙连接失败,将使用4G", err);
|
||||
});
|
||||
}
|
||||
});
|
||||
this.createThrottledFunctions();
|
||||
|
||||
|
||||
// 注册蓝牙相关事件
|
||||
bleTool.addReceiveCallback(this.bleValueNotify, "HBY100J");
|
||||
bleTool.addDisposeCallback(this.bleStateBreak, "HBY100J");
|
||||
bleTool.addRecoveryCallback(this.bleStateRecovry, "HBY100J");
|
||||
bleTool.addStateBreakCallback(this.bleStateBreak, "HBY100J");
|
||||
bleTool.addStateRecoveryCallback(this.bleStateRecovry, "HBY100J");
|
||||
|
||||
// 尝试连接蓝牙
|
||||
if (data.data.deviceMac) {
|
||||
// 假设 deviceMac 是蓝牙的 deviceId
|
||||
bleTool.LinkBlue(data.data.deviceMac).then(() => {
|
||||
console.log("100J 蓝牙连接成功");
|
||||
this.bleStateRecovry({deviceId: data.data.deviceMac});
|
||||
}).catch(err => {
|
||||
console.log("100J 蓝牙连接失败,将使用4G", err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
onHide: function() {
|
||||
@ -990,7 +1004,7 @@
|
||||
bleValueNotify: function(receive, device, path, recArr) { //订阅消息
|
||||
// 注意:这里 receive.deviceId 是蓝牙的 MAC 地址,而 this.formData.deviceId 是 4G 的 ID
|
||||
// 所以这里需要修改判断逻辑,或者不判断直接解析
|
||||
|
||||
|
||||
// 尝试解析蓝牙上报的数据
|
||||
if (receive.bytes) {
|
||||
const parsedData = parseBleData(receive.bytes);
|
||||
|
||||
Reference in New Issue
Block a user