|
|
@@ -4,30 +4,39 @@
|
|
|
|
|
|
<transition appear name="fade">
|
|
|
<div class="pscon" v-if="!isTour">
|
|
|
- <Danmaku
|
|
|
+ <!-- <Danmaku
|
|
|
class="danmaku"
|
|
|
:quotes="quotes"
|
|
|
:danmuArr="danmu"
|
|
|
:showIcon="require(`@/assets/images/icon/danmu_open_jiyinhong.png`)"
|
|
|
:closeIcon="require('@/assets/images/icon/danmu_close.png')"
|
|
|
:arrowIcon="require('@/assets/images/icon/danmu_top.png')"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
|
|
|
<menubar @clickMenu="handleMenu" ref="menubar" class="menubar" />
|
|
|
|
|
|
- <rightmenu @clickRightMenu="handleRMenu" class="rightmenu" />
|
|
|
+ <!-- <rightmenu @clickRightMenu="handleRMenu" class="rightmenu" /> -->
|
|
|
|
|
|
- <exhibition @handleClick="loadScene" :ccs="ccs" :someData="someData" class="exhibition" />
|
|
|
+ <exhibition
|
|
|
+ @handleClick="loadScene"
|
|
|
+ :ccs="ccs"
|
|
|
+ :someData="someData"
|
|
|
+ class="exhibition"
|
|
|
+ />
|
|
|
|
|
|
<wheel @mousedown="wheeldown" @mouseclick="wheelclick" />
|
|
|
|
|
|
<vpopup @close="handlepopClose" :cp="cp" v-if="cp" />
|
|
|
|
|
|
- <xuliezhen v-show="isJieShuo" :isSpeak="isSpeak" />
|
|
|
-
|
|
|
+ <!-- <xuliezhen v-show="isJieShuo" :isSpeak="isSpeak" /> -->
|
|
|
</div>
|
|
|
|
|
|
- <tourbtn @toggleTour="toggleTour" @exitTour="handleExitTour" class="tourbtn" v-else />
|
|
|
+ <tourbtn
|
|
|
+ @toggleTour="toggleTour"
|
|
|
+ @exitTour="handleExitTour"
|
|
|
+ class="tourbtn"
|
|
|
+ v-else
|
|
|
+ />
|
|
|
</transition>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -35,11 +44,11 @@
|
|
|
import { getList, getSomeData } from "@/config/api";
|
|
|
import wheel from "./components/wheel.vue";
|
|
|
import menubar from "./components/menubar.vue";
|
|
|
-import rightmenu from "./components/rightmenu.vue";
|
|
|
+// import rightmenu from "./components/rightmenu.vue";
|
|
|
|
|
|
import exhibition from "@/components/exhibition";
|
|
|
import vpopup from "./components/popup.vue";
|
|
|
-import xuliezhen from "./components/xuliezhen.vue";
|
|
|
+// import xuliezhen from "./components/xuliezhen.vue";
|
|
|
import tourbtn from "./components/tourbtn.vue";
|
|
|
|
|
|
import * as krfn from "@/core/index.js";
|
|
|
@@ -47,7 +56,8 @@ import * as krfn from "@/core/index.js";
|
|
|
window.__krfn = krfn.default;
|
|
|
|
|
|
export default {
|
|
|
- components: { wheel, menubar, exhibition, tourbtn, rightmenu, xuliezhen, vpopup },
|
|
|
+ // components: { wheel, menubar, exhibition, tourbtn, rightmenu, xuliezhen, vpopup },
|
|
|
+ components: { wheel, menubar, exhibition, tourbtn, vpopup },
|
|
|
data() {
|
|
|
return {
|
|
|
quotes: [
|
|
|
@@ -71,7 +81,7 @@ export default {
|
|
|
isSpeak: false,
|
|
|
isJieShuo: true,
|
|
|
isTour: false,
|
|
|
- isbgmplaying: false
|
|
|
+ isbgmplaying: false,
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -96,14 +106,21 @@ export default {
|
|
|
this.TO && clearTimeout(this.TO);
|
|
|
},
|
|
|
loadScene(sceneCode) {
|
|
|
- this.ccs = this.someData.scenes && this.someData.scenes.find((item) => sceneCode.toLowerCase().indexOf(item.sceneCode.toLowerCase()) > -1);
|
|
|
+ this.ccs =
|
|
|
+ this.someData.scenes &&
|
|
|
+ this.someData.scenes.find(
|
|
|
+ (item) =>
|
|
|
+ sceneCode.toLowerCase().indexOf(item.sceneCode.toLowerCase()) > -1
|
|
|
+ );
|
|
|
if (!this.ccs.initVisual) {
|
|
|
this.ccs.initVisual = {
|
|
|
vlookat: 0,
|
|
|
hlookat: 0,
|
|
|
};
|
|
|
}
|
|
|
- this.krpano.call(`skin_loadscene('scene_${sceneCode}',${this.ccs.initVisual.vlookat},${this.ccs.initVisual.hlookat})`);
|
|
|
+ this.krpano.call(
|
|
|
+ `skin_loadscene('scene_${sceneCode}',${this.ccs.initVisual.vlookat},${this.ccs.initVisual.hlookat})`
|
|
|
+ );
|
|
|
},
|
|
|
|
|
|
executeTour() {
|
|
|
@@ -140,12 +157,22 @@ export default {
|
|
|
},
|
|
|
|
|
|
wheelclick(data, istour) {
|
|
|
+ window.parent.postMessage(
|
|
|
+ {
|
|
|
+ source: "closemenu",
|
|
|
+ data: true,
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
let targetIdx = "";
|
|
|
- let currentIdx = this.someData.scenesOrder.findIndex((item) => this.currentScene.toLowerCase().indexOf(item.toLowerCase()) > -1);
|
|
|
+ let currentIdx = this.someData.scenesOrder.findIndex(
|
|
|
+ (item) =>
|
|
|
+ this.currentScene.toLowerCase().indexOf(item.toLowerCase()) > -1
|
|
|
+ );
|
|
|
|
|
|
if (data == "f") {
|
|
|
targetIdx = currentIdx + 1;
|
|
|
- if (targetIdx >= this.someData.scenesOrder.length-1) {
|
|
|
+ if (targetIdx >= this.someData.scenesOrder.length - 1) {
|
|
|
if (this.isTour) {
|
|
|
this.handleExitTour();
|
|
|
}
|
|
|
@@ -171,7 +198,8 @@ export default {
|
|
|
this.krpano = document.getElementById("krpanoSWFObject");
|
|
|
}
|
|
|
|
|
|
- this.krpano && this.krpano.set("hlookat_moveforce", data == "l" ? -speed : speed);
|
|
|
+ this.krpano &&
|
|
|
+ this.krpano.set("hlookat_moveforce", data == "l" ? -speed : speed);
|
|
|
},
|
|
|
wheelup() {
|
|
|
if (!this.krpano) {
|
|
|
@@ -180,21 +208,38 @@ export default {
|
|
|
this.krpano.set("hlookat_moveforce", 0);
|
|
|
},
|
|
|
handleMenu(data) {
|
|
|
- if (data.id == "comment") {
|
|
|
- this.cp = data.id;
|
|
|
+ // if (data.id == "comment") {
|
|
|
+ // this.cp = data.id;
|
|
|
+ // }
|
|
|
+ if (data.id == "full") {
|
|
|
+ window.parent.postMessage(
|
|
|
+ {
|
|
|
+ source: "fullscreen",
|
|
|
+ data: true,
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
+ return;
|
|
|
}
|
|
|
if (data.id == "music") {
|
|
|
if (this.someData.bgm.url) {
|
|
|
this.bgmAudio.src = this.$serverName + this.someData.bgm.url;
|
|
|
if (data.isSelect) {
|
|
|
- this.bgmAudio.play()
|
|
|
+ this.bgmAudio.play();
|
|
|
} else {
|
|
|
this.bgmAudio.pause();
|
|
|
- this.isbgmplaying = false
|
|
|
+ this.isbgmplaying = false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (data.id == "manyou") {
|
|
|
+ window.parent.postMessage(
|
|
|
+ {
|
|
|
+ source: "closemenu",
|
|
|
+ data: true,
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
data.isSelect ? this.playTour() : this.stopTour();
|
|
|
}
|
|
|
},
|
|
|
@@ -203,7 +248,7 @@ export default {
|
|
|
this.$refs.menubar && this.$refs.menubar.closeItem(this.cp);
|
|
|
this.cp = "";
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
async getData() {
|
|
|
let params = {
|
|
|
pageNum: 1,
|
|
|
@@ -216,7 +261,6 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$nextTick(() => {
|
|
|
-
|
|
|
document.addEventListener("mouseup", () => {
|
|
|
this.wheelup.bind(this)();
|
|
|
});
|
|
|
@@ -226,34 +270,32 @@ export default {
|
|
|
this.wheelclick("f", true);
|
|
|
});
|
|
|
|
|
|
-
|
|
|
this.bgmAudio.addEventListener("playing", () => {
|
|
|
- this.isbgmplaying = true
|
|
|
- this.$refs.menubar && this.$refs.menubar.closeItem('music', true);
|
|
|
+ this.isbgmplaying = true;
|
|
|
+ this.$refs.menubar && this.$refs.menubar.closeItem("music", true);
|
|
|
});
|
|
|
|
|
|
this.bgmAudio.addEventListener("pause", () => {
|
|
|
- this.$refs.menubar && this.$refs.menubar.closeItem('music', false);
|
|
|
+ this.$refs.menubar && this.$refs.menubar.closeItem("music", false);
|
|
|
});
|
|
|
|
|
|
- this.$bus.$on('closeHP',()=>{
|
|
|
+ this.$bus.$on("closeHP", () => {
|
|
|
if (this.isbgmplaying) {
|
|
|
this.bgmAudio.play();
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
+ });
|
|
|
|
|
|
this.$bus.$on("clickHotspot", (data) => {
|
|
|
if (data.sceneCode == "notjump") {
|
|
|
- let hp = this.ccs.someData.hotspots.find((item) => item.name == data.id);
|
|
|
- if (hp.hotspotType=='link') {
|
|
|
- window.open(hp.hyperlink,"_blank")
|
|
|
- return
|
|
|
+ let hp = this.ccs.someData.hotspots.find(
|
|
|
+ (item) => item.name == data.id
|
|
|
+ );
|
|
|
+ if (hp.hotspotType == "link") {
|
|
|
+ window.open(hp.hyperlink, "_blank");
|
|
|
+ return;
|
|
|
}
|
|
|
if (hp) {
|
|
|
-
|
|
|
- if (hp.hotspotType=='audio'||hp.hotspotType=='video') {
|
|
|
+ if (hp.hotspotType == "audio" || hp.hotspotType == "video") {
|
|
|
this.bgmAudio.pause();
|
|
|
}
|
|
|
|
|
|
@@ -276,7 +318,11 @@ export default {
|
|
|
this.ccs =
|
|
|
scenes &&
|
|
|
scenes.find((item) => {
|
|
|
- return this.currentScene.toLowerCase().indexOf(item.sceneCode.toLowerCase()) > -1;
|
|
|
+ return (
|
|
|
+ this.currentScene
|
|
|
+ .toLowerCase()
|
|
|
+ .indexOf(item.sceneCode.toLowerCase()) > -1
|
|
|
+ );
|
|
|
});
|
|
|
|
|
|
window.__krfn.utils.initHotspot(this.krpano, this.ccs.someData, false);
|
|
|
@@ -296,12 +342,13 @@ export default {
|
|
|
if (this.someData.bgm.url) {
|
|
|
this.bgmAudio.src = this.$serverName + this.someData.bgm.url;
|
|
|
this.bgmAudio.loop = true;
|
|
|
- this.bgmAudio.play()
|
|
|
+ this.bgmAudio.play();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
window.embedpano({
|
|
|
- xml: this.$serverName + "/work/5/tour.xml",
|
|
|
+ // 修改地址
|
|
|
+ xml: this.$serverName + "/work/5/tour_test.xml",
|
|
|
// _test
|
|
|
// xml: "http://192.168.0.109:8004/panoversion/pano/tour.xml",
|
|
|
swf: "%HTMLPATH%/static/lib/krpano/tour.swf",
|
|
|
@@ -309,9 +356,11 @@ export default {
|
|
|
html5: "auto",
|
|
|
mobilescale: 1,
|
|
|
vars: {
|
|
|
- "startscene": this.someData.firstScene.sceneCode ? ('scene_' + this.someData.firstScene.sceneCode) : '',
|
|
|
- "view.vlookat":this.someData.firstScene.initVisual.vlookat || 0,
|
|
|
- "view.hlookat":this.someData.firstScene.initVisual.hlookat || 0,
|
|
|
+ startscene: this.someData.firstScene.sceneCode
|
|
|
+ ? "scene_" + this.someData.firstScene.sceneCode
|
|
|
+ : "",
|
|
|
+ "view.vlookat": this.someData.firstScene.initVisual.vlookat || 0,
|
|
|
+ "view.hlookat": this.someData.firstScene.initVisual.hlookat || 0,
|
|
|
"autorotate.enabled": !!this.someData.isAuto,
|
|
|
...settings,
|
|
|
},
|
|
|
@@ -344,8 +393,8 @@ export default {
|
|
|
}
|
|
|
.menubar {
|
|
|
position: absolute;
|
|
|
- bottom: 10px;
|
|
|
- left: 404px;
|
|
|
+ bottom: 15px;
|
|
|
+ right: 15px;
|
|
|
z-index: 99;
|
|
|
}
|
|
|
|