瀏覽代碼

大楼加点击事件

刘靖诗 3 年之前
父節點
當前提交
5460431bff
共有 1 個文件被更改,包括 25 次插入1 次删除
  1. 25 1
      src/views/SandTable/component/ThreeModel1.vue

+ 25 - 1
src/views/SandTable/component/ThreeModel1.vue

@@ -13,7 +13,7 @@
         v-show="info.show"
         v-show="info.show"
         :style="'left: ' + info.x + 'px; top: ' + info.y + 'px;'"
         :style="'left: ' + info.x + 'px; top: ' + info.y + 'px;'"
       >
       >
-        <div class="fan-name pointer" @click.stop="info.clickName">
+        <div class="fan-name pointer" v-show="info.id != 'build'" @click.stop="info.clickName">
           {{ info.name }}
           {{ info.name }}
         </div>
         </div>
         <div
         <div
@@ -449,6 +449,24 @@ export default {
             console.log("海子井");
             console.log("海子井");
           },
           },
         },
         },
+        { // 大楼
+           id: "build",
+           x: 0,
+           y: 0,
+           show: true,
+           ox: 290,
+           oy: 120,
+           fanW: 60,
+           fanH: 100,
+           fanX: -260,
+           fanY: -200,
+           position: null,
+           name: "大楼",
+           clickName: function () { console.log("大楼") },
+           clickFan: () => { 
+           this.showFanInfo(this.htmlLayer[10].position);
+          },
+         },
       ],
       ],
       fanInfoLayer: {
       fanInfoLayer: {
         id: "fan-info",
         id: "fan-info",
@@ -676,9 +694,15 @@ export default {
           gltf.scene.position.set(0, 0, -35); // 10, 0, -50    -6, 0.13, -50
           gltf.scene.position.set(0, 0, -35); // 10, 0, -50    -6, 0.13, -50
           scene.add(gltf.scene);
           scene.add(gltf.scene);
           gltf.scene.rotateY(120);
           gltf.scene.rotateY(120);
+            this.htmlLayer[10].position = {
+                x: -6,
+                y: -4,
+                z: -35,
+            }
           scene.onAfterRender = () => {
           scene.onAfterRender = () => {
             this.$emit("when");
             this.$emit("when");
             this.$refs.pageLoading.hide();
             this.$refs.pageLoading.hide();
+            this.setEveryHTML();
           };
           };
         },
         },
         (xhr) => {},
         (xhr) => {},