From f5233339920a59103d53e8efadc6f3f5d0b64f31 Mon Sep 17 00:00:00 2001
From: lixuliang <lixuliang_hd@126.com>
Date: 星期三, 08 五月 2024 14:45:37 +0800
Subject: [PATCH] 移动端

---
 src/components/rightMenu/bottom.vue |  229 ++++++++++++++++++++++++--------------------------------
 1 files changed, 99 insertions(+), 130 deletions(-)

diff --git a/src/components/rightMenu/bottom.vue b/src/components/rightMenu/bottom.vue
index b32c12b..cfafd63 100644
--- a/src/components/rightMenu/bottom.vue
+++ b/src/components/rightMenu/bottom.vue
@@ -1,27 +1,31 @@
 <template>
-  <div class="bottom" id="bottom">
-    <div class="mapTools" v-show="show">
-      <div class="mapTool" v-show="test.fwval">
-        <el-button class="tool-rotate" @click="zoomIn" title="鏀惧ぇ">
-          <img src="../../../static/img/image/zoomIn.png" />
-        </el-button>
+  <div class="bottom" id="bottom" :style="customStyle" v-show="show">
+    <div class="mapTool">
+      <div class="tool-rotate" @click="flyBack" title="澶嶄綅">
+        <img src="@/assets/img/collection/recover.png" />
       </div>
-       <div class="mapTool" v-show="test.fwval">
-        <el-button class="tool-rotate" @click="zoomOut" title="缂╁皬">
-          <img src="../../../static/img/image/zoomOut.png" />
-        </el-button>
+    </div>
+    <div class="mapTool2" v-show="test.fwval">
+      <div class="tool-rotate" @click="zoomIn" title="鏀惧ぇ">
+        <img src="@/assets/img/collection/add.png" />
       </div>
-      <!-- <div class="mapTool">
+      <div class="border"></div>
+      <div class="tool-rotate" @click="zoomOut" title="缂╁皬">
+        <img src="@/assets/img/collection/reduce.png" />
+      </div>
+    </div>
+    <!-- <div class="mapTool">
         <el-button
           class="tool-trueNorth"
-          v-show="test.zbzval"
+          v-show="test.
+          "
           @click="trueNorth"
           title="姝e寳"
         >
           <img src="../../../static/img/image/zbz.png" />
         </el-button>
       </div> -->
-      <!-- <div class="mapTool">
+    <!-- <div class="mapTool">
         <el-button
           class="tool-fullScreen"
           v-show="test.qpval"
@@ -31,127 +35,60 @@
           <img src="../../../static/img/image/qp.png" />
         </el-button>
       </div> -->
-    </div>
   </div>
 </template>
 
 <style scoped>
-.bottom {
-  position: absolute;
-  bottom: 0.4rem;
-  height: 0.76rem;
-  right: 0.4rem;
-}
-.mapModeControl {
-  position: absolute;
-  right: 0.05rem;
-  background: rgba(90, 90, 90, 0.5);
-  bottom: 0.05rem;
-  height: 0.76rem;
-  width: 1.03rem;
-  transition: all 1s;
-}
-.bottom .mapModeControl:hover {
-  transition: all 0.6s;
-  -webkit-transition: all 0.6s;
-  width: 3.2rem;
-}
-.mapMode {
-  display: inline-block;
-}
-.mapMode dl {
-  width: 0.88rem;
-  height: 0.6rem;
-  border: 1px solid #494949;
-  cursor: pointer;
-  margin: 0.08rem;
-}
-
-.mapMode dl:hover {
-  border-color: #0553b4;
-}
-
-.mapMode dl {
-  position: relative;
-}
-#history {
-  background: url(../../../static/img/1.png) no-repeat;
-}
-#mode-3d {
-  background: url(../../../static/img/2.png) no-repeat;
-}
-#mode-2d {
-  background: url(../../../static/img/4.png) no-repeat;
-}
-.mapMode dt {
-  width: 100%;
-  height: 0.2rem;
-  line-height: 0.2rem;
-  position: absolute;
-  left: 0;
-  bottom: 0px;
-  font-size: 0.12rem;
-  text-align: center;
-  color: #fff;
-  text-shadow: 1px 1px 2px #000;
-  background: rgba(0, 0, 0, 0.5);
-}
-.mapModeActive {
-  background: rgba(1, 37, 80, 0.5) !important;
-}
-
-.mapTools {
-  position: absolute;
-  /* bottom: 2rem; */
-  bottom: 0.2rem;
-  /* right: 0.1rem; */
-}
 .mapTool {
-  margin: 0.1rem 0;
+  width: 0.42rem;
+  /* border-radius: 10px; */
+  /* background: #ffffff; */
+  /* margin-bottom: 8px; */
 }
