|
@@ -39,17 +39,51 @@ export default {
|
|
|
scene:'xinjiangout',
|
|
|
canjump:false,
|
|
|
view:"",
|
|
|
+ isFullscreen: false,
|
|
|
rnd:Math.random()
|
|
|
}
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ onFullScreen() {
|
|
|
+ let element = document.documentElement;
|
|
|
+ if (this.isFullscreen) {
|
|
|
+ if (document.exitFullscreen) {
|
|
|
+ document.exitFullscreen();
|
|
|
+ } else if (document.webkitCancelFullScreen) {
|
|
|
+ document.webkitCancelFullScreen();
|
|
|
+ } else if (document.mozCancelFullScreen) {
|
|
|
+ document.mozCancelFullScreen();
|
|
|
+ } else if (document.msExitFullscreen) {
|
|
|
+ document.msExitFullscreen();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (element.requestFullscreen) {
|
|
|
+ element.requestFullscreen();
|
|
|
+ } else if (element.webkitRequestFullScreen) {
|
|
|
+ element.webkitRequestFullScreen();
|
|
|
+ } else if (element.mozRequestFullScreen) {
|
|
|
+ element.mozRequestFullScreen();
|
|
|
+ } else if (element.msRequestFullscreen) {
|
|
|
+ element.msRequestFullscreen();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 改变当前全屏状态
|
|
|
+ },
|
|
|
jump(){
|
|
|
this.showWelcome = false
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$nextTick(()=>{
|
|
|
+ document.addEventListener("fullscreenchange", () => {
|
|
|
+ this.isFullscreen = !this.isFullscreen;
|
|
|
+ this.$refs.ifr.contentWindow.postMessage({
|
|
|
+ source: "changeFullScreenIcon",
|
|
|
+ data:this.isFullscreen,
|
|
|
+ },'*');
|
|
|
+ });
|
|
|
+
|
|
|
this.$refs.wevideo.addEventListener
|
|
|
this.$refs.wevideo.addEventListener("ended", () => {
|
|
|
this.showWelcome = false
|
|
@@ -68,11 +102,17 @@ export default {
|
|
|
if (Object.prototype.toString.call(res.data) == "[object Object]") {
|
|
|
let data = res.data.data;
|
|
|
if (res.data.source === "currentScene") {
|
|
|
- this.view = ''
|
|
|
+ this.view = data.firstView
|
|
|
+ console.log(data.pano);
|
|
|
+
|
|
|
if (data.pano) {
|
|
|
let {x,y,z,w} = data.quat
|
|
|
this.view = `&firstView=pano:${data.pano},qua:${x+', '+y+', '+z+', '+w}`
|
|
|
}
|
|
|
+
|
|
|
+ if (data.firstView) {
|
|
|
+ this.view = `&firstView=${data.firstView}`
|
|
|
+ }
|
|
|
this.scene = data.id
|
|
|
this.$bus.$emit('activeScene',data.id)
|
|
|
this.$showLoading()
|
|
@@ -86,6 +126,10 @@ export default {
|
|
|
if (res.data.source === "reLoadPage") {
|
|
|
this.$refs.ifr.contentWindow.location.reload()
|
|
|
}
|
|
|
+
|
|
|
+ if (res.data.source === "fullscreen") {
|
|
|
+ this.onFullScreen();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|