完成6075J蓝牙对接

This commit is contained in:
liub
2026-03-30 13:17:47 +08:00
parent 4e518e7340
commit 37f5047a46
32 changed files with 472 additions and 281 deletions

View File

@ -18,13 +18,10 @@
<image src="/static/images/common/more.png" mode="aspectFit" class="more"></image>
</view>
</view>
<view class="sendFlex"
v-show="showSendFlex"
>
<view class="sendFlex" v-show="showSendFlex">
<view class="callpolice" @click="callpolice" v-show="showWarn">报警</view>
<view class="Sendmessage" @click="location" v-show="showMap">位置</view>
<view class="Sendmessage" @click="handleSend"
v-show="ShowSendmessage">发送信息</view>
<view class="Sendmessage" @click="handleSend" v-show="ShowSendmessage">发送信息</view>
</view>
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
@ -159,22 +156,22 @@
components: {
MescrollUni
},
computed:{
showSendFlex(){
computed: {
showSendFlex() {
// return this.activeTab && this.activeTab.id !== ''&& (this.activeTabInfo.communicationMode==0 || this.activeTabInfo.communicationMode==2);
if(this.showMap || this.ShowSendmessage || this.showWarn){
if (this.showMap || this.ShowSendmessage || this.showWarn) {
return true;
}
return false;
},
ShowSendmessage(){
return this.dic.showMsgTypes.indexOf(this.activeTabInfo.typeName)>-1
ShowSendmessage() {
return this.dic.showMsgTypes.indexOf(this.activeTabInfo.typeName) > -1
},
showMap(){
return this.dic.showMapTypes.indexOf(this.activeTabInfo.typeName)>-1
showMap() {
return this.dic.showMapTypes.indexOf(this.activeTabInfo.typeName) > -1
},
showWarn(){
return this.dic.showCallPolice.indexOf(this.activeTabInfo.typeName)>-1
showWarn() {
return this.dic.showCallPolice.indexOf(this.activeTabInfo.typeName) > -1
}
},
data() {
@ -254,10 +251,15 @@
deviceName: "", //重命名
activeTabInfo: '',
dic: {
showMsgTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'BJQ6075J'],//需要发送消息的类型
showMapTypes:['BJQ6170','HBY210','HBY670','BJQ6075','HBY018A','HBY100-J','BJQ6075J','HBY008A','HBY100-Y'],//需要显示地图的类型
showCallPolice:['BJQ6170','HBY210','HBY670','BJQ6075','HBY018A','HBY100-J','BJQ6075J','HBY008A','HBY100-Y']//需要发送报警的类型
}
showMsgTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'BJQ6075J'], //需要发送消息的类型
showMapTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'HBY018A', 'HBY100-J', 'BJQ6075J', 'HBY008A',
'HBY100-Y'
], //需要显示地图的类型
showCallPolice: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'HBY018A', 'HBY100-J', 'BJQ6075J',
'HBY008A', 'HBY100-Y'
] //需要发送报警的类型
},
isPageShow: true
}
},
methods: {
@ -299,8 +301,11 @@
this.updateBleStatu();
},
bleStateRecovery() {
console.log("蓝牙适配器恢复可用,重连断开的设备");
ble.linkAllDevices();
if (this.isPageShow) {
console.log("蓝牙适配器恢复可用,重连断开的设备");
ble.linkAllDevices();
}
},
bleBreak(res) {
@ -738,8 +743,11 @@
.filter(Boolean);
},
},
onHide() {
this.isPageShow = false;
},
onShow() {
this.isPageShow = true;
if (ble) {
//因为vue视图只能后退不能隐藏后再显示
//所以回到首页后将其他所有页面的订阅都删除