|
@@ -1,38 +1,51 @@
|
|
<template>
|
|
<template>
|
|
<div :class="`theme${theme}`" class="scene-body">
|
|
<div :class="`theme${theme}`" class="scene-body">
|
|
- <div class="logo">
|
|
|
|
- <img :src="require(`@/assets/images/proj2022/pc/logo.png`)" alt="" />
|
|
|
|
|
|
+ <div class="logo" v-if="!showViewMode">
|
|
|
|
+ <img @click="$router.push({ path: '/' })" :src="require(`@/assets/images/proj2022/pc/logo.png`)" alt="" />
|
|
</div>
|
|
</div>
|
|
<div class="scene-con">
|
|
<div class="scene-con">
|
|
- <!-- <vbar :showAside="showAside" v-if="!tourStatus" :name="currentItem.name" @showSearch="showSearch=true" @openAside="showAside=!showAside"></vbar> -->
|
|
|
|
- <scene :tourStatus="tourStatus"/>
|
|
|
|
|
|
+ <scene :tourStatus="tourStatus" />
|
|
|
|
|
|
- <vside :isShow="!tourStatus&&showAside" @close="showAside=false" />
|
|
|
|
- <vmap v-show="!tourStatus" />
|
|
|
|
-
|
|
|
|
- <zhanxiang :currentZQ="currentZQ" v-if="isShowZL" @close="isShowZL=false" :tourStatus="tourStatus"/>
|
|
|
|
|
|
+ <div v-if="showViewMode">
|
|
|
|
+ <div :class="{ disabled: flying }" class="tab-layer">
|
|
|
|
+ <div class="tabs">
|
|
|
|
+ <div :class="{ active: mode === 'floorplan' }" @click="changeMode('floorplan', $event)">
|
|
|
|
+ <img :src="require('@/assets/images/proj2022/mobile/floor@2x.png')" alt="" />
|
|
|
|
+ <span>平面</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div :class="{ active: mode === 'dollhouse' }" @click="changeMode('dollhouse', $event)">
|
|
|
|
+ <img :src="require('@/assets/images/proj2022/mobile/dollhouse@2x.png')" alt="" />
|
|
|
|
+ <span>三维</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div :class="{ active: mode === 'birdview' }" @click="changeMode('birdview', $event)">
|
|
|
|
+ <img :src="require('@/assets/images/proj2022/mobile/bird view@2x.png')" alt="" />
|
|
|
|
+ <span>鸟瞰</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
|
|
- <rmenu :menuType="menuType" :tourStatus="tourStatus" @opencp="handlecp"/>
|
|
|
|
- <vmenu :tourStatus="tourStatus" @opencp="handlecp" />
|
|
|
|
- <vsearch :currentPanoid="currentPanoid" @closeSearch="showSearch=false" v-if="showSearch"/>
|
|
|
|
-
|
|
|
|
|
|
+ <template v-else>
|
|
|
|
+ <vside :isShow="!tourStatus && showAside" @close="showAside = false" />
|
|
|
|
+ <zhanxiang @showSearch="showSearch = true" v-if="isShowZL" @close="isShowZL = false" :tourStatus="tourStatus" />
|
|
|
|
+ <rmenu :currentPanoid="currentPanoid" :isShowfunc="isShowfunc" :menuType="menuType" :tourStatus="tourStatus" @opencp="handlecp" />
|
|
|
|
+ <vmenu :tourStatus="tourStatus" @opencp="handlecp" />
|
|
|
|
+ <vsearch :currentPanoid="currentPanoid" @closeSearch="closeSearch" v-if="showSearch" />
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <vhotspot v-if="hotspot" @close="hotspot=''" :hotspot='hotspot'/>
|
|
|
|
|
|
+ <birdview :hideClose="true" @close="mode='',showViewMode=false" v-if="mode=='birdview'"/>
|
|
|
|
+
|
|
|
|
+ <vhotspot v-if="hotspot" @close="hotspot = ''" :hotspot="hotspot" />
|
|
<vpopup v-if="showpopup && cp" v-clickoutside="handleoutside">
|
|
<vpopup v-if="showpopup && cp" v-clickoutside="handleoutside">
|
|
<div slot="vcon" class="popcon">
|
|
<div slot="vcon" class="popcon">
|
|
<component :is="cp" :currentPano="currentPano" :currentItem="currentItem"> </component>
|
|
<component :is="cp" :currentPano="currentPano" :currentItem="currentItem"> </component>
|
|
- <img
|
|
|
|
- @click="(showpopup = false), (cp = '')"
|
|
|
|
- class="close"
|
|
|
|
- :src="require('@/assets/images/project/icon/close.png')"
|
|
|
|
- alt=""
|
|
|
|
- />
|
|
|
|
|
|
+ <img @click="(showpopup = false), (cp = '')" class="close" :src="require('@/assets/images/project/icon/close.png')" alt="" />
|
|
</div>
|
|
</div>
|
|
</vpopup>
|
|
</vpopup>
|
|
|
|
|
|
<div class="logincon" v-if="loginUrl">
|
|
<div class="logincon" v-if="loginUrl">
|
|
- <img class="close" @click="loginUrl=''" :src="require('@/assets/images/mobile/icon/close_b.png')" alt="" />
|
|
|
|
|
|
+ <img class="close" @click="loginUrl = ''" :src="require('@/assets/images/mobile/icon/close_b.png')" alt="" />
|
|
<iframe :src="loginUrl" frameborder="0"></iframe>
|
|
<iframe :src="loginUrl" frameborder="0"></iframe>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -45,6 +58,8 @@ import menu from "./menu.vue";
|
|
import rmenu from "./raside/menu.vue";
|
|
import rmenu from "./raside/menu.vue";
|
|
import zhanxiang from "./zhanxiang/index.vue";
|
|
import zhanxiang from "./zhanxiang/index.vue";
|
|
|
|
|
|
|
|
+import birdview from "./birdview/index.vue";
|
|
|
|
+
|
|
|
|
|
|
import popup from "./popup.vue";
|
|
import popup from "./popup.vue";
|
|
import vsearch from "./search";
|
|
import vsearch from "./search";
|
|
@@ -57,7 +72,7 @@ import qrcode from "./components/qrcode.vue";
|
|
import scene from "./scene.vue";
|
|
import scene from "./scene.vue";
|
|
import vhotspot from "@/components/hotspot/index.vue";
|
|
import vhotspot from "@/components/hotspot/index.vue";
|
|
|
|
|
|
-import {region,Booth} from "@/data/raw.js";
|
|
|
|
|
|
+import { region, Booth } from "@/data/raw.js";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -73,71 +88,77 @@ export default {
|
|
vsearch,
|
|
vsearch,
|
|
vhotspot,
|
|
vhotspot,
|
|
vbar,
|
|
vbar,
|
|
- vmap
|
|
|
|
|
|
+ vmap,
|
|
|
|
+ birdview
|
|
},
|
|
},
|
|
- computed:{
|
|
|
|
- currentItem(){
|
|
|
|
- return (this.themes.find(item=>item.id==this.theme));
|
|
|
|
|
|
+ computed: {
|
|
|
|
+ currentItem() {
|
|
|
|
+ return this.themes.find((item) => item.id == this.theme);
|
|
|
|
+ },
|
|
|
|
+ currentPano() {
|
|
|
|
+ return Booth.find((item) => item.panoId == this.currentPanoid) || {};
|
|
},
|
|
},
|
|
- currentPano(){
|
|
|
|
- return Booth.find(item=>item.panoId==this.currentPanoid) || {}
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- menuType:'func',
|
|
|
|
|
|
+ menuType: "func",
|
|
|
|
+ isShowfunc: false,
|
|
showpopup: false,
|
|
showpopup: false,
|
|
- showAside:false,
|
|
|
|
- showSearch:false,
|
|
|
|
- isShowZL:false,
|
|
|
|
- currentZQ:'',
|
|
|
|
|
|
+ showAside: false,
|
|
|
|
+ showSearch: false,
|
|
|
|
+ isShowZL: false,
|
|
cp: "",
|
|
cp: "",
|
|
tourStatus: false,
|
|
tourStatus: false,
|
|
showAll: false,
|
|
showAll: false,
|
|
currentPanoid: "",
|
|
currentPanoid: "",
|
|
isFull: false,
|
|
isFull: false,
|
|
hotspots: [],
|
|
hotspots: [],
|
|
- hotspot:'',
|
|
|
|
- loginUrl:'',
|
|
|
|
- currentTheme:'',
|
|
|
|
- booth:Booth
|
|
|
|
|
|
+ hotspot: "",
|
|
|
|
+ loginUrl: "",
|
|
|
|
+ currentTheme: "",
|
|
|
|
+ booth: Booth,
|
|
|
|
+ showViewMode: false,
|
|
|
|
+ flying:false,
|
|
|
|
+ mode:'floorplan'
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
|
|
- watch:{
|
|
|
|
- currentTheme(newVal){
|
|
|
|
|
|
+ watch: {
|
|
|
|
+ currentTheme(newVal) {
|
|
if (newVal) {
|
|
if (newVal) {
|
|
- let tt = this.currentPanoid
|
|
|
|
- this.currentPanoid = ''
|
|
|
|
- this.$router.push({params:{type:newVal.id,isjump:'none'}})
|
|
|
|
|
|
+ let tt = this.currentPanoid;
|
|
|
|
+ this.currentPanoid = "";
|
|
|
|
+ this.$router.push({ params: { type: newVal.id, isjump: "none" } });
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.currentPanoid = tt;
|
|
this.currentPanoid = tt;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
mounted() {
|
|
mounted() {
|
|
- this.$showLoading()
|
|
|
|
|
|
+ this.$showLoading();
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$bus.$on('mblogin',data=>{
|
|
|
|
- this.loginUrl = data
|
|
|
|
- })
|
|
|
|
|
|
+ this.$bus.$on("mblogin", (data) => {
|
|
|
|
+ this.loginUrl = data;
|
|
|
|
+ });
|
|
|
|
|
|
- this.$bus.$on('emitShowZX',data=>{
|
|
|
|
- this.isShowZL = data.show
|
|
|
|
- this.currentZQ = data.current
|
|
|
|
|
|
+ this.$bus.$on("emitShowZX", (data) => {
|
|
|
|
+ this.isShowZL = data;
|
|
|
|
+ });
|
|
|
|
|
|
- })
|
|
|
|
|
|
+ this.$bus.$on("changeMenu", (data) => {
|
|
|
|
+ this.menuType = data;
|
|
|
|
+ });
|
|
|
|
|
|
- this.$bus.$on('changeMenu',data=>{
|
|
|
|
- this.menuType= data
|
|
|
|
- })
|
|
|
|
|
|
+ this.$bus.$on("changeShowfunc", (data) => {
|
|
|
|
+ this.isShowfunc = data;
|
|
|
|
+ });
|
|
|
|
|
|
- this.$bus.$on('opencp',data=>{
|
|
|
|
- this.handlecp(data)
|
|
|
|
- this.isShowZL=false
|
|
|
|
- })
|
|
|
|
|
|
+ this.$bus.$on("opencp", (data) => {
|
|
|
|
+ this.handlecp(data);
|
|
|
|
+ this.isShowZL = false;
|
|
|
|
+ });
|
|
window.addEventListener("message", (res) => {
|
|
window.addEventListener("message", (res) => {
|
|
if (Object.prototype.toString.call(res.data) == "[object Object]") {
|
|
if (Object.prototype.toString.call(res.data) == "[object Object]") {
|
|
let data = res.data.data;
|
|
let data = res.data.data;
|
|
@@ -148,35 +169,62 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
if (res.data.source === "onplayStatus") {
|
|
if (res.data.source === "onplayStatus") {
|
|
- console.log('onplayStatus');
|
|
|
|
|
|
+ console.log("onplayStatus");
|
|
this.tourStatus = data.tourIsPlaying;
|
|
this.tourStatus = data.tourIsPlaying;
|
|
}
|
|
}
|
|
|
|
|
|
if (res.data.source === "pano.chosen") {
|
|
if (res.data.source === "pano.chosen") {
|
|
- console.log('pano.chosen');
|
|
|
|
- window.g_lock = true
|
|
|
|
|
|
+ console.log("pano.chosen");
|
|
|
|
+ window.g_lock = true;
|
|
}
|
|
}
|
|
|
|
|
|
if (res.data.source === "tour.end") {
|
|
if (res.data.source === "tour.end") {
|
|
- window.g_lock = false
|
|
|
|
|
|
+ window.g_lock = false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (res.data.source === "warp.interrupted") {
|
|
|
|
+ console.log("warp.interrupted");
|
|
|
|
+ window.g_lock = false;
|
|
|
|
+ }
|
|
|
|
|
|
- if (res.data.source === "warp.interrupted") {
|
|
|
|
- console.log('warp.interrupted');
|
|
|
|
- window.g_lock = false
|
|
|
|
|
|
+ if (res.data.source === "mode.changed") {
|
|
|
|
+ console.log("mode.changed", data);
|
|
|
|
+ if (data == "floorplan" || data == "dollhouse") {
|
|
|
|
+ this.showViewMode = true;
|
|
|
|
+ this.flying = false;
|
|
|
|
+ this.mode = data
|
|
|
|
+ document.querySelector("#ifr").contentWindow.postMessage(
|
|
|
|
+ {
|
|
|
|
+ source: "toggleClear",
|
|
|
|
+ data: this.showViewMode,
|
|
|
|
+ },
|
|
|
|
+ "*"
|
|
|
|
+ );
|
|
|
|
+ } else if (data == "panorama") {
|
|
|
|
+ this.showViewMode = false;
|
|
|
|
+ this.flying = false;
|
|
|
|
+ document.querySelector("#ifr").contentWindow.postMessage(
|
|
|
|
+ {
|
|
|
|
+ source: "toggleClear",
|
|
|
|
+ data: this.showViewMode,
|
|
|
|
+ },
|
|
|
|
+ "*"
|
|
|
|
+ );
|
|
|
|
+ } else if (data == "transitioning") {
|
|
|
|
+ this.flying = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (res.data.source === "flying.ended") {
|
|
if (res.data.source === "flying.ended") {
|
|
- console.log('flying.ended');
|
|
|
|
|
|
+ console.log("flying.ended");
|
|
this.currentPanoid = data;
|
|
this.currentPanoid = data;
|
|
- this.currentTheme = region.find(item=>{
|
|
|
|
- if (item.spread.indexOf(Number(this.currentPanoid))>-1) {
|
|
|
|
- return item
|
|
|
|
|
|
+ this.currentTheme = region.find((item) => {
|
|
|
|
+ if (item.spread.indexOf(Number(this.currentPanoid)) > -1) {
|
|
|
|
+ return item;
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- window.g_lock = false
|
|
|
|
|
|
+ window.g_lock = false;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -186,19 +234,28 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ changeMode(data) {
|
|
|
|
+ this.mode = data
|
|
|
|
+ document.querySelector('#ifr').contentWindow.player.director.changeMode(data);
|
|
|
|
+ },
|
|
|
|
+ closeSearch(data) {
|
|
|
|
+ if (data == "closeAll") {
|
|
|
|
+ this.isShowZL = false;
|
|
|
|
+ }
|
|
|
|
+ this.showSearch = false;
|
|
|
|
+ },
|
|
handlecp(data) {
|
|
handlecp(data) {
|
|
this.cp = data;
|
|
this.cp = data;
|
|
this.showpopup = true;
|
|
this.showpopup = true;
|
|
},
|
|
},
|
|
- handleoutside(){
|
|
|
|
- this.cp = '';
|
|
|
|
|
|
+ handleoutside() {
|
|
|
|
+ this.cp = "";
|
|
this.showpopup = false;
|
|
this.showpopup = false;
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -206,11 +263,67 @@ export default {
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
.scene-body {
|
|
.scene-body {
|
|
background-repeat: no-repeat;
|
|
background-repeat: no-repeat;
|
|
|
|
+
|
|
|
|
+ .tab-layer {
|
|
|
|
+ width: 100%;
|
|
|
|
+ text-align: center;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ z-index: 10;
|
|
|
|
+ position: fixed;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
+ top: 30px;
|
|
|
|
+ pointer-events: none;
|
|
|
|
+ .tabs {
|
|
|
|
+ pointer-events: auto;
|
|
|
|
+ position: relative;
|
|
|
|
+ display: flex;
|
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
|
+ padding: 2px;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ padding: 0px 2px;
|
|
|
|
+ backdrop-filter: blur(20px);
|
|
|
|
+ >div {
|
|
|
|
+ color: #fff;
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ transition: all 0.3s ease;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ z-index: 1;
|
|
|
|
+ margin: 4px;
|
|
|
|
+ padding: 2px 6px 2px 0;
|
|
|
|
+ img {
|
|
|
|
+ width: 30px;
|
|
|
|
+ }
|
|
|
|
+ >span{
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &.active {
|
|
|
|
+ background: rgba(127, 127, 127, 0.57);
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .disabled{
|
|
|
|
+ opacity: 0.5;
|
|
|
|
+ pointer-events: none;
|
|
|
|
+ }
|
|
|
|
+
|
|
.scene-con {
|
|
.scene-con {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
- .logo {
|
|
|
|
|
|
+ .logo {
|
|
position: absolute;
|
|
position: absolute;
|
|
left: 10px;
|
|
left: 10px;
|
|
top: 8px;
|
|
top: 8px;
|
|
@@ -227,30 +340,30 @@ export default {
|
|
height: 100%;
|
|
height: 100%;
|
|
.close {
|
|
.close {
|
|
position: absolute;
|
|
position: absolute;
|
|
- top: 20px;
|
|
|
|
|
|
+ top: 40px;
|
|
right: 20px;
|
|
right: 20px;
|
|
width: 16px;
|
|
width: 16px;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
z-index: 1000;
|
|
z-index: 1000;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .logincon{
|
|
|
|
|
|
+ .logincon {
|
|
position: fixed;
|
|
position: fixed;
|
|
z-index: 999999;
|
|
z-index: 999999;
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
top: 0;
|
|
top: 0;
|
|
left: 0;
|
|
left: 0;
|
|
- >iframe{
|
|
|
|
|
|
+ > iframe {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
- .close{
|
|
|
|
- display: inline-block;
|
|
|
|
- position: absolute;
|
|
|
|
- right: 16px;
|
|
|
|
- top: 16px;
|
|
|
|
- width: 16px;
|
|
|
|
|
|
+ .close {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 16px;
|
|
|
|
+ top: 16px;
|
|
|
|
+ width: 16px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|