From 275ebad367a5951b222bd6ca11679b3d4d7a1d0e Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 23 Dec 2021 10:12:17 +0800
Subject: [PATCH] +加入模型

---
 src/components/mobileWindow/index.vue  |   10 ++-
 src/components/mobilemap/index.vue     |  115 +++++++++++++++++++++++--------------
 src/styles/mobile/popup.scss           |   18 +++--
 src/components/mobileLeftNav/index.vue |    3 
 4 files changed, 91 insertions(+), 55 deletions(-)

diff --git a/src/components/mobileLeftNav/index.vue b/src/components/mobileLeftNav/index.vue
index ccf3c39..a533ef5 100644
--- a/src/components/mobileLeftNav/index.vue
+++ b/src/components/mobileLeftNav/index.vue
@@ -207,7 +207,8 @@
       // console.log(posi);
       this.$store.dispatch("mapFlyTo", {
         //飞入
-        lntLat: [posi.lng + 0.01187, posi.lat - 0.0308, 4000],
+        lntLat: [posi.lng + 0.00917, posi.lat - 0.0188, 2100],
+        // lntLat: [posi.lng + 0.01187, posi.lat - 0.0308, 4000],
         // lntLat: [121.50492752204283, 31.21567802276832, 2530],
         heading: 0,
         pitch: -45,
diff --git a/src/components/mobileWindow/index.vue b/src/components/mobileWindow/index.vue
index e373fd8..fba1497 100644
--- a/src/components/mobileWindow/index.vue
+++ b/src/components/mobileWindow/index.vue
@@ -29,7 +29,12 @@
             <div class="m-c-title">{{ item.name }}:</div>
             <span class="m-c-center">{{ item.value }}</span>
           </div>
-          <div class="mobileBig-center-introduce" v-html="introduce"></div>
+          <div
+            class="mobileBig-center-introduce"
+            style="padding-top: 10px"
+            v-show="introduce"
+            v-html="introduce"
+          ></div>
         </div>
       </div>
       <div class="mobile-popup-control">
@@ -138,8 +143,7 @@
         //   value: "详情",
         // },
       ],
-      introduce:
-        "1,是一个阿拉伯数字。1是一个自然数,是最小的正整数,是最小的正奇数。1是一个有理数,是一位数,也是奇数。1既不是质数也不是合数。1的n次方(n∈R)都等于1。1的倒数是它本身。一个或者几个事物所组成的整体,可以看作是单位“1”。",
+      introduce: "暂无详情数据",
       title: "",
       fullscreenLoading: false,
       url: "/img/job/one.jpg",
diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index 0b9f4df..2aaeefd 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -186,41 +186,82 @@
         if (!that.MobileWindowsHide) {
           // that.$store.dispatch("closeMobileWindowsDom"); //关闭随地图弹窗
         }
-        // if (!that.MobileWindowsHideFixed) {
-        //   that.$store.dispatch("CLOSE_WIDOWFIXED"); //关闭固定弹窗
-        // }
-        // if (!that.MobileWindowsHide && that.popupsDom) {
-        //   that.popupsDom.closeOur();
-        //   that.$store.commit("MSET_MOBILEWINDOWSHIDE", true);
-        // }
-        // nowPosition = [e.wgs84Position.lng, e.wgs84Position.lat];
-        // console.log(nowPosition);
       });
 
-      const layer = new DC.TilesetLayer("layer");
-      viewer.addLayer(layer);
-      const tileset = new DC.Tileset(
-        "http://resource.dvgis.cn/data/3dtiles/ljz/tileset.json"
-      );
-      const style = new DC.TilesetStyle();
-      style.color = {
-        conditions: [
-          ["${Height} >= 300", "rgba(45, 0, 75, 0.5)"],
-          ["${Height} >= 200", "rgb(102, 71, 151)"],
-          ["${Height} >= 100", "rgb(170, 162, 204)"],
-          ["${Height} >= 50", "rgb(224, 226, 238)"],
-          ["${Height} >= 25", "rgb(252, 230, 200)"],
-          ["${Height} >= 10", "rgb(248, 176, 87)"],
-          ["${Height} >= 5", "rgb(198, 106, 11)"],
-          ["true", "rgb(127, 59, 8)"],
-        ],
-      };
+      //自带白模型↓
+      // const layer = new DC.TilesetLayer("layer");
+      // viewer.addLayer(layer);
+      // const tileset = new DC.Tileset(
+      //   "http://resource.dvgis.cn/data/3dtiles/ljz/tileset.json"
+      // );
+      // const style = new DC.TilesetStyle();
+      // style.color = {
+      //   conditions: [
+      //     ["${Height} >= 300", "rgba(45, 0, 75, 0.5)"],
+      //     ["${Height} >= 200", "rgb(102, 71, 151)"],
+      //     ["${Height} >= 100", "rgb(170, 162, 204)"],
+      //     ["${Height} >= 50", "rgb(224, 226, 238)"],
+      //     ["${Height} >= 25", "rgb(252, 230, 200)"],
+      //     ["${Height} >= 10", "rgb(248, 176, 87)"],
+      //     ["${Height} >= 5", "rgb(198, 106, 11)"],
+      //     ["true", "rgb(127, 59, 8)"],
+      //   ],
+      // };
 
