From b69ca83a6f4eacc6afa0ac5b23514e6a520b79ea Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 19 Mar 2021 19:19:23 +0800
Subject: [PATCH] 部分逻辑修改

---
 src/page/index/logo.vue |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/src/page/index/logo.vue b/src/page/index/logo.vue
index 00b979c..4b421eb 100644
--- a/src/page/index/logo.vue
+++ b/src/page/index/logo.vue
@@ -365,21 +365,31 @@
           url: "/api/blade-jfpts/alarm/alarm/selecttx?id=" + that.deviceId,
           method: "post",
         }).then(function (response) {
-          var userId = JSON.parse(window.localStorage.getItem('物联网安保云服务平台-userInfo')).content.user_id;
-          if (response.data.data.length > 0 && response.data.data[0].waringType == "一键求助" && response.data.data[0].alarmId != userId) {
+          var userId = JSON.parse(
+            window.localStorage.getItem("物联网安保云服务平台-userInfo")
+          ).content.user_id;
+
+          if (response.data.data.length > 0) {
             that.deviceId = response.data.data[0].id;
-            that.form = response.data.data[0];
-            that.peopleList = [
-              { label: that.form.oneContacts, value: that.form.onePhone },
-              { label: that.form.twoContacts, value: that.form.twoPhone },
-              { label: that.form.threeContacts, value: that.form.threePhone },
-            ];
-            that.peopleName = that.form.oneContacts;
-            that.peoplePhone = that.form.onePhone;
-            that.dialogTableVisible = true;
-            that.videoConversationReal = true;
-            that.$refs.realAudio.src = "./realVideo/audio.mp3";
-            that.$refs.realAudio.play();
+            console.log(userId, response.data.data[0].alarmId);
+            if (
+              response.data.data[0].waringType == "紧急求救" &&
+              response.data.data[0].alarmId == userId
+            ) {
+              response.data.data[0].waringType == "一键求助";
+              that.form = response.data.data[0];
+              that.peopleList = [
+                { label: that.form.oneContacts, value: that.form.onePhone },
+                { label: that.form.twoContacts, value: that.form.twoPhone },
+                { label: that.form.threeContacts, value: that.form.threePhone },
+              ];
+              that.peopleName = that.form.oneContacts;
+              that.peoplePhone = that.form.onePhone;
+              that.dialogTableVisible = true;
+              that.videoConversationReal = true;
+              that.$refs.realAudio.src = "./realVideo/audio.mp3";
+              that.$refs.realAudio.play();
+            }
           }
         });
       }, 5000);
@@ -387,6 +397,8 @@
     closeDialog() {
       //关闭窗口回调,关闭警报
       this.$refs.realAudio.pause();
+     this.videoConversationReal = false;
+      this.oldVideoSatart = false;
     },
     updateJtyep(row, jtype, t) {
       var that = this;

--
Gitblit v1.9.3