chenlei 8 mēneši atpakaļ
vecāks
revīzija
81caf274ab
2 mainītis faili ar 26 papildinājumiem un 17 dzēšanām
  1. 21 16
      scene/src/views/gui/menu.vue
  2. 5 1
      tilt-model-web/index.html

+ 21 - 16
scene/src/views/gui/menu.vue

@@ -418,6 +418,14 @@
 import HotList from "./components/hotList.vue";
 import Share from "./components/share.vue";
 
+const MULTILAYER_MAP = [
+  ['KJ-FwOrAt4DM4i', 'KJ-C1pVWZpykU5_01'],
+  ['KJ-2BxnrjuodUQ', 'KJ-SM7nrYVplQb'],
+  ['KJ-Sp7nzqeQQP3', 'KJ-rZN0SwW1Rm0'],
+  ['KJ-xrLkN8YPHG1', 'KJ-6c3Bmj5M6Tr'],
+  ['KJ-X98HYd4MMqU', 'KJ-IXbIMNFQPZC']
+];
+
 export default {
   components: { HotList, Share },
   data() {
@@ -448,29 +456,26 @@ export default {
       this.guideStep = 1;
       localStorage.setItem("isGuided", "true");
     }
-    console.log('12',window.location.href.includes('KJ-FwOrAt4DM4i'))
-    if(window.location.href.includes('KJ-FwOrAt4DM4i')){
-      this.is1Ceng = true
-    }
-    if(window.location.href.includes('KJ-C1pVWZpykU5_01')){
-      this.is2Ceng = true
+
+    const multilayerIndex = MULTILAYER_MAP.findIndex(arr => arr.includes(window.number))
+
+    if (multilayerIndex > -1) {
+      if (MULTILAYER_MAP[multilayerIndex].findIndex(code => window.number === code) === 0) {
+        this.is1Ceng = true
+      } else {
+        this.is2Ceng = true
+      }
     }
   },
   methods: {
     changFloor() {
+      const multilayerIndex = MULTILAYER_MAP.findIndex(arr => arr.includes(window.number))
+
       if(this.is1Ceng){
-        // window.location.href = 'https://houseoss.4dkankan.com/project/ZHZRZYJ/index.html#/?m=KJ-C1pVWZpykU5_01'
-        window.location.replace('https://houseoss.4dkankan.com/project/ZHZRZYJ/index.html#/?m=KJ-C1pVWZpykU5_01')
-        window.location.reload()
-        // window.history.replaceState({}, '', 'https://houseoss.4dkankan.com/project/ZHZRZYJ/index.html#/?m=KJ-C1pVWZpykU5_01');
+        window.location.replace(window.location.origin + window.location.pathname + '?m=' + MULTILAYER_MAP[multilayerIndex][1])
       }
       if(this.is2Ceng){
-        // window.location.href = 'https://houseoss.4dkankan.com/project/ZHZRZYJ/index.html#/?m=KJ-FwOrAt4DM4i'
-        window.location.replace('https://houseoss.4dkankan.com/project/ZHZRZYJ/index.html#/?m=KJ-FwOrAt4DM4i')
-        window.location.reload()
-
-        // window.history.replaceState({}, '', 'https://houseoss.4dkankan.com/project/ZHZRZYJ/index.html#/?m=KJ-FwOrAt4DM4i');
-
+        window.location.replace(window.location.origin + window.location.pathname + '?m=' + MULTILAYER_MAP[multilayerIndex][0])
       }
     },
     clearScreen() {

+ 5 - 1
tilt-model-web/index.html

@@ -3,7 +3,7 @@
 
 <head>
   <meta charset="UTF-8" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
   <script src="./vue.min.js"></script>
   <!-- 引入样式 -->
   <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
@@ -187,6 +187,8 @@
       align-items: center;
       position: absolute;
       bottom: 30px;
+      bottom: calc(30px + constant(safe-area-inset-bottom));
+      bottom: calc(30px + env(safe-area-inset-bottom));
       left: 0;
       padding: 0 20px;
       z-index: 2;
@@ -373,6 +375,8 @@
       position: absolute;
       left: 0;
       bottom: 0;
+      bottom: constant(safe-area-inset-bottom);
+      bottom: env(safe-area-inset-bottom);
       padding: 10px;
       display: flex;
       justify-content: center;