浏览代码

功能修改

sunzehao 1 周之前
父节点
当前提交
439b6ebf69
共有 2 个文件被更改,包括 72 次插入82 次删除
  1. 32 47
      src/views/cesium.vue
  2. 40 35
      src/views/cesiumComponents/windView.vue

+ 32 - 47
src/views/cesium.vue

@@ -1009,58 +1009,43 @@ export default {
     },
 
     initresetViewport() {
-      this.resetViewport1();
+    //   this.resetViewport1();
     },
     // 城市视角重置视角
     resetViewport(height = 0, callback) {
       // 设置初始视图为宁夏
       const that = this;
-      this.viewer.camera.flyTo({
-        destination: Cesium.Cartesian3.fromDegrees(
-          //宁夏银川
-          //   106.169866,
-          //   38.46637,
-          //   height || 10000
-
-          //北京
-          116.391586,
-          39.898832,
-          height || 500
-          // 106.2,
-          // 38.467,
-          // 15000.0
-
-          // 113.3191,
-          // 23.109,
-          // 1000
-
-          //上海
-          // 121.47,
-          // 31.23,
-          // 1000
-        ),
-
-        // orientation: {
-        //   heading: 0, //北京天安门角度 0 上海角度 1
-        //   pitch: -0.2,
-        //   roll: 0,
-        // },
-        duration: 3,
-        // orientation: {
-        //   heading: Cesium.Math.toRadians(0),
-        //   pitch: Cesium.Math.toRadians(-90),
-        //   roll: 0.0,
-        // },
-        // duration: 1.0,
-        complete() {
-          // 为什么要加这个?因为破库地球没完全加载完成时如果执行了监听鼠标滑动事件会光速报错滑跪
-          if (!that.loadDone) {
-            that.initEventInputAction();
-            that.loadDone = true;
-          }
-          callback && callback();
-        },
-      });
+      const isFirstVisit = !sessionStorage.getItem('hasVisitedMap');
+      if (isFirstVisit) {
+        this.viewer.camera.flyTo({
+            destination: Cesium.Cartesian3.fromDegrees(
+            //北京
+            116.391586,
+            39.898832,
+            height || 500
+            ),
+            duration: 3,
+            complete() {
+            // 为什么要加这个?因为破库地球没完全加载完成时如果执行了监听鼠标滑动事件会光速报错滑跪
+            if (!that.loadDone) {
+                that.initEventInputAction();
+                that.loadDone = true;
+            }
+            callback && callback();
+            },
+        });
+        sessionStorage.setItem('hasVisitedMap', 'true');
+      } else {
+        this.viewer.camera.setView({
+            destination: Cesium.Cartesian3.fromDegrees(
+                116.391586,
+                39.898832,
+                height || 500
+            ),
+            duration: 3,
+        });
+      }
+      
     },
     resetViewport1(height = 0) {
       // 设置初始视图为宁夏

+ 40 - 35
src/views/cesiumComponents/windView.vue

@@ -1748,41 +1748,6 @@ export default {
 </style>
 <style lang="less" scoped>
 
-.currentSlider {
-  .el-slider__runway {
-    background: linear-gradient(
-      90deg,
-      #0a1931 0%,
-      /* 凌晨4点 - 深蓝色 */ #1b3b6f 15%,
-      /* 清晨 - 蓝色 */ #4a90e2 30%,
-      /* 早晨 - 浅蓝色 */ #f7d038 45%,
-      /* 上午 - 黄色 */ #ffffff 60%,
-      /* 正午 - 白色 */ #ff9966 75%,
-      /* 傍晚 - 橙色 */ #6a3093 90%,
-      /* 夜晚 - 深紫色 */ #0a1931 100% /* 凌晨4点 - 深蓝色 */
-    );
-    // background: linear-gradient(
-    //   to right,
-    //   #0d1b2a 0%,
-    //   /* 22:00 - 深夜 */ #1b263b 8.33%,
-    //   /* 00:00 */ #1b263b 16.67%,
-    //   /* 02:00 */ #415a77 25%,
-    //   /* 04:00 - 黎明前 */ #778da9 33.33%,
-    //   /* 06:00 - 清晨 */ #a8c0e0 41.67%,
-    //   /* 08:00 */ #d4e4f7 50%,
-    //   /* 10:00 */ #ffffff 58.33%,
-    //   /* 12:00 - 正午 */ #ffffff 66.67%,
-    //   /* 14:00 */ #fff9e6 75%,
-    //   /* 16:00 */ #ffd89b 83.33%,
-    //   /* 18:00 - 黄昏 */ #b4846c 91.67%,
-    //   /* 20:00 */ #0d1b2a 100% /* 22:00 */
-    // );
-  }
-
-  .el-slider__bar {
-    background: transparent;
-  }
-}
 .model-bg-new-right {
   width: 100%;
   min-height: 135px;
@@ -2104,4 +2069,44 @@ export default {
         color: #fff !important;
     }
 }
+
+.currentSlider {
+  .el-slider__runway {
+    background: linear-gradient(
+      90deg,
+      #0a1931 0%,
+      /* 凌晨4点 - 深蓝色 */ #1b3b6f 15%,
+      /* 清晨 - 蓝色 */ #4a90e2 30%,
+      /* 早晨 - 浅蓝色 */ #f7d038 45%,
+      /* 上午 - 黄色 */ #ffffff 60%,
+      /* 正午 - 白色 */ #ff9966 75%,
+      /* 傍晚 - 橙色 */ #6a3093 90%,
+      /* 夜晚 - 深紫色 */ #0a1931 100% /* 凌晨4点 - 深蓝色 */
+    );
+
+    .el-slider__marks-text{
+        color: #fff !important;
+    }
+    // background: linear-gradient(
+    //   to right,
+    //   #0d1b2a 0%,
+    //   /* 22:00 - 深夜 */ #1b263b 8.33%,
+    //   /* 00:00 */ #1b263b 16.67%,
+    //   /* 02:00 */ #415a77 25%,
+    //   /* 04:00 - 黎明前 */ #778da9 33.33%,
+    //   /* 06:00 - 清晨 */ #a8c0e0 41.67%,
+    //   /* 08:00 */ #d4e4f7 50%,
+    //   /* 10:00 */ #ffffff 58.33%,
+    //   /* 12:00 - 正午 */ #ffffff 66.67%,
+    //   /* 14:00 */ #fff9e6 75%,
+    //   /* 16:00 */ #ffd89b 83.33%,
+    //   /* 18:00 - 黄昏 */ #b4846c 91.67%,
+    //   /* 20:00 */ #0d1b2a 100% /* 22:00 */
+    // );
+  }
+
+  .el-slider__bar {
+    background: transparent;
+  }
+}
 </style>