From 497cce1e45c581a41f58a77da72542d4a5985607 Mon Sep 17 00:00:00 2001 From: liub Date: Wed, 24 Sep 2025 11:34:15 +0800 Subject: [PATCH] =?UTF-8?q?670=20SOS=E8=BD=AC=E5=88=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=AB=AF=E8=BF=9B=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/670/HBY670.js | 19 ++++++++++++++++--- manifest.json | 2 +- pages/670/HBY670.vue | 24 +++++++++++++++--------- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/api/670/HBY670.js b/api/670/HBY670.js index ce050d4..580ad2e 100644 --- a/api/670/HBY670.js +++ b/api/670/HBY670.js @@ -9,11 +9,13 @@ function getdata(data,url,method){ if(!method){ method='POST'; } - request({ + let cfg={ url: url, method: method, data:data - }).then((res)=>{ + }; + + request(cfg).then((res)=>{ console.log("res=",res); resolve(res); }).catch(ex=>{ @@ -90,11 +92,22 @@ function getDetail(id){ method: 'get', }) } + +//发送SOS +function sendSos(data){ + return request({ + url: '/app/xinghan/device/SOSGradeSettings', + method: 'post', + data:data + }) +} export default{ sendUsr:sendUsr, warnMsg:warnMsg, sendPic:sendPic, - getDetail:getDetail + getDetail:getDetail, + sendSos:sendSos, + getdata:getdata } diff --git a/manifest.json b/manifest.json index 8aa5b30..2435780 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "星汉物联", "appid" : "__UNI__A21EF43", "description" : "设备管控", - "versionName" : "1.0.25", + "versionName" : "1.0.28", "versionCode" : "100", "transformPx" : false, /* 5+App特有相关 */ diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index bea2f8f..97f8567 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -52,9 +52,9 @@ - - {{formData.address}} + + {{formData.address}} @@ -449,7 +449,8 @@ }, onLoad: function() { - // console.log("670页面加载"); + + these = this; recei = BleReceive.getBleReceive(); ble = BleTool.getBleTool(); @@ -516,8 +517,8 @@ }, methods: { gotoMap() { - this.detailData.longitude=this.formData.Lon; - this.detailData.latitude=this.formData.Lat; + this.detailData.longitude = this.formData.Lon; + this.detailData.latitude = this.formData.Lat; uni.navigateTo({ url: '/pages/common/map/index', events: { @@ -718,8 +719,9 @@ }); }, - sendMQ(message) { - message = JSON.stringify(message); + sendMQ(json, url) { + + let message = JSON.stringify(json); console.log("imei=", this.formData.imei ? this.formData.imei : this.device.deviceImei); const topic = `B/${this.formData.imei?this.formData.imei:this.device.deviceImei}`; return new Promise((resolve, reject) => { @@ -747,6 +749,8 @@ reject(error); } }); + + }, parseDataMQ(json) { let receiveData = {}; @@ -1137,7 +1141,9 @@ let requestSend = () => { this.sendMQ(json).then((res) => { console.log("4g发送成功"); - + json.deviceId = these.device.id; + json.deviceImei = these.device.deviceImei; + api.sendSos(json); }).catch((ex) => { console.log("ex=", ex);