From ec5a5f7020c39414f75402da00a2458b780ba33f Mon Sep 17 00:00:00 2001 From: gongdi <410827992@qq.com> Date: Fri, 3 Dec 2021 13:37:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=8B=E6=B5=A6=E5=AD=A6=E6=A0=A1=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E9=98=B6=E6=AE=B5=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/screenAdaptation/pages/index.vue | 48 ++++++++++++++-------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/views/screenAdaptation/pages/index.vue b/src/views/screenAdaptation/pages/index.vue index d3d8daa..f9dfb65 100644 --- a/src/views/screenAdaptation/pages/index.vue +++ b/src/views/screenAdaptation/pages/index.vue @@ -24,11 +24,20 @@ load3DModel:false,//是否加载学校3D模型 model3DUrl:"",//学校3D模型路径 pointerEvents:"auto", - env:getEnv() + env:getEnv(), + modelId:1, } }, mounted(){ this.cancelLoading(); + window.addEventListener('message',(event)=>{ + this.listen3DEvent(event) + }) + }, + beforeDestroy(){ + window.removeEventListener('message',(event)=>{ + this.listen3DEvent(event) + },true); }, watch:{ $route:{ @@ -72,12 +81,13 @@ * 改变div背景图 以及事件穿透属性值 * */ changeBackGround:function (modelId) { + this.modelId = modelId; if(modelId !== 3){ if(modelId == 1){ //立体校园 - window.removeEventListener('message',(event)=>{ - this.listen3DEvent(event) - }) +// window.removeEventListener('message',(event)=>{ +// this.listen3DEvent(event) +// }) if(this.env === "development"){ // this.model3DUrl = "https://three-dimensional.obs.myhuaweicloud.com/tech-tools/others/yangpuxuexiao3D/index.html?AccessKeyId=WAFBGJACKDOQZDH1MKZ1&Expires=1667894500&Signature=mE9wpuN1ImyOz3yMGPwiaI0UPaU%3D"; }else { @@ -89,17 +99,11 @@ //this.model3DUrl = "https://three-dimensional.obs.myhuaweicloud.com/tech-tools/others/yangpuxuexiaonew/index.html?AccessKeyId=WAFBGJACKDOQZDH1MKZ1&Expires=1668049230&Signature=r4Vs%2BaCdcmsQso6Pq2/luCcJU3U%3D"; }else { this.model3DUrl = "./3D/builds-b1/index.html"; - window.addEventListener('message',(event)=>{ - this.listen3DEvent(event) - }) } } this.pointerEvents = "none"; document.getElementById("screenContent").style.backgroundImage = ""; }else { - window.removeEventListener('message',(event)=>{ - this.listen3DEvent(event) - }) this.load3DModel = false; this.model3DUrl = ""; this.pointerEvents = "auto"; @@ -110,16 +114,28 @@ if(event.data){ switch (event.data){ case 'click_01': - //行政管理 - this.$router.push({path:'/adminCenter'}); + if(this.modelId === 1){ + window.open("https://720yun.com/t/09vkOb1h78b?scene_id=59463132") + }else { + //行政管理 + this.$router.push({path:'/adminCenter'}); + } break; case 'click_02': - //家长服务 - this.$router.push({path:'/serviceCenter'}); + if(this.modelId === 1){ + window.open("https://720yun.com/t/09vkOb1h78b?scene_id=59463132") + }else { + //家长服务 + this.$router.push({path:'/serviceCenter'}); + } break; case 'click_03': - //运行数据 - this.$router.push({path:'/monitorCenter'}); + if(this.modelId === 1){ + window.open("https://720yun.com/t/09vkOb1h78b?scene_id=58868837") + }else { + //运行数据 + this.$router.push({path:'/monitorCenter'}); + } break; case 'click_04': //教师管理