Pārlūkot izejas kodu

解决场景打不开的问题

aamin 2 gadi atpakaļ
vecāks
revīzija
1c64420c17

+ 66 - 42
H5场景/public/index.html

@@ -1,41 +1,57 @@
-<!doctype html>
+<!DOCTYPE html>
 <html>
-
-<head>
-    <meta charset="utf-8">
-    <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 http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+  <head>
+    <meta charset="utf-8" />
+    <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 http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
     <title>江苏省文旅厅-518云上博物启动会</title>
-    <meta name="description" content="四维时代">
-    <meta property="og:title" content="四维时代">
-    <meta property="og:description" content="四维时代">
-    <meta property="og:image:type" content="image/jpg">
-    <link rel="icon" type="image/png" sizes="32x32" href="./favicon.ico" class="keep">
-    <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"/>
+    <meta name="description" content="四维时代" />
+    <meta property="og:title" content="四维时代" />
+    <meta property="og:description" content="四维时代" />
+    <meta property="og:image:type" content="image/jpg" />
+    <link
+      rel="icon"
+      type="image/png"
+      sizes="32x32"
+      href="./favicon.ico"
+      class="keep"
+    />
+    <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"
+    />
     <!-- <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/CAD/cad.css?v=2.25"/> -->
-    <style>
-    </style>
+    <style></style>
     <script>
-        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("#"));
-        } 
+      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("#"));
+      }
     </script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/Hot_new.js"></script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/manage_new.js" defer></script>
 
     <script class="build keep">
-        if (window.performance) {
-            window.navigationStart = window.performance.timing.navigationStart;
-        } else {
-            window.navigationStart = Date.now() + 300;
-        } 
+      if (window.performance) {
+        window.navigationStart = window.performance.timing.navigationStart;
+      } else {
+        window.navigationStart = Date.now() + 300;
+      }
     </script>
 
-<!-- 提示使用 移动端 浏览 -->
+    <!-- 提示使用 移动端 浏览 -->
     <!-- <script>
             if (
             window.navigator.userAgent.match(
@@ -45,24 +61,32 @@
             // 移动端
         }else alert('请使用移动端设备浏览!')
     </script> -->
+  </head>
 
-</head>
-
-<body>
+  <body>
     <div id="app"></div>
-    <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/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_new.js" defer></script>
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/flexible.js" defer></script>
+    <script src="<%= VUE_APP_STATIC_DIR %>/js/flexible.js"></script>
     <!-- <script src="<%= VUE_APP_STATIC_DIR %>/js/overlay.js"></script> -->
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/Hot_new.js" defer></script>  
-    <script src="<%= VUE_APP_STATIC_DIR %>/js/main_2020_show_new.js" defer></script>
     <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/OBJLoader.js"></script>
     <!-- <script src="<%= VUE_APP_STATIC_DIR %>/js/CAD/bundle.js"></script> -->
     <script src="<%= VUE_APP_STATIC_DIR %>/js/loadCAD.js" defer></script>
-</body>
-
-</html>
+    <script>
+      window.onload = function () {
+        const script = document.createElement("script");
+        script.type = "text/javascript";
+        script.src = "<%= VUE_APP_STATIC_DIR %>/js/main_2020_show_new.js";
+        document.body.appendChild(script);
+      };
+    </script>
+  </body>
+</html>

+ 3 - 2
H5场景/public/static/js/Hot_new.js

@@ -1208,8 +1208,9 @@ window.initHot = function(model){
                 var src = getLink(this.info.iframe[0]);
                 
                 if(this.info.linkType=="jumpLink"){
-                    var newPage = window.open(src, "_blank" ); 
-                    newPage.focus();  
+                    // var newPage = window.open(src, "_blank" ); 
+                    // newPage.focus();
+                    location.href = src 
                     
                 }else if(this.info.linkType=="iframeDiv"){
                     

+ 1 - 2
H5场景/src/views/gui/compomemt/floorSelect.vue

@@ -40,8 +40,7 @@ export default {
   watch: {},
   methods: {
     skipUrl(url) {
-      window.location.href =
-        window.location.origin + window.location.pathname + `#/?m=${url}`;
+      window.location.replace(window.location.origin + window.location.pathname + `#/?m=${url}`)
       setTimeout(() => {
         location.reload(true);
       }, 200);

BIN
H5场景本地化/dist.zip


+ 4 - 2
H5场景本地化/public/static/js/Hot_new.js

@@ -1208,8 +1208,9 @@ window.initHot = function(model){
                 var src = getLink(this.info.iframe[0]);
                 
                 if(this.info.linkType=="jumpLink"){
-                    var newPage = window.open(src, "_blank" ); 
-                    newPage.focus();  
+                    // var newPage = window.open(src, "_blank" ); 
+                    // newPage.focus();
+                    location.href = src 
                     
                 }else if(this.info.linkType=="iframeDiv"){
                     
@@ -1771,6 +1772,7 @@ window.initHot = function(model){
             li.hot = hot;   // 列表每一项对应一个热点
             li.appendChild(span);
             docFragment.appendChild(li);
+             
         }) 
         setTimeout(()=>{        
             var ul = document.querySelector('#hotListContent ul');

+ 1 - 2
H5场景本地化/src/views/gui/compomemt/floorSelect.vue

@@ -40,8 +40,7 @@ export default {
   watch: {},
   methods: {
     skipUrl(url) {
-      window.location.href =
-        window.location.origin + window.location.pathname + `#/?m=${url}`;
+      window.location.replace(window.location.origin + window.location.pathname + `#/?m=${url}`)
       setTimeout(() => {
         location.reload(true);
       }, 200);