From c556b802e4a4635a4b55b141baa4d0bbc5b6c80d Mon Sep 17 00:00:00 2001 From: liub Date: Mon, 29 Sep 2025 10:01:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D650=E3=80=81670=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E5=AD=97=E6=AE=B500=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=8C=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 4 ++-- manifest.json | 2 +- pages/650/HBY650.vue | 11 +++++++---- pages/670/HBY670.vue | 15 +++++++++++---- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/config/index.js b/config/index.js index d093640..a0bcd76 100644 --- a/config/index.js +++ b/config/index.js @@ -12,11 +12,11 @@ const config = { }, // 生产环境 production: { - BASE_URL: 'https://fuyuanshen.com/backend', + BASE_URL: 'https://www.cnxhyc.com/jingquan', API_PREFIX: '', // MQTT 配置 MQTT_HOST: 'www.cnxhyc.com', - MQTT_PORT: 8083, + MQTT_PORT: 9084, MQTT_USERNAME: 'admin', MQTT_PASSWORD: '#YtvpSfCNG' } diff --git a/manifest.json b/manifest.json index 9c4cb37..7fe5bd7 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "星汉物联", "appid" : "__UNI__A21EF43", "description" : "设备管控", - "versionName" : "1.0.1", + "versionName" : "1.0.2", "versionCode" : "100", "transformPx" : false, /* 5+App特有相关 */ diff --git a/pages/650/HBY650.vue b/pages/650/HBY650.vue index e203ce1..ec02911 100644 --- a/pages/650/HBY650.vue +++ b/pages/650/HBY650.vue @@ -984,7 +984,7 @@ uni.uploadFile({ // url: 'http://114.55.111.217/video/upload', - url: baseURL+"app/video/upload", + url: baseURL + "app/video/upload", filePath: videoPath, name: 'file', header: { @@ -1148,7 +1148,7 @@ }, closePop: function() { this.Status.Pop.showPop = false; - + if (this.Status.Pop.cancelCallback) { this.Status.Pop.cancelCallback(); } @@ -1262,7 +1262,9 @@ let arr = gbk.encode(text) let gbkData = gbk.arr2hex(arr); - + let s = (text.length * 2).toString(16); + let len = String(s).padStart(4, '0') + len = len.match(/.{1,2}/g); // 构建数据包 const bufferSize = 5 + gbkData.length / 2; // 头部4字节 + 数据部分 const buffer = new ArrayBuffer(bufferSize); @@ -1272,7 +1274,8 @@ dataView.setUint8(0, 0x55); // 帧头 dataView.setUint8(1, 0x03); // 帧类型:文字 dataView.setUint8(2, currentPacket.toString(16)); // 包序号 - dataView.setUint16(3, (text.length * 2).toString(16)); // 数据长度 + dataView.setUint8(3, parseInt('0x' + len[0], 16)); // 数据长度 + dataView.setUint8(4, parseInt('0x' + len[1], 16)); // 数据长度 // 填充数据 let index = 0; diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index b539446..ec4f0e6 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -590,9 +590,9 @@ that.formData.job = personnelInfo.position; that.formData.usrid = personnelInfo.code } - that.formData.imei=res.deviceImei; - these.device.deviceImei=res.deviceImei; - if(that.formData.imei){ + that.formData.imei = res.deviceImei; + these.device.deviceImei = res.deviceImei; + if (that.formData.imei) { that.initMQ(); } let dic = { @@ -2218,11 +2218,18 @@ const buffer = new ArrayBuffer(bufferSize); const dataView = new DataView(buffer); + let s = (text.length * 2).toString(16); + let len = String(s).padStart(4, '0') + len = len.match(/.{1,2}/g); + // 填充头部 dataView.setUint8(0, 0x55); // 帧头 dataView.setUint8(1, 0x03); // 帧类型:文字 dataView.setUint8(2, currentPacket.toString(16)); // 包序号 - dataView.setUint16(3, (text.length * 2).toString(16)); // 数据长度 + dataView.setUint8(3, parseInt('0x' + len[0], 16)); // 数据长度 + dataView.setUint8(4, parseInt('0x' + len[1], 16)); // 数据长度 + + // 填充数据 let index = 0;