| | |
| | | </div> |
| | | |
| | | <!-- 主要内容区域 --> |
| | | <div class="main-content"> |
| | | <div class="main-content" v-loading="isLoading"> |
| | | <!-- 模型 --> |
| | | <div class="content" v-if="currentView === 'model'"> |
| | | <iframe id="model-iframe" class="content-frame" src="" frameborder="0"></iframe> |
| | | <div class="w-full h-full" v-if="currentView === 'model'" > |
| | | <iframe id="model-iframe" class="content-frame w-full h-[588px]" src="" frameborder="0"></iframe> |
| | | </div> |
| | | <!-- 720 --> |
| | | <div class="pano-content" v-if="currentView === '720'"> |
| | | <div id="panoviewpreview" class="pano-frame"> |
| | | <div class="w-full h-full bg-white" v-if="currentView === '720'"> |
| | | <div id="panoviewpreview" class="pano-frame w-full h-[588px]"> |
| | | </div> |
| | | </div> |
| | | <!-- 项目 --> |
| | | <div class="w-full h-full" v-if="currentView === 'project'" > |
| | | <iframe id="scene-iframe" class="scene-frame w-full h-[588px]" src="" frameborder="0"></iframe> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { nextTick } from 'vue' |
| | | export default { |
| | | name: 'Home', |
| | | components: { |
| | |
| | | } |
| | | }, |
| | | bottomImage: new URL('@/assets/images/titles/shigong.png', import.meta.url).href, |
| | | isLoading: false |
| | | } |
| | | }, |
| | | methods: { |
| | | handleChange(view) { |
| | | this.isLoading = true |
| | | this.currentView = view |
| | | |
| | | if (view === 'model') { |
| | | removepano('krpanoSWFObject') |
| | | nextTick(() => { |
| | | this.modelShow() |
| | | }) |
| | | } else if (view === '720') { |
| | | nextTick(() => { |
| | | this.panoShow() |
| | | }) |
| | | } else if (view === 'project') { |
| | | nextTick(() => { |
| | | this.sceneShow() |
| | | }) |
| | | } |
| | | }, |
| | | modelShow() { |
| | | const iframe = document.getElementById('model-iframe') |
| | | let token = '' |
| | | const token = '08168BBAD572518D1AB6EC233A13C3E2FA9C16340A21C6B6D0F2785DBDF2CB3506A0873877DA22C7E7ADA6CB1012493B4C702FC75B529ABD' |
| | | const projectId = '1c179617-a7d9-4243-b813-84fa55a17ce7' |
| | | let ifrSrc = '' |
| | | console.log('模型中查看') |
| | | ifrSrc = `${window.IP_CONFIG.SCENE_URL}?token=${token}&projectId=${_this.projectID}&isPreview=1&edit=false` |
| | | ifrSrc = `${window.ProjectConfig.modelUrl}?token=${token}&projectId=${projectId}&isPreview=1&edit=false` |
| | | iframe.src = ifrSrc |
| | | console.log('加载iframe地址', ifrSrc) |
| | | this.isLoading = false |
| | | }, |
| | | panoShow(item, scene) { |
| | | this.isLoading = false |
| | | const basepath = `${window.ProjectConfig.panoUrl}/Panorama${item.PbUrl}/vtour/` |
| | | const xmlurl = `${basepath}tour.xml?r=${(Math.random() * 100000 + 1)}` |
| | | let setting = {} |
| | | if (scene) { |
| | | const scenename = 'scene_' + scene.PsScenename |
| | | setting = { startscene: scenename } |
| | | } |
| | | this.$nextTick(() => { |
| | | embedpano({ |
| | | xml: xmlurl, |
| | | target: 'panoviewpreview', |
| | | basepath, |
| | | vars: setting, |
| | | html5: 'auto', |
| | | passQueryParameters: true |
| | | }) |
| | | }) |
| | | }, |
| | | sceneShow() { |
| | | const iframe = document.getElementById('scene-iframe') |
| | | const ifrSrc = window.ProjectConfig.sceneUrl |
| | | iframe.src = ifrSrc |
| | | this.isLoading = false |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.isLoading = true |
| | | this.modelShow() |
| | | }, |
| | | } |
| | |
| | | |
| | | .main-content { |
| | | flex: 1; |
| | | padding: 20px; |
| | | background-color: #0a1931; |
| | | background-color: #fff; |
| | | width: 100%; |
| | | height: 588px; |
| | | } |