|
@@ -1,6 +1,13 @@
|
|
|
<template>
|
|
|
<div class="scene-body">
|
|
|
- <iframe ref="ifr" id="ifr" :key="viewId" :src="`scene.html?m=1248${boothItem || firstView[viewId]}`" allowfullscreen="true" frameborder="0"></iframe>
|
|
|
+ <iframe
|
|
|
+ ref="ifr"
|
|
|
+ id="ifr"
|
|
|
+ :key="viewId"
|
|
|
+ :src="`scene.html?m=1248${boothItem || firstView[viewId]}`"
|
|
|
+ allowfullscreen="true"
|
|
|
+ frameborder="0"
|
|
|
+ ></iframe>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -11,7 +18,13 @@ import { Booth } from "@/data/booth.js";
|
|
|
let firstView = {};
|
|
|
region.forEach((item) => {
|
|
|
let { x, y, z, w } = item.firstView.panoQuaternion;
|
|
|
- firstView[item.id] = `&firstView=pano:${item.firstView.panoId},qua:${x + ", " + y + ", " + z + ", " + w}`;
|
|
|
+ firstView[item.id] = `&firstView=pano:${item.firstView.panoId},qua:${x +
|
|
|
+ ", " +
|
|
|
+ y +
|
|
|
+ ", " +
|
|
|
+ z +
|
|
|
+ ", " +
|
|
|
+ w}`;
|
|
|
});
|
|
|
|
|
|
export default {
|
|
@@ -28,24 +41,30 @@ export default {
|
|
|
boothItem: function() {
|
|
|
let tmp = "";
|
|
|
if (this.boothId) {
|
|
|
- let tt = ''
|
|
|
- let cutt = ''
|
|
|
+ let tt = "";
|
|
|
+ let cutt = "";
|
|
|
for (let index = 0; index < Booth.length; index++) {
|
|
|
const item = Booth[index];
|
|
|
- tt = item.company.filter(sub=>sub.panoId==this.boothId)
|
|
|
- if (tt.length>0) {
|
|
|
- cutt = tt[0]
|
|
|
- break
|
|
|
+ tt = item.company.filter((sub) => sub.panoId == this.boothId);
|
|
|
+ if (tt.length > 0) {
|
|
|
+ cutt = tt[0];
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (tt.length>1&&this.boothRepeat) {
|
|
|
- cutt = tt[this.boothRepeat.split('_')[1]]
|
|
|
+ if (tt.length > 1 && this.boothRepeat) {
|
|
|
+ cutt = tt[this.boothRepeat.split("_")[1]];
|
|
|
}
|
|
|
|
|
|
let panoQuat = cutt && cutt.firstView.split("qua:")[1];
|
|
|
let [x, y, z, w] = panoQuat.split(",");
|
|
|
- tmp = `&firstView=pano:${cutt.panoId},qua:${x + ", " + y + ", " + z + ", " + w}`;
|
|
|
+ tmp = `&firstView=pano:${cutt.panoId},qua:${x +
|
|
|
+ ", " +
|
|
|
+ y +
|
|
|
+ ", " +
|
|
|
+ z +
|
|
|
+ ", " +
|
|
|
+ w}`;
|
|
|
}
|
|
|
return tmp;
|
|
|
},
|
|
@@ -56,18 +75,32 @@ export default {
|
|
|
if (data.events == "flyToPano") {
|
|
|
let panoQuat = data.data.firstView.split("qua:")[1];
|
|
|
let [x, y, z, w] = panoQuat.split(",");
|
|
|
- let fnname = 'flyToPano'
|
|
|
- if (ifrWindow.player.mode == 'panorama') {
|
|
|
- fnname = 'blackToPano'
|
|
|
+ let fnname = "flyToPano";
|
|
|
+ if (ifrWindow.player.mode == "panorama") {
|
|
|
+ fnname = "blackToPano";
|
|
|
}
|
|
|
ifrWindow.player[fnname]({
|
|
|
pano: ifrWindow.player.model.panos.index[data.data.panoId],
|
|
|
- quaternion: new ifrWindow.THREE.Quaternion(Number(x), Number(y), Number(z), Number(w)),
|
|
|
+ quaternion: new ifrWindow.THREE.Quaternion(
|
|
|
+ Number(x),
|
|
|
+ Number(y),
|
|
|
+ Number(z),
|
|
|
+ Number(w)
|
|
|
+ ),
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (data.events == "toggleTour") {
|
|
|
ifrWindow[data.data]();
|
|
|
+ if (data.data == "startAndPlay") {
|
|
|
+ ifrWindow.postMessage(
|
|
|
+ {
|
|
|
+ source: "clickStartAndPlay",
|
|
|
+ data: "clickStartAndPlay",
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|