1
gjj
2025-03-19 deb4bf3307d7bedf2ea3c9b3ed1363a3b47df765
src/views/Home.vue
@@ -30,8 +30,8 @@
    <!-- 模型 / 720 -->
    <div class="w-full h-full" :style="isFullScreen  ? fullScreenStyle : 'width: 100%; height: 100%;'" v-if="currentView === '720' || currentView === 'model'">
      <iframe id="model-iframe" class="content-frame w-full h-full" src="" frameborder="0" :style="isFullScreen ? fullScreenModelStyle : ''" v-if="currentView === 'model'"></iframe>
      <div id="panoviewpreview" class="pano-frame w-full h-full" :style="isFullScreen ? fullScreenPanoStyle : ''" v-if="currentView === '720'"></div>
      </div>
      <iframe id="panoviewpreview" class="pano-frame w-full h-full" :style="isFullScreen ? fullScreenPanoStyle : ''" v-if="currentView === '720'"></iframe>
    </div>
     <!-- 720全景图版本选择 -->
     <!--<div class="w-full h-[120px] bg-[rgba(19,40,64,0.8)] absolute bottom-0 left-0 right-0 flex items-center py-[10px]" :style="isFullScreen ? 'z-index: 100; height:' : ''" v-if="currentView === '720'">
      <div v-for="item in panoVersionList" :key="item.value" :style="isFullScreen ? 'z-index: 100;' : ''">
@@ -205,7 +205,6 @@
   this.isLoading = true
   this.currentView = view
   if (view === 'model') {
    removepano('krpanoSWFObject')
    nextTick(() => {
     this.modelShow()
    })
@@ -215,7 +214,6 @@
    })
   } else if (view === 'project') {
    nextTick(() => {
      removepano('krpanoSWFObject')
     this.sceneShow()
    })
   }
@@ -286,26 +284,38 @@
   })
  },
  panoPreview(item, scene) {
    removepano('krpanoSWFObject')
   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,
    // /LinkShare/PanoShare/:PanoId/:organizeId/:StartScene
    // PanoId:全景图的id,organizeId:项目id,StartScene:初始场景id
    const panoFrame = document.getElementById('panoviewpreview')
    nextTick(() => {
      if(panoFrame.src){
        panoFrame.removeAttribute("src"); //先移除上一次的src地址
      }
      let ifrSrc = ''
      ifrSrc = `${window.ProjectConfig.panoUrl}/#/LinkShare/PanoShare/${scene.PbGuid}/${this.projectId}/${scene.PsScenename}`
      panoFrame.setAttribute("src",ifrSrc);
    })
   })
    this.isLoading = false
  //   removepano('krpanoSWFObject')
  //  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')