wangming 2 сар өмнө
parent
commit
7631d2ccb9

+ 31 - 0
src/components/component/alarModel.vue

@@ -107,6 +107,7 @@ export default {
     computed: {},
     methods: {
         authorizeIot() {
+            this.hanledList("Voice");
             this.sn = this.clientId;
             this.alarmModel = false;
             // const { name, sn, voipDevices } = this;
@@ -173,11 +174,13 @@ export default {
             });
         },
         handleAlarm() {
+            this.hanledList("noVoice");
             this.alarmModel = false;
         },
         // voip相关方法
         async getVoipDevices() {
             const { list } = await getDeviceVoIPList();
+            console.log("getDeviceVoIPList:", list);
             if (list && list.length > 0) {
                 const authorizeFlag = list.some(
                     (item) => item.sn === this.clientId
@@ -185,6 +188,9 @@ export default {
                 console.log("authorizeFlag:", list, authorizeFlag);
                 this.authorizeFlag = authorizeFlag;
             }
+            if (!list || list.length === 0) {
+                this.authorizeFlag = false;
+            }
             if (typeof list === "object") {
                 this.voipDevices = list;
             }
@@ -250,6 +256,7 @@ export default {
             });
         },
         async gotoCallPage() {
+            this.hanledList("Voice");
             wx.showToast({
                 title: "通话加载中...",
                 icon: "loading",
@@ -492,12 +499,36 @@ export default {
                 const minutes = now.getMinutes().toString().padStart(2, "0");
                 const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}`;
                 this.nowTime = formattedTime;
+                console.log("isWmpf:", isWmpf);
                 if (!isWmpf) {
+                    console.log("isWmpf:", isWmpf);
                     this.getVoipDevices();
                 }
                 console.log("接收到消息:", topic, data);
             });
         },
+
+        hanledList(type) {
+            this.$http
+                .get(`wap/event/handleEvent/${this.eventListId}`)
+                .then((res) => {
+                    if (res.data.code == 200) {
+                        if (type === "noVoice") {
+                            uni.showToast({
+                                title: "已处理",
+                                icon: "success",
+                                duration: 1500,
+                            });
+                        }
+                    } else {
+                        uni.showToast({
+                            title: "处理失败",
+                            icon: "none",
+                            duration: 1500,
+                        });
+                    }
+                });
+        },
     },
     beforeMount() {
         if (uni.getStorageSync("userId")) {

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

@@ -42,7 +42,7 @@
                     >
                 </view>
                 <view class="rightItem" @click="goNo()">
-                    <view class="rightTitle">报警设备</view>
+                    <view class="rightTitle">异常设备</view>
                     <view class="rightContent" v-if="warnNum == 0"
                         ><text>0</text>台</view
                     >
@@ -89,6 +89,7 @@
                 >您有<text class="shareNum">{{ shareNum }}</text
                 >台设备待授权</text
             >
+            <image src="../../static/arrTwo.png" class="arrImage"></image>
         </view>
 
         <!-- <view> </view> -->
@@ -403,5 +404,10 @@ export default {
         font-size: 28rpx;
         color: #ffffff;
     }
+    .arrImage {
+        width: 20rpx;
+        height: 30rpx;
+        margin-left: 300rpx;
+    }
 }
 </style>

+ 0 - 1
src/pagesA/shareList/shareList.vue

@@ -153,7 +153,6 @@ export default {
         }, 1000);
     },
     onLoad(option) {
-        console.log("shareList onLoad", option);
         this.status = option.shareStatus;
         if (this.status == "all") {
             this.status = null;