-      viewer.use(new DC.Measure());
+      // viewer.use(new DC.Measure());
 
-      tileset.setStyle(style);
+      // tileset.setStyle(style);
       // layer.addOverlay(tileset);
       // viewer.flyTo(tileset);
+      //自带白模型↑
+
+      //精细模型↓
+      const tilesetLayer = new that.DC.TilesetLayer("tilesetLayer");
+      viewer.addLayer(tilesetLayer);
+      const tileset = new that.DC.Tileset(
+        "http://data.mars3d.cn/3dtiles/max-shihua/tileset.json",
+        {
+          luminanceAtZenith: 0.5,
+        }
+      );
+      tilesetLayer.addOverlay(tileset);
+      // viewer.flyTo(tileset);
+      //精细模型↑
+
+      //瀑布流↓
+      const wallLayer = new that.DC.VectorLayer("wallLayer");
+      viewer.addLayer(wallLayer);
+      var arr = [
+        [115.87597219, 28.74628526, 100],
+        [115.87556558, 28.74415792, 100],
+        [115.87459782, 28.74197687, 100],
+        [115.87371834, 28.74219927, 100],
+        [115.87210924, 28.74182217, 100],
+        [115.86469971, 28.73630725, 100],
+        [115.86387107, 28.73620123, 100],
+        [115.86274498, 28.73616026, 100],
+        [115.86173699, 28.7424135, 100],
+        [115.86105468, 28.74643934, 100],
+        [115.8660924, 28.74642593, 100],
+        [115.87597219, 28.74628526, 100],
+      ];
+      arr.forEach((item) => {
+        item = item.join(",");
+      });
+      arr = arr.join(";");
+      const wall = new that.DC.Wall(arr);
+      wall.setStyle({
+        material: new that.DC.WallTrailMaterialProperty({
+          color: that.DC.Color.DEEPSKYBLUE,
+          speed: 4,
+        }),
+      });
+      wallLayer.addOverlay(wall);
+
+      viewer.use(new that.DC.Measure());
+      //瀑布流↑
+
+      //飞入起始点
       that.$store.dispatch("mapFlyTo", {
         lntLat: [115.87186406, 28.74449337, 1200],
         heading: 0,
@@ -229,28 +270,14 @@
         noOpen: true,
       });
       //地图渲染完成执行srore中MSET_CREADE
-      that.$store.dispatch("MSET_CREADE");
+      // that.$store.dispatch("MSET_CREADE");
 
       tileset.on(DC.MouseEventType.CLICK, (e) => {
-        // that.popupFlag = true
-        // that.popupWindow = true;
-
         viewer.scene.globe.depthTestAgainstTerrain = false;
-
-        // console.log(document.getElementById("mobile-map_content_content"));
-        // console.log(e);
 
         // 定制化窗体
         that.openPopupS(e.position, [e.wgs84Position.lng, e.wgs84Position.lat]);
-
-        // popup.setWrapper('<div></div>')
-
-        // popup.showAt(e.position, document.getElementById('modelPopup'))
       });
-
-      // viewer.zoomToPosition(
-      //     new DC.Position(105.565571, 31.984708, 15362816, 0, -90)
-      // )
 
       viewer.compass.enable = false;
       viewer.zoomController.enable = true;
diff --git a/src/styles/mobile/popup.scss b/src/styles/mobile/popup.scss
index a006b78..29950b9 100644
--- a/src/styles/mobile/popup.scss
+++ b/src/styles/mobile/popup.scss
@@ -89,8 +89,8 @@
                     width: 70px;
                     height: 70px;
                 }
-                $centerFontSize: 15px;
                 //内容显示
+                $centerFontSize: 13px;
                 .mobileBig-center-our {
                     width: 100%;
                     height: auto;
@@ -102,10 +102,10 @@
                         @extend .centersFlex;
                         .m-c-title {
                             color: #fff;
-                            width: 25%;
+                            width: 21%;
                         }
                         .m-c-center {
-                            width: 75%;
+                            width: 79%;
                             // text-indent: 2em;
                             word-wrap: break-word;
                             color: #fff;
@@ -138,7 +138,11 @@
                     content: "";
                     width: 0px;
                     height: 0px;
-                    border: 8px solid #29baf1;
+                    // background-image: linear-gradient(#29baf1a1, #29baf1a1);
+                    border-top: 8px solid transparent;
+                    border-bottom: 8px solid #19b3f0a1;
+                    border-left: 8px solid transparent;
+                    border-right: 8px solid #19b3f0a1;
                     position: absolute;
                     bottom: -8px;
                     left: calc(50% - 8px);
@@ -183,9 +187,9 @@
         div:nth-child(2) {
             display: none !important;
         }
-        div:nth-child(3) {
-            // border-top: 1px solid #ebebeb;
-        }
+        // div:nth-child(3) {
+        //     // border-top: 1px solid #ebebeb;
+        // }
         div {
             width: $controllerw;
             height: $controllerw;

--
Gitblit v1.9.3