lanxin 3 месяцев назад
Родитель
Сommit
4a1a469f02

+ 4 - 9
hot/src/views/Home.vue

@@ -62,12 +62,7 @@
           </div>
           <!-- 左右箭头 -->
           <div @click="cutMyInd(-1, myInd === 0)" class="leftJJ awccJJ" :class="{ noClick: myInd === 0 }" v-if="data[myType] && data[myType].length > 1"></div>
-          <div
-            @click="cutMyInd(1, myInd === data[myType].length - 1)"
-            class="rightJJ awccJJ"
-            :class="{ noClick: myInd === data[myType].length - 1 }"
-            v-if="data[myType] && data[myType].length > 1"
-          ></div>
+          <div @click="cutMyInd(1, myInd === data[myType].length - 1)" class="rightJJ awccJJ" :class="{ noClick: myInd === data[myType].length - 1 }" v-if="data[myType] && data[myType].length > 1"></div>
         </div>
       </div>
     </div>
@@ -182,8 +177,8 @@ export default {
     },
     async getConfig() {
       let url = `./config/config.json`;
-      let result = (await this.$http.get(url));
-      console.error(result)
+      let result = await this.$http.get(url);
+      console.error(result);
     },
     async getData() {
       // https://www.4dmodel.com/
@@ -265,7 +260,7 @@ export default {
   height: 100%;
   // background-color: rgba(255, 252, 247, 0.6);
   // backdrop-filter: blur(10px);
-  background: rgba(0, 0, 0, 0.7);
+  background: linear-gradient(90deg, rgba(39, 48, 51, 1) 0%, rgba(39, 48, 51, 0.8) 100%);
   backdrop-filter: blur(12.5px);
   position: relative;
   #myAudio {

+ 57 - 9
scene/public/static/data/data.json

@@ -11,7 +11,13 @@
           "title": "",
           "descs": []
         },
-        "units": []
+        "units": [],
+        "style": {
+          "top": "-12.1%",
+          "left": "-20.3%",
+          "scaleX": "1.45",
+          "scaleY": "1.36"
+        }
       },
       {
         "name": "午门",
@@ -21,7 +27,13 @@
           "title": "",
           "descs": []
         },
-        "units": []
+        "units": [],
+        "style": {
+          "top": "0%",
+          "left": "0%",
+          "scaleX": "1.45",
+          "scaleY": "1.36"
+        }
       },
       {
         "name": "东雁翅楼",
@@ -31,7 +43,13 @@
           "title": "",
           "descs": []
         },
-        "units": []
+        "units": [],
+        "style": {
+          "top": "0%",
+          "left": "0%",
+          "scaleX": "1.45",
+          "scaleY": "1.36"
+        }
       }
     ]
   },
@@ -47,7 +65,13 @@
           "title": "",
           "descs": []
         },
-        "units": []
+        "units": [],
+        "style": {
+          "top": "0%",
+          "left": "0%",
+          "scaleX": "1.45",
+          "scaleY": "1.36"
+        }
       }
     ]
   },
@@ -63,7 +87,13 @@
           "title": "",
           "descs": []
         },
-        "units": []
+        "units": [],
+        "style": {
+          "top": "0%",
+          "left": "0%",
+          "scaleX": "1.45",
+          "scaleY": "1.36"
+        }
       },
       {
         "name": "午门",
@@ -73,7 +103,13 @@
           "title": "",
           "descs": []
         },
-        "units": []
+        "units": [],
+        "style": {
+          "top": "0%",
+          "left": "0%",
+          "scaleX": "1.45",
+          "scaleY": "1.36"
+        }
       },
       {
         "name": "东雁翅楼",
@@ -83,7 +119,13 @@
           "title": "",
           "descs": []
         },
-        "units": []
+        "units": [],
+        "style": {
+          "top": "0%",
+          "left": "0%",
+          "scaleX": "1.45",
+          "scaleY": "1.36"
+        }
       }
     ]
   },
@@ -135,7 +177,13 @@
           "title": "",
           "descs": []
         },
-        "units": []
+        "units": [],
+        "style": {
+          "top": "0%",
+          "left": "0%",
+          "scaleX": "1.45",
+          "scaleY": "1.36"
+        }
       },
       {
         "name": "午门",
@@ -499,4 +547,4 @@
       }
     ]
   }
-]
+]

+ 5 - 21
scene/public/static/js/Hot.js

@@ -6,10 +6,6 @@ const playVideoWhenFlyOut = false;
 const playVideoMax = window.isEdit ? 3 : browser.isMobile() ? 1 : 3;
 const playAniMax = window.isEdit ? 6 : browser.isMobile() ? 3 : 5;
 
