From 05f6d4e6609c973f63d51335a4b7d1f01405ebf3 Mon Sep 17 00:00:00 2001
From: gjj <Ganjj@probim.com.cn>
Date: Wed, 19 Mar 2025 14:56:27 +0800
Subject: [PATCH] 全景图展示修改
---
public/config.js | 6 +++---
src/views/Home.vue | 36 +++++++++++++-----------------------
2 files changed, 16 insertions(+), 26 deletions(-)
diff --git a/public/config.js b/public/config.js
index 753b231..8669c90 100644
--- a/public/config.js
+++ b/public/config.js
@@ -2,7 +2,7 @@
* @Author: gjj Ganjj@probim.com.cn
* @Date: 2025-02-14 14:32:17
* @LastEditors: gjj Ganjj@probim.com.cn
- * @LastEditTime: 2025-02-26 14:46:42
+ * @LastEditTime: 2025-03-19 11:39:50
* @FilePath: \北京交通大学\public\config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -10,9 +10,9 @@
// axiosBaseURL: "http://47.117.124.20:2002/",
axiosBaseURL: "http://8.140.54.245:5000",
axiosTimeout: 1000 * 30, //毫秒
- panoUrl: 'http://8.140.54.245:5000', // 全景预览地址
+ panoUrl: 'http://8.140.54.245:5010', // 全景预览地址
panoBaseUrl: 'http://8.140.54.245:5000', // 全景图及文档接口
modelUrl: 'http://8.140.54.245:5010/#/Home/sceneManagementDetail?shareUrlToken=69E38706C533C52C84A9F864785953A2AB834465D303010594EF3531C3AE64EE121F5C12AFB6E145D2F72023B59D3999249F65A61D9E4F11F3CD4667FA621262CC361AC0176055077A4C26B78B014EEB', // 模型预览地址
- sceneUrl: 'http://resources.vothing.com/mp4/12.mp4', // 场景地址
+ videoUrl: 'http://resources.vothing.com/mp4/12.mp4', // 实况地址
projectId: '7d242691-e6b2-4fbc-b4df-687883eb1a4c', // 项目id
}
\ No newline at end of file
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 809c83a..8b02944 100644
--- a/src/views/Home.vue
+++ b/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,18 @@
})
},
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
},
sceneShow() {
const iframe = document.getElementById('scene-iframe')
--
Gitblit v1.9.3