From c39cbcb34d1929b2abb177f59538aaaae34dd292 Mon Sep 17 00:00:00 2001 From: liub Date: Thu, 30 Oct 2025 11:10:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=93=9D=E7=89=99=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E3=80=81=E7=BB=93=E6=9D=9F=E6=90=9C=E7=B4=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/100/HBY100.vue | 82 ++++++++++++++----------------- pages/210/deviceControl/index.vue | 2 +- pages/4877/BJQ4877.vue | 12 ++--- pages/6155/deviceDetail.vue | 13 ++--- pages/6331/BJQ6331.vue | 12 ++--- pages/650/HBY650.vue | 16 +++--- pages/670/HBY670.vue | 18 ++++--- pages/7305/BJQ7305.vue | 14 +++--- pages/common/addBLE/LinkBle.vue | 2 +- utils/BleHelper.js | 31 +++++++----- 11 files changed, 104 insertions(+), 100 deletions(-) diff --git a/manifest.json b/manifest.json index 12cf937..282ed38 100644 --- a/manifest.json +++ b/manifest.json @@ -132,7 +132,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "", + "appid" : "wxe16dcf57e925a6b5", "setting" : { "urlCheck" : false }, diff --git a/pages/100/HBY100.vue b/pages/100/HBY100.vue index ea5a481..56849d9 100644 --- a/pages/100/HBY100.vue +++ b/pages/100/HBY100.vue @@ -23,13 +23,14 @@ - - 蓝牙名称 - {{formData.blename}} - + 设备名称 - {{formData.deviceName}} + {{device.deviceName}} + + + 蓝牙名称 + {{device.bluetoothName}} 蓝牙状态 @@ -323,48 +324,39 @@ sta_LightFreq: '', sta_LightDimmer: '', sta_system: '' - }, dic: { - SOS: [{ - text: '声光报警', - val: 'sos', - img: '/static/images/4877/sg.png', - activeImg: '/static/images/4877/sgActive.png' - }, - { - text: '泛光照明', - val: 'fan', - img: '/static/images/4877/fan.png', - activeImg: '/static/images/4877/fanActive.png' - } - ], - gropus: [{ - text: '红配组', - val: 'red_group', - img: '/static/images/4877/light.png', - activeImg: '/static/images/4877/lightActive.png' - }, - { - text: '蓝配组', - val: 'blue_group', - img: '/static/images/4877/light.png', - activeImg: '/static/images/4877/lightActive.png' - }, - { - text: '绿配组', - val: 'green_group', - img: '/static/images/4877/light.png', - activeImg: '/static/images/4877/lightActive.png' - }, - { - text: '黄配组', - val: 'yellow_group', - img: '/static/images/4877/light.png', - activeImg: '/static/images/4877/lightActive.png' - } - - ] + sta_VoiceType: { + "0": '关闭', + "1": '消防', + "2": '公安', + "3": '交警', + "4": '市政', + "5": '应急', + "6": '医疗', + "7": '铁道', + "8": 'app语音', + }, + + sta_LightType: { + "0": '关闭', + "1": '红蓝闪', + "2": '红闪', + "3": '黄闪', + "4": '蓝闪', + "5": '红流水', + "6": '黄流水', + "7": '蓝流水' + }, + + + sta_system: { + "0": '关机', + "1": '仅充电', + "2": '开机未充电', + "3": '开机且充电' + } + }, device: { id: "", diff --git a/pages/210/deviceControl/index.vue b/pages/210/deviceControl/index.vue index 7db6436..80f02b9 100644 --- a/pages/210/deviceControl/index.vue +++ b/pages/210/deviceControl/index.vue @@ -240,7 +240,7 @@ - diff --git a/pages/4877/BJQ4877.vue b/pages/4877/BJQ4877.vue index 9dba199..8e37021 100644 --- a/pages/4877/BJQ4877.vue +++ b/pages/4877/BJQ4877.vue @@ -24,20 +24,20 @@ - 蓝牙名称 - {{formData.blename}} + 设备名称 + {{device.deviceName}} - 设备名称 - {{formData.deviceName}} - + 蓝牙名称 + {{device.bluetoothName}} + 蓝牙状态 {{formData.bleStatu?'已连接':'未连接'}} - 设备强制报警中! diff --git a/pages/6155/deviceDetail.vue b/pages/6155/deviceDetail.vue index e49632b..ecc5333 100644 --- a/pages/6155/deviceDetail.vue +++ b/pages/6155/deviceDetail.vue @@ -22,18 +22,19 @@ - - 蓝牙名称 - {{formData.blename}} - + 设备名称 - {{formData.deviceName}} + {{device.deviceName}} - 充电状态 + 设备状态 {{formData.statu}} + + 蓝牙名称 + {{device.bluetoothName}} + 蓝牙状态 {{formData.bleStatu?'已连接':'未连接'}} diff --git a/pages/6331/BJQ6331.vue b/pages/6331/BJQ6331.vue index 8a5fcc9..c5a3c0e 100644 --- a/pages/6331/BJQ6331.vue +++ b/pages/6331/BJQ6331.vue @@ -22,15 +22,15 @@ - + + 设备名称 + {{device.deviceName}} + 蓝牙名称 - {{formData.blename}} - - - 设备名称 - {{formData.deviceName}} + {{device.bluetoothName}} + 蓝牙状态 {{formData.bleStatu?'已连接':'未连接'}} diff --git a/pages/650/HBY650.vue b/pages/650/HBY650.vue index 641c8a3..9c495a7 100644 --- a/pages/650/HBY650.vue +++ b/pages/650/HBY650.vue @@ -24,11 +24,11 @@ 蓝牙名称 - {{formData.blename}} + {{device.bluetoothName}} 设备名称 - {{formData.deviceName}} + {{device.deviceName}} 蓝牙状态 @@ -40,14 +40,14 @@ - + 警告!环境存在漏电电源! - - - - - + + + + + diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index 120cf2c..64f81f7 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -33,6 +33,10 @@ 设备名称 {{device.deviceName}} + + 蓝牙名称 + {{device.bluetoothName}} + 蓝牙状态 {{formData.bleStatu?'已连接':'未连接'}} @@ -69,17 +73,17 @@ - + 警告!设备静止报警中! - - - - - + + + + + - 设备强制报警中! diff --git a/pages/7305/BJQ7305.vue b/pages/7305/BJQ7305.vue index b7d5d34..c571ca5 100644 --- a/pages/7305/BJQ7305.vue +++ b/pages/7305/BJQ7305.vue @@ -22,18 +22,20 @@ - - 蓝牙名称 - {{formData.blename}} - 设备名称 - {{formData.deviceName}} + {{device.deviceName}} - 充电状态 + 设备状态 {{formData.statu}} + + 蓝牙名称 + {{device.bluetoothName}} + + + 蓝牙状态 {{formData.bleStatu?'已连接':'未连接'}} diff --git a/pages/common/addBLE/LinkBle.vue b/pages/common/addBLE/LinkBle.vue index b3d95a3..2596e2b 100644 --- a/pages/common/addBLE/LinkBle.vue +++ b/pages/common/addBLE/LinkBle.vue @@ -20,7 +20,7 @@ 设备IMEI:{{device.imei}} - + {{Statu.boundRemark}} diff --git a/utils/BleHelper.js b/utils/BleHelper.js index 7a861bd..337f7b7 100644 --- a/utils/BleHelper.js +++ b/utils/BleHelper.js @@ -511,9 +511,11 @@ class BleHelper { uni.onBluetoothAdapterStateChange((state) => { // console.log('蓝牙状态发生变化:' + JSON.stringify(state)); + this.data.discovering = state.discovering; + if (this.data.available !== state.available) { this.data.available = state.available; - this.data.discovering = state.discovering; + if (this.data.available && this.data .isOpenBlue) { //蓝牙状态再次可用,重连所有设备 @@ -870,10 +872,7 @@ class BleHelper { return Promise.resolve(); } return new Promise((resolve, reject) => { - this.data.available = false; - this.data.discovering = false; - this.data.isOpenBlue = false; - this.data.searchList = []; + this.StopSearch(); @@ -882,15 +881,19 @@ class BleHelper { uni.closeBluetoothAdapter({ success: () => { // console.log("蓝牙模块已关闭"); - + this.data.available = false; + this.data.discovering = false; + this.data.isOpenBlue = false; + this.data.searchList = []; + resolve(); }, fail: (ex) => { console.error('无法关闭蓝牙模块:', ex); ex = this.getError(ex); - + reject(ex); }, complete: () => { - resolve(); + } }); @@ -963,7 +966,8 @@ class BleHelper { //停止搜索 StopSearch() { - if (this.data.platform == 'web') { + if (this.data.platform == 'web' || !this.data.discovering) { + console.error("web平台或当前没有搜索,直接返回"); return Promise.resolve(); } let p1 = new Promise((resolve, reject) => { @@ -1481,7 +1485,9 @@ class BleHelper { // 处理 MTU 设置 if (plus.os.name === 'Android') { - this.setMtu(deviceId); + this.setMtu(deviceId).catch(ex=>{ + console.error("mtu设置失败=",ex); + }); } resolve(true); @@ -1579,12 +1585,11 @@ class BleHelper { _succ(mtuRes); }, fail: (ex) => { - console.error( - "mtu设置失败", ex); + ex = this.getError(ex); _err( ex - ); // MTU设置失败不影响连接成功 + ); }, complete() { console.log("设置mtu完毕"); From 2493bb7113fd21e64836ed912ff9ff72ed0fcd1e Mon Sep 17 00:00:00 2001 From: liub Date: Fri, 7 Nov 2025 11:57:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=8C=E6=88=90100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 192 ++++-- pages.json | 67 +- pages/100/HBY100.vue | 1077 ++++++++++++++++++++++-------- pages/4877/BJQ4877.vue | 12 +- pages/6155/deviceDetail.vue | 13 +- pages/6331/AudioManager.vue | 22 - pages/6331/BJQ6331.vue | 12 +- pages/650/HBY650.vue | 12 +- pages/670/HBY670.vue | 19 +- pages/7305/BJQ7305.vue | 12 +- pages/common/addBLE/LinkBle.vue | 100 +-- pages/common/index/index.vue | 67 +- static/images/4877/4877equip.png | Bin 41350 -> 0 bytes utils/BleHelper.js | 4 +- utils/BleReceive.js | 52 +- utils/Common.js | 144 ++-- 16 files changed, 1278 insertions(+), 527 deletions(-) delete mode 100644 pages/6331/AudioManager.vue delete mode 100644 static/images/4877/4877equip.png diff --git a/App.vue b/App.vue index edb4820..eb826f1 100644 --- a/App.vue +++ b/App.vue @@ -3,7 +3,7 @@ import upgrade from '@/utils/update.js' export default { - onLaunch: function() { + onLaunch: function() { //以下代码仅在开发时使用,否则会出现不可预知的问题。 //清除登陆之外的所有信息; // let store=uni.getStorageInfoSync(); @@ -28,24 +28,29 @@ // }); // uni.clearStorageSync(); //以上代码仅在开发时使用,否则会出现不可预知的问题。 - - + + // #ifdef APP-PLUS + var appid = plus.runtime.appid; + console.log('应用的 appid 为:' + appid); + // #endif }, onShow: function() { console.log('App Show'); //将检查更新换到onshow,因为苹果用户喜欢一直挂着 - uni.getSystemInfo({success:function(res){ - if(res.uniPlatform=='app'){ - bleTool.getBleTool(); - let appid=plus.runtime.appid; - if(appid!=='HBuilder'){ - console.log("appid=",appid); + uni.getSystemInfo({ + success: function(res) { + if (res.uniPlatform == 'app') { + bleTool.getBleTool(); + let appid = plus.runtime.appid; + if (appid !== 'HBuilder') { + console.log("appid=", appid); upgrade.checkAndUpdateWgt(); } - - + + } - }}); + } + }); }, onHide: function() { console.log('App Hide'); @@ -55,66 +60,117 @@ + font-family: "PingFang SC"; + src: url("~@/static/fonts/PingFangSC.ttf") format("opentype"); + } + + @font-face { + font-family: "PingFangBold"; + src: url("~@/static/fonts/PingFangBold.ttf") format("opentype"); + } + \ No newline at end of file diff --git a/pages.json b/pages.json index 2382871..c89a492 100644 --- a/pages.json +++ b/pages.json @@ -252,34 +252,71 @@ } }, { - "path" : "pages/6331/BJQ6331", - "style" : - { - "navigationBarTitleText" : "BJQ6331" + "path": "pages/6331/BJQ6331", + "style": { + "navigationBarTitleText": "BJQ6331" + } + }, + + { + "path": "pages/4877/BJQ4877", + "style": { + "navigationBarTitleText": "BJQ 4877" } }, { - "path" : "pages/6331/AudioManager", - "style" : - { - "navigationBarTitleText" : "语音管理" + "path": "pages/100/HBY100", + "style": { + "navigationBarTitleText": "HBY 100" } }, { - "path" : "pages/4877/BJQ4877", - "style" : - { - "navigationBarTitleText" : "BJQ 4877" + "path": "pages/common/audioManager/AudioList", + "style": { + "navigationBarTitleText": "语音管理", + "disableScroll":true, + "app-plus": { + "bounce":"none", + "titleNView": { + "buttons": [ + + { + "color": "#00000000", + "text": "删", + "fontSize": "10", + "float": "right", + "fontWeight": "normal" + + }, + { + "color": "#ffffffde", + "text": "编辑", + "fontSize": "14", + "float": "right", + "fontWeight": "normal" + + }, + { + "color": "#ffffffde", + "text": "取消", + "fontSize": "14", + "float": "right", + "fontWeight": "normal" + + } + ] + } + } } }, { - "path" : "pages/100/HBY100", + "path" : "pages/common/audioManager/Recording", "style" : { - "navigationBarTitleText" : "HBY 100" + "navigationBarTitleText" : "录制语音" } } - + ], "tabBar": { diff --git a/pages/100/HBY100.vue b/pages/100/HBY100.vue index 56849d9..334b9ca 100644 --- a/pages/100/HBY100.vue +++ b/pages/100/HBY100.vue @@ -1,9 +1,9 @@