-.mapTool .el-button {
-  padding: 0 !important;
-  font-size: 0.24rem;
-  border: unset;
-  float: unset;
-  display: block;
-  background: rgba(18, 126, 255, 1);
+.mapTool .tool-rotate img {
+  width: 100%;
+}
+.mapTool2 {
+  width: 0.32rem;
+  margin: auto;
+  background: #ffffff;
+  box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.21);
+  border-radius: 10px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+.mapTool2 .tool-rotate {
+  height: 0.33rem;
+  line-height: 0.33rem;
 }
 
-/* .button-group-vertical {
-  text-align: center;
-  position: relative;
-} */
-.fgx {
-  position: absolute;
-  width: 80%;
-  height: 1px;
-  height: 1px;
-  border: 1px solid #dcdfe6;
-  z-index: 999;
-  margin: 0 10%;
+.mapTool2 .tool-rotate img {
+  width: 0.17rem;
 }
-/* .button-group-vertical .el-button-group > .el-button:first-child {
-  border-top-right-radius: 0.04rem !important;
-  border-bottom-left-radius: 0px !important;
-}
-.button-group-vertical .el-button-group > .el-button:last-child {
-  border-top-right-radius: 0;
-  border-bottom-left-radius: 0.04rem !important;
-} */
-.mapTool img {
-  width: 24px;
-  margin: 3px;
-  /* height: 0.4rem; */
+
+.border {
+  width: 100%;
+  height: 1px;
+  border: 0.005rem solid #f3f3f3;
 }
 </style>
     
 <script>
 import Bus from "../../js/bus.js";
+import store from "@/utils/store";
+
 export default {
   props: ["test"],
   data() {
     return {
+      customStyle: {
+        position: "absolute",
+        bottom: "0.4rem",
+        right: "0.1rem",
+      },
+      state: store.layerPanel,
       show: true,
       parentdata: {
         fwval: false,
@@ -188,9 +125,29 @@
     };
   },
   mounted() {
-    Bus.$on("myMsg", (myMsg) => {
-      this.show = myMsg;
-    });
+    // Bus.$on("myMsg", (myMsg) => {
+    //   this.show = myMsg;
+    // });
+  },
+  watch: {
+    "state.show": {
+      handler(newVal) {
+        if (newVal) {
+          this.customStyle = {
+            position: "absolute",
+            top: "calc(0.75rem + 40px)",
+            right: "0.1rem",
+          };
+        } else {
+          this.customStyle = {
+            position: "absolute",
+            bottom: "0.4rem",
+            right: "0.1rem",
+          };
+        }
+      },
+      immediate: true,
+    },
   },
   methods: {
     modeClick(index, mode) {
@@ -198,20 +155,32 @@
       Viewer.scene.mode = mode;
     },
     flyBack() {
+      const loading = this.$loading({
+        lock: true,
+        text: "闀滃ご澶嶄綅涓�...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
       // let p = sgworld.Navigate.getDegrees();
       // console.log("缁忕含搴�:", p);
-      sgworld.Navigate.flyToPointsInterest({
-        destination: new Cesium.Cartesian3.fromDegrees(
-          this.camera.position[0],
-          this.camera.position[1],
-          this.camera.position[2]
-        ),
-        orientation: {
-          heading: Cesium.Math.toRadians(this.camera.orientation.heading),
-          pitch: Cesium.Math.toRadians(this.camera.orientation.pitch),
-          roll: Cesium.Math.toRadians(this.camera.orientation.roll),
+      sgworld.Navigate.flyToPointsInterest(
+        {
+          destination: new Cesium.Cartesian3.fromDegrees(
+            this.camera.position[0],
+            this.camera.position[1],
+            this.camera.position[2]
+          ),
+          orientation: {
+            heading: Cesium.Math.toRadians(this.camera.orientation.heading),
+            pitch: Cesium.Math.toRadians(this.camera.orientation.pitch),
+            roll: Cesium.Math.toRadians(this.camera.orientation.roll),
+          },
         },
-      });
+        () => {
+          loading.close();
+        }
+      );
     },
     fullScreen() {
       Viewer.fullscreenButton.viewModel.command(true);

--
Gitblit v1.9.3