-
-
-
-
 window.initHot = function (model) {
   var objLoader = new THREE.OBJLoader();
   var _planeGeometry = new THREE.PlaneGeometry(1, 1);
@@ -54,9 +50,8 @@ window.initHot = function (model) {
       o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
     -1 == r.indexOf("?") ? (src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o) : (src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o);
 
-    
     if (window.project_env && window.project_env == "development") {
-      return src.replace("https://www.4dmodel.com/SuperTwo/hot_online1", "http://192.168.0.18:8089");
+      return src.replace("https://www.4dmodel.com/SuperTwo/hot_online1", "http://192.168.0.78:8089");
     } else {
       return src.replace("https://www.4dmodel.com/SuperTwo/hot_online1", "hot");
     }
@@ -634,13 +629,7 @@ window.initHot = function (model) {
       var cornerPoint;
 
       if (this.plane) {
-        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),
-        ];
+        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)];
       } else {
         var bound = new THREE.Box3().copy(this.info.modelBound.bound);
         var center = bound.center();
@@ -737,10 +726,7 @@ window.initHot = function (model) {
         return convertTool.updateVisible(this, "visi", true);
       }
 
-      let visible =
-        visibility != void 0
-          ? visibility
-          : !this.info.visiblePanos || (type == "every" ? panos.every((pano) => this.info.visiblePanos.includes(pano.id)) : panos.some((pano) => this.info.visiblePanos.includes(pano.id))); //type为every时,需要panos中每个都可见才显示
+      let visible = visibility != void 0 ? visibility : !this.info.visiblePanos || (type == "every" ? panos.every((pano) => this.info.visiblePanos.includes(pano.id)) : panos.some((pano) => this.info.visiblePanos.includes(pano.id))); //type为every时,需要panos中每个都可见才显示
 
       convertTool.updateVisible(this, "visi", visible);
 
@@ -934,7 +920,7 @@ window.initHot = function (model) {
 
     updateScale(e, t) {
       //自适应调节大小   原先的shine改为了photo的动画
-      if (!DATA.autoAdjustHotScale || /* this.texType != "shine" */ this.texType != "photo"  || !this.plane) return;
+      if (!DATA.autoAdjustHotScale || /* this.texType != "shine" */ this.texType != "photo" || !this.plane) return;
 
       var scale = convertTool.getScaleForConstantSize(
         $.extend({}, autoSizeInfo, {
@@ -1230,9 +1216,7 @@ window.initHot = function (model) {
             setTimeout(function e() {
               if (s) {
                 var t = document.querySelector("#id1").contentWindow.document;
-                t.querySelector("video") &&
-                  (t.querySelector("video").play(), !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
-                  t.querySelector("audio") && t.querySelector("audio").play();
+                t.querySelector("video") && (t.querySelector("video").play(), !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")), t.querySelector("audio") && t.querySelector("audio").play();
               } else setTimeout(e, 300);
             }, 800);
         }

+ 4 - 16
scene/src/View.vue

@@ -1,23 +1,11 @@
 <template>
   <div class="view-body" :class="{ isMobile }">
     <div class="switch-btn" v-if="mode == 'dollhouse'">
-      <div
-        class="btn-item"
-        :class="{ active: sceneNum === scene.num }"
-        v-for="scene in sceneList"
-        :key="scene.num"
-        @click="changeScene(scene)"
-      >
+      <div class="btn-item" :class="{ active: sceneNum === scene.num }" v-for="scene in sceneList" :key="scene.num" @click="changeScene(scene)">
         {{ scene.name }}
       </div>
     </div>
-    <iframe
-      v-if="show"
-      :src="sceneUrl"
-      allowfullscreen
-      frameborder="0"
-      id="myIframe"
-    ></iframe>
+    <iframe v-if="show" :src="sceneUrl" allowfullscreen frameborder="0" id="myIframe"></iframe>
   </div>
 </template>
 
@@ -44,7 +32,7 @@ export default {
       flyInModel: "flyInModel",
     }),
     sceneUrl() {
-      return `/index.html?m=${this.sceneNum}#/`;
+      return `./index.html?m=${this.sceneNum}#/`;
     },
   },
   methods: {
@@ -155,7 +143,7 @@ export default {
     .switch-btn {
       position: fixed;
       // bottom: 2.6667rem;
-      bottom:auto;
+      bottom: auto;
       top: 20px;
       left: 10px;
       // display: none;

BIN
scene/src/assets/image/map/1.jpg


BIN
scene/src/assets/image/map/11.jpg


BIN
scene/src/assets/image/map/5.jpg


BIN
scene/src/assets/image/map/茶世界/东雁翅楼.jpg


BIN
scene/src/assets/image/map/茶世界/午门.jpg


BIN
scene/src/assets/image/map/茶世界/西雁翅楼.jpg


+ 1 - 1
scene/src/utils/api.js

@@ -18,6 +18,6 @@ export const getVisitAPI = () => {
 export const getExhibitionInfoAPI = () => {
   return axios({
     method: "get",
-    url: "/static/data/data.json",
+    url: "./static/data/data.json",
   });
 };

+ 21 - 36
scene/src/views/gui/components/layerMap.vue

@@ -4,12 +4,7 @@
     <div class="layer-close" @click="$emit('close')"></div>
     <div class="layer-content">
       <div class="wep-options" v-if="sceneList && sceneList.length > 1">
-        <div
-          class="wep-option"
-          :class="{ onselected: sceneNum === i.num }"
-          v-for="i in sceneList"
-          @click="changeScene(i)"
-        >
+        <div class="wep-option" :class="{ onselected: sceneNum === i.num }" v-for="i in sceneList" @click="changeScene(i)">
           {{ i.name }}
         </div>
         <!-- <div  class="wep-option">午门</div>
@@ -17,12 +12,7 @@
       </div>
       <div class="map-content" ref="mapEle" v-if="info">
         <ul class="cell-list">
-          <li
-            v-for="(i, index) in info.units"
-            class="li"
-            :class="{ active: unit == index + 1 }"
-            @click="changeUnit(index + 1)"
-          >
+          <li v-for="(i, index) in info.units" class="li" :class="{ active: unit == index + 1 }" @click="changeUnit(index + 1)">
             <span>{{ i.name }}</span>
           </li>
           <!-- <li class="li" :class="{ active: unit == 2 }" @click="changeUnit(2)">
@@ -30,12 +20,8 @@
           </li> -->
         </ul>
         <div class="map-box-main" ref="mapMainEle">
-          <div
-            class="map-box"
-            ref="mapBox"
-            :style="`transform: translate(-50%, -50%) scale(${mapScale});background-image:url(${require(`../../../assets/image/map/${info.img}`)});`"
-          >
-            <div class="map-svg">
+          <div class="map-box" ref="mapBox" :style="` transform: translate(-50%, -50%) scale(${mapScale});background-image:url(${require(`../../../assets/image/map/${info.img}`)});`">
+            <div class="map-svg" :style="`top:${info.style.top};left:${info.style.left};transform:scale(${info.style.scaleX},${info.style.scaleY});`">
               <!-- <svg
                 xmlns="http://www.w3.org/2000/svg"
                 xmlns:xlink="http://www.w3.org/1999/xlink"
@@ -58,14 +44,7 @@
               <!-- <img src="../../../assets/image/icon/new-icon/test.svg" alt="" /> -->
 
               <div class="point-list">
-                <div
-                  class="tool_map_point"
-                  :pano-id="id"
-                  @click="goPano(id)"
-                  :class="{ current: panoId == id, over: i.over }"
-                  :style="`transform:translate(${i.x}px,${i.y}px);`"
-                  v-for="(i, id, index) in points"
-                >
+                <div class="tool_map_point" v-show="isPointShow(id)" :pano-id="id" @click="goPano(id)" :class="{ current: panoId == id, over: i.over }" :style="`transform:translate(${i.x}px,${i.y}px);`" v-for="(i, id, index) in points">
                   <p class="tips">点位{{ id }}</p>
                 </div>
               </div>
@@ -164,6 +143,15 @@ export default {
   methods: {
     ...mapMutations(["setData"]),
 
+    isPointShow(id) {
+      console.log(this.info.id);
+      // 根据场景码筛选
+      if (this.info.num === "KJ-CmveHNimLmQ" && id < 3) {
+        return false;
+      }
+      return true;
+    },
+
     changeScene(scene) {
       this.sceneNum = scene.num;
       this.unit = 0;
@@ -268,8 +256,7 @@ export default {
     position: absolute;
     width: 56px;
     height: 56px;
-    background: url(../../../assets/image/icon/new-icon/icon_close.png)
-      no-repeat;
+    background: url(../../../assets/image/icon/new-icon/icon_close.png) no-repeat;
     background-size: 100%;
     right: 56px;
     top: 56px;
@@ -358,6 +345,8 @@ export default {
           height: 1064px;
           transform: translate(-50%, -50%) scale(0.58);
           background-image: url(../../../assets/image/icon/new-icon/map.jpg);
+          background-repeat: no-repeat;
+          background-size: 100% 100%;
           position: absolute;
           left: 50%;
           top: 50%;
@@ -403,8 +392,7 @@ export default {
                 z-index: 1;
                 &.over {
                   border: none !important;
-                  background: url(../../../assets/image/icon/new-icon/red.png)
-                    no-repeat 50% / contain;
+                  background: url(../../../assets/image/icon/new-icon/red.png) no-repeat 50% / contain;
                 }
 
                 &.current {
@@ -415,8 +403,7 @@ export default {
                     top: 50%;
                     width: 24px;
                     height: 24px;
-                    background: url(../../../assets/image/icon/new-icon/blue.png)
-                      no-repeat 50% / contain;
+                    background: url(../../../assets/image/icon/new-icon/blue.png) no-repeat 50% / contain;
                     transform: translate(-50%, -50%);
                   }
                 }
@@ -475,13 +462,11 @@ export default {
           vertical-align: middle;
           background-size: 100%;
           &.no {
-            background: url(../../../assets/image/icon/new-icon/no.png)
-              no-repeat;
+            background: url(../../../assets/image/icon/new-icon/no.png) no-repeat;
             background-size: 100%;
           }
           &.now {
-            background: url(../../../assets/image/icon/new-icon/blue.png)
-              no-repeat;
+            background: url(../../../assets/image/icon/new-icon/blue.png) no-repeat;
             background-size: 100%;
           }
         }