From ae5e8203a6008119d57453d3ae3833e9b541b7c4 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 16 Dec 2021 13:31:44 +0800
Subject: [PATCH] +

---
 src/components/mobilemap/index.vue     |   48 ++++++-----------------
 src/components/mobileLeftNav/index.vue |   12 ++++-
 src/store/getters.js                   |    3 +
 src/store/modules/mobile.js            |    6 ++
 4 files changed, 29 insertions(+), 40 deletions(-)

diff --git a/src/components/mobileLeftNav/index.vue b/src/components/mobileLeftNav/index.vue
index 2cbf6e6..0f03e66 100644
--- a/src/components/mobileLeftNav/index.vue
+++ b/src/components/mobileLeftNav/index.vue
@@ -1,7 +1,7 @@
 <template>
   <div class="m-left-nav" :style="[navStyle]">
     <!-- :style="[coutrolStyle]" -->
-    <div class="m-left-coutrol" @click="iconHide = !iconHide">
+    <div class="m-left-coutrol" @click="changeIconHide">
       <i :class="icons"></i>
     </div>
     <ul>
@@ -46,9 +46,9 @@
 </template>
 
 <script>
+import { mapGetters } from "vuex";
 export default {
   name: "mobileLeftNav",
-  computed: {},
   watch: {
     iconHide() {
       if (this.iconHide) {
@@ -62,6 +62,9 @@
       }
     },
   },
+  computed: {
+    ...mapGetters(["iconHide"]),
+  },
   data() {
     return {
       popupWindow1: false,
@@ -71,7 +74,6 @@
         "https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
       ],
       icons: "el-icon-d-arrow-right",
-      iconHide: false,
       navStyle: {
         right: "0px",
       },
@@ -166,6 +168,10 @@
   },
   mounted() {},
   methods: {
+    changeIconHide() {
+      let isif = this.iconHide;
+      this.$store.commit("MSET_ICONHIDE", !isif);
+    },
     generatePosition(num) {
       const list = [];
       for (let i = 0; i < num; i++) {
diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index f666086..4d1b8a2 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -64,12 +64,12 @@
       bigPopup: {
         width: 0,
         height: 0,
-        transition: "all 3s",
+        // transition: "all 3s",
       },
     };
   },
   computed: {
-    ...mapGetters(["mviewer", "mBigPopup", "mBigPopupAfter"]),
+    ...mapGetters(["mviewer", "mBigPopup", "mBigPopupAfter", "iconHide"]),
   },
   watch: {
     mBigPopup() {
@@ -174,14 +174,17 @@
       });
       // let nowPosition = "";
       // 地图移动事件
-      // viewer.on(DC.MouseEventType.MOUSE_MOVE, (e) => {
-      //   if (that.popupWindow && that.popupsDom) {
-      //     that.popupsDom.closeOur();
-      //     that.popupWindow = false;
-      //   }
-      //   // nowPosition = [e.wgs84Position.lng, e.wgs84Position.lat];
-      //   // console.log(nowPosition);
-      // });
+      viewer.on(DC.MouseEventType.MOUSE_MOVE, (e) => {
+        if (!that.iconHide) {
+          that.$store.commit("MSET_ICONHIDE", true);
+        }
+        if (that.popupWindow && that.popupsDom) {
+          that.popupsDom.closeOur();
+          that.popupWindow = false;
+        }
+        // nowPosition = [e.wgs84Position.lng, e.wgs84Position.lat];
+        // console.log(nowPosition);
+      });
 
       // // eslint-disable-next-line camelcase
       // const baselayer_shaded = DC.ImageryLayerFactory.createArcGisImageryLayer({
@@ -246,32 +249,7 @@
 
         // 定制化窗体
         that.openPopupS(e.position, [e.wgs84Position.lng, e.wgs84Position.lat]);
-        // that.popupsDom = new DC.mobileDivForms(viewer, {
-        //   domId: "mobilePopup",
-        //   title: "成教楼  ",
-        //   className: "mobilePopup",
-        //   content: document.getElementById("mobile-map_content_content"),
-        //   position: [e.position],
-        // });
-        // console.log(e.position);
-        // that.positions = [e.wgs84Position.lng, e.wgs84Position.lat];
 
-        // // let flying = new DC.Flying(viewer);
-        // // flying.positions = [
-        // //   `${nowPosition[0]},${nowPosition[0]},0,-29`,
-        // //   `${e.wgs84Position.lng},${e.wgs84Position.lat},0,-29`,
-        // // ];
-        // // flying.start();
-        // console.log(e.wgs84Position.lng, e.wgs84Position.lat);
-        // viewer.zoomToPosition(
-        //   new DC.Position(
-        //     e.wgs84Position.lng,
-        //     e.wgs84Position.lat - 0.012,
-        //     1530,
-        //     0,
-        //     -45
-        //   )
-        // );
         // popup.setWrapper('<div></div>')
 
         // popup.showAt(e.position, document.getElementById('modelPopup'))
diff --git a/src/store/getters.js b/src/store/getters.js
index dbf262b..28b33f7 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -2,7 +2,8 @@
 let mobile = {
     mviewer: state => state.mobile.mviewer,
     mBigPopup: state => state.mobile.mBigPopup,
-    mBigPopupAfter: state => state.mobile.mBigPopupAfter
+    mBigPopupAfter: state => state.mobile.mBigPopupAfter,
+    iconHide: state => state.mobile.iconHide
 }
 const getters = {
     ...mobile,
diff --git a/src/store/modules/mobile.js b/src/store/modules/mobile.js
index 133768c..ac242b6 100644
--- a/src/store/modules/mobile.js
+++ b/src/store/modules/mobile.js
@@ -3,7 +3,8 @@
         mviewer: null,
         mBigPopup: false,
         mBigPopupAfter: false,
-        ips: ''
+        ips: '',
+        iconHide: false,
     },
     mutations: {
         MSET_VIEWER(state, viewer) {
@@ -14,6 +15,9 @@
         },
         MSET_BIGPOPUPAFTER(state, viewer) {
             state.mBigPopupAfter = viewer
+        },
+        MSET_ICONHIDE(state, viewer) {
+            state.iconHide = viewer
         }
     },
     actions: {

--
Gitblit v1.9.3