shuishen
2022-03-25 20d94ba53e1b8c64754bda684a7350d32be10d99
src/pcviews/specialmap/welcome.vue
@@ -103,7 +103,8 @@
            audioSynth: null,
            audioMsg: null,
            panoramaShow: false,
            audioImgUrl: '/img/icon/start-video.png'
            audioImgUrl: '/img/icon/start-video.png',
            urlDataName: null
        }
    },
    created () { },
@@ -120,10 +121,29 @@
            that.audioCourse = false
            that.audioImgUrl = '/img/icon/close-video.png'
        }
        this.getData()
        window.onbeforeunload = e => { // 刷新时弹出提示
            this.audioSynth.cancel()
        }
    },
    watch: {
        $route: {
            immediate: true,
            handler (newData, oldData) {
                if (this.urlDataName == null) {
                    this.urlDataName = this.$route.query.name
                    this.getData()
                } else if (newData.query.name != this.urlDataName) {
                    this.audioSynth.cancel()
                    global.viewer.removeLayer(pathLayer)
                    global.viewer.removeLayer(pointLayer)
                    this.urlDataName = this.$route.query.name
                    this.getData()
                }
                // if (this.$route.query.type) {//需要监听的参数
                //     this.type = this.$route.query.type
                // }
            }
        }
    },
    computed: {
@@ -136,7 +156,7 @@
    },
    methods: {
        getData () {
            getWelcome({ hdname: this.$route.query.name }).then((res) => {
            getWelcome({ hdname: this.urlDataName }).then((res) => {
                var result = res.data.data
                this.title = result.hdname
                this.time = result.time
@@ -249,7 +269,6 @@
                }
            }
        },
        closeModel () {
            global.viewer.removeLayer(pathLayer)
            global.viewer.removeLayer(pointLayer)
@@ -261,7 +280,6 @@
            this.$store.dispatch('delVisitedViews', this.$route)
            this.$router.push('/pcLayout/default')
        },
        panoramaPlay () {
            this.panoramaShow = true
            this.panoramaUrl = this.panoramaUrlOne