tremble il y a 3 ans
Parent
commit
b119c0ba67
51 fichiers modifiés avec 116487 ajouts et 58080 suppressions
  1. 19 39
      public/index.html
  2. 1 21
      public/mobile.html
  3. 40 0
      public/scene.html
  4. 58563 0
      public/static/js/main_2020_show - 副本.js
  5. 56248 56113
      public/static/js/main_2020_show.js
  6. 534 168
      public/static/js/manage.js
  7. 53 41
      public/static/js/myShow.js
  8. 450 391
      public/static/js/overlay.js
  9. 0 20
      src/App.vue
  10. 1 1
      src/assets/style/reset.less
  11. 2 1
      src/clients/index.js
  12. 2 1
      src/clients/mobile.js
  13. 1 4
      src/main.js
  14. 24 0
      src/clients/scene.vue
  15. 4 5
      src/components/mapsvg/e.vue
  16. 4 7
      src/components/mapsvg/xuting.vue
  17. 83 0
      src/data/raw.js
  18. 25 68
      src/pages/mobilescene/index.vue
  19. 4 0
      src/pages/mobilescene/map.vue
  20. 4 1
      src/pages/mobilescene/menu.vue
  21. 52 111
      src/pages/mobilescene/scene.vue
  22. 0 12
      src/pages/mobilescene/views/gui/error.vue
  23. 0 21
      src/pages/mobilescene/views/gui/guide.vue
  24. 0 13
      src/pages/mobilescene/views/gui/guimsg.vue
  25. 0 17
      src/pages/mobilescene/views/gui/hotspotlist.vue
  26. 0 35
      src/pages/mobilescene/views/gui/loading.vue
  27. 0 292
      src/pages/mobilescene/views/gui/menu.vue
  28. 0 81
      src/pages/mobilescene/views/gui/other.vue
  29. 0 77
      src/pages/mobilescene/views/gui/title.vue
  30. 0 257
      src/pages/mobilescene/views/gui/vrcon.vue
  31. 0 61
      src/pages/mobilescene/views/gui/webvr.vue
  32. 0 10
      src/pages/mobilescene/views/hot/index.vue
  33. 0 12
      src/pages/mobilescene/views/popup/index.vue
  34. 1 0
      src/pages/scene/aside.vue
  35. 86 93
      src/pages/scene/index.vue
  36. 4 1
      src/pages/scene/menu.vue
  37. 74 106
      src/pages/scene/scene.vue
  38. 207 0
      src/pages/scenePage/index.vue
  39. 0 0
      src/pages/scenePage/views/gui/error.vue
  40. 0 0
      src/pages/scenePage/views/gui/guide.vue
  41. 0 0
      src/pages/scenePage/views/gui/guimsg.vue
  42. 0 0
      src/pages/scenePage/views/gui/hotspotlist.vue
  43. 0 0
      src/pages/scenePage/views/gui/loading.vue
  44. 0 0
      src/pages/scenePage/views/gui/menu.vue
  45. 0 0
      src/pages/scenePage/views/gui/other.vue
  46. 0 0
      src/pages/scenePage/views/gui/title.vue
  47. 0 0
      src/pages/scenePage/views/gui/vrcon.vue
  48. 0 0
      src/pages/scenePage/views/gui/webvr.vue
  49. 0 0
      src/pages/scenePage/views/hot/index.vue
  50. 0 0
      src/pages/scenePage/views/popup/index.vue
  51. 1 0
      vue.config.js

+ 19 - 39
public/index.html

@@ -1,41 +1,21 @@
 <!DOCTYPE html>
 <html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="renderer" content="webkit">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
-    <meta name="format-detection" content="telephone=no">
-    <link rel="icon" href="<%= BASE_URL %>logo.ico">
-    <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/css/oldVer/main0.css"/>
-    <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/css/main.css?v=2.25"/>
-    <title>2021年全国大众创业万众创新活动周云展览</title>
-    <script class="build keep">
-      if (window.performance) {
-          window.navigationStart = window.performance.timing.navigationStart;
-      } else {
-          window.navigationStart = Date.now() + 300;
-      };
-      (function() {
-        if (
-          navigator.userAgent.indexOf("iPhone") > -1 ||
-          navigator.userAgent.indexOf("Android") > -1
-        ) {
-          let href = window.location.href.split('/index.html')
-          window.location.href =  href[0] + "/mobile.html";
-        }
-      })();
-  </script>
-  </head>
-  <body>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/jquery-2.1.1.min.js" class="build keep"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/player-0.0.12.min.js" class="build keep"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/Tween.js"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/manage.js"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/myShow.js"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/overlay.js"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/main_2020_show.js"></script>
-    <div id="app"></div>
-  </body>
-</html>
+
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+  <meta name="renderer" content="webkit">
+  <meta name="viewport"
+    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
+  <meta name="format-detection" content="telephone=no">
+  <link rel="icon" href="<%= BASE_URL %>logo.ico">
+  <title>2021年全国大众创业万众创新活动周云展览</title>
+</head>
+
+<body>
+  <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/jquery-2.1.1.min.js" class="build keep"></script>
+  <div id="app"></div>
+</body>
+
+</html>

+ 1 - 21
public/mobile.html

@@ -8,31 +8,11 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
     <meta name="format-detection" content="telephone=no">
     <link rel="icon" href="<%= BASE_URL %>logo.ico">
-    <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/css/oldVer/main0.css"/>
-    <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/css/main.css?v=2.25"/>
     <title>2021年全国大众创业万众创新活动周云展览</title>
-    <script class="build keep">
-      if (window.performance) {
-          window.navigationStart = window.performance.timing.navigationStart;
-      } else {
-          window.navigationStart = Date.now() + 300;
-      };
-      (function(){
-        if (!(navigator.userAgent.indexOf('iPhone') > -1 || navigator.userAgent.indexOf('Android') > -1)) {
-              let href = window.location.href.split('/mobile.html')
-              window.location.href =  href[0] + "/index.html";
-            }
-      })();
-  </script>
+   
   </head>
   <body>
     <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/jquery-2.1.1.min.js" class="build keep"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/player-0.0.12.min.js" class="build keep"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/Tween.js"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/manage.js"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/myShow.js"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/overlay.js"></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/main_2020_show.js"></script>
     <div id="app"></div>
   </body>
 </html>

+ 40 - 0
public/scene.html

@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="renderer" content="webkit">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
+    <meta name="format-detection" content="telephone=no">
+    <link rel="icon" href="<%= BASE_URL %>logo.ico">
+    <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/css/oldVer/main0.css"/>
+    <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/css/main.css?v=2.25"/>
+    <title>2021年全国大众创业万众创新活动周云展览</title>
+    <script class="build keep">
+        var number = window.location.href.substring(window.location.href.indexOf("=") + 1);
+        if (number.indexOf("&") != -1) {
+            number = number.substring(0, number.indexOf("&"));
+        }
+        if (number.indexOf("#") != -1) {
+            number = number.substring(0, number.indexOf("#"));
+        } 
+      if (window.performance) {
+          window.navigationStart = window.performance.timing.navigationStart;
+      } else {
+          window.navigationStart = Date.now() + 300;
+      };
+      
+  </script>
+  </head>
+  <body>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/jquery-2.1.1.min.js" class="build keep"></script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/player-0.0.12.min.js" class="build keep"></script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/Tween.js"></script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/manage.js"></script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/myShow.js"></script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/overlay.js"></script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/main_2020_show.js"></script>
+    <div id="app"></div>
+  </body>
+</html>

Fichier diff supprimé car celui-ci est trop grand
+ 58563 - 0
public/static/js/main_2020_show - 副本.js


Fichier diff supprimé car celui-ci est trop grand
+ 56248 - 56113
public/static/js/main_2020_show.js


+ 534 - 168
public/static/js/manage.js

@@ -1,223 +1,589 @@
 //管理js文件 获取modeldata.js 判断是否有特殊的字段,如果有就先加载SpecialScene.js 里面有对特殊场景处理的代码 否则就直接加载main
-var Manage = function() {
-  this.time = "?" + new Date().getTime();
+var Manage = function(){
+  this.weixinURL = "https://res.wx.qq.com/open/js/jweixin-1.2.0.js",
+  this.time = "?"+new Date().getTime();
   this.loadAudio();
-};
-
+//   this.loadWeixin();
+}
 //动态加载js文件
