From 50373f407d1b0a5069f6423d52caf0925a753208 Mon Sep 17 00:00:00 2001 From: liub Date: Tue, 23 Sep 2025 08:36:21 +0800 Subject: [PATCH] =?UTF-8?q?650/670=E5=A2=9E=E5=8A=A0=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E6=8E=A2=E6=B5=8B=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E8=B7=9F=E4=BE=9B=E5=BA=94=E5=95=86=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E7=9A=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 83 +- pages/650/HBY650.vue | 2 +- pages/670/HBY670.vue | 115 +- pages/BlueTooth/ModeSetting/4877.vue | 1267 -------- pages/BlueTooth/ModeSetting/HBY6155.vue | 1947 ----------- pages/BlueTooth/ModeSetting/HBY6155V1.vue | 2039 ------------ pages/BlueTooth/ModeSetting/HBY650.vue | 2123 ------------ pages/BlueTooth/ModeSetting/HBY650_1.vue | 2025 ------------ pages/BlueTooth/ModeSetting/HBY670V1.vue | 2857 ----------------- pages/BlueTooth/ModeSetting/ModeSetting.vue | 1499 --------- pages/BlueTooth/ModeSetting/VideoSend.vue | 529 --- pages/BlueTooth/ModeSetting/VideoSend_1.vue | 517 --- pages/BlueTooth/ModeSetting/VideoSend_670.vue | 546 ---- pages/BlueTooth/ModeSetting/index.vue | 118 - pages/BlueTooth/ModeSetting/update.vue | 273 -- pages/common/addBLE/LinkBle.vue | 15 +- pages/common/addBLE/addEquip.vue | 7 +- utils/BleHelper.js | 28 +- utils/BleReceive.js | 4 +- utils/request.js | 4 +- utils/update.js | 17 +- 21 files changed, 125 insertions(+), 15890 deletions(-) delete mode 100644 pages/BlueTooth/ModeSetting/4877.vue delete mode 100644 pages/BlueTooth/ModeSetting/HBY6155.vue delete mode 100644 pages/BlueTooth/ModeSetting/HBY6155V1.vue delete mode 100644 pages/BlueTooth/ModeSetting/HBY650.vue delete mode 100644 pages/BlueTooth/ModeSetting/HBY650_1.vue delete mode 100644 pages/BlueTooth/ModeSetting/HBY670V1.vue delete mode 100644 pages/BlueTooth/ModeSetting/ModeSetting.vue delete mode 100644 pages/BlueTooth/ModeSetting/VideoSend.vue delete mode 100644 pages/BlueTooth/ModeSetting/VideoSend_1.vue delete mode 100644 pages/BlueTooth/ModeSetting/VideoSend_670.vue delete mode 100644 pages/BlueTooth/ModeSetting/index.vue delete mode 100644 pages/BlueTooth/ModeSetting/update.vue diff --git a/pages.json b/pages.json index 87d418f..525cbc9 100644 --- a/pages.json +++ b/pages.json @@ -226,78 +226,7 @@ "navigationBarTitleText": "呼叫" } }, - { - "path": "pages/BlueTooth/ModeSetting/index", - "style": { - "navigationBarTitleText": "设备类型" - } - }, - { - "path": "pages/BlueTooth/ModeSetting/VideoSend", - "style": { - "navigationBarTitleText": "发送视频" - - } - }, - { - "path": "pages/BlueTooth/ModeSetting/VideoSend_1", - "style": { - "navigationBarTitleText": "发送视频" - - - } - }, - { - "path": "pages/BlueTooth/ModeSetting/VideoSend_670", - "style": { - "navigationBarTitleText": "发送视频" - - - } - }, - { - "path": "pages/BlueTooth/ModeSetting/HBY650", - "style": { - "navigationBarTitleText": "HBY650" - } - }, - { - "path": "pages/BlueTooth/ModeSetting/HBY650_1", - "style": { - "navigationBarTitleText": "HBY650" - } - }, - { - "path": "pages/BlueTooth/ModeSetting/ModeSetting", - "style": { - "navigationBarTitleText": "7307-0.96TFT" - } - }, - { - "path": "pages/BlueTooth/ModeSetting/update", - "style": { - "navigationBarTitleText": "版本更新" - } - }, - { - "path": "pages/BlueTooth/ModeSetting/HBY6155", - "style": { - "navigationBarTitleText": "HBY6155" - } - }, - { - "path": "pages/BlueTooth/ModeSetting/HBY6155V1", - "style": { - "navigationBarTitleText": "HBY6155_V1" - } - }, - { - "path": "pages/BlueTooth/ModeSetting/HBY670V1", - "style": { - "navigationBarTitleText": "HBY670" - } - }, { "path": "pages/670/HBY670", "style": { @@ -317,17 +246,11 @@ "navigationBarTitleText": "历史记录" } }, + { - "path": "pages/BlueTooth/ModeSetting/4877", + "path": "pages/7305/BJQ7305", "style": { - "navigationBarTitleText": "" - } - }, - { - "path" : "pages/7305/BJQ7305", - "style" : - { - "navigationBarTitleText" : "BJQ7305" + "navigationBarTitleText": "BJQ7305" } } diff --git a/pages/650/HBY650.vue b/pages/650/HBY650.vue index 41bafca..6ee93dd 100644 --- a/pages/650/HBY650.vue +++ b/pages/650/HBY650.vue @@ -510,7 +510,7 @@ dataValue = 0x65; break; case "close": //关闭 - dataValue = 0x68; + dataValue = 0x64; break; case true: //开灯 dataValue = 0x6E; diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index 16d43c5..55d0d10 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -27,31 +27,32 @@ 设备IMEI - {{device.deviceImei}} + {{device.deviceImei}} 设备名称 - {{device.deviceName}} + {{device.deviceName}} 设备状态 - {{formData.sta_system}} + {{formData.sta_system}} 定位信息 - + {{formData.Lon}} - + {{formData.Lat}} - {{formData.address}} + {{formData.address}} + @@ -95,6 +96,10 @@ @click="GearSetting('hight','staticBattery')"> 高档 + + 关闭 + @@ -316,7 +321,7 @@ promptTitle: '设备名称', modelValue: '', visibleClose: false, - + okCallback: null }, BottomMenu: { show: false, @@ -481,8 +486,8 @@ if (res && res.code == 200) { res = res.data; - let json=res; - console.log("res=",res); + let json = res; + console.log("res=", res); that.formData.Lon = res.longitude; that.formData.Lat = res.latitude; that.formData.address = res.address; @@ -493,17 +498,17 @@ that.formData.job = personnelInfo.position; that.formData.usrid = personnelInfo.code } - - let dic = { - "3": "hight", - "2": "center", - "1": "low", - "0": "close", - - }; - let staticLevelText = dic[json.staDetectGrade]; - that.formData.modeCurr = staticLevelText; - + + let dic = { + "3": "hight", + "2": "center", + "1": "low", + "0": "close", + + }; + let staticLevelText = dic[json.staDetectGrade]; + that.formData.modeCurr = staticLevelText; + dic = { "0": "none", "1": "ruo", @@ -513,14 +518,15 @@ }; let warn = dic[json.staDetectResult]; that.formData.warnLevel = warn; - - let lightingLevelText = json.staLightGrade === 1 ? 'hight' : json.staLightGrade === 2 ? 'low' : + + let lightingLevelText = json.staLightGrade === 1 ? 'hight' : json.staLightGrade === 2 ? + 'low' : 'close'; that.formData.lightCurr = lightingLevelText; - + that.formData.battary = json.staPowerPercent - - + + let hours = Math.floor(json.staPowerTime / 60); let remainingMinutes = json.staPowerTime % 60; let xuhang = '0分'; @@ -532,13 +538,13 @@ } else { xuhang = `${hours}小时${remainingMinutes}分`; } - + that.formData.xuhang = xuhang; - + let sosText = json.staSOSGrade === 2 ? 'rb' : json.staSOSGrade === 1 ? "sg" : "close"; that.formData.SOS = sosText; - - + + } }); }, @@ -1009,7 +1015,12 @@ borderColor: "#e034344d", buttonBgColor: "#E03434", buttonText: "解除报警", - okCallback: callback, + okCallback: () => { + if (callback) { + callback(); + } + this.Status.Pop.okCallback = null; + }, clickEvt: 'time' }); }, @@ -1097,7 +1108,7 @@ let OpenSOS = () => { these.formData.qzwarn = true; //标记为强制报警了 - these.Status.staticWarn.time = 50; + these.Status.staticWarn.time = 180; this.formData.SOS = type; let loopFunc = () => { @@ -1121,21 +1132,34 @@ console.log("111111"); this.showQzWarn(this.Status.Pop.okCallback); } + + } these.Status.staticWarn.inteval = setInterval(() => { loopFunc(); - }, 1000) + }, 1000); bleSendCmd(); } if (type == 'rb') { //红蓝报警 - this.formData.SOS = type; - bleSendCmd(); - return; - } - if (type == 'sg') //强制报警 + console.log("11111"); + let sendRb = () => { + this.formData.SOS = type; + bleSendCmd(); + these.formData.qzwarn=false; + this.Status.staticWarn.time=0; + return; + } + if (these.formData.qzwarn) { + console.log("222222"); + these.showQzWarn(sendRb); + } else { + sendRb(); + } + + } else if (type == 'sg') //强制报警 { this.showPop({ @@ -1147,8 +1171,7 @@ buttonText: "开启" }); return; - } - if (type == 'close') { + } else if (type == 'close') { if (this.formData.SOS = 'sg') { //解除声光报警 this.CloseWarn(true); @@ -1178,7 +1201,7 @@ hight: 0x65, center: 0x66, low: 0x67, - close: 0x68 + close: 0x64 }, mqtt: { hight: 3, @@ -2324,14 +2347,22 @@ .eqinfo .value { color: rgba(255, 255, 255, 0.6); - font-family: PingFang SC; - font-size: 28rpx; + font-family: 'PingFang SC'; + font-size: 28rpx !important; font-weight: 400; letter-spacing: 0.07px; text-align: left; } + + .eqinfo .valueFont { + font-family: 'PingFang SC'; + font-size: 28rpx !important; + font-weight: 400; + color: rgba(255, 255, 255, 0.6); + } + .eqinfo .multiValue { display: flex; flex-direction: column; diff --git a/pages/BlueTooth/ModeSetting/4877.vue b/pages/BlueTooth/ModeSetting/4877.vue deleted file mode 100644 index e474f14..0000000 --- a/pages/BlueTooth/ModeSetting/4877.vue +++ /dev/null @@ -1,1267 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/HBY6155.vue b/pages/BlueTooth/ModeSetting/HBY6155.vue deleted file mode 100644 index aa59bc7..0000000 --- a/pages/BlueTooth/ModeSetting/HBY6155.vue +++ /dev/null @@ -1,1947 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/HBY6155V1.vue b/pages/BlueTooth/ModeSetting/HBY6155V1.vue deleted file mode 100644 index f303cda..0000000 --- a/pages/BlueTooth/ModeSetting/HBY6155V1.vue +++ /dev/null @@ -1,2039 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/HBY650.vue b/pages/BlueTooth/ModeSetting/HBY650.vue deleted file mode 100644 index 663be31..0000000 --- a/pages/BlueTooth/ModeSetting/HBY650.vue +++ /dev/null @@ -1,2123 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/HBY650_1.vue b/pages/BlueTooth/ModeSetting/HBY650_1.vue deleted file mode 100644 index 0b5b4c7..0000000 --- a/pages/BlueTooth/ModeSetting/HBY650_1.vue +++ /dev/null @@ -1,2025 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/HBY670V1.vue b/pages/BlueTooth/ModeSetting/HBY670V1.vue deleted file mode 100644 index c1fe054..0000000 --- a/pages/BlueTooth/ModeSetting/HBY670V1.vue +++ /dev/null @@ -1,2857 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/ModeSetting.vue b/pages/BlueTooth/ModeSetting/ModeSetting.vue deleted file mode 100644 index c464993..0000000 --- a/pages/BlueTooth/ModeSetting/ModeSetting.vue +++ /dev/null @@ -1,1499 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/VideoSend.vue b/pages/BlueTooth/ModeSetting/VideoSend.vue deleted file mode 100644 index 741860d..0000000 --- a/pages/BlueTooth/ModeSetting/VideoSend.vue +++ /dev/null @@ -1,529 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/VideoSend_1.vue b/pages/BlueTooth/ModeSetting/VideoSend_1.vue deleted file mode 100644 index 1c1eadb..0000000 --- a/pages/BlueTooth/ModeSetting/VideoSend_1.vue +++ /dev/null @@ -1,517 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/VideoSend_670.vue b/pages/BlueTooth/ModeSetting/VideoSend_670.vue deleted file mode 100644 index a91f306..0000000 --- a/pages/BlueTooth/ModeSetting/VideoSend_670.vue +++ /dev/null @@ -1,546 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/index.vue b/pages/BlueTooth/ModeSetting/index.vue deleted file mode 100644 index b1fd93b..0000000 --- a/pages/BlueTooth/ModeSetting/index.vue +++ /dev/null @@ -1,118 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/BlueTooth/ModeSetting/update.vue b/pages/BlueTooth/ModeSetting/update.vue deleted file mode 100644 index e814728..0000000 --- a/pages/BlueTooth/ModeSetting/update.vue +++ /dev/null @@ -1,273 +0,0 @@ - - - - - diff --git a/pages/common/addBLE/LinkBle.vue b/pages/common/addBLE/LinkBle.vue index aca3b43..8c9d12a 100644 --- a/pages/common/addBLE/LinkBle.vue +++ b/pages/common/addBLE/LinkBle.vue @@ -17,6 +17,9 @@ 设备Mac:{{device.macAddress}} + + 设备IMEI:{{device.imei}} + {{Statu.boundRemark}} @@ -63,7 +66,8 @@ ], "linkStatu": false, "macAddress": "", - "communicationMode":"" + "communicationMode":"", + "imei":"" }, serverDevice:null } @@ -118,7 +122,7 @@ console.log("收到设备消息,", receive); if (these.device.deviceId == receive.deviceId) { console.log("11111:",receive); - + these.device.imei=f.imei; if (receive.bytes[0] == 0xFC || receive.str.indexOf('mac address:') == 0) { if (f && f.macAddress) { these.device.macAddress = f.macAddress; @@ -153,11 +157,14 @@ } }) - // let inteval = setInterval(this.initDevice, 5000); + let inteval = setInterval(this.initDevice, 5000); }, methods: { initDevice: function() { + if(!these.device.macAddress){ + return; + } clearTimeout(this.Statu.timeInteval); this.Statu.timeInteval = setTimeout(() => { @@ -251,7 +258,7 @@ data: { deviceImei: '', deviceMac: these.device.macAddress, - communicationMode: '1', //0是4g,1是蓝牙 + communicationMode: 1, //0是4g,1是蓝牙,2蓝牙&4G } }); promise.then((res) => { diff --git a/pages/common/addBLE/addEquip.vue b/pages/common/addBLE/addEquip.vue index 98e706f..11afffd 100644 --- a/pages/common/addBLE/addEquip.vue +++ b/pages/common/addBLE/addEquip.vue @@ -141,7 +141,6 @@ }, onHide: function() { ble.StopSearch(); - }, onUnload() { @@ -173,11 +172,11 @@ } } - console.log("equip=", these.EquipMents) + // console.log("equip=", these.EquipMents) }, pagePath); // console.log("addEquip") ble.addReceiveCallback((receivData, f, path, arr) => { - if (f.macAddress) { + if (f.macAddress && these.device) { showLoading(these, { text: '正在验证设备' }); @@ -200,7 +199,7 @@ onShow: function() { - this.EquipMents = []; + // this.EquipMents = []; this.PairEquip = []; ble && ble.StartSearch().catch((ex) => { if (ex.code == 10001) { diff --git a/utils/BleHelper.js b/utils/BleHelper.js index cd24135..a2f27f5 100644 --- a/utils/BleHelper.js +++ b/utils/BleHelper.js @@ -532,6 +532,20 @@ class BleHelper { }); this.updateCache(); } + + if (str.indexOf('imei:') == 0) { + let imei = str.split(':')[1]; + + + this.data.LinkedList.find((v) => { + if (v.deviceId == receive + .deviceId) { + v.imei=imei; + } + }); + this.updateCache(); + + } if (bytes[0] == 0xFC) { //6155以0xFC开头代表mac地址 console.log("收到mac地址:", bytes) @@ -669,8 +683,8 @@ class BleHelper { let RunSearch = (serviceId) => { return new Promise((resolve, reject) => { uni.startBluetoothDevicesDiscovery({ - services: [serviceId], - allowDuplicatesKey: false, + services:serviceId? [serviceId]:[], + allowDuplicatesKey: true, success: (res) => { //console.log('开始搜索蓝牙设备成功'); resolve(res); @@ -689,11 +703,11 @@ class BleHelper { return new Promise((resolve, reject) => { let promises = []; - for (let i = 0; i < serviceIds.length; i++) { - - promises.push(RunSearch(serviceIds[i])); - } + // for (let i = 0; i < serviceIds.length; i++) { + // promises.push(RunSearch(serviceIds[i])); + // } + promises.push(RunSearch()); Promise.all(promises).then(resolve).catch(reject); }); @@ -1150,7 +1164,7 @@ class BleHelper { console.log("正在连接" + deviceId); uni.createBLEConnection({ deviceId: deviceId, - timeout: 3000, + timeout: 30000, success: (info) => { console.log("新连接成功", this.data.LinkedList); this.getLinkBlue().then((arr) => { diff --git a/utils/BleReceive.js b/utils/BleReceive.js index 1f0b06e..421886f 100644 --- a/utils/BleReceive.js +++ b/utils/BleReceive.js @@ -96,7 +96,7 @@ class BleReceive { staticLevelText = '低档'; modeCurr = "low"; break; - case 0x68: + case 0x64: staticLevelText = '关闭'; modeCurr = "close"; break; @@ -274,7 +274,7 @@ class BleReceive { case 0x67: staticLevelText = 'low'; break - case 0x68: + case 0x64: staticLevelText = 'close'; break } diff --git a/utils/request.js b/utils/request.js index 8078084..7d28d86 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,5 +1,5 @@ import config from '../config/index.js'; -const env = 'development'; //production development //开发of线上 改这里就行 +const env = 'production'; //production development //开发of线上 改这里就行 const BASE = config[env]; const request = (options) => { console.log("options"+JSON.stringify(options),BASE.BASE_URL) @@ -22,7 +22,7 @@ const request = (options) => { header: options.header || {}, timeout: 30000, success: (res) => { - console.log("res=",res); + // console.log("res=",res); resolve(res.data); }, fail: (err) => { diff --git a/utils/update.js b/utils/update.js index f69bb7a..89bf952 100644 --- a/utils/update.js +++ b/utils/update.js @@ -25,7 +25,7 @@ function checkAndUpdateWgt(updateUrl) { let callbck = (res) => { uni.hideLoading(); - console.log("检查更新成功=", res) + // console.log("检查更新成功=", res) if (res.statusCode === 200) { const updateInfo = res.data.data; @@ -61,10 +61,11 @@ function checkAndUpdateWgt(updateUrl) { method: 'GET', data: { currentVersion: currentVersion, - platform: uni.getSystemInfoSync().platform + platform: uni.getSystemInfoSync().platform, + appId:"xhyc" }, success: (res) => { - console.log("res=>",res) + // console.log("res=>",res) res.type='1'; resolve(res); }, @@ -129,18 +130,18 @@ function checkAndUpdateWgt(updateUrl) { let length = results.length; let flag=false; for (var i = 0; i < length; i++) { - console.log('results[i]=',results[i]); - if (results[i].status == 'fulfilled' && results[i].value.type==='1' ) { + console.log('results['+i+']=',results[i]); + if (results[i].status == 'fulfilled' && results[i].value.type==='1' && !flag ) { flag=true; callbck(results[i].value) - break; + // break; } - if(results[i].status == 'fulfilled' && results[i].value.type!=='1'){ + if(results[i].status == 'fulfilled' && results[i].value.type!=='1' && !flag){ flag=true; Callback1(results[i].value); - break; + // break; } } if(!flag){