From bda127148b7a03f515b845dead5b70508a7918f7 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 24 Dec 2021 15:41:37 +0800
Subject: [PATCH] 逻辑调整部分文件更换

---
 src/components/map/components/mapPopup.vue |   45 ++++++++++++++++++---------------------------
 1 files changed, 18 insertions(+), 27 deletions(-)

diff --git a/src/components/map/components/mapPopup.vue b/src/components/map/components/mapPopup.vue
index c5209fc..44b37ca 100644
--- a/src/components/map/components/mapPopup.vue
+++ b/src/components/map/components/mapPopup.vue
@@ -89,7 +89,7 @@
                                                     <ul>
                                                         <li v-for="(item, index) in teachList"
                                                             :key="index"
-                                                            @click="mechanismDetailPopup(item)">
+                                                            @click="mechanismDetailPopup(0, item)">
                                                             <i class="popup-icon location-icon deblurring"></i>
                                                             {{item}}
                                                         </li>
@@ -98,7 +98,8 @@
                                                 <div>
                                                     <ul>
                                                         <li v-for="(item, index) in liveList"
-                                                            :key="index">
+                                                            :key="index"
+                                                            @click="mechanismDetailPopup(1, item)">>
                                                             <i class="popup-icon location-icon deblurring"></i>
                                                             {{item}}
                                                         </li>
@@ -170,11 +171,6 @@
                   ref="popupImgs">
         </el-image>
 
-        <campusNav ref="campusNavRoute"
-                   :comeName="comeName"
-                   :getToName="getToName"
-                   v-show="campusNavFlag" />
-
         <audio ref="audioControlPlay"
                style="position: fixed; left: 111111111px;"
                v-html="audioSource"
@@ -194,9 +190,6 @@
         return {
             DC: null,
             tabBtnFlag: '教学科研行政',
-            campusNavFlag: false,
-            comeName: '',
-            getToName: '',
             QRCodeFlag: false,
             audioSource: '',
             audioFlag: false
@@ -232,36 +225,35 @@
             // 教学
             'teachList',
             // 科研
-            'liveList'
+            'liveList',
+            // 校内导航的显示关闭
+            'campusNavFlag'
         ])
     },
     created () {
         this.DC = global.DC
+    },
+    watch: {
+        introduceText: function (newQuestion, oldQuestion) {
+            var zhText = encodeURI(newQuestion)
+            this.audioSource = `<source src="http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=4&text=${zhText}" type="audio/mpeg"><embed height="0" width="0" src="http://tts.baidu.com/text2audio?text=${zhText}">`
+        }
     },
     methods: {
         tabBtnClick (param) {
             this.tabBtnFlag = param
         },
 
-        closeCampusNav () {
-            this.campusNavFlag = false
-            this.$refs.campusNavRoute.clearLayer()
-            this.$store.commit('SET_STARTINGPOINT', null)
-            this.$store.commit('SET_TERMINUS', null)
-            this.comeName = ''
-            this.getToName = ''
-        },
-
         comeHereClick () {
-            this.comeName = this.stateName
+            this.$store.commit('SET_COMENAME', this.stateName)
             this.$store.commit('SET_TERMINUS', this.pointPosition)
-            if (this.campusNavFlag == false) this.campusNavFlag = true
+            if (this.campusNavFlag == false) this.$store.commit('SET_CAMPUSNAVFLAG', true)
         },
 
         getToHereClick () {
-            this.getToName = this.stateName
+            this.$store.commit('SET_GETTONAME', this.stateName)
             this.$store.commit('SET_STARTINGPOINT', this.pointPosition)
-            if (this.campusNavFlag == false) this.campusNavFlag = true
+            if (this.campusNavFlag == false) this.$store.commit('SET_CAMPUSNAVFLAG', true)
         },
 
         qrCodeClick () {
@@ -309,7 +301,6 @@
             if (this.audioSource == '') {
                 var zhText = encodeURI(this.$refs.DomIntroduceText.innerText)
                 this.audioSource = `<source src="http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=4&text=${zhText}" type="audio/mpeg"><embed height="0" width="0" src="http://tts.baidu.com/text2audio?text=${zhText}">`
-                console.log(this.audioSource)
                 this.$refs.audioControlPlay.play()
                 this.audioFlag = true
             } else {
@@ -327,8 +318,8 @@
             this.audioFlag = false
         },
 
-        mechanismDetailPopup (param) {
-            getMechanismDetail({ mechanismname: param }).then(res => {
+        mechanismDetailPopup (num, param) {
+            getMechanismDetail({ num: num, mechanismName: param }).then(res => {
                 console.log(res)
                 var result = res.data.data
                 this.$store.commit('CLEAR_ALL', null)

--
Gitblit v1.9.3