瀏覽代碼

检测到跌倒人物目标图标由绿变黄,确认跌倒与跌倒呼救,人物目标图标变红,检测到没有跌倒事件,目标重新变绿

wangming 4 周之前
父節點
當前提交
11ba081a80

+ 1 - 1
src/components/js_sdk/index.js

@@ -8,7 +8,7 @@ http.setConfig(config => {
         //     config.baseUrl = "https://api.radar-power.asia:4443/portal-service-server/";
         // }
         config.baseUrl = "https://radar-power.cn/portal-service-server/";
-        config.baseUrl = "https://api.radar-power.asia:4443/portal-service-server/";
+        // config.baseUrl = "https://api.radar-power.asia:4443/portal-service-server/";
     }
     if (__wxConfig.envVersion == 'trial') {
         // let selectedService = uni.getStorageSync("sercviceChoice")

+ 1 - 1
src/pages/home/home.vue

@@ -98,7 +98,7 @@
             </movable-view>
         </movable-area> -->
 
-        <view class="bot_version"> v3.0.17</view>
+        <view class="bot_version"> v3.0.18</view>
         <view
             class="shareInfo"
             @click="goDeviceShare()"

+ 35 - 2
src/pagesA/deviceDetail/deviceDetail.vue

@@ -475,6 +475,7 @@ export default {
             zoomTimes: "",
             // 设备分享权限判断
             shareJudge: false,
+            fallingEventChange: false,
         };
     },
     computed: {},
@@ -1033,8 +1034,6 @@ export default {
             "DATA",
             topic,
             (message, msgTopic) => {
-                console.log(`接收到 ${msgTopic} 消息:`, message);
-                // 处理消息
                 const dataMatch = msgTopic.match(
                     /^\/dev\/(.+)\/tracker_targets$/
                 );
@@ -1049,6 +1048,36 @@ export default {
         if (this.unsubscribeFn) {
             console.log(`✅ 已成功订阅主题: ${topic}`);
         }
+
+        const topicTwo = `/dev/${this.clientId}/falling_event_change`;
+        this.fallingEventChange = MqttService.subscribe(
+            "DATA",
+            topicTwo,
+            (message, msgTopic) => {
+                const dataMatch = msgTopic.match(
+                    /^\/dev\/(.+)\/falling_event_change$/
+                );
+                if (dataMatch && dataMatch[1] === this.clientId) {
+                    const dataMessage = JSON.parse(message.toString());
+                    console.log(dataMessage.falling, "dataMessage");
+                    if (dataMessage.falling == 1) {
+                        this.falling = dataMessage.falling;
+                        this.lnbAction = "actionYellow";
+                    } else if (
+                        dataMessage.falling == 2 ||
+                        dataMessage.falling == 3
+                    ) {
+                        this.falling = dataMessage.falling;
+                        this.lnbAction = "actionRed";
+                    } else {
+                        this.lnbAction = "action8";
+                    }
+                }
+            }
+        );
+        if (this.unsubscribeFn) {
+            console.log(`✅ 已成功订阅主题: ${topicTwo}`);
+        }
     },
     onUnload() {
         this.inactivityTimer = null;
@@ -1057,6 +1086,10 @@ export default {
             this.unsubscribeFn();
             this.unsubscribeFn = null;
         }
+        if (this.fallingEventChange) {
+            this.fallingEventChange();
+            this.fallingEventChange = null;
+        }
         // 关闭 DATA 连接
         // MqttService.disconnectData();
     },

+ 2 - 2
src/pagesA/my/my.vue

@@ -27,7 +27,7 @@
                     <image src="../../static/arrTwo.png" mode="" />
                 </view>
             </view>
-            <view class="menu-item" @click="serverchange()">
+            <!-- <view class="menu-item" @click="serverchange()">
                 <view class="meanLeft">
                     <image src="../../static/setting.png" mode="" />
                     <text>网络配置</text>
@@ -35,7 +35,7 @@
                 <view class="meanRight">
                     <image src="../../static/arrTwo.png" mode="" />
                 </view>
-            </view>
+            </view> -->
             <!-- <view class="menu-item" @click="deaAccount()">
                 <view class="meanLeft">
                     <image src="../../static/logoff.png" mode="" />

+ 1 - 1
src/utils/globalMqtt.js

@@ -48,7 +48,7 @@ class MqttService {
         uni.showToast({
             title: "平台连接中...",
             icon: "loading",
-            duration: 1500, //持续的时间
+            duration: 1000, //持续的时间
         });
         if (this.dataConnected && this.dataClient) {
             console.log("DATA MQTT 已连接,复用现有实例");