-Manage.prototype.LoadJs = function(_files, succes) {
-  /* 已加载文件缓存列表,用于判断文件是否已加载过,若已加载则不再次加载*/
-  var classcodes = [];
-  var FileArray = [];
+Manage.prototype.LoadJs = function(_files, succes){
+/* 已加载文件缓存列表,用于判断文件是否已加载过,若已加载则不再次加载*/
+var classcodes = [];
+var FileArray = [];
   if (typeof _files === "object") {
-    FileArray = _files;
+      FileArray = _files;
   } else {
-    /*如果文件列表是字符串,则用,切分成数组*/
-    if (typeof _files === "string") {
-      FileArray = _files.split(",");
-    }
+      /*如果文件列表是字符串,则用,切分成数组*/
+      if (typeof _files === "string") {
+          FileArray = _files.split(",");
+      }
   }
   if (FileArray != null && FileArray.length > 0) {
-    var LoadedCount = 0;
-    for (var i = 0; i < FileArray.length; i++) {
-      loadFile(FileArray[i], function() {
-        LoadedCount++;
-        if (LoadedCount == FileArray.length) {
-          try {
-            succes();
-          } catch (err) {
+      var LoadedCount = 0;
+      for (var i = 0; i < FileArray.length; i++) {
+          loadFile(FileArray[i], function() {
+              LoadedCount++;
+              if (LoadedCount == FileArray.length) {
+                try {
+                  succes();
+                }
+                  catch(err) {
             console.log("err: 您未定义回调");
-          }
         }
-      });
-    }
+              }
+          })
+      }
   }
   /*加载JS文件,url:文件路径,success:加载成功回调函数*/
   function loadFile(url, success) {
-    if (!FileIsExt(classcodes, url)) {
-      var _ThisType = GetFileType(url);
-      var ThisType =
-        _ThisType.indexOf("?") == -1
-          ? _ThisType
-          : _ThisType.substring(0, _ThisType.indexOf("?"));
-      var fileObj = null;
-      if (ThisType == ".js") {
-        fileObj = document.createElement("script");
-        fileObj.src = url;
-      } else if (ThisType == ".css") {
-        fileObj = document.createElement("link");
-        fileObj.href = url;
-        fileObj.type = "text/css";
-        fileObj.rel = "stylesheet";
-      } else if (ThisType == ".less") {
-        fileObj = document.createElement("link");
-        fileObj.href = url;
-        fileObj.type = "text/css";
-        fileObj.rel = "stylesheet/less";
-      }
-      success = success || function() {};
-      fileObj.onload = fileObj.onreadystatechange = function() {
-        if (
-          !this.readyState ||
-          "loaded" === this.readyState ||
-          "complete" === this.readyState
-        ) {
+      if (!FileIsExt(classcodes, url)) {
+          var _ThisType = GetFileType(url);
+          var ThisType = _ThisType.indexOf("?") == -1 ? _ThisType  :  _ThisType.substring(0,_ThisType.indexOf("?"));
+          var fileObj = null;
+          if (ThisType == ".js") {
+              fileObj = document.createElement('script');
+              fileObj.src = url;
+          } else if (ThisType == ".css") {
+              fileObj = document.createElement('link');
+              fileObj.href = url;
+              fileObj.type = "text/css";
+              fileObj.rel = "stylesheet";
+          } else if (ThisType == ".less") {
+              fileObj = document.createElement('link');
+              fileObj.href = url;
+              fileObj.type = "text/css";
+              fileObj.rel = "stylesheet/less";
+          }
+          success = success || function() {};
+          fileObj.onload = fileObj.onreadystatechange = function() {
+              if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {
+                  success();
+                  classcodes.push(url)
+              }
+          }
+          document.getElementsByTagName('head')[0].appendChild(fileObj);
+      } else {
           success();
-          classcodes.push(url);
-        }
-      };
-      document.getElementsByTagName("head")[0].appendChild(fileObj);
-    } else {
-      success();
-    }
+      }
   }
   /*获取文件类型,后缀名,小写*/
   function GetFileType(url) {
-    if (url != null && url.length > 0) {
-      return url.substr(url.lastIndexOf(".")).toLowerCase();
-    }
-    return "";
+      if (url != null && url.length > 0) {
+          return url.substr(url.lastIndexOf(".")).toLowerCase();
+      }
+      return "";
   }
   /*文件是否已加载*/
   function FileIsExt(FileArray, _url) {
-    if (FileArray != null && FileArray.length > 0) {
-      var len = FileArray.length;
-      for (var i = 0; i < len; i++) {
-        if (FileArray[i] == _url) {
-          return true;
-        }
+      if (FileArray != null && FileArray.length > 0) {
+          var len = FileArray.length;
+          for (var i = 0; i < len; i++) {
+              if (FileArray[i] == _url) {
+                  return true;
+              }
+          }
       }
-    }
-    return false;
+      return false;
   }
+
+};
+
+//获取页面url后面的参数
+Manage.prototype.number = function(variable) {
+var query = window.location.search.substring(1);
+   var vars = query.split("&");
+   for (var i=0;i<vars.length;i++) {
+           var pair = vars[i].split("=");
+           if(pair[0] == variable){return pair[1];}
+   }
+   return(false);
 };
 
-Manage.prototype.loadAudio = function() {
-  //相关:g_tourAudio \  g_playAudio
-  g_bgAudio = new Audio();
+Manage.prototype.loadWeixin = function() {
+  var that = this;
+  this.LoadJs(that.weixinURL+that.time,function(){ });
+
+}
+
+Manage.prototype.loadAudio = function() { //相关:g_tourAudio \  g_playAudio
+  g_bgAudio = new Audio;
   g_bgAudio.loop = true;
   g_bgAudio.autoplay = true;
   g_bgAudio.id = "bgaudio";
-
+  
   //https://www.cnblogs.com/interdrp/p/4211883.html   部分资料
-  g_bgAudio.load(); // iOS 9   还需要额外的 load 一下, 否则直接 play 无效
-  var play = function() {
-    //if(window.tourAudioSta) return;
+  g_bgAudio.load();	// iOS 9   还需要额外的 load 一下, 否则直接 play 无效
+  var play = function(){
+      //if(window.tourAudioSta) return;
+       
+      this.switchBgmState(true)
+      
+      document.removeEventListener("touchstart",play);
+      document.removeEventListener("click",play);
+      $('#player')[0] && $('#player')[0].removeEventListener("touchstart", play);
+  }.bind(this);
+  
+  g_bgAudio.oncanplay = ()=>{ 
+      this.switchBgmState(true)
+  }
+  document.addEventListener("WeixinJSBridgeReady", ()=> {
+      this.switchBgmState(true)
+  }, false);
+  
+  document.addEventListener("touchstart", play);//ios需要加个事件才能播放 不能自动播放;如果还有浏览器不行,换成别的交互事件
+  document.addEventListener("click", play);
+  $('#player')[0] && $('#player')[0].addEventListener("touchstart", play);
+  g_bgAudio.addEventListener('ended', ()=>{ 
+      this.switchBgmState(true)
+  }); 
+  
+  
+  
+  $("#volume").find("a").on("click", ()=> { 
+       
+      if($("#volume img")[0].src.indexOf("btn_on.png")>-1)
+      { 
+          this.switchBgmState(true); 
+      }
+      else if($("#volume img")[0].src.indexOf("btn_off.png")>-1)
+      {
+          this.switchBgmState(false);    
+      }
+  }) 
 
-    this.switchBgmState(true);
+  
+  
+}   
+Manage.prototype.switchBgmState = function(state){
+  if(!g_bgAudio || !g_bgAudio.src) return;
+  
+  var played = function(){
+      console.log('begin play bgm');
+      g_play = 1; 
+      g_playAudio = g_bgAudio;
+      $("#volume a img").attr("src", "./images/Volume btn_off.png")
+      $("#volume").attr("title", "关闭声音");
+      g_tourAudio && g_tourAudio.pause()
+  }
+  var paused = function(){ 
+      g_play = 0;
+      g_playAudio == g_bgAudio && (g_playAudio =  null)
+      $("#volume a img").attr("src", "./images/Volume btn_on.png")
+      $("#volume").attr("title", "打开声音");
+  }
+  
+  if(state ){
+      g_bgAudio.play(); 
+      if(g_bgAudio.paused){
+          paused()
+      }else{
+          played()
+          return true
+      }            
+  }else{
+      g_bgAudio.pause();
+      paused()
+  } 
+  
+  
+  g_bgAudio.pauseByHot = false
+  g_bgAudio.pauseByTour = false
+}    
+  
 
-    document.removeEventListener("touchstart", play);
-    document.removeEventListener("click", play);
-    $("#player")[0].removeEventListener("touchstart", play);
-  }.bind(this);
 
-  g_bgAudio.oncanplay = () => {
-    this.switchBgmState(true);
-  };
 
-  document.removeEventListener("WeixinJSBridgeReady", play);
-  document.addEventListener("WeixinJSBridgeReady",play);
 
-  document.addEventListener("touchstart", play); //ios需要加个事件才能播放 不能自动播放;如果还有浏览器不行,换成别的交互事件
-  document.addEventListener("click", play);
-  $("#player")[0].addEventListener("touchstart", play);
-  g_bgAudio.addEventListener("ended", () => {
-    this.switchBgmState(true);
-  });
 
-  $("#volume")
-    .find("a")
-    .on("click", () => {
-      if ($("#volume img")[0].src.indexOf("btn_on.png") > -1) {
-        this.switchBgmState(true);
-      } else if ($("#volume img")[0].src.indexOf("btn_off.png") > -1) {
-        this.switchBgmState(false);
-      }
-    });
-};
 
-Manage.prototype.switchBgmState = function(state) {
-  if (!g_bgAudio || !g_bgAudio.src) return;
 
-  var played = function() {
-    console.log("begin play bgm");
-    g_play = 1;
-    g_playAudio = g_bgAudio;
-    $("#volume a img").attr("src", "./images/Volume btn_off.png");
-    $("#volume").attr("title", "关闭声音");
-    g_tourAudio && g_tourAudio.pause();
-  };
-  var paused = function() {
-    g_play = 0;
-    g_playAudio == g_bgAudio && (g_playAudio = null);
-    $("#volume a img").attr("src", "./images/Volume btn_on.png");
-    $("#volume").attr("title", "打开声音");
+
+Manage.prototype.weixinShare = function() {
+  console.log("weixinShare")
+  $.ajax({    
+      url:'https://www.4dage.com/wechat/jssdk/', 
+      type: "post",
+      data : {
+          'url' : location.href.split('#')[0]
+      }, 
+      dataType:"jsonp",     
+      jsonpCallback:"success_jsonp",         
+      success:function(data,textStatus){
+          console.log("weixinShare success")
+          console.log(data.appId)
+          
+          wx.config({
+              // debug : true,
+              appId : data.appId,
+              timestamp : data.timestamp,
+              nonceStr : data.nonceStr,
+              signature : data.signature,
+              jsApiList : [ 'checkJsApi', 'onMenuShareTimeline',
+                      'onMenuShareAppMessage', 'onMenuShareQQ',
+                      'onMenuShareWeibo', 'hideMenuItems',
+                      'showMenuItems', 'hideAllNonBaseMenuItem',
+                      'showAllNonBaseMenuItem', 'translateVoice',
+                      'startRecord', 'stopRecord', 'onRecordEnd',
+                      'playVoice', 'pauseVoice', 'stopVoice',
+                      'uploadVoice', 'downloadVoice', 'chooseImage',
+                      'previewImage', 'uploadImage', 'downloadImage',
+                      'getNetworkType', 'openLocation', 'getLocation',
+                      'hideOptionMenu', 'showOptionMenu', 'closeWindow',
+                      'scanQRCode', 'chooseWXPay',
+                      'openProductSpecificView', 'addCard', 'chooseCard',
+                      'openCard' ]
+          });
+      },    
+      error:function(XMLHttpRequest,textStatus,errorThrown){    
+          console.log("jsonp.error:"+textStatus);    
+      }    
+  }); 
+  
+  var success_jsonp = function(json){
+      console.log(json);
   };
 
-  if (state) {
-    g_bgAudio.play();
-    if (g_bgAudio.paused) {
-      paused();
-    } else {
-      played();
-      return true;
-    }
-  } else {
-    g_bgAudio.pause();
-    paused();
-  }
 
-  g_bgAudio.pauseByHot = false;
-  g_bgAudio.pauseByTour = false;
-};
+  wx.ready(function(){ 
+      // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行〿
+      //对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中〿
+      //分享到朋友圈 
+      console.log(g_weixinObj)
+      wx.onMenuShareTimeline({ 
+          title: g_weixinObj.title, // 分享标题 
+          link: g_weixinObj.lineLink, // 分享链接 
+          imgUrl: g_weixinObj.imgUrl, // 分享图标 
+          desc: g_weixinObj.desc
+      }); 
+
+      //获取“分享给朋友”按钮点击状态及自定义分享内容接叿
+      wx.onMenuShareAppMessage({ 
+          title: g_weixinObj.title, // 分享标题 
+          desc: g_weixinObj.desc,  // 分享描述 
+          link: g_weixinObj.lineLink, // 分享链接 
+          imgUrl: g_weixinObj.imgUrl, // 分享图标 
+          type: '', // 分享类型,music、video或link,不填默认为link 
+          dataUrl: '' // 如果type是music或video,则要提供数据链接,默认为空 
+      });
+      
+      wx.onMenuShareWeibo({
+          title: g_weixinObj.title, // 分享标题
+          desc: g_weixinObj.desc, // 分享描述
+          link: g_weixinObj.lineLink, // 分享链接
+          imgUrl: g_weixinObj.imgUrl, // 分享图标
+          success: function () { 
+              // 用户确认分享后执行的回调函数
+          },
+          cancel: function () { 
+              // 用户取消分享后执行的回调函数
+          }
+      });
+
+      wx.onMenuShareQZone({
+          title: g_weixinObj.title, // 分享标题
+          desc: g_weixinObj.desc, // 分享描述
+          link: g_weixinObj.lineLink, // 分享链接
+          imgUrl: g_weixinObj.imgUrl, // 分享图标
+          success: function () { 
+              // 用户确认分享后执行的回调函数
+          },
+          cancel: function () { 
+              // 用户取消分享后执行的回调函数
+          }
+      });
+
+      wx.onMenuShareQQ({
+          title: g_weixinObj.title, // 分享标题
+          desc:  g_weixinObj.desc, // 分享描述
+          link: g_weixinObj.lineLink, // 分享链接
+          imgUrl: g_weixinObj.imgUrl, // 分享图标
+          success: function () { 
+              // 用户确认分享后执行的回调函数
+          },
+          cancel: function () { 
+              // 用户取消分享后执行的回调函数
+          }
+      });
+
+      wx.error(function(res){ 
+      // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名〿
+
+      });
+  });
+
+  
+}
 
-Manage.prototype.dealURL = function(src, type) {
+
+
+Manage.prototype.dealURL = function(src, type){
   //music: "///super.4dage.com/data/LYW/edit/20200928_151633415.mp3"
   //"https://super.4dage.com/data/LYW/edit/20200928_165319399.jpg"]
-
-  if (window.isLocal && settings.localPrefix != void 0) {
-    //本地将线上的前缀替换
-    var oldPrefixs = [
-      "https://super.4dage.com/",
-      "http://super.4dage.com/",
-      "///super.4dage.com/",
-    ];
-    for (let i = 0; i < oldPrefixs.length; i++) {
-      if (src.includes(oldPrefixs[i])) {
-        return src.replace(oldPrefixs[i], settings.localPrefix);
-        break;
+  
+ 
+  if(window.isLocal && settings.localPrefix!=void 0){//本地将线上的前缀替换
+      var oldPrefixs = ["https://super.4dage.com/", "http://super.4dage.com/", "///super.4dage.com/"]
+      for(let i=0;i<oldPrefixs.length;i++){
+          if(src.includes(oldPrefixs[i])){
+              return src.replace(oldPrefixs[i], settings.localPrefix)
+              break;
+          }
       }
+      console.error("没有找到合适的本地链接")
+      return src
+  }else{
+      //add https://
+      var prefix = g_Prefix.replace('https://','').replace('http://','') 
+      if(!src.includes('http:/') && !src.includes('https:/') && src.includes(prefix)){
+          src = 'https://'+src
+      }
+      return src
+  }
+  
+  
+}
+
+Manage.prototype.showInfo = function (o) { // ({result:true, title:"发布成功"}); 
+ 
+var box = $(".resultBox");
+
+var title = o.title || o || i18n.get('保存成功');
+box.children().eq(0).html(title) 
+
+
+//var time = o.time || THREE.Math.clamp((Config.lang=='en') ? title.length*50 : title.length*130 ,1300,5000);
+var time = o.time ||  THREE.Math.clamp(title.length*130 ,1300,  5000);
+  o.time || console.log("showtime  " + time)
+
+//实际有一半的时间在渐变透明度
+this.showInfoTimer && clearTimeout(this.showInfoTimer) 
+box.removeClass("animate");//如果之后不久又要showinfo一个的话,先停止前面的animate
+setTimeout(function () {
+  box.css(
+    {
+      '-webkit-animation-duration': time + 'ms',
+      'animation-duration': time + 'ms'
     }
-    console.error("没有找到合适的本地链接");
-    return src;
+  )
+      if(o.top){
+          box.children().css('top', o.top + "%");
+      }else{
+          box.children().css('top', '' )
+      }
+  box.removeClass("hide");
+  box.addClass("animate");
+  if (o.dontInteract) {//遮挡对屏幕的操作
+    box.css('pointer-events', 'auto')
   } else {
-    //add https://
-    var prefix = g_Prefix.replace("https://", "").replace("http://", "");
-    if (
-      !src.includes("http:/") &&
-      !src.includes("https:/") &&
-      src.includes(prefix)
-    ) {
-      src = "https://" + src;
-    }
-    return src;
+    box.css('pointer-events', 'none')
   }
-};
+   
+
+  this.showInfoTimer = setTimeout(function () {
+    box.removeClass("animate");
+    box.addClass("hide");
+    this.showInfoTimer = null; 
+  }.bind(this), time + 20)
+
+}.bind(this), 50)//这个数字太小的话后面触发的没有重新animate的效果 应该要比帧率大吧
+
+
+}//like:  manage.showInfo({title:'a', top:20})
+
+
+
+var manage = new Manage();
+
+//公用的函数
+
+function getQueryVariable(variable)
+{
+     var query = window.location.search.substring(1);
+     var vars = query.split("&");
+     for (var i=0;i<vars.length;i++) {
+             var pair = vars[i].split("=");
+             if(pair[0] == variable){return pair[1];}
+     }
+     return(false);
+}
 
 //隐藏公司Logo
-function showLogo() {
+function showLogo(){
   $("#myCompany").hide();
   $("#loaderCoBrandName").hide();
   $("#title-logo").hide();
-  $(".title-container").css("justify-content", "center");
+  $(".title-container").css("justify-content","center")
 }
 //czj 添加随机的时间
-function randomTime() {
-  return new Date();
+function randomTime(){
+  return new Date()
+}
+function matcher(data){
+  if(!data || !g_version ) return data;
+  delete data.model.vision_version;
+  var _data = {
+      files: {
+          "templates": ["images/images{{number}}/{{filename}}"]
+      },
+      model :{
+          sid :window.number,
+          camera_start:
+          data.model.images && data.model.images.length != 0  ? 
+          {
+              camera: {
+                  zoom: "-1",
+                  quaternion: [
+                      JSON.parse(data.model.images[0].metadata).camera_quaternion.z,
+                      JSON.parse(data.model.images[0].metadata).camera_quaternion.w,
+                      JSON.parse(data.model.images[0].metadata).camera_quaternion.x,
+                      JSON.parse(data.model.images[0].metadata).camera_quaternion.y
+                  ]
+              },
+              pano: { uuid: JSON.parse(data.model.images[0].metadata).scan_id },
+              mode: "0"
+          }
+          : ''
+      },
+      sid: window.number,
+      hoticon: {
+          default: "https://super.4dage.com/images/4dagePoint2.png",
+          higt: "https://super.4dage.com/images/4dagePoint.png"
+      },
+      special: "false",
+      weixinDesc: ""
+  };
+  $.extend(true,data,_data)
+  return data;
 }
 
-window.loadMange = () => {
-  if (!window.manage) {
-    window.manage =  new Manage();
+function hotMatcher(data={}){
+  //if(!data || !g_version) return data; 
+  if(g_version) {
+      data.tourAudio = data.audio || {};
+  }else{
+      data.tourAudio = {}
   }
-};
+  return data;
+}
+
+
+var GifTexDeal = {
+  
+  animateObjects : [], 
+   
+  addAnimation : function(texture, owner, info, id){
+      var object = {
+          texture,
+          owner,
+          info,
+          id 
+      }
+      this.setRepeart(object)
+      this.animateObjects.push(object)
+      return object
+  },
+  remove : function(object){
+      var index = this.animateObjects.indexOf(object) 
+      if(index>-1){
+          this.stop(object)
+          object.texture.repeat.set(1,1) 
+          this.animateObjects.splice(index, 1)
+      }
+  },
+  setRepeart : function(object){
+      object.texture.repeat.set(1/object.info.cellXcount, 1/object.info.cellYcount)
+  },
+  start: function(object){ 
+      /* var b = this
+        , offset = this.cursor.material.map.offset
+        , f = function(a) {
+          return Math.floor(17 * a) / 17   //对应17个精灵图片段
+      };
+      b.canStartAnimation = !1,
+      this.cursorAnimate = new TWEEN.Tween(offset).to({
+          x: 1    //100%
+      }, 1e3).onStart(function() {
+          b.canStartAnimation = !1
+      }).onStop(function() {
+          b.canStartAnimation = !0,
+          this.x = 0,
+          offset.x = 0
+      }).onUpdate(function() {}).onComplete(function() {
+          done(),
+          offset.x = 0,
+          setTimeout(function() {
+              b.canStartAnimation = !0
+          }, 1500)
+      }),
+      this.cursorAnimate.easing(f),
+      this.cursorAnimate.start()
+*/ 
+        
+      if(!object || object.started)return;
+      var count = object.info.cellXcount * object.info.cellYcount
+      
+      if(count == 1 )return;
+      
+      transitions.start( (progress)=>{
+          var index = Math.floor(count * progress);
+          var indexX =  index % object.info.cellXcount
+          var indexY =  object.info.cellYcount - Math.floor(index / object.info.cellXcount ) - 1;  //uv.offset.y是从下到上的
+          object.texture.offset.x = indexX / object.info.cellXcount;
+          object.texture.offset.y = indexY / object.info.cellYcount;
+          
+          //console.log(object.id + " : "+ object.texture.offset.toArray())
+      } , object.info.duration, ()=>{//done
+          object.started = false
+          object.texture.offset.x = 0;
+          object.texture.offset.y = 0;
+          this.start(object)
+      }, 0 ,null, object.id, "gif_"+object.id); 
+
+      object.started = true
+
+  },
+  
+  startAnimations : function(o={}){
+      this.animateObjects.forEach(e=>{this.start(e)})
+
+  }
+  ,
+  stop: function(object){ 
+      if(!object || !object.started)return;
+      transitions.cancelById("gif_"+object.id);
+      object.texture.offset.set(0,0)    
+      object.started = false
+  }
+}
+
+var CloneObject = function(copyObj, result, isSimpleCopy) {
+  //isSimpleCopy只复制最外层
+  //复制json		result的可能:普通数字或字符串、普通数组、复杂对象
+  if(!copyObj)return null
+  result = result || {};
+  if (copyObj instanceof Array) {
+      if (copyObj[0]instanceof Object) {
+          //不支持含有 [[Object]] 这样二级数组里面还是复杂数据的,普通和复杂的数据混合可能也不支持
+          console.error("不支持含有 [[Object]] 这样二级数组里面还是复杂数据的...")
+      }
+      return copyObj.slice(0);
+      //如果是数组,直接复制返回(排除数组内是object
+  }
+  for (var key in copyObj) {
+      if (copyObj[key]instanceof Object && !isSimpleCopy)
+          result[key] = CloneObject(copyObj[key]);
+      else
+          result[key] = copyObj[key];
+      //如果是函数类同基本数据,即复制引用
+  }
+  return result;
+}
+;
+
+
+//兼容一代的場景
+//請求地址統一管理
+var g_onePregix = "https://bigscene.4dage.com/" //对应一代  http://www.4dmodel.com/SuperPanoramic/index.html?m=55
+var g_version = manage.number("version");
+g_version === "one" ? g_Prefix = g_onePregix : '';
+

+ 53 - 41
public/static/js/myShow.js

@@ -1,57 +1,69 @@
-window.g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
-window.g_version = window.g_Prefix="https://super.4dage.com/";
+var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
+var g_Prefix="https://super.4dage.com/";
+// var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
+var s = window.location.href.split('/');
+s.pop();
+//var g_Prefix = s.join('/');
+var g_index=null;
+var g_modeldata=null;
 
-window.g_index=null;
-window.g_modeldata=null;
+var g_weixinTitle=null;
 
-window.g_weixinTitle=null;
-
-window.g_Hots=null;
-window.g_HotMeshes=[];
-window.g_HotMeshSize = {
+var g_Hots=null;
+var g_HotMeshes=[];
+var g_HotMeshSize = {
   g_HotMeshWidth: 0.3,
   g_HotMeshHeight:0.3
 };
 
 //add表示添加,delete表示删除
-window.g_HotStatus=null;
-window.g_newHot = [];//存储新加热点
-window.g_HotImage= {
+var g_HotStatus=null;
+var g_newHot = [];//存储新加热点
+var g_HotImage= {
 	"point":"https://super.4dage.com/images/4dagePoint2.png",
 	"point2":"https://super.4dage.com/images/4dagePoint.png"
 };	
-window.g_saveHot=false;
+var g_saveHot=false;
 
-window.g_TextColor=0x7777ff;
-window.g_Text=null;
-window.g_TextPlaneMesh=[];
-window.g_TextIconMesh=[];
-window.g_TextIcon="./images/text.png";
-window.g_SelectTextIndex=null;
-window.g_TextShow=null;
-window.g_audioPlay=false;
-window.g_background=null; 
-window.g_roof=null;
+var g_TextColor=0x7777ff;
+var g_Text=null;
+var g_TextPlaneMesh=[];
+var g_TextIconMesh=[];
+var g_TextIcon="./images/text.png";
+var g_SelectTextIndex=null;
+var g_TextShow=null;
+var g_audioPlay=false;
+var g_background=null; 
+var g_roof=null;
 
-window.g_data2 = null;//加载的data2.js的内容
-window.g_bgAudio=null;//背景音乐
-window.g_tourAudio=null;//导览音乐
-window.g_play = 1;//表示播放图标状态
-window.g_playAudio = null;//当前在播放或当继续播放时应该播放的,是g_bgAudio或g_tourAudio 
-window.g_currentHot = null;//当前打开的热点 
-//window.g_Texture=null;
-//window.g_ChunknameTexture={};   //chunkname和贴图名称对应
-window.g_NormalTexture=false;
-window.g_SpecularTexture=false;
-window.g_DirectionalLight=null;  
+var g_data2 = null;//加载的data2.js的内容
+var g_bgAudio=null;//背景音乐
+var g_tourAudio=null;//导览音乐
+var g_play = 1;//表示播放图标状态
+var g_playAudio = null;//当前在播放或当继续播放时应该播放的,是g_bgAudio或g_tourAudio 
+var g_currentHot = null;//当前打开的热点 
+//var g_Texture=null;
+//var g_ChunknameTexture={};   //chunkname和贴图名称对应
+var g_NormalTexture=false;
+var g_SpecularTexture=false;
+var g_DirectionalLight=null;  
   
-window.g_snapShotWidth = 200; //截图下载图片的大小
-window.g_snapShotHeight = 140;
+var g_snapShotWidth = 200; //截图下载图片的大小
+var g_snapShotHeight = 140;
 
+//微信分享
+var g_weixinObj = {
+  "title": document.querySelector("head title").innerHTML,
+  "lineLink" : window.location.href,
+  "imgUrl" : "https://www.4dmodel.com/SuperPanoramic/images/weixintitle.jpg",
+  "desc" : "四维时代提供技术支持",
+}
 
-window.settings = {
+var settings = {
     overlay:{
-      width:1, height:0.5, depth:0.02
-    },
-    dontExamHot:true
-}  
+		width:1, height:0.5, depth:0.02
+	}  
+}
+if(window.number == '725'||window.number == '724'){
+    settings.mobileNavHigh = true
+}

+ 450 - 391
public/static/js/overlay.js

@@ -2,397 +2,459 @@ var MathLight = {};
 MathLight.RADIANS_PER_DEGREE = Math.PI / 180;
 MathLight.DEGREES_PER_RADIAN = 180 / Math.PI;
 
-window.initOverlay = function(THREE) {
-  var _planeGeometry = new THREE.PlaneGeometry(
-    settings.overlay.width,
-    settings.overlay.height,
-    1,
-    1
-  );
-  var _boxGeometry = new THREE.BoxBufferGeometry(
-    settings.overlay.width,
-    settings.overlay.height,
-    settings.overlay.depth
-  );
-  //ie的mesh 加了polygonOffset也是会重叠。所以去掉前面的face:  (但是突然ie又播放不了videoTexture)
-  var newIndex = [..._boxGeometry.index.array];
-  newIndex.splice(4 * 6, 6);
-  _boxGeometry.setIndex(
-    new THREE.BufferAttribute(new Uint16Array(newIndex), 1)
-  );
-
-  var _boxMat = new THREE.MeshBasicMaterial({
-    //MeshStandardMaterial
-    color: "#eeeeee",
-    transparent: !0,
-    opacity: 0.8,
-  });
-
-  var overlayGroup = new THREE.Object3D();
-  player.model.add(overlayGroup);
-  overlayGroup.name = "overlayGroup";
-  player.overlayGroup = overlayGroup;
-
-  var Overlay = function(info) {
-    THREE.Object3D.call(this);
-    this.sid = info.sid;
-    if (info.media) this.preDeal(info);
-    this.build(info);
-    this.name = "overlay_" + this.sid;
-  };
-  Overlay.prototype = Object.create(THREE.Object3D.prototype);
-
-  Overlay.prototype.build = function(info) {
-    var plane = new THREE.Mesh(
-      _planeGeometry,
-      new THREE.MeshBasicMaterial({
+ 
+ 
+
+var initOverlay = function(THREE) {
+    var _planeGeometry = new THREE.PlaneGeometry(settings.overlay.width,settings.overlay.height,1,1)
+    var _boxGeometry = new THREE.BoxBufferGeometry(settings.overlay.width,settings.overlay.height,settings.overlay.depth)
+    //ie的mesh 加了polygonOffset也是会重叠。所以去掉前面的face:  (但是突然ie又播放不了videoTexture)
+    var newIndex = [..._boxGeometry.index.array]
+    newIndex.splice(4 * 6, 6)
+    _boxGeometry.setIndex(new THREE.BufferAttribute(new Uint16Array(newIndex),1))
+
+    var _boxMat = new THREE.MeshBasicMaterial({
         //MeshStandardMaterial
-        color: "#00c8af",
-        opacity: 0.4,
+        color: "#eeeeee",
         transparent: !0,
-        polygonOffset: true,
-        //是否开启多边形偏移		//ie不开启时blank也不会闪烁
-        polygonOffsetFactor: -0.9,
-        //多边形偏移因子
-        polygonOffsetUnits: -4.0,
-        //多边形偏移单位
-      })
-    );
-    plane.renderOrder = 3;
-    this.add(plane);
-    this.plane = plane;
-    if (info.hasBox) {
-      this.addBox(true);
+        opacity: 0.8
+    })
+
+    var overlayGroup = new THREE.Object3D;
+    player.model.add(overlayGroup);
+    overlayGroup.name = "overlayGroup"
+    player.overlayGroup = overlayGroup;
+
+    var Overlay = function(info) {
+        THREE.Object3D.call(this);
+        this.sid = info.sid;
+        if (info.media)
+            this.preDeal(info)
+        this.build(info);
+        this.name = "overlay_" + this.sid;
     }
-    overlayGroup.add(this);
-
-    if (info.media) {
-      if (info.media.includes("video")) {
-        //var id = "video"+ this.sid    id="${ id }"
-        var video = $(
-          `<video  controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>`
-        )[0];
-
-        video.setAttribute("crossOrigin", "Anonymous");
-        //要在src设置好前解决跨域
-        $(video).on("contextmenu", function() {
-          return false;
-        });
-        //禁止右键点击出
-
-        video.src = manage.dealURL(info.file);
-        info.media = video;
-        info.type = "video";
+    Overlay.prototype = Object.create(THREE.Object3D.prototype);
+
+    Overlay.prototype.build = function(info) {
+
+        var plane = new THREE.Mesh(_planeGeometry,new THREE.MeshBasicMaterial({
+            //MeshStandardMaterial
+            color: "#00c8af",
+            opacity: 0.4,
+            transparent: !0,
+            polygonOffset: true,
+            //是否开启多边形偏移		//ie不开启时blank也不会闪烁
+            polygonOffsetFactor: -0.9,
+            //多边形偏移因子
+            polygonOffsetUnits: -4.0,
+            //多边形偏移单位  
+        }))
+        plane.renderOrder = 3
+        this.add(plane);
+        this.plane = plane;
+        if (info.hasBox) {
+            this.addBox(true)
+        }
+        overlayGroup.add(this);
 
-        /* video.addEventListener('loadeddata', ()=>{
+        if (info.media) {
+            if (info.media.includes('video')) { 
+                //var id = "video"+ this.sid    id="${ id }"
+                var video = $(`<video  controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>`)[0]
+                 
+                video.setAttribute("crossOrigin", 'Anonymous')
+                //要在src设置好前解决跨域
+                $(video).on('contextmenu', function() {
+                    return false;
+                });
+                //禁止右键点击出
+
+                video.src = manage.dealURL(info.file);
+                info.media = video;
+                info.type = "video"
+
+                /* video.addEventListener('loadeddata', ()=>{
                     console.log(this.sid + " loaded!!!")
                 }) */
-        video.volume = 0;
-        video.muted = true;
-        plane.material.opacity = 1;
-      } else if (info.media.includes("photo")) {
-        /* var img = new Image();
+                
+                video.oncanplaythrough = function() {
+                    plane.material.map.needsUpdate = !0
+                    if(video.shouldPlay){
+                        video.play()
+                    } 
+                }
+                
+                
+                video.volume = 0
+                video.muted = true
+                plane.material.opacity = 1;
+            } else if (info.media.includes('photo')) {
+                /* var img = new Image();
                  
                 img.src = manage.dealURL(info.file) //"https://4dkk.4dage.com/images/images"+Config.projectNum+"/overlay"+this.sid+".jpg?m="+new Date().getTime()
                 info.media = img
                  */
 
-        info.type = "photo";
-        plane.material.opacity = 0.1;
-      }
+                info.type = "photo"
+                plane.material.opacity = 0.1;
+                
+                /* this.animateInfo = {
+                        cellXcount : 4,
+                        cellYcount : 2,
+                        loop : true,
+                        duration : 1000 
+                    }
+                */
+
+        
+            }
+            
+            plane.material.color = new THREE.Color(1,1,1)
+        }
+        if (info.width == void 0)
+            info.width = settings.overlay.width;
+        if (info.height == void 0)
+            info.height = settings.overlay.height;
+        this.setFromInfo(info)
+        this.fileSrc = info.file
 
-      plane.material.color = new THREE.Color(1, 1, 1);
     }
-    if (info.width == void 0) info.width = settings.overlay.width;
-    if (info.height == void 0) info.height = settings.overlay.height;
-    this.setFromInfo(info);
-    this.fileSrc = info.file;
-  };
-
-  Overlay.prototype.setFromInfo = function(info) {
-    //1 恢复到编辑之前 2 初始加载
-    var plane = this.plane;
-    this.transformAtPanos = info.transformAtPanos || {};
-    //在每个漫游点独立设置的position。
-    //var curPanoTransform = player.currentPano && this.transformAtPanos[player.currentPano.id] || {}
-    var curPanoTransform = this.transformAtPanos[this.getTransformSid()] || {};
-
-    info.depth && this.scale.setZ(info.depth / settings.overlay.depth);
-
-    this.posCustom = info.pos ? info.pos.clone() : this.position.clone();
-    //没有单独设置position的漫游点使用的position
-    this.position.copy(curPanoTransform.pos || this.posCustom);
-
-    this.quaCustom = info.qua ? info.qua.clone() : this.quaternion.clone();
-    this.quaternion.copy(curPanoTransform.qua || this.quaCustom);
-
-    this.widthCustom = info.width;
-    this.heightCustom = info.height;
-    this.width = curPanoTransform.width || this.widthCustom;
-    this.height = curPanoTransform.height || this.heightCustom;
-    var a = this.getScaleBySize(this.width, this.height);
-    this.scale.setX(a.x);
-    this.scale.setY(a.y);
-
-    if (info.type) {
-      if (!plane.material.map) {
-        if (info.type == "video") {
-          plane.material.map = new THREE.VideoTexture(info.media);
-          this.hasRequestLoad = true;
-
-          plane.material.map.wrapS = plane.material.map.wrapT =
-            THREE.ClampToEdgeWrapping;
-          plane.material.map.minFilter = THREE.LinearFilter;
-          plane.material.map.magFilter = THREE.LinearFilter;
-          plane.material.map.generateMipmaps = true;
-        } else {
-          this._loadDones = [];
-          /* plane.material.map = Texture.load(info.file,()=>{
+
+
+
+
+
+    Overlay.prototype.setFromInfo = function(info) {
+        //1 恢复到编辑之前 2 初始加载 
+        var plane = this.plane; 
+        var transformAtPanos = {}
+        for(var i in info.transformAtPanos){
+            transformAtPanos[i] = {
+                width : info.transformAtPanos[i].width,
+                height : info.transformAtPanos[i].height,
+                pos : info.transformAtPanos[i].pos.clone(),
+                qua : info.transformAtPanos[i].qua.clone(),
+            }      
+        } 
+        
+        this.transformAtPanos = transformAtPanos
+        //在每个漫游点独立设置的position。  
+        //var curPanoTransform = player.currentPano && this.transformAtPanos[player.currentPano.id] || {}
+        var curPanoTransform = this.transformAtPanos[ getTransformSid()] || {}
+         
+        
+        info.depth && this.scale.setZ(info.depth / settings.overlay.depth)
+
+        this.posCustom = info.pos ? info.pos.clone() : this.position.clone();
+        //没有单独设置position的漫游点使用的position
+        this.position.copy(curPanoTransform.pos || this.posCustom)
+
+        this.quaCustom = info.qua ? info.qua.clone() : this.quaternion.clone()
+        this.quaternion.copy(curPanoTransform.qua || this.quaCustom);
+
+        this.widthCustom = info.width
+        this.heightCustom = info.height
+        this.width = curPanoTransform.width || this.widthCustom
+        this.height = curPanoTransform.height || this.heightCustom
+        var a = this.getScaleBySize(this.width, this.height)
+        this.scale.setX(a.x)
+        this.scale.setY(a.y)
+
+        if (info.type) {
+            if (!plane.material.map) {
+                if (info.type == "video") {
+                    plane.material.map = new THREE.VideoTexture(info.media);
+                    this.hasRequestLoad = true
+
+                    plane.material.map.wrapS = plane.material.map.wrapT = THREE.ClampToEdgeWrapping;
+                    plane.material.map.minFilter = THREE.LinearFilter;
+                    plane.material.map.magFilter = THREE.LinearFilter;
+                    plane.material.map.generateMipmaps = true;
+
+                } else {
+                    this._loadDones = []
+                    /* plane.material.map = Texture.load(info.file,()=>{
                         if(this._loadDones){
                             this._loadDones.forEach(e=>e())
                             this._loadDones = null
                         }
                     })  */
-        }
-        /* plane.material.map.wrapS = plane.material.map.wrapT = THREE.ClampToEdgeWrapping;
+                }
+                /* plane.material.map.wrapS = plane.material.map.wrapT = THREE.ClampToEdgeWrapping;
                 plane.material.map.minFilter = THREE.LinearFilter;
                 plane.material.map.magFilter = THREE.LinearFilter;
                 plane.material.map.generateMipmaps = true;  */
-      } else plane.material.map.image = info.media;
-      this.file = info.file;
-    }
-    this.overlayType = info.type;
+            } else
+                plane.material.map.image = info.media;
+            this.file = info.file;
+        }
+        this.overlayType = info.type;
+
+        if (!!this.hasBox != !!info.hasBox) {
+            this.addBox(!this.hasBox);
+        }
 
-    if (!!this.hasBox != !!info.hasBox) {
-      this.addBox(!this.hasBox);
+        this.updateMatrixWorld()
+        this.getVisiblePanos()
+        
+        
+        {//gif
+            if(this.animation){
+                GifTexDeal.remove(this.animation)
+            }
+            this.animateInfo = CloneObject(info.animateInfo) 
+            if(this.animateInfo && plane.material.map){
+                this.animation = GifTexDeal.addAnimation(plane.material.map, this, this.animateInfo, this.sid )
+                this.visible && this.inSight() && GifTexDeal.start(this.animation)
+            }    
+        }
+        
+        
+        
     }
 
-    this.updateMatrixWorld();
-    this.getVisiblePanos();
-  };
 
-  Overlay.prototype.getTransformSid = function() {
-    var name;
-    if (player.mode == "panorama") {
-      name = player.currentPano ? player.currentPano.id : "outside";
-    } else {
-      name = "outside";
-    }
-    return name;
-  };
 
-  Overlay.prototype.addBox = function(state) {
-    if (state == !!this.hasBox) {
-      return;
+   
+
+
+
+
+    Overlay.prototype.addBox = function(state) {
+        if (state == !!this.hasBox) {
+            return;
+        }
+        if (state) {
+            var box = new THREE.Mesh(_boxGeometry,_boxMat)
+            box.position.set(0, 0, settings.overlay.depth / 2);
+            box.renderOrder = 3
+            this.plane.position.set(0, 0, settings.overlay.depth);
+            this.add(box);
+            this.box = box;
+
+        } else {
+            this.plane.position.set(0, 0, 0);
+            this.remove(this.box);
+            this.box = null;
+        }
+        this.hasBox = state
     }
-    if (state) {
-      var box = new THREE.Mesh(_boxGeometry, _boxMat);
-      box.position.set(0, 0, settings.overlay.depth / 2);
-      box.renderOrder = 3;
-      this.plane.position.set(0, 0, settings.overlay.depth);
-      this.add(box);
-      this.box = box;
-    } else {
-      this.plane.position.set(0, 0, 0);
-      this.remove(this.box);
-      this.box = null;
+
+    Overlay.prototype.getSizeByScale = function() {
+        return {
+            width: settings.overlay.width * this.scale.x,
+            height: settings.overlay.height * this.scale.y
+        }
     }
-    this.hasBox = state;
-  };
-
-  Overlay.prototype.getSizeByScale = function() {
-    return {
-      width: settings.overlay.width * this.scale.x,
-      height: settings.overlay.height * this.scale.y,
-    };
-  };
-  Overlay.prototype.getScaleBySize = function(width, height) {
-    return {
-      x: width / settings.overlay.width,
-      y: height / settings.overlay.height,
-    };
-  };
-
-  Overlay.prototype.preDeal = function(info) {
-    info.pos = new THREE.Vector3().fromArray(info.pos);
-    info.qua = new THREE.Quaternion().fromArray(info.qua);
-    info.width = parseFloat(info.width);
-    info.height = parseFloat(info.height);
-    info.depth = parseFloat(info.depth);
-    info.hasBox = parseInt(info.hasBox);
-    info.pos.x = parseFloat(info.pos.x);
-    info.pos.y = parseFloat(info.pos.y);
-    info.pos.z = parseFloat(info.pos.z);
-    info.qua.x = parseFloat(info.qua.x);
-    info.qua.y = parseFloat(info.qua.y);
-    info.qua.z = parseFloat(info.qua.z);
-    info.qua.w = parseFloat(info.qua.w);
-
-    if (!info.transformAtPanos) info.transformAtPanos = {};
-
-    for (let i in info.transformAtPanos) {
-      info.transformAtPanos[i].pos = new THREE.Vector3().fromArray(
-        info.transformAtPanos[i].pos
-      );
-      info.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(
-        info.transformAtPanos[i].qua
-      );
+    Overlay.prototype.getScaleBySize = function(width, height) {
+        return {
+            x: width / settings.overlay.width,
+            y: height / settings.overlay.height,
+        }
     }
-  };
 
-  Overlay.prototype.getVisiblePanos = function() {
-    this.visiblePanos = common.getVisiblePano(this.plane.getWorldPosition(), {
-      model: null,
-    });
-  };
+    Overlay.prototype.preDeal = function(info) {
+        info.pos = new THREE.Vector3().fromArray(info.pos)
+        info.qua = new THREE.Quaternion().fromArray(info.qua)
+        info.width = parseFloat(info.width)
+        info.height = parseFloat(info.height)
+        info.depth = parseFloat(info.depth)
+        info.hasBox = parseInt(info.hasBox)
+        info.pos.x = parseFloat(info.pos.x)
+        info.pos.y = parseFloat(info.pos.y)
+        info.pos.z = parseFloat(info.pos.z)
+        info.qua.x = parseFloat(info.qua.x)
+        info.qua.y = parseFloat(info.qua.y)
+        info.qua.z = parseFloat(info.qua.z)
+        info.qua.w = parseFloat(info.qua.w)
+
+        if (!info.transformAtPanos)
+            info.transformAtPanos = {}
+
+        for (let i in info.transformAtPanos) {
+            info.transformAtPanos[i].pos = new THREE.Vector3().fromArray(info.transformAtPanos[i].pos)
+            info.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(info.transformAtPanos[i].qua)
 
-  Overlay.prototype.updateVisibles = function(panos) {
-    if (settings.isEdit && EditOverlay.editPlane == this) {
-      return true;
-    }
+        }
 
-    this.visible = !!panos.find((pano) => this.visiblePanos.includes(pano));
-    if (!this.visible && this.overlayType == "video") this.videoControl("stop");
-  };
+    }
 
-  Overlay.updateVisibles = function(panos) {
-    if (panos === true) {
-      player.overlayGroup.children.forEach((e) => (e.visible = true));
-    } else {
-      player.overlayGroup.children.forEach((e) => e.updateVisibles(panos));
+    Overlay.prototype.getVisiblePanos = function() {//在不同点还不一样
+        var depth = this.scale.z * settings.overlay.depth;
+        var getPos = function(position, quaternion, width, height){//每个overlay位置对应5个坐标,plane中心和四个角的位置
+            
+            var cornerPoint = [
+                new THREE.Vector3(0, 0, depth),
+                new THREE.Vector3(-width/2, height/2, depth),
+                new THREE.Vector3(width/2, height/2, depth),
+                new THREE.Vector3(width/2, -height/2, depth),
+                new THREE.Vector3(-width/2, -height/2, depth),
+            ]; 
+            
+            return cornerPoint.map(e=>{
+                return e.clone().applyQuaternion(quaternion).add(position)
+            }) 
+            
+        }
+        
+        var customPositions = getPos(this.posCustom, this.quaCustom, this.widthCustom, this.heightCustom)
+        var posAtPanos = {}
+        
+        for(let panoId in this.transformAtPanos){
+            if(panoId == 'outSide')continue;
+            posAtPanos[panoId] = getPos(this.transformAtPanos[panoId].pos, this.transformAtPanos[panoId].qua, this.transformAtPanos[panoId].width, this.transformAtPanos[panoId].height)
+            
+        }  
+        
+        
+        this.visiblePanos = common.getVisiblePano(customPositions, {
+            model: null , posAtPanos
+        });
     }
-  };
-
-  Overlay.prototype.videoControl = function(state) {
-    if (this.overlayType != "video") return;
-    if (!state || state == "stop") {
-      this.plane.material.map.image.paused ||
-        this.plane.material.map.image.pause();
-      if (state == "stop") {
-        this.plane.material.map.image.currentTime = 0;
-      }
-      //console.log("pause")
-    } else if (state) {
-      this.plane.material.map.image.paused &&
-        this.plane.material.map.image.play();
-      //console.log("play")
+    
+    
+    Overlay.prototype.updateVisibles = function(panos) {
+        
+        if(settings.isEdit && EditOverlay.editPlane == this){
+            return true
+        }
+        
+        this.visible = !!panos.find(pano=>this.visiblePanos.includes(pano))
+        if (!this.visible && this.overlayType == 'video')
+            this.videoControl('stop')
+        
+        /* if(this.animateInfo){ //在player.update里更新
+            if(this.visible){
+                GifTexDeal.start(this.animation)
+            }else{
+                GifTexDeal.stop(this.animation)
+            }
+        } */ 
     }
-  };
-  Overlay.prototype.inSight = function() {
-    if (player.mode == "panorama") {
-      var position = this.plane.getWorldPosition();
-      var pos2d = math.getPos2d(position, player.camera, $("#player")[0]);
-      if (pos2d.trueSide && pos2d.inSight) {
-        return true;
-      } else {
-        var cornerPoint = [
-          new THREE.Vector3(
-            -settings.overlay.width / 2,
-            settings.overlay.height / 2,
-            0
-          ),
-          new THREE.Vector3(
-            settings.overlay.width / 2,
-            settings.overlay.height / 2,
-            0
-          ),
-          new THREE.Vector3(
-            settings.overlay.width / 2,
-            -settings.overlay.height / 2,
-            0
-          ),
-          new THREE.Vector3(
-            -settings.overlay.width / 2,
-            -settings.overlay.height / 2,
-            0
-          ),
-        ];
-        for (var i = 0; i < 4; i++) {
-          cornerPoint[i].applyMatrix4(this.plane.matrixWorld);
-          var pos2d = math.getPos2d(
-            cornerPoint[i],
-            player.camera,
-            $("#player")[0]
-          );
-          if (pos2d.trueSide && pos2d.inSight) {
-            return true;
-          }
+    
+    
+    Overlay.updateVisibles = function(panos) {
+        if (panos === true) {
+            player.overlayGroup.children.forEach(e=>e.visible = true)
+        } else {
+            player.overlayGroup.children.forEach(e=>e.updateVisibles(panos))
+        }
+    }
+
+    Overlay.prototype.videoControl = function(state){
+        if(this.overlayType != "video")return
+        var video = this.plane.material.map.image
+        if(!state || state == 'stop'){
+            video.paused || video.pause()
+            if(state == 'stop'){
+                video.currentTime = 0;
+               
+            }
+            video.shouldPlay = false
+            //console.log("pause")
+        }else if(state){ 
+            video.paused && video.play()
+            video.shouldPlay = true
+            //console.log("play")
+        }
+    }     
+    Overlay.prototype.inSight = function(){
+        if(player.mode == 'panorama'){
+            var position = this.plane.getWorldPosition()
+            var pos2d = math.getPos2d(position, player.camera, $("#player")[0])
+            if(pos2d.trueSide && pos2d.inSight){
+                return true
+            }else{ 
+                var cornerPoint = [
+                    new THREE.Vector3(-settings.overlay.width/2, settings.overlay.height/2, 0),
+                    new THREE.Vector3(settings.overlay.width/2, settings.overlay.height/2, 0),
+                    new THREE.Vector3(settings.overlay.width/2, -settings.overlay.height/2, 0),
+                    new THREE.Vector3(-settings.overlay.width/2, -settings.overlay.height/2, 0),
+                ];            
+                for(var i=0;i<4;i++){//只要有一点可见就算看见
+                    cornerPoint[i].applyMatrix4(this.plane.matrixWorld);
+                    var pos2d = math.getPos2d(cornerPoint[i], player.camera, $("#player")[0])
+                    if(pos2d.trueSide && pos2d.inSight){
+                        return true
+                    }
+                }
+            }
+        }else{//飞出要判断模型阻挡,有点耗时就算了
+            return true
         }
-      }
-    } else {
-      return true;
     }
-  };
+    
+    
+    Overlay.prototype.addToLoadQueue = function() {
+        if (this.overlayType == 'photo') {
+            Overlay.loadQueue.includes(this) || Overlay.loadQueue.push(this)
 
-  Overlay.prototype.addToLoadQueue = function() {
-    if (this.overlayType == "photo") {
-      Overlay.loadQueue.includes(this) || Overlay.loadQueue.push(this);
+        }
     }
-  };
-
-  Overlay.prototype.requestDownload = function() {
-    if (this.hasRequestLoad || this.overlayType != "photo") return;
-
-    console.log("overlay beginDownload : " + this.sid);
-    var plane = this.plane;
-
-    plane.material.map = Texture.load(this.file, () => {
-      plane.material.needsUpdate = true;
-      if (this._loadDones) {
-        this._loadDones.forEach((e) => e());
-        this._loadDones = null;
-      }
-      setTimeout(Overlay.loadNext, 50);
-      plane.material.opacity = 1;
-      console.log("overlay loaded: " + this.sid);
-    });
-    plane.material.map.wrapS = plane.material.map.wrapT =
-      THREE.ClampToEdgeWrapping;
-    plane.material.map.minFilter = THREE.LinearFilter;
-    plane.material.map.magFilter = THREE.LinearFilter;
-    plane.material.map.generateMipmaps = true;
-
-    this.hasRequestLoad = true;
-  };
-
-  Overlay.loadQueue = []; //等待下载的overlay,目前只针对photo
-  Overlay.maxLoadingCount = 3; //同时正在load图片的数量
-  Overlay.loadNext = () => {
-    //继续requestDownload  loadQueue中前排的item
-
-    var loadings = player.overlayGroup.children.filter(
-      (e) => e.hasRequestLoad && e._loadDones
-    ); //开始下载了但是没加载好的
-
-    Overlay.loadQueue
-      .slice(0, Overlay.maxLoadingCount - loadings.length)
-      .forEach((e) => e.requestDownload());
-    Overlay.loadQueue.splice(0, Overlay.maxLoadingCount - loadings.length);
-  };
-
-  Overlay.getNeedLoad = function() {
-    //计算获取loadQueue,每次都重新计算,覆盖旧的
-    if (!player || !player.domElement || !player.mode) return;
-
-    if (player.mode != "panorama") {
-      if (!Overlay.loadWhenOutside) return;
-
-      if (Overlay.loadQueue.length == 0) {
-        Overlay.loadQueue = player.overlayGroup.children
-          .filter((e) => !e.hasRequestLoad)
-          .slice(0, 5);
-      }
-
-      return;
+    
+    
+    Overlay.prototype.requestDownload = function() {
+        if (this.hasRequestLoad || this.overlayType != 'photo')
+            return
+
+        console.log('overlay beginDownload : ' + this.sid)
+        var plane = this.plane;
+
+        plane.material.map = Texture.load(this.file, ()=>{
+            
+            if (this._loadDones) {
+                this._loadDones.forEach(e=>e())
+                this._loadDones = null
+            }
+            setTimeout(Overlay.loadNext, 50)
+            plane.material.opacity = 1;
+            console.log('overlay loaded: ' + this.sid)
+            
+            if(this.animateInfo){
+                this.animation = GifTexDeal.addAnimation(plane.material.map, this, this.animateInfo, this.sid )
+                this.visible && this.inSight() && GifTexDeal.start(this.animation)
+            }
+            
+            plane.material.needsUpdate = true
+        })
+        plane.material.map.wrapS = plane.material.map.wrapT = THREE.ClampToEdgeWrapping;
+        plane.material.map.minFilter = THREE.LinearFilter;
+        plane.material.map.magFilter = THREE.LinearFilter;
+        plane.material.map.generateMipmaps = true;
+
+        this.hasRequestLoad = true
     }
-    Overlay.loadWhenOutside = true;
-    var overlays = player.overlayGroup.children.filter(
-      (e) => !e.hasRequestLoad && e.visiblePanos.includes(player.currentPano)
-    );
-    //var maxAngle = THREE.Math.degToRad( cameraLight.getHFOVFromVFOV(70, player.domElement.clientWidth, app.player.domElement.clientHeight) / 2);
-    var cameraDir = player.getDirection();
-
-    /* var maxCount = 5; 
+
+    Overlay.loadQueue = []; //等待下载的overlay,目前只针对photo
+    Overlay.maxLoadingCount = 3; //同时正在load图片的数量
+    Overlay.loadNext = ()=>{//继续requestDownload  loadQueue中前排的item
+
+        var loadings = player.overlayGroup.children.filter(e=>e.hasRequestLoad && e._loadDones)//开始下载了但是没加载好的
+        
+        Overlay.loadQueue.slice(0, Overlay.maxLoadingCount - loadings.length).forEach(e=>e.requestDownload())
+        Overlay.loadQueue.splice(0, Overlay.maxLoadingCount - loadings.length)
+    }
+
+    Overlay.getNeedLoad = function() {//计算获取loadQueue,每次都重新计算,覆盖旧的
+        if (!player || !player.domElement || !player.mode)
+            return;
+
+        if (player.mode != 'panorama') {
+            if (!Overlay.loadWhenOutside)
+                return; 
+
+            if (Overlay.loadQueue.length == 0) {
+                Overlay.loadQueue = player.overlayGroup.children.filter(e=>!e.hasRequestLoad).slice(0, 5);
+            }
+
+            return;
+        }
+        Overlay.loadWhenOutside = true
+        var overlays = player.overlayGroup.children.filter(e=>!e.hasRequestLoad && e.visiblePanos.includes(player.currentPano))
+        //var maxAngle = THREE.Math.degToRad( cameraLight.getHFOVFromVFOV(70, player.domElement.clientWidth, app.player.domElement.clientHeight) / 2);
+        var cameraDir = player.getDirection()
+
+        /* var maxCount = 5; 
         if(overlays.length>maxCount){
             for(var i=0;i<overlays.length;i++){ 
                 //角度为可见范围 
@@ -407,45 +469,42 @@ window.initOverlay = function(THREE) {
                 Overlay.loadQueue.push()
             }
         }else{ */
-    Overlay.loadQueue = overlays;
-    //}
-
-    var request = [
-      (overlay) => {
-        return true;
-      },
-    ];
-    var rank = [
-      (overlay) => {
-        var dis = overlay.plane.getWorldPosition().distanceTo(player.position);
-        return -dis;
-      },
-      (overlay) => {
-        var tagDir = overlay.plane.getWorldPosition().sub(player.position);
-        var angle = tagDir.angleTo(cameraDir);
-        return -angle * 20;
-      },
-    ];
-    var result = common.sortByScore(Overlay.loadQueue, request, rank);
-    Overlay.loadQueue = result
-      ? result.slice(0, 5).map((e) => e.item)
-      : player.overlayGroup.children
-          .filter((e) => !e.hasRequestLoad)
-          .slice(0, 2);
-  };
-
-  Overlay.load = () => {
-    //开始下载图片
-    Overlay.getNeedLoad();
-    Overlay.loadNext();
-    var unloads = player.overlayGroup.children.filter((e) => !e.hasRequestLoad);
-    if (unloads.length) {
-      setTimeout(Overlay.load, 200);
-    } else {
-      Overlay.allRequestLoad = true;
-      console.log("allRequestLoad");
+        Overlay.loadQueue = overlays
+        //} 
+
+        var request = [(overlay)=>{
+            return true
+        }
+        ];
+        var rank = [(overlay)=>{
+            var dis = overlay.plane.getWorldPosition().distanceTo(player.position);
+            return -dis
+        }
+        , (overlay)=>{
+            var tagDir = overlay.plane.getWorldPosition().sub(player.position)
+            var angle = tagDir.angleTo(cameraDir)
+            return -angle * 20
+        }
+        ]
+        var result = common.sortByScore(Overlay.loadQueue, request, rank);
+        Overlay.loadQueue = result ? result.slice(0, 5).map(e=>e.item) : player.overlayGroup.children.filter(e=>!e.hasRequestLoad).slice(0, 2);
+
     }
-  };
 
-  window.Overlay = Overlay;
-};
+    Overlay.load = ()=>{//开始下载图片
+        Overlay.getNeedLoad() 
+        Overlay.loadNext()
+        var unloads = player.overlayGroup.children.filter(e=>!e.hasRequestLoad)
+        if (unloads.length) {
+            setTimeout(Overlay.load, 200)
+        } else {
+            Overlay.allRequestLoad = true
+            console.log('allRequestLoad')
+        }
+    }
+
+    window.Overlay = Overlay;
+
+}
+
+

+ 0 - 20
src/App.vue

@@ -1,20 +0,0 @@
-<template>
-    <router-view/>
-</template>
-
-<script>
-import '@/assets/style/reset.less'
-import '@/assets/style/public.less'
-import '@/assets/theme/color.less'
-
-export default {
-    
-}
-</script>
-<style lang="less">
-html,body{
-    width: 100%;
-    height: 100%;
-    color: #fff;
-}
-</style>

+ 1 - 1
src/assets/style/reset.less

@@ -16,7 +16,7 @@ label,summary{cursor:default;}
 a,button{cursor:pointer;}
 h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:bold;}
 del,ins,u,s,a,a:hover{text-decoration:none;}
-body,textarea,input,button,select,keygen,legend{font:14px/1.14;outline:0;}
+body,textarea,input,button,select,keygen,legend{font-size: 14px;;outline:0;}
 *{box-sizing: border-box}
 a{text-decoration: none;}
 input{  

+ 2 - 1
src/clients/index.js

@@ -8,7 +8,8 @@ Vue.use(Viewer,{
   defaultOptions: {
     navbar:false,
     button:false,
-    maxZoomRatio:2
+    maxZoomRatio:2,
+    title:false
   }
 })
 

+ 2 - 1
src/clients/mobile.js

@@ -9,7 +9,8 @@ Vue.use(Viewer,{
   defaultOptions: {
     navbar:false,
     button:false,
-    maxZoomRatio:2
+    maxZoomRatio:2,
+    title:false
   }
 })
 

+ 1 - 4
src/main.js

@@ -1,7 +1,6 @@
 import Vue from 'vue'
-import App from './App.vue'
+import App from './scene.vue'
 import '@/mixins'
-import router from './router'
 import 'viewerjs/dist/viewer.css'
 import Viewer from 'v-viewer'
 Vue.use(Viewer,{
@@ -16,8 +15,6 @@ Vue.use(Viewer,{
 Vue.config.productionTip = false
 
 
-
 new Vue({
-  router,
   render: h => h(App)
 }).$mount('#app')

+ 24 - 0
src/clients/scene.vue

@@ -0,0 +1,24 @@
+<template>
+    <layout />
+</template>
+
+<script>
+import "@/assets/style/reset.less";
+import "@/assets/style/public.less";
+import "@/assets/theme/color.less";
+import layout from "@/pages/scenePage/index.vue";
+
+export default {
+  components: {
+    layout,
+  },
+};
+</script>
+<style lang="less">
+html,
+body,
+#app {
+  width: 100%;
+  height: 100%;
+}
+</style>

+ 4 - 5
src/components/mapsvg/e.vue

@@ -327,11 +327,10 @@ export default {
       let target = e.target.parentElement;
       let tt = this.data[target.id];
       if (tt) {
-        let { x, y, z, w } = tt.quaternion;
-        window.player.flyToPano({
-          pano: window.player.model.panos.index[tt.id],
-          quaternion: new THREE.Quaternion(x, y, z, w),
-        });
+        this.$bus.$emit('ifrMessage',{
+          events:'flyToPano',
+          data:tt
+        })
       }
     },
   },

+ 4 - 7
src/components/mapsvg/xuting.vue

@@ -191,13 +191,10 @@ export default {
       let target = e.target.parentElement;
       let tt = this.data[target.id];
       if (tt) {
-        let { x, y, z, w } = tt.quaternion;
-        console.log(tt.id);
-        console.log(x, y, z, w);
-        window.player.flyToPano({
-          pano: window.player.model.panos.index[tt.id],
-          quaternion: new THREE.Quaternion(x, y, z, w),
-        });
+        this.$bus.$emit('ifrMessage',{
+          events:'flyToPano',
+          data:tt
+        })
       }
     },
   },

+ 83 - 0
src/data/raw.js

@@ -0,0 +1,83 @@
+
+//展区
+let region = [
+  {
+    id:'A',
+    name:'A区',
+    theme:'#FF9700',//主题颜色
+    desc:'创新创业带动就业量质齐升', //展区简介,
+    company:[1,2,3,4] //对应展位id
+  },
+  {
+    id:'B',
+    name:'B区',
+    theme:'#FF9700',
+    desc:'创新创业促进全民共同富裕',
+    company:[]
+  },
+  {
+    id:'C',
+    name:'C区',
+    theme:'#FF9700',
+    desc:'改革激发创新创业创造活力',
+    company:[]
+    
+  },
+  {
+    id:'D',
+    name:'D区',
+    theme:'#FF9700',
+    desc:'创新创业助力构建新发展格局',
+    company:[]
+  },
+  {
+    id:'E',
+    name:'E区',
+    theme:'#FF9700',
+    desc:'创新创业支撑科技自立自强',
+    company:[]
+  },
+  {
+    id:'xuting',
+    name:'序厅',
+    theme:'#FF9700',
+    desc:'创新创业支撑科技自立自强',
+    company:[]
+  }
+]
+
+// 展位
+let Booth = [
+  {
+    id:1,//从1开始递增
+    name:'“同建共享”理念引领下的“双创”经营模式', // 展位名称
+    panoId: '10', //对应的点位id
+    hotspotVideo: ['video1.mp4','video2.mp4'], //视频名称(不要用中文命名),无视频时字段为空
+    panoQuaternion:{
+      w: -0.48899862433554325,
+      x: -0.020489121201029994,
+      y: 0.8712794101764484,
+      z: -0.036506747279894156
+    }, //展位视角
+    mapId:'xt-s1' //小地图对应的点位id
+  },
+  {
+    id:2,
+    name:'“同建共享”理念引领下的“双创”经营模式',
+    panoId: '11',
+    panoQuaternion:{
+      w: -0.48899862433554325,
+      x: -0.020489121201029994,
+      y: 0.8712794101764484,
+      z: -0.036506747279894156
+    },
+    hotspotVideo: ['video1.mp4','video2.mp4'],
+    mapId:'xt-s1'
+  }
+]
+
+
+export {
+  region,
+  Booth
+}

+ 25 - 68
src/pages/mobilescene/index.vue

@@ -86,89 +86,46 @@ export default {
       loginUrl:''
     };
   },
-  watch: {
-    theme(newVal) {
-      if(newVal=='xuting') {
-        window.player.flyToPano({
-          pano: window.player.model.panos.index[0],
-          quaternion: new THREE.Quaternion(-0.001489144851378805,0.8167267402741333,0.002107772549575186,0.5770188587943806)
-        });
-      }
-
-      if (newVal=='e') {
-        window.player.flyToPano({
-          pano: window.player.model.panos.index[30],
-          quaternion: new THREE.Quaternion(0.028523630856794317, 0.953183703881663, -0.09519870492067249, 0.2855948602103702),
-        });
-      }
-    }
-  },
+ 
   mounted() {
     this.$showLoading()
     this.$nextTick(() => {
       this.$bus.$on('mblogin',data=>{
         this.loginUrl = data
       })
-      window.firstView = ''
-      if(this.theme=='xuting') {
-        window.firstView= 'pano:0,qua:-0.001489144851378805,0.8167267402741333,0.002107772549575186,0.5770188587943806'
-      }
+      window.addEventListener("message", (res) => {
+        if (Object.prototype.toString.call(res.data) == "[object Object]") {
+          let data = res.data.data;
+          if (res.data.source === "showAll") {
+            this.showAll = true;
+            setTimeout(() => {
+              this.$hideLoading();
+            }, 500);
+          }
+
+          if (res.data.source === "onplayStatus") {
+            this.tourStatus = data.tourIsPlaying;
+          }
+
+          if (res.data.source === "flying.ended") {
+            this.currentPanoid = data;
+          }
+
+          if (res.data.source === "openHotspot") {
+            this.hotspot = data;
+            this.$bus.$emit("isShowAside", false);
+          }
+        }
+      });
 
-      if (this.theme=='e') {
-        window.firstView= 'pano:30,qua:0.028523630856794317, 0.953183703881663, -0.09519870492067249, 0.2855948602103702'
-      }
-      if (!window.evt) {
-        window.evt = document.createEvent("HTMLEvents");
-      }
-      window.evt.initEvent("loadfinish", false, false);
-      window.addEventListener("loadfinish", this.start, false);
     });
   },
 
   methods: {
-    getHotSpotList() {
-      $.ajax({
-        url:
-          window.g_Prefix +
-          "data/" +
-          window.number +
-          "/hot/js/data.js" +
-          "?" +
-          Math.random(),
-        type: "get",
-        dataType: "json",
-        contentType: "application/json",
-        success: (result) => {
-          this.hotspots = result;
-        },
-      });
-    },
     handlecp(data) {
       this.cp = data;
       this.showpopup = true;
     },
-    start() {
-      this.showAll = true;
-      setTimeout(() => {
-        this.$hideLoading()
-      });
-      if (window.player) {
-        
-        this.getHotSpotList();
-        //监听导览状态
-        window.player.on("onplayStatus", (data) => {
-          this.tourStatus = data.tourIsPlaying;
-        });
-        window.player.on("flying.ended", (...data) => {
-          console.log('点位id',data[2].id)
-          this.currentPanoid = data[2].id;
-        });
-        window.player.on("openHotspot", (data) => {
-          this.hotspot = this.hotspots[data]
-          this.hotspot.contents = this.hotspot.content ? this.hotspot.content.split('(4dage)') : []
-        });
-      }
-    },
   },
 };
 </script>

+ 4 - 0
src/pages/mobilescene/map.vue

@@ -64,11 +64,15 @@ export default {
     left: -30px;
     top: 0;
     width: 30px;
+    font-size: 0;
     >img{
       &:first-of-type{
         width: 40%;
       }    
       &:last-of-type{
+        position: absolute;
+        top: 50%;
+        transform: translateY(-50%);
         width: 25%;
         margin-left: 5px;
       }

+ 4 - 1
src/pages/mobilescene/menu.vue

@@ -125,7 +125,10 @@ export default {
     },
     toggle() {
       let fn = this.tourStatus ? "stopTour" : "startAndPlay";
-      window[fn]();
+      this.$bus.$emit('ifrMessage',{
+        events:'toggleTour',
+        data:fn
+      })
     },
   },
   mounted() {},

+ 52 - 111
src/pages/mobilescene/scene.vue

@@ -1,127 +1,68 @@
 <template>
-  <div class="parent-body">
-    <!-- 热点 -->
-    <hot />
-    <!-- 热点弹出框 -->
-    <popup />
-    <!-- 加载初始页面 -->
-    <div id="gui-thumb"></div>
-
-    <!-- 主容器 -->
-    <div id="player"></div>
-    <div id="gui-parent">
-      <!-- 进度条加载 -->
-      <gui-loading v-show="false"/>
-      <div id="gui" class="disable">
-        <!-- 退出VR模式按钮 -->
-        <div id="vrOff">
-          <img id="vrOffImg" src="images/vrOffImg.png" alt="" />
-        </div>
-
-        <!-- 热点列表 -->
-        <hotspot-list />
-
-        <!-- 标题 -->
-        <v-title />
-
-        <!-- 底部菜单 -->
-        <v-menu class="disable" />
-
-        <!-- 导览 -->
-        <v-guide class="disable" />
-
-        <!-- logo -->
-        <div
-          id="myCompany"
-          style="width:100%;position:absolute;bottom:20px;text-align:center;font-size:14px;font-family: '微软雅黑';font-weight:580;color: rgba(255, 255, 255, 0.8);"
-        >
-          四维时代提供技术支持
-        </div>
-      </div>
-
-      <!-- vr -->
-      <web-vr />
-
-      <!-- loading -->
-      <div id="gui-spinner" style="display: none;">
-        <div class="gui-spinner-icon"></div>
-      </div>
-
-      <!-- guimsg -->
-      <guimsg />
-
-      <!-- 错误提示 -->
-      <v-error />
-
-      <vr-con />
-
-      <v-other />
-    </div>
+  <div class="scene-body">
+    <iframe
+      ref="ifr"
+      src="scene.html?m=1079"
+      allowfullscreen="true"
+      frameborder="0"
+    ></iframe>
   </div>
 </template>
 
 <script>
-import hot from "./views/hot";
-import popup from "./views/popup";
-import guiLoading from "./views/gui/loading";
-import hotspotList from "./views/gui/hotspotlist";
-import vTitle from "./views/gui/title";
-import vMenu from "./views/gui/menu";
-import vGuide from "./views/gui/guide";
-import webVr from "./views/gui/webvr";
-import guimsg from "./views/gui/guimsg";
-import vError from "./views/gui/error";
-import vrCon from "./views/gui/vrcon";
-import vOther from "./views/gui/other";
-
 export default {
   props: ["tourStatus"],
-  components: {
-    hot,
-    popup,
-    guiLoading,
-    hotspotList,
-    vTitle,
-    vMenu,
-    vGuide,
-    webVr,
-    guimsg,
-    vError,
-    vrCon,
-    vOther,
-  },
-  mounted() {
-    this.starLoad();
-  },
-  methods: {
-    starLoad() {
-      window.number = (this.themes.find(item=>item.id==this.theme)).sceneCode;
-      window.loadMainJs();
-      window.loadMange();
-      window.loadScene();
-    },
-    destroy() {
-      window.hadLoad = true;
-      if (window.player) {
-        window.player.sceneRenderer.suspend();
-        window.player = "";
-        $(".parent-body").remove();
-        $("#player").remove();
+  watch: {
+    theme(newVal) {
+      if (newVal == "xuting") {
+        this.$refs.ifr.contentWindow.postMessage(
+          {
+            source: "changeExhition",
+            data: {
+              quat: [
+                -0.001489144851378805,
+                0.8167267402741333,
+                0.002107772549575186,
+                0.5770188587943806,
+              ],
+              index: 0,
+            },
+          },
+          "*"
+        );
+      }
+
+      if (newVal == "e") {
+        this.$refs.ifr.contentWindow.postMessage(
+          {
+            source: "changeExhition",
+            data: {
+              quat: [
+                0.028523630856794317,
+                0.953183703881663,
+                -0.09519870492067249,
+                0.2855948602103702,
+              ],
+              index: 30,
+            },
+          },
+          "*"
+        );
       }
-    },
-  },
-  beforeDestroy() {
-    this.destroy();
-  },
+    }
+  }
 };
 </script>
 
 <style lang="less" scoped>
-.parent-body {
+.scene-body {
   width: 100%;
-  height: 100%;
-  padding-top: 0;
+  height: 100vh;
   position: relative;
-  overflow-x: hidden;
+  overflow: hidden;
+  > iframe {
+    width: 100%;
+    height: 100%;
+  }
 }
 </style>

+ 0 - 12
src/pages/mobilescene/views/gui/error.vue

@@ -1,12 +0,0 @@
-<template>
-  <div class="gui-error message-outer" style="display: none;">
-            <div class="message-inner">
-                <div class="message-content">
-                    <div class="error-problem-text"></div>
-                    <div class="error-solution-text"></div>
-                    <div class="error-explanation"></div>
-                    <div class="error-actions"></div>
-                </div>
-            </div>
-        </div>
-</template>

+ 0 - 21
src/pages/mobilescene/views/gui/guide.vue

@@ -1,21 +0,0 @@
-<template>
-  <div id="drawer-container">
-                <div id="drawer" class="fullWidth">
-                    <div class="frame-container darkGlass">
-                        <div id="scrollFrame" class="frame">
-                            <ul id="thumb-container" class="slidee"></ul>
-                        </div>
-                        <div class="scrollbar" id="scroller">
-                            <div class="handle"></div>
-                        </div>
-                    </div>
-                </div>
-                <div id="playHead">
-                    <div id="status">
-                        <span class="curIdx">1</span>
-                        of <span class="totalSteps"></span>
-                    </div>
-                    <div id="progressBar"></div>
-                </div>
-            </div>
-</template>

+ 0 - 13
src/pages/mobilescene/views/gui/guimsg.vue

@@ -1,13 +0,0 @@
-<template>
-  <div id="gui-message" class="message-outer darkGlass" style="display: none;">
-            <h2 class="model-title"></h2>
-            <div class="message-inner">
-                <div class="message-content">
-                    <a id="button-play">
-                        <i class="icon icon-play"></i>
-                    </a>
-                    <div class="explore">{[{ EXPLORE_3D_SPACE }]}</div>
-                </div>
-            </div>
-        </div>
-</template>

+ 0 - 17
src/pages/mobilescene/views/gui/hotspotlist.vue

@@ -1,17 +0,0 @@
-<template>
-  <div id="hotListWrap">
-      <div id="hotListTitle">
-          <div>
-              <span id="hotListText">热点列表</span>
-              <img id="hotListIcon" src="images/hotlist.png" alt="">
-          </div>
-      </div>
-      <div id="hotListContent">
-          <ul>
-          </ul>
-      </div>
-      <div id="hotListBottom">
-          <img id="hotListClose" src="images/hotListClose.png" alt="">
-      </div>
-  </div>
-</template>

+ 0 - 35
src/pages/mobilescene/views/gui/loading.vue

@@ -1,35 +0,0 @@
-<template>
-  <div id="gui-loading" class="message-outer darkGlass" style="display: none;">
-            <h2 class="model-title"></h2>
-            <div class="message-inner">
-                <div class="loadingLogo"> 
-                    <div class="img"> 
-                    </div> 
-                </div> 
-                <div class="progressbar" data-perc="100">
-                    <div class="label">
-                        <div class="perc">0%</div>
-                    </div>
-                    <div class="bar"><span></span></div>
-                </div>
-                <div id="loaderCoBrand">
-                    <div class="vert-align">
-                        <h2 id="loaderCoBrandName">四维时代提供技术支持</h2>
-                    </div>
-                </div>
-                <div class="bottom-logo">
-                    <div class="img"></div>
-                </div>
-                <div class="specialPower">
-                    <span class="powered-by">{[{ POWERED_BY }]}</span>
-                    &#xA0;<div class="img"></div>
-                </div>
-            </div>
-        </div>
-</template>
-
-<style lang="less" scoped>
-#gui-loading{
-    opacity: 0!important;
-}
-</style>

+ 0 - 292
src/pages/mobilescene/views/gui/menu.vue

@@ -1,292 +0,0 @@
-<template>
-  <div class="pinBottom-container">
-    <div class="pinBottom center">
-      <div id="view-controllers"></div>
-    </div>
-    <div class="pinBottom left">
-      <div>
-        <div class="viewContainer">
-          <div
-            id="previous"
-            class="previous desktop-only ui-icon"
-            style="display: none"
-          >
-            <a>
-              <img
-                rel="tooltip"
-                title=""
-                :src="require('@/assets/images/play.png')"
-                width="24"
-                height="24"
-                data-original-title="播放"
-              />
-            </a>
-          </div>
-          <div
-            id="play"
-            class="ui-icon"
-            rel="tooltip"
-            data-original-title="播放"
-          >
-            <a>
-              <img
-                title=""
-                :src="require('@/assets/images/play.png')"
-                width="24"
-                height="24"
-              />
-            </a>
-          </div>
-          <div id="pause" class="ui-icon" style="display: none">
-            <a>
-              <img
-                rel="tooltip"
-                title=""
-                :src="require('@/assets/images/pause.png')"
-                width="24"
-                height="24"
-                data-original-title="暂停"
-              />
-            </a>
-          </div>
-          <div
-            id="next"
-            class="next desktop-only ui-icon wide"
-            style="display: none"
-          >
-            <a>
-              <i
-                rel="tooltip"
-                title=""
-                class="icon icon-dpad-right"
-                data-original-title="下一个"
-              ></i>
-            </a>
-          </div>
-          <div id="gui-modes-map" class="ui-icon double active">
-            <div
-              data-original-title="导览"
-              @click="isGuide = !isGuide"
-              id="pullTab"
-              rel="tooltip"
-              title=""
-            >
-              <img
-                class="icon icon-inside"
-                :src="
-                  require(`@/assets/images/auto${
-                    !isGuide ? '_active' : ''
-                  }.png`)
-                "
-                title="navigation icon"
-              />
-            </div>
-            
-            <div
-              data-original-title="全景漫游"
-              id="gui-modes-inside"
-              rel="tooltip"
-            >
-              <img
-                class="icon icon-inside"
-                :src="require('@/assets/images/inside.png')"
-                title="navigation icon"
-              />
-              <img
-                class="icon icon-inside active"
-                :src="require('@/assets/images/inside_active.png')"
-                title="navigation icon"
-              />
-            </div>
-            <div
-              data-original-title="迷你模型"
-              id="gui-modes-dollhouse"
-              rel="tooltip"
-            >
-              <img
-                class="icon icon-inside"
-                :src="require('@/assets/images/dollhouse.png')"
-                title="navigation icon"
-              />
-              <img
-                class="icon icon-inside active"
-                :src="require('@/assets/images/dollhouse_active.png')"
-                title="navigation icon "
-              />
-            </div>
-            <div
-              data-original-title="俯视图"
-              id="gui-modes-floorplan"
-              rel="tooltip"
-              title=""
-            >
-              <img
-                class="icon icon-inside"
-                :src="require('@/assets/images/floor.png')"
-                title="navigation icon"
-              />
-              <img
-                class="active icon icon-inside active"
-                :src="require('@/assets/images/floor_active.png')"
-                title="navigation icon"
-              />
-            </div>
-            <div
-              data-original-title="VR"
-              id="vr"
-              rel="tooltip"
-              title=""
-              style="display: none"
-            >
-              <img
-                class="icon icon-inside"
-                :src="require('@/assets/images/VR.png')"
-                title="navigation icon"
-              />
-            </div>
-            <div
-              data-original-title="热点列表"
-              id="hotList"
-              rel="tooltip"
-              title=""
-              style="display: none"
-            >
-              <img
-                class="icon icon-inside"
-                :src="require('@/assets/images/hotlist.png')"
-                title="navigation icon"
-              />
-              <img
-                class="icon icon-inside active"
-                :src="require('@/assets/images/hotlist.png')"
-                title="navigation icon"
-              />
-            </div>
-            <div
-              data-original-title="消除外壳"
-              id="gui-remove-face"
-              rel="tooltip"
-              title=""
-              style="display: none; float: left"
-            >
-              <img
-                class="icon icon-inside"
-                :src="require('@/assets/images/face.jpg')"
-                title="navigation icon"
-              />
-            </div>
-          </div>
-        </div>
-
-      </div>
-    </div>
-
-
-    <div class="pinBottom right hideTarget">
-      <div class="rightViewContainer clearfix">
-        <div class="gui-floor">
-          <div class="gui-floor-title"></div>
-          <div class="gui-floor-icon">
-            <span class="gui-floor-number"></span>
-          </div>
-          <div class="container"></div>
-        </div>
-        <div id="volume" class="ui-icon wide">
-          <a>
-            <img
-              :src="require('@/assets/images/Volume btn_on.png')"
-              width="24"
-              height="24"
-            />
-          </a>
-        </div>
-        <div id="vr" class="ui-icon wide hidden" style="display: none">
-          <a>
-            <i
-              rel="tooltip"
-              title="{[{ VIEW_IN_VR }]}"
-              class="icon icon-webvr"
-            ></i>
-          </a>
-        </div>
-        <div id="sharing" class="ui-icon wide hidden" style="display: none">
-          <a>
-            <i
-              rel="tooltip"
-              title="{[{ SOCIAL_SHARING }]}"
-              class="icon icon-share"
-            ></i>
-          </a>
-        </div>
-        <div
-          id="gui-fullscreen"
-          class="ui-icon wide"
-          data-placement="top"
-          rel="tooltip"
-          title="{[{ VIEW_FULLSCREEN }]}"
-        >
-          <a>
-            <i class="icon icon-fullscreen"></i>
-          </a>
-        </div>
-        <div
-          id="gui-fullscreen-exit"
-          class="ui-icon wide"
-          data-placement="top"
-          rel="tooltip"
-          title="{[{ EXIT_FULLSCREEN }]}"
-          style="display: none"
-        >
-          <a>
-            <i class="icon icon-fullscreen-exit"></i>
-          </a>
-        </div>
-        <div class="pull-right terms terms2">
-          <a>{[{ TERMS }]}</a>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-
-export default {
-  components:{
-  },
-  data() {
-    return {
-      isGuide: true,
-     
-    };
-  },
-  computed: {
-   
-  },
-  methods: {
-  
-  },
-};
-</script>
-
-<style lang="less" scoped>
-#gui-modes-map {
-  > div {
-    > img {
-      display: block;
-    }
-    .active {
-      display: none;
-    }
-  }
-  .active {
-    > img {
-      display: block;
-    }
-    .active {
-      display: none;
-    }
-  }
-}
-
-</style>

+ 0 - 81
src/pages/mobilescene/views/gui/other.vue

@@ -1,81 +0,0 @@
-<template>
-  <div>
-    <div id="share-modal" style="display: none">
-      <div class="title">{[{ SOCIAL_SHARING }]}</div>
-      <div id="share-outer">
-        <div class="share-to">{[{ SHARE_TO }]}</div>
-        <div class="share-images">
-          <a id="facebook-share">
-            <div class="share-button">
-              <span class="faceBookLink">
-                <i class="icon icon-facebook"></i>
-              </span>
-            </div>
-          </a>
-          <a id="twitter-share">
-            <div class="share-button">
-              <span class="twitterLink">
-                <i class="icon icon-twitter"></i>
-              </span>
-            </div>
-          </a>
-          <a id="mail-share">
-            <div class="share-button">
-              <span class="mailLink">
-                <i class="icon icon-email"></i>
-              </span>
-            </div>
-          </a>
-        </div>
-        <div class="direct-link">{[{ SHARE_LINK }]}</div>
-        <div id="share-url">
-          <span id="share-url-text"></span>
-        </div>
-        <div id="copy-success" class="hidden">
-          <span id="copy-success-text">{[{ SHARE_COPIED }]}</span>
-        </div>
-      </div>
-      <div id="share-close" class="close">
-        <i class="icon icon-close"></i>
-      </div>
-    </div>
-    <div id="terms-modal" class="fadeOut" style="display: none">
-      <div id="terms-text"></div>
-      <div class="close">
-        <a>
-          <i class="icon icon-close"></i>
-        </a>
-      </div>
-    </div>
-    <div id="quick-blackout" class="quick" style="display: none"></div>
-    <div id="quick-logo" class="quick-brand" style="display: none"></div>
-    <div id="hover-top" class="hover-row" style="display: none"></div>
-    <div id="hover-bottom" class="hover-row" style="display: none"></div>
-    <div id="call-to-action">
-      <div id="pause-overlay" style="display: none">
-        <div id="pause-icon">
-          <a>
-            <i class="icon icon-pause"></i>
-          </a>
-        </div>
-      </div>
-      <div id="interaction-modal">
-        <div id="interaction-modal-inner">
-          <div class="nav-icon">
-            <img
-              :src="require('@/assets/images/pc_step1.png')"
-              class="icon"
-              title="navigation icon"
-              data-page="1"
-            />
-            <div class="nav-help-button">
-              <div class="next-button nav-help-page" data-id="plus"></div>
-              <div class="prev-button nav-help-page"></div>
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-    <div id="tag-billboards" style="display: none"></div>
-  </div>
-</template>

+ 0 - 77
src/pages/mobilescene/views/gui/title.vue

@@ -1,77 +0,0 @@
-<template>
-  <div class="pinTop left">
-                <div id="model-title">
-                    <div class="title-row">
-                        <div id="title-toggle">
-                            <a>
-                                <i class="icon icon-dpad-left"></i>
-                            </a>
-                        </div>
-                        <div id="title-container-wrapper" rel="tooltip" data-placement="bottom" data-html="true">
-                            <div class="title-container  meta-toggle">
-                                <div class="co-brand">
-                                    {[{ PRESENTED_BY }]}<span class="title" id="cobrandTitle"></span>
-                                </div>
-                                <div id="title-logo">
-                                    <i></i>
-                                </div>
-                                <div id="gui-name" class="titleText"></div>
-                                <a id="more-hint"><i class="icon icon-dpad-down"></i></a>
-                                <a id="less-hint"><i class="icon icon-dpad-up"></i></a>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div id="meta-info-wrapper">
-                    <div id="meta-info" class="darkGlass">
-                        <div id="meta-description"></div>
-                        <div class="contact-info">
-                            <i class="icon icon-user pull-left"></i>
-                            &#xA0;<div id="contact-data"></div>
-                        </div>
-                        <div class="address">
-                            <i class="icon icon-pin"></i>
-                            <span id="addressTxt"></span>
-                        </div>
-                        <div id="tag-toggles" class="menu-toggles hidden">
-                            <span>{[{ MATTERTAG_CONTENT }]}</span>
-                            <div id="tag-inputs" class="menu-radios">
-                                <div id="show-tag" class="menu-radio-show">
-                                    <input id="radio-tag-show" type="radio" name="tags" value="show">
-                                    <label for="radio-tag-show">{[{ SHOW }]}</label>
-                                </div>
-                                <div id="hide-tag" class="menu-radio-hide">
-                                    <input id="radio-tag-hide" type="radio" name="tags" value="hide">
-                                    <label for="radio-tag-hide">{[{ HIDE }]}</label>
-                                </div>
-                            </div>
-                        </div>
-                        <div id="labels-toggles" class="menu-toggles hidden">
-                            <span>Labels</span>
-                            <div id="labels-inputs" class="menu-radios">
-                                <div id="show-label" class="menu-radio-show">
-                                    <input id="radio-labels-show" type="radio" name="labels" value="show">
-                                    <label for="radio-labels-show">Show</label>
-                                </div>
-                                <div id="hide-label" class="menu-radio-hide">
-                                    <input id="radio-labels-hide" type="radio" name="labels" value="hide">
-                                    <label for="radio-labels-hide">Hide</label>
-                                </div>
-                            </div>
-                        </div>
-                        <div id="share-origin" class="hidden">
-                            <hr>
-                            <div>
-                                <i class="icon icon-ext-link"></i>
-                                <div id="share-link-wrapper"></div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-</template>
-<script>
-export default {
-  
-}
-</script>

+ 0 - 257
src/pages/mobilescene/views/gui/vrcon.vue

@@ -1,257 +0,0 @@
-<template>
-  <div>
-    <div id="help-dialog" class="nav-help-dialog" style="display: none;">
-            <div class="nav-help-elements">
-                <div class="help-tabs">
-                    <div class="navigation-tab">
-                        <span>{[{ HELP_NAVIGATION_TAB }]}</span>
-                    </div>
-                    <div class="more-help-tab">
-                        <span>{[{ HELP_MORE_HELP_TAB }]}</span>
-                    </div>
-                </div>
-            </div>
-            <div id="navigation-help-wrapper">
-                <div id="navigation-help" class="help outer">
-                    <div class="interactions left">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <hr>
-                        <div class="bottom-info"></div>
-                        <img class="keyboard">
-                    </div>
-                    <div class="interactions middle">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <hr>
-                        <div class="bottom-info"></div>
-                        <img class="keyboard">
-                    </div>
-                    <div class="interactions right">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <hr>
-                        <div class="bottom-info"></div>
-                        <img class="keyboard">
-                    </div>
-                </div>
-            </div>
-            <div id="more-help-wrapper">
-                <div id="more-help">
-                    <div class="ui-instructions more-help-hlr">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-tour">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-dollhouse">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-inside">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-360">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-floors">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-tag">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-vr">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-fullscreen">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                    <div class="ui-instructions more-help-zoom">
-                        <h2 class="top-info"></h2>
-                        <img class="big-image">
-                        <div class="bottom-info"></div>
-                    </div>
-                </div>
-            </div>
-            <div class="close">
-                <a>
-                    <i class="icon icon-close"></i>
-                </a>
-            </div>
-        </div>
-        <div id="vr-modal" class="vr-popup" style="display: none;">
-            <div class="title">{[{ VR_VIEW_SPACE }]}</div>
-            <div class="outer">
-                <div class="inner">
-                    <h3 class="vr-popup-title">
-                        <span class="show-supported p1">
-                            <p class="center">{[{ VR_SHOW_SUPPORTED }]}</p>
-                        </span>
-                        <span class="show-unsupported p1">{[{ VR_SHOW_UNSUPPORTED }]}</span>
-                        <span class="show-ios p1">
-                            {[{ VR_SHOW_IOS_1 }]}<br>
-                            <br>
-                        </span>
-                        <span class="show-ios p2">{[{ VR_WHAT_YOU_NEED }]}</span>
-                    </h3>
-                    <div class="vr-images">
-                        <div class="img-container cardboard first">
-                            <img class="vr-sm-image first">
-                            <div class="vr-img-caption first">
-                                <span class="show-supported show-desktop show-ios p1">
-                                    <b class="cardboard">{[{ VR_GOOGLE_CARDBOARD }]}</b>
-                                    <b class="gearvr hidden">{[{ VR_SAMSUNG_GEAR_VR }]}</b>
-                                </span>
-                                <span class="show-supported show-unsupported show-desktop p2">{[{ VR_NEED_CARDBOARD
-                                    }]}</span>
-                                <span class="show-supported show-unsupported show-desktop p3">{[{ VR_NEED_SAMSUNG
-                                    }]}</span>
-                                <span class="show-ios p2">
-                                    <b>{[{ VR_GOOGLE_CARDBOARD }]}</b>
-                                    <br>
-                                    <br>
-                                </span>
-                            </div>
-                        </div>
-                        <div class="front-close">
-                            <span class="front-close-x">&#x2715;</span>
-                        </div>
-                        <div class="img-container gearvr second">
-                            <img class="vr-sm-image second">
-                            <div class="vr-img-caption second">
-                                <span class="show-supported show-desktop p1">
-                                    <b>{[{ VR_SAMSUNG_GEAR_VR }]}</b>
-                                </span>
-                                <span class="show-supported p2">
-                                    <p>
-                                        <b>{[{ VR_COMPATIBLE_ANDROID }]}</b>
-                                    </p>
-                                    <p>{[{ VR_ANDROID_DETAIL }]}</p>
-                                </span>
-                                <span class="show-desktop p2">
-                                    <p>
-                                        <b>{[{ VR_COMPATIBLE_IPHONES_1 }]}</b>
-                                    </p>
-                                    <p>{[{ VR_COMPATIBLE_IPHONES_2 }]}</p>
-                                </span>
-                                <span class="show-ios p2">
-                                    <p>
-                                        <b b id="vr-compatible-iphones-3">{[{ VR_COMPATIBLE_IPHONES_3 }]}</b>
-                                    </p>
-                                    <p id="vr-compatible-iphones-2b">{[{ VR_COMPATIBLE_IPHONES_2 }]}</p>
-                                </span>
-                                <span class="show-unsupported p1 p2">
-                                    <p>
-                                        <b>{[{ VR_COMPATIBLE_ANDROID }]}</b>
-                                    </p>
-                                    <p>{[{ VR_ANDROID_DETAIL }]}</p>
-                                </span>
-                                <span class="show-supported show-unsupported show-desktop p3">
-                                    <p>
-                                        <b>{[{ VR_COMPATIBLE_SAMSUNG }]}</b>
-                                    </p>
-                                    <p>{[{ VR_SAMSUNG_DETAIL }]}</p>
-                                </span>
-                            </div>
-                        </div>
-                        <div class="img-container third">
-                            <img class="vr-sm-image third">
-                            <div class="vr-img-caption third">
-                                <span class="show-supported show-unsupported show-ios p2">
-                                    <p>
-                                        <b>{[{ VR_APP_FOR_CARDBOARD }]}</b>
-                                    </p>
-                                    <p>
-                                        <a class="cardboardLink">{[{ VR_DOWNLOAD_HERE }]}</a>
-                                    </p>
-                                </span>
-                                <span class="show-desktop p2">
-                                    <p>
-                                        <b>{[{ VR_ANDROID_DVICES }]}</b>
-                                    </p>
-                                    <p>{[{ VR_ANDROID_DETAIL }]}</p>
-                                </span>
-                                <span class="show-supported show-unsupported p3">
-                                    <p>
-                                        <b>{[{ VR_APP_FOR_SAMSUNG }]}</b>
-                                    </p>
-                                    <p>
-                                        <a class="gearLink">{[{ VR_DOWNLOAD_HERE }]}</a>
-                                    </p>
-                                </span>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="vr-popup-body">
-                        <span class="show-supported p1">
-                            <p>
-                                <i>{[{ VR_REQUIRE_HEADSET }]}</i>
-                            </p>
-                            <br>
-                            <p>
-                                <i>{[{ VR_REDIRECT_TO_STORE }]}</i>
-                            </p>
-                            <br>
-                            <p class="improper-embed hidden">
-                                <i>{[{ VR_IMPROPER_EMBED }]}</i>
-                            </p>
-                        </span>
-                        <span class="show-ios p1">
-                            <p>
-                                <i id="show-ios-2">{[{ VR_SHOW_IOS_2 }]}</i>
-                            </p>
-                        </span>
-                        <span class="show-desktop p1">
-                            <p></p>
-                            <h3>{[{ VR_OPEN_ANDROID_LINK }]}</h3>
-                            <p>
-                                <br>
-                            </p>
-                            <p class="logo-button">
-                                <span class="modelLink"></span>
-                            </p>
-                            <br>
-                            <br>
-                            <p></p>
-                            <h3>{[{ VR_ANDROID_OPTIONS }]}</h3>
-                            <p></p>
-                        </span>
-                    </div>
-                </div>
-                <div class="vr-buttons">
-                    <div class="next-button"></div>
-                    <div class="prev-button">{[{ VR_PREVIOUS_CAPS }]}</div>
-                    <div class="vr-arrows prev-container">
-                        <!-- <img class="prev-arrow" src="images/arrow.png"> -->
-                    </div>
-                    <div class="vr-arrows next-container">
-                        <!-- <img class="next-arrow" src="images/arrow.png"> -->
-                    </div>
-                </div>
-                <div class="vr-page"></div>
-                <div class="close">
-                    <a>
-                        <i class="icon icon-close"></i>
-                    </a>
-                </div>
-            </div>
-        </div>
-  </div>
-</template>

+ 0 - 61
src/pages/mobilescene/views/gui/webvr.vue

@@ -1,61 +0,0 @@
-<template>
-  <div class="webvr-popup" style="display:none">
-            <div class="messaging">
-                <div class="page p1">
-                    <div class="title">{[{ WEBVR_FOR_DAYDREAM }]}</div>
-                    <img class="image device-headset-side">
-                    <div class="enter-button">{[{ WEBVR_ENTER_WEBVR }]}</div>
-                    <span class="hrule"></span>
-                    <div class="alt-help">
-                        <span class="open-with-app">{[{ VR_APP_OPEN }]}</span>
-                    </div>
-                </div>
-                <div class="page p2 hidden">
-                    <div class="title">{[{ VR_WHAT_YOU_NEED }]}</div>
-                    <ul class="tabs">
-                        <li class="tabbutton" id="tabcardboard">{[{ VR_GOOGLE_CARDBOARD }]}</li>
-                        <li class="tabbutton" id="tabdaydream">{[{ VR_GOOGLE_DAYDREAM }]}</li>
-                        <li class="tabbutton" id="tabnative">{[{ VR_APP }]}</li>
-                    </ul>
-                    <div class="tab-content webvr">
-                        <img class="image device-headset">
-                        <span class="detail headset">
-                            <u>{[{ VR_GOOGLE_CARDBOARD }]}</u>
-                        </span>
-                        <img class="image device-phone">
-                        <span class="detail phone">
-                            <p>
-                                <b>
-                                    <u>{[{ VR_COMPATIBLE_ANDROID }]}</u>
-                                </b>
-                            </p>
-                            <p>{[{ VR_ANDROID_DETAIL }]}</p>
-                        </span>
-                        <div class="detail daydream-label">{[{ VR_NEED_DAYDREAM }]}</div>
-                    </div>
-                    <div class="tab-content native hidden">
-                        <div class="badge-label">{[{ VR_APP_FOR_ANDROID }]}</div>
-                        <span>
-                            <img class="image badge-cardboard">
-                            <img class="image badge-oculus">
-                        </span>
-                    </div>
-                </div>
-            </div>
-            <div class="close">
-                <a>
-                    <i class="icon icon-close"></i>
-                </a>
-            </div>
-            <div class="footer">
-                <div class="help">
-                    <a>{[{ HELP }]}</a>
-                </div>
-                <div>|</div>
-                <div class="terms">
-                    <a>{[{ MATTERPORT_TERMS }]}</a>
-                </div>
-                <!-- <img src="images/glyph.svg"> -->
-            </div>
-        </div>
-</template>

+ 0 - 10
src/pages/mobilescene/views/hot/index.vue

@@ -1,10 +0,0 @@
-<template>
-   <div id="hot"> 
-    </div>
-</template>
-
-<script>
-export default {
-  
-}
-</script>

+ 0 - 12
src/pages/mobilescene/views/popup/index.vue

@@ -1,12 +0,0 @@
-<template>
-  <div id="popup">
-        <div class="popup-content"></div>
-        <div id="closepop">close</div>
-    </div>
-</template>
-
-<script>
-export default {
-  
-}
-</script>

+ 1 - 0
src/pages/scene/aside.vue

@@ -172,6 +172,7 @@ export default {
         position: relative;
         overflow: hidden;
         border: 3px solid transparent;
+        font-size: 0;
         >img{
           width: 100%;
         }

+ 86 - 93
src/pages/scene/index.vue

@@ -1,7 +1,15 @@
 <template>
   <div :class="`theme${theme}`" class="scene-body">
     <div class="scene-con" v-show="showAll">
-      <vside @currentPano="data=>{currentPano=data}" v-show="!tourStatus" :currentPanoid="currentPanoid" />
+      <vside
+        @currentPano="
+          (data) => {
+            currentPano = data;
+          }
+        "
+        v-show="!tourStatus"
+        :currentPanoid="currentPanoid"
+      />
       <vmenu :tourStatus="tourStatus" @opencp="handlecp" />
       <scene :tourStatus="tourStatus" v-if="showScene" />
       <div class="vright">
@@ -19,10 +27,15 @@
       </div>
     </div>
 
-    <vhotspot v-if="hotspot" @close="hotspot=''" :hotspot='hotspot'/>
+    <vhotspot v-if="hotspot" @close="hotspot = ''" :hotspot="hotspot" />
     <vpopup v-if="showpopup && cp">
       <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"
@@ -51,6 +64,24 @@ import qrcode from "./components/qrcode.vue";
 import scene from "./scene.vue";
 import vhotspot from "@/components/hotspot/index.vue";
 
+let exitFullscreen = function() {
+  document.exitFullscreen
+    ? document.exitFullscreen()
+    : document.msExitFullscreen
+    ? document.msExitFullscreen()
+    : document.mozCancelFullScreen
+    ? document.mozCancelFullScreen()
+    : document.webkitExitFullscreen && document.webkitExitFullscreen();
+};
+let requestFullscreen = function(e) {
+  e.requestFullscreen
+    ? e.requestFullscreen()
+    : e.mozRequestFullScreen
+    ? e.mozRequestFullScreen()
+    : e.webkitRequestFullscreen
+    ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
+    : e.msRequestFullscreen && e.msRequestFullscreen();
+};
 
 export default {
   components: {
@@ -62,7 +93,7 @@ export default {
     vcontent: content,
     scene,
     vsearch,
-    vhotspot
+    vhotspot,
   },
   data() {
     return {
@@ -72,116 +103,78 @@ export default {
       showAll: false,
       showScene: true,
       currentPanoid: "",
-      currentPano:{},
+      currentPano: {},
       isFull: false,
       hotspots: [],
-      hotspot:''
+      hotspot: "",
     };
   },
-  computed:{
-    currentItem(){
-      return (this.themes.find(item=>item.id==this.theme));
-    }
+  computed: {
+    currentItem() {
+      return this.themes.find((item) => item.id == this.theme);
+    },
   },
-  watch: {
-    theme(newVal) {
-      if(newVal=='xuting') {
-        window.player.flyToPano({
-          pano: window.player.model.panos.index[0],
-          quaternion: new THREE.Quaternion(-0.001489144851378805,0.8167267402741333,0.002107772549575186,0.5770188587943806)
-        });
-      }
 
-      if (newVal=='e') {
-        window.player.flyToPano({
-          pano: window.player.model.panos.index[30],
-          quaternion: new THREE.Quaternion(0.028523630856794317, 0.953183703881663, -0.09519870492067249, 0.2855948602103702),
-        });
-      }
-    }
-  },
   mounted() {
-    this.$showLoading()
-
+    this.$showLoading();
     this.$nextTick(() => {
-      window.firstView = ''
-      if(this.theme=='xuting') {
-        window.firstView= 'pano:0,qua:-0.001489144851378805,0.8167267402741333,0.002107772549575186,0.5770188587943806'
-      }
+      window.addEventListener("message", (res) => {
+        if (Object.prototype.toString.call(res.data) == "[object Object]") {
+          let data = res.data.data;
+          if (res.data.source === "showAll") {
+            this.showAll = true;
+            setTimeout(() => {
+              this.$hideLoading();
+            }, 500);
+          }
 
-      if (this.theme=='e') {
-        window.firstView= 'pano:30,qua:0.028523630856794317, 0.953183703881663, -0.09519870492067249, 0.2855948602103702'
-      }
+          if (res.data.source === "onplayStatus") {
+            this.tourStatus = data.tourIsPlaying;
+          }
 
-      $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", ()=> {
-        this.isFull = !!(document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement)
-      })
-      if (!window.evt) {
-        window.evt = document.createEvent("HTMLEvents");
-      }
-      window.evt.initEvent("loadfinish", false, false);
-      window.addEventListener("loadfinish", this.start, false);
+          if (res.data.source === "flying.ended") {
+            this.currentPanoid = data;
+          }
+
+          if (res.data.source === "openHotspot") {
+            this.hotspot = data;
+            this.$bus.$emit("isShowAside", false);
+          }
+        }
+      });
+
+      $(document).on(
+        "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",
+        () => {
+          this.isFull = !!(
+            document.fullscreenElement ||
+            document.mozFullscreenElement ||
+            document.mozFullScreenElement ||
+            document.webkitFullscreenElement ||
+            document.msFullscreenElement
+          );
+        }
+      );
+   
     });
   },
   beforeDestroy() {
-    $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange")
-    window.removeEventListener("loadfinish", this.start, false);
+    $(document).on(
+      "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange"
+    );
   },
   methods: {
-    getHotSpotList() {
-      $.ajax({
-        url:
-          window.g_Prefix +
-          "data/" +
-          window.number +
-          "/hot/js/data.js" +
-          "?" +
-          Math.random(),
-        type: "get",
-        dataType: "json",
-        contentType: "application/json",
-        success: (result) => {
-          this.hotspots = result;
-        },
-      });
-    },
     handleFull() {
       if (this.isFull) {
-        $("#gui-fullscreen-exit")
-          .find("a")
-          .click();
+        exitFullscreen();
       } else {
-        $("#gui-fullscreen")
-          .find("a")
-          .click();
+        requestFullscreen($("html")[0]);
       }
     },
     handlecp(data) {
       this.cp = data;
       this.showpopup = true;
-      this.$bus.$emit('isShowAside',false)
-    },
-    start() {
-      this.showAll = true;
-      setTimeout(() => {
-        this.$hideLoading()
-      },500);
-      if (window.player) {
-        
-        this.getHotSpotList();
-        //监听导览状态
-        window.player.on("onplayStatus", (data) => {
-          this.tourStatus = data.tourIsPlaying;
-        });
-        window.player.on("flying.ended", (...data) => {
-          this.currentPanoid = data[2].id;
-        });
-        window.player.on("openHotspot", (data) => {
-          this.hotspot = this.hotspots[data]
-          this.hotspot.contents = this.hotspot.content ? this.hotspot.content.split('(4dage)') : []
-          this.$bus.$emit('isShowAside',false)
-        });
-      }
+      this.$bus.$emit("isShowAside", false);
     },
   },
 };
@@ -233,14 +226,14 @@ export default {
     }
   }
 
-  .mascot{
+  .mascot {
     position: fixed;
     bottom: 0;
     right: 0;
     z-index: 899;
     width: 330px;
     pointer-events: none;
-    >img{
+    > img {
       width: 100%;
     }
   }

+ 4 - 1
src/pages/scene/menu.vue

@@ -108,7 +108,10 @@ export default {
     },
     toggle(){
       let fn = this.tourStatus?'stopTour':'startAndPlay'
-      window[fn]()
+      this.$bus.$emit('ifrMessage',{
+        events:'toggleTour',
+        data:fn
+      })
     }
   },
   mounted(){

+ 74 - 106
src/pages/scene/scene.vue

@@ -1,127 +1,95 @@
 <template>
-  <div class="parent-body">
-    <!-- 热点 -->
-    <hot />
-    <!-- 热点弹出框 -->
-    <popup />
-    <!-- 加载初始页面 -->
-    <div id="gui-thumb"></div>
-
-    <!-- 主容器 -->
-    <div id="player"></div>
-    <div id="gui-parent">
-      <!-- 进度条加载 -->
-      <gui-loading v-show="false"/>
-      <div id="gui" class="disable">
-        <!-- 退出VR模式按钮 -->
-        <div id="vrOff">
-          <img id="vrOffImg" src="images/vrOffImg.png" alt="" />
-        </div>
-
-        <!-- 热点列表 -->
-        <hotspot-list />
-
-        <!-- 标题 -->
-        <v-title />
-
-        <!-- 底部菜单 -->
-        <v-menu class="disable" />
-
-        <!-- 导览 -->
-        <v-guide class="disable" />
-
-        <!-- logo -->
-        <div
-          id="myCompany"
-          style="width:100%;position:absolute;bottom:20px;text-align:center;font-size:14px;font-family: '微软雅黑';font-weight:580;color: rgba(255, 255, 255, 0.8);"
-        >
-          四维时代提供技术支持
-        </div>
-      </div>
-
-      <!-- vr -->
-      <web-vr />
-
-      <!-- loading -->
-      <div id="gui-spinner" style="display: none;">
-        <div class="gui-spinner-icon"></div>
-      </div>
-
-      <!-- guimsg -->
-      <guimsg />
-
-      <!-- 错误提示 -->
-      <v-error />
-
-      <vr-con />
-
-      <v-other />
-    </div>
+  <div class="scene-body">
+    <iframe
+      ref="ifr"
+      :src="`scene.html?m=1079${firstView[viewId]}`"
+      allowfullscreen="true"
+      frameborder="0"
+    ></iframe>
   </div>
 </template>
 
 <script>
-import hot from "./views/hot";
-import popup from "./views/popup";
-import guiLoading from "./views/gui/loading";
-import hotspotList from "./views/gui/hotspotlist";
-import vTitle from "./views/gui/title";
-import vMenu from "./views/gui/menu";
-import vGuide from "./views/gui/guide";
-import webVr from "./views/gui/webvr";
-import guimsg from "./views/gui/guimsg";
-import vError from "./views/gui/error";
-import vrCon from "./views/gui/vrcon";
-import vOther from "./views/gui/other";
-
 export default {
   props: ["tourStatus"],
-  components: {
-    hot,
-    popup,
-    guiLoading,
-    hotspotList,
-    vTitle,
-    vMenu,
-    vGuide,
-    webVr,
-    guimsg,
-    vError,
-    vrCon,
-    vOther,
+  data(){
+    return {
+      firstView: {
+        xuting:
+          "&firstView=pano:0,qua:-0.001489144851378805,0.8167267402741333,0.002107772549575186,0.5770188587943806",
+        e:
+          "&firstView=pano:30,qua:0.028523630856794317, 0.953183703881663, -0.09519870492067249, 0.2855948602103702",
+      },
+      viewId:this.$route.params.type
+    }
   },
   mounted() {
-    this.starLoad();
+    let ifrWindow = this.$refs.ifr.contentWindow
+    this.$bus.$on('ifrMessage',(data)=>{
+      if (data.events=='flyToPano') {
+          let { x, y, z, w } = data.data.quaternion
+          ifrWindow.player.flyToPano({
+            pano: ifrWindow.player.model.panos.index[data.data.id],
+            quaternion: new ifrWindow.THREE.Quaternion(x, y, z, w),
+          });
+      }
+
+      if (data.events=='toggleTour') {
+        ifrWindow[data.data]()
+      }
+    })
   },
-  methods: {
-    starLoad() {
-      window.number = (this.themes.find(item=>item.id==this.theme)).sceneCode;
-      window.loadMainJs();
-      window.loadMange();
-      window.loadScene();
-    },
-    destroy() {
-      window.hadLoad = true;
-      if (window.player) {
-        window.player.sceneRenderer.suspend();
-        window.player = "";
-        $(".parent-body").remove();
-        $("#player").remove();
+  watch: {
+    theme(newVal) {
+      if (newVal == "xuting") {
+        this.$refs.ifr.contentWindow.postMessage(
+          {
+            source: "changeExhition",
+            data: {
+              quat: [
+                -0.001489144851378805,
+                0.8167267402741333,
+                0.002107772549575186,
+                0.5770188587943806,
+              ],
+              index: 0,
+            },
+          },
+          "*"
+        );
+      }
+
+      if (newVal == "e") {
+        this.$refs.ifr.contentWindow.postMessage(
+          {
+            source: "changeExhition",
+            data: {
+              quat: [
+                0.028523630856794317,
+                0.953183703881663,
+                -0.09519870492067249,
+                0.2855948602103702,
+              ],
+              index: 30,
+            },
+          },
+          "*"
+        );
       }
     },
   },
-  beforeDestroy() {
-    this.destroy();
-  },
 };
 </script>
 
 <style lang="less" scoped>
-.parent-body {
+.scene-body {
   width: 100%;
-  height: 100%;
-  padding-top: 0;
+  height: 100vh;
   position: relative;
-  overflow-x: hidden;
+  overflow: hidden;
+  > iframe {
+    width: 100%;
+    height: 100%;
+  }
 }
 </style>

+ 207 - 0
src/pages/scenePage/index.vue

@@ -0,0 +1,207 @@
+<template>
+  <div class="parent-body">
+    <!-- 热点 -->
+    <hot />
+    <!-- 热点弹出框 -->
+    <popup />
+    <!-- 加载初始页面 -->
+    <div id="gui-thumb"></div>
+
+    <!-- 主容器 -->
+    <div id="player"></div>
+    <div id="gui-parent">
+      <!-- 进度条加载 -->
+      <gui-loading v-show="false" />
+      <div id="gui" class="disable">
+        <!-- 退出VR模式按钮 -->
+        <div id="vrOff">
+          <img id="vrOffImg" src="images/vrOffImg.png" alt="" />
+        </div>
+
+        <!-- 热点列表 -->
+        <hotspot-list />
+
+        <!-- 标题 -->
+        <v-title />
+
+        <!-- 底部菜单 -->
+        <v-menu class="disable" />
+
+        <!-- 导览 -->
+        <v-guide class="disable" />
+
+        <!-- logo -->
+        <div
+          id="myCompany"
+          style="width:100%;position:absolute;bottom:20px;text-align:center;font-size:14px;font-family: '微软雅黑';font-weight:580;color: rgba(255, 255, 255, 0.8);"
+        >
+          四维时代提供技术支持
+        </div>
+      </div>
+
+      <!-- vr -->
+      <web-vr />
+
+      <!-- loading -->
+      <div id="gui-spinner" style="display: none;">
+        <div class="gui-spinner-icon"></div>
+      </div>
+
+      <!-- guimsg -->
+      <guimsg />
+
+      <!-- 错误提示 -->
+      <v-error />
+
+      <vr-con />
+
+      <v-other />
+    </div>
+  </div>
+</template>
+
+<script>
+import hot from "./views/hot";
+import popup from "./views/popup";
+import guiLoading from "./views/gui/loading";
+import hotspotList from "./views/gui/hotspotlist";
+import vTitle from "./views/gui/title";
+import vMenu from "./views/gui/menu";
+import vGuide from "./views/gui/guide";
+import webVr from "./views/gui/webvr";
+import guimsg from "./views/gui/guimsg";
+import vError from "./views/gui/error";
+import vrCon from "./views/gui/vrcon";
+import vOther from "./views/gui/other";
+
+export default {
+  data() {
+    return {
+      hotspots: [],
+    };
+  },
+  components: {
+    hot,
+    popup,
+    guiLoading,
+    hotspotList,
+    vTitle,
+    vMenu,
+    vGuide,
+    webVr,
+    guimsg,
+    vError,
+    vrCon,
+    vOther,
+  },
+  methods: {
+    getHotSpotList() {
+      $.ajax({
+        url:
+          window.g_Prefix +
+          "data/" +
+          window.number +
+          "/hot/js/data.js" +
+          "?" +
+          Math.random(),
+        type: "get",
+        dataType: "json",
+        contentType: "application/json",
+        success: (result) => {
+          this.hotspots = result;
+        },
+      });
+    },
+    start() {
+      //加载完成页面展示
+      window.parent.postMessage(
+        {
+          source: "showAll",
+          data: true,
+        },
+        "*"
+      );
+
+      if (window.player) {
+        this.getHotSpotList();
+        //监听导览状态
+        window.player.on("onplayStatus", (data) => {
+          window.parent.postMessage(
+            {
+              source: "onplayStatus",
+              data,
+            },
+            "*"
+          );
+        });
+
+        window.player.on("flying.ended", (...data) => {
+          window.parent.postMessage(
+            {
+              source: "flying.ended",
+              data: data[2].id,
+            },
+            "*"
+          );
+        });
+
+        window.player.on("openHotspot", (data) => {
+          this.hotspot = this.hotspots[data];
+          this.hotspot.contents = this.hotspot.content
+            ? this.hotspot.content.split("(4dage)")
+            : [];
+
+          window.parent.postMessage(
+            {
+              source: "openHotspot",
+              data: this.hotspot,
+            },
+            "*"
+          );
+        });
+      }
+    },
+  },
+  mounted() {
+    this.$nextTick(() => {
+      
+      if (!window.evt) {
+        window.evt = document.createEvent("HTMLEvents");
+      }
+      window.evt.initEvent("loadfinish", false, false);
+      window.addEventListener("loadfinish", this.start, false);
+
+      window.addEventListener("message", (res) => {
+        if (Object.prototype.toString.call(res.data) == "[object Object]") {
+          let data = res.data.data;
+          if (res.data.source === "changeExhition") {
+            window.player.flyToPano({
+              pano: window.player.model.panos.index[data.index],
+              quaternion: new THREE.Quaternion(...data.quat),
+            });
+          }
+
+          if (res.data.source === "enterExhition") {
+              window.firstView= data.firstView
+          }
+        }
+      });
+    });
+  },
+  beforeDestroy() {
+    $(document).off(
+      "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange"
+    );
+    window.removeEventListener("loadfinish", this.start, false);
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.parent-body {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  overflow: hidden;
+}
+</style>

src/pages/scene/views/gui/error.vue → src/pages/scenePage/views/gui/error.vue


src/pages/scene/views/gui/guide.vue → src/pages/scenePage/views/gui/guide.vue


src/pages/scene/views/gui/guimsg.vue → src/pages/scenePage/views/gui/guimsg.vue


src/pages/scene/views/gui/hotspotlist.vue → src/pages/scenePage/views/gui/hotspotlist.vue


src/pages/scene/views/gui/loading.vue → src/pages/scenePage/views/gui/loading.vue


src/pages/scene/views/gui/menu.vue → src/pages/scenePage/views/gui/menu.vue


src/pages/scene/views/gui/other.vue → src/pages/scenePage/views/gui/other.vue


src/pages/scene/views/gui/title.vue → src/pages/scenePage/views/gui/title.vue


src/pages/scene/views/gui/vrcon.vue → src/pages/scenePage/views/gui/vrcon.vue


src/pages/scene/views/gui/webvr.vue → src/pages/scenePage/views/gui/webvr.vue


src/pages/scene/views/hot/index.vue → src/pages/scenePage/views/hot/index.vue


src/pages/scene/views/popup/index.vue → src/pages/scenePage/views/popup/index.vue


+ 1 - 0
vue.config.js

@@ -5,6 +5,7 @@ const path = require('path');
 let pages = {
   index: 'src/clients/index.js',
   mobile: 'src/clients/mobile.js',
+  scene: 'src/clients/scene.js',
 }
 
 module.exports = {