+
liuyg
2021-12-16 ae5e8203a6008119d57453d3ae3833e9b541b7c4
+
4 files modified
69 ■■■■■ changed files
src/components/mobileLeftNav/index.vue 12 ●●●● patch | view | raw | blame | history
src/components/mobilemap/index.vue 48 ●●●● patch | view | raw | blame | history
src/store/getters.js 3 ●●●● patch | view | raw | blame | history
src/store/modules/mobile.js 6 ●●●● patch | view | raw | blame | history
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++) {
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'))
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,
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: {