Bladeren bron

提交设备详情

wangming 2 maanden geleden
bovenliggende
commit
3c29cfc686
3 gewijzigde bestanden met toevoegingen van 41 en 21 verwijderingen
  1. 25 2
      src/components/component/alarModel.vue
  2. 2 2
      src/components/js_sdk/index.js
  3. 14 17
      src/pagesA/deviceDetail/deviceDetail.vue

+ 25 - 2
src/components/component/alarModel.vue

@@ -504,7 +504,7 @@ export default {
                 this.devName = data.devName;
                 this.sn = data.clientId;
                 this.eventListId = data.eventListId;
-
+                this.getVoipAuthor(this.clientId, userId);
                 console.log(data, topic, "接收到消息222:");
                 console.log(
                     "接收到消息:",
@@ -533,7 +533,9 @@ export default {
 
         hanledList(type) {
             this.$http
-                .get(`wap/event/handleEvent/${this.eventListId}`)
+                .get(`wap/event/handleEvent`, {
+                    eventListId: this.eventListId,
+                })
                 .then((res) => {
                     if (res.data.code == 200) {
                         if (type === "noVoice") {
@@ -559,6 +561,27 @@ export default {
                 console.log("MQTT连接已断开");
             }
         },
+        getVoipAuthor(clientId, userId) {
+            console.log(clientId, userId);
+            this.$http
+                .post(
+                    "wap/share/queryUserVoipPermission",
+                    {
+                        userId: userId,
+                        clientId: clientId,
+                    },
+                    {
+                        header: {
+                            "Content-Type": "application/json;charset=UTF-8",
+                        },
+                    }
+                )
+                .then((res) => {
+                    if (res.data.data) {
+                        console.log(res.data.data, 9999);
+                    }
+                });
+        },
     },
     mounted() {
         setTimeout(() => {

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

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

+ 14 - 17
src/pagesA/deviceDetail/deviceDetail.vue

@@ -10,7 +10,8 @@
                     width: `${length / 200}px`,
                     height: `${width / 200}px`,
                     position: 'relative',
-
+                    left: `${xOffset / 100}rpx`,
+                    top: `${yOffset / 100}rpx`,
                     overflow: 'hidden',
                 }"
                 :class="[
@@ -316,7 +317,9 @@ export default {
     methods: {
         getdevInfo(devId) {
             this.$http
-                .get(`wap/device/queryDeviceInfoById/${devId}`, {})
+                .get(`wap/device/queryDeviceInfoById`, {
+                    devId: devId,
+                })
                 .then((res) => {
                     if (res.data.data) {
                         this.devInfo = res.data.data;
@@ -416,6 +419,7 @@ export default {
                         );
                     }
                 });
+                this.isInitAlarm = true;
             });
             client.on("disconnect", () => {
                 console.log("MQTT不在连接");
@@ -461,6 +465,7 @@ export default {
                             if (item.length < 4) return;
                             const [x, y, z, id] = item;
                             currentIds.add(id);
+                            console.log(currentIds, 9999);
                             if (!(id in this.targetPoints)) {
                                 this.targetPoints[id] = {
                                     x,
@@ -764,24 +769,16 @@ export default {
         },
     },
     onLoad(options) {
-        try {
-            const devItem = this.parseDeviceItem(options.devItem);
-            const { devId, clientId } = devItem;
-            this.connectMQTT(clientId, devId);
-            this.getFrequency(devId);
-            this.getdevInfo(devId);
-            this.getdevRoomInfo(devId);
-        } catch (error) {
-            uni.showToast({
-                title: "设备信息格式错误",
-                icon: "none",
-            });
-        }
+        const devItem = this.parseDeviceItem(options.devItem);
+        const { devId, clientId } = devItem;
+        this.connectMQTT(clientId, devId);
+        this.getFrequency(devId);
+        this.getdevInfo(devId);
+        this.getdevRoomInfo(devId);
         this.autoPlayinterval = setTimeout(() => {
             this.autoSwipe();
         }, 3000);
         this.getCurrentDate();
-        this.isInitAlarm = true;
     },
     onUnload() {
         this.isInitAlarm = false;
@@ -860,7 +857,7 @@ export default {
             background-image: url("http://jkld.radar-power.com//uploadFiles/framework/file/20250620/toilet_bg.png");
             background-repeat: no-repeat;
             background-position: center;
-            transform: scale(2.5);
+            transform: scale(2.2);
 
             .moduleContent {
                 overflow: hidden;