liuyg
2021-12-25 9c50a6a7cf6f40af955672f7b38950aa61a5484f
src/pcviews/campusnavi/index.vue
@@ -1,35 +1,56 @@
<template>
    <div>
        <campusNav ref="campusNavRoute"
                   :comeName="comeName"
                   :getToName="getToName"
                   v-show="campusNavFlag" />
    </div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
    data () {
        return {
            campusNavFlag: true,
            comeName: '',
            getToName: ''
        }
    },
    computed: {
        ...mapGetters([
            'viewer',
            'popupBgUrl',
            'pupupQRUrl',
            // 终点
            'terminus',
            // 起点
            'startingPoint',
            // 点信息
            'pointPosition',
            // 点名称
            'stateName',
            // 地址
            'siteName',
            // 介绍
            'introduceText',
            // 全景地址
            'panoramaUrl',
            // 详情弹框显示关闭
            'detailsPopup',
            // 全景弹框显示关闭
            'panoramaPopup',
            // 校内导航的显示关闭
            'campusNavFlag'
        ])
    },
    mounted () {
        if (this.campusNavFlag == false) this.$store.commit('SET_CAMPUSNAVFLAG', true)
    },
    methods: {
        closeCampusNav () {
            this.campusNavFlag = false
            this.$refs.campusNavRoute.clearLayer()
            this.$store.commit('SET_STARTINGPOINT', null)
            this.$store.commit('SET_TERMINUS', null)
            this.comeName = ''
            this.getToName = ''
            this.$store.dispatch('delVisitedViews', this.$route)
            this.$router.push('/pcLayout/default')
        }
    },
    destroyed () {
        this.campusNavFlag = false
    }
}
</script>