From 61ece754a673dfaa0930f8f3145e4e9e40eb0e6b Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 17 Mar 2022 17:33:32 +0800
Subject: [PATCH] 部分更改

---
 src/pcviews/specialmap/welcome.vue |   45 ++++++++++++++++++++++++++++-----------------
 1 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/src/pcviews/specialmap/welcome.vue b/src/pcviews/specialmap/welcome.vue
index 04a4948..f1cb15d 100644
--- a/src/pcviews/specialmap/welcome.vue
+++ b/src/pcviews/specialmap/welcome.vue
@@ -9,7 +9,7 @@
                     <a href="javascript:void(0);" title="全景浏览">
                         <img
                             @click="panoramaPlay"
-                            class="panorama-control"
+                            class="panorama-control deblurring"
                             src="/img/icon/panorama.png"
                             alt
                         />
@@ -17,13 +17,18 @@
                     <a href="javascript:void(0);" title="语音介绍">
                         <img
                             @click="audioPlay"
-                            class="audio-control"
+                            class="audio-control deblurring"
                             src="/img/navicon/audio.png"
                             alt
                         />
                     </a>
                     <a href="javascript:void(0);" title="关闭">
-                        <img @click="closeModel" class="close-box" src="/img/navicon/close.png" alt />
+                        <img
+                            @click="closeModel"
+                            class="close-box deblurring"
+                            src="/img/navicon/close.png"
+                            alt
+                        />
                     </a>
                 </div>
             </div>
@@ -75,6 +80,9 @@
 import { getWelcome } from '@/api/pc/public/specialmap'
 import { mapGetters } from 'vuex'
 
+let pathLayer = null
+let pointLayer = null
+
 export default {
     data () {
         return {
@@ -87,8 +95,6 @@
             pathList: [],
             pointNameList: [],
             pointList: [],
-            pathLayer: null,
-            pointLayer: null,
             panoramaUrlOne: '',
             panoramaUrl: '',
             audioSource: '',
@@ -111,10 +117,13 @@
             this.audioCourse = false
         }
         this.getData()
+
+        window.onbeforeunload = e => { // 刷新时弹出提示
+            this.audioSynth.cancel()
+        }
     },
     computed: {
         ...mapGetters([
-            'viewer',
             // 校区内导航的显示关闭
             'campusNavFlag',
             'orgNavBarFlag',
@@ -156,11 +165,11 @@
                     this.pathList.push(k)
                 })
 
-                this.pathLayer = new global.DC.VectorLayer('pathLayer')
-                this.viewer.addLayer(this.pathLayer)
+                pathLayer = new global.DC.VectorLayer('pathLayer')
+                global.viewer.addLayer(pathLayer)
 
-                this.pointLayer = new global.DC.HtmlLayer('pointLayer')
-                this.viewer.addLayer(this.pointLayer)
+                pointLayer = new global.DC.HtmlLayer('pointLayer')
+                global.viewer.addLayer(pointLayer)
 
                 this.pathList.forEach((item) => {
                     this.drawPolyline(item)
@@ -171,13 +180,13 @@
                 })
                 if (this.pointList.length > 0) {
                     this.$store.dispatch('pcMoveView', {
-                        viewer: this.viewer,
+                        viewer: global.viewer,
                         jd: +this.pointList[0].split(',')[0] - 0.0005,
                         wd: this.pointList[0].split(',')[1]
                     })
                 } else {
                     this.$store.dispatch('pcMoveView', {
-                        viewer: this.viewer,
+                        viewer: global.viewer,
                         jd: +this.pathList[0].split(';')[0].split(',')[0] - 0.0005,
                         wd: this.pathList[0].split(';')[0].split(',')[1]
                     })
@@ -199,7 +208,7 @@
                 clampToGround: true
             })
 
-            this.pathLayer.addOverlay(polyline)
+            pathLayer.addOverlay(polyline)
         },
         drawPoint (item, name) {
             const divIcon = new global.DC.DivIcon(
@@ -215,7 +224,7 @@
                     </div>
                 `
             )
-            this.pointLayer.addOverlay(divIcon)
+            pointLayer.addOverlay(divIcon)
         },
         audioPlay () {
             if (this.audioFlag == false) {
@@ -234,8 +243,8 @@
             }
         },
         closeModel () {
-            this.viewer.removeLayer(this.pathLayer)
-            this.viewer.removeLayer(this.pointLayer)
+            global.viewer.removeLayer(pathLayer)
+            global.viewer.removeLayer(pointLayer)
 
             this.audioSynth.cancel()
             this.audioFlag = false
@@ -250,7 +259,9 @@
         }
     },
     destroyed () {
-        // this.audioPlay();
+        this.audioSynth.cancel()
+        global.viewer.removeLayer(pathLayer)
+        global.viewer.removeLayer(pointLayer)
         // console.log("关闭", "see1");
     }
 }

--
Gitblit v1.9.3