++
liuyg
2022-03-05 01f9c88fd0ee768155e5b341c2bb95a85bc11a08
src/components/mobileLeftNav/index.vue
@@ -1,5 +1,5 @@
<template>
  <div class="m-left-nav" :style="[navStyle]">
  <div :class="['m-left-nav', seeRight ? '' : 'nones']" :style="[navStyle]">
    <!-- :style="[coutrolStyle]" -->
    <div class="m-left-coutrol" @click="changeIconHide">
      <i :class="icons"></i>
@@ -9,6 +9,7 @@
        v-for="(item, index) in leftNavData"
        :key="index"
        @click="leftNavClick(item)"
        v-show="!item.notShow"
      >
        <img :style="[imgStyle]" :src="item.img" alt="" />
        <span>{{ item.label }}</span>
@@ -43,9 +44,26 @@
        this.imgStyle.right = "0";
      }
    },
    seeRight() {
      if (this.seeRight) {
        this.leftNavData[0].flag = false;
        this.leftNavData[0].img = this.leftNavData[0].checked;
        this[this.leftNavData[0].layer].show = true;
      } else {
        let lnd = this.leftNavData;
        for (let k in lnd) {
          if (this[this.leftNavData[k].layer]._show) {
            // console.log(lnd[k].label, "所有开启");
            this.leftNavData[k].flag = false;
            this.leftNavData[k].img = this.leftNavData[k].normal;
            this[this.leftNavData[k].layer].show = false;
          }
        }
      }
    },
  },
  computed: {
    ...mapGetters(["iconHide"]),
    ...mapGetters(["iconHide", "dimensionData", "seeRight"]),
  },
  data() {
    return {
@@ -58,9 +76,10 @@
      },
      leftNavData: [
        {
          flag: false,
          flag: true,
          label: "标签",
          img: "/img/leftnav/tag.png",
          // img: "/img/leftnav/tag.png",
          img: "/img/leftnav/tag-checked.png",
          normal: "/img/leftnav/tag.png",
          checked: "/img/leftnav/tag-checked.png",
          layer: "tagLayer",
@@ -121,6 +140,7 @@
          type: 9,
          imgSrc: "img/leftnav/map-aed.png",
          // imgSrc: "img/mobile/pink.png",
          notShow: true,
        },
        {
          flag: false,
@@ -169,6 +189,7 @@
      this.$store.commit("MSET_ICONHIDE", !isif);
    },
    leftNavClick(item) {
      // console.log(123132);
      //判断并关闭已开启标签
      let lnd = this.leftNavData;
      for (let k in lnd) {
@@ -190,7 +211,7 @@
        item.img = item.checked;
        this[item.layer].show = true;
        // console.log("飞入");
        this.flyTo(item);
        // this.flyTo(item);
        this.$store.dispatch("closeMobileWindowsDom"); //关闭弹窗
      } else {
        item.img = item.normal;
@@ -198,16 +219,29 @@
      }
    },
    flyTo(item) {
      let that = this;
      let posi = this[item.layer].positions[0];
      // console.log(posi);
      let lntLat =
        that.dimensionData.pitch == -45
          ? [posi.lng + 0.00917, posi.lat - 0.0188, 500]
          : [posi.lng + 0.01197, posi.lat - 0.00055, 500];
      // that.mviewer.camera.flyTo({
      //   destination: Cesium.Cartesian3.fromDegrees(
      //     lntLat[0],
      //     lntLat[1],
      //     lntLat[2]
      //   ),
      // });
      // return;
      this.$store.dispatch("mapFlyTo", {
        //飞入
        lntLat: [posi.lng + 0.00917, posi.lat - 0.0188, 2100],
        lntLat: lntLat,
        // lntLat: [posi.lng + 0.01187, posi.lat - 0.0308, 4000],
        // lntLat: [121.50492752204283, 31.21567802276832, 2530],
        heading: 0,
        pitch: -45,
        roll: 0,
        heading: that.dimensionData.heading,
        pitch: that.dimensionData.pitch,
        roll: that.dimensionData.roll,
        noOpen: true,
      });
    },
@@ -271,7 +305,7 @@
              dom = `
                        <div  class="way-entitys-box">
                            <div  class="way-title" style="border: white 1px solid; padding-left: 2px;font-size: 12px; background: #0066ff;  width: 12px;line-height: 13px; padding:2px 1px 2px 1px; color:white;">
                                ${data[k].roadname}
                                 ${data[k].roadname}
                            </div>
                            <div  class="way-sign-box">
                                <img src="https://map.hit.edu.cn/images/roadsign3.png">
@@ -283,12 +317,11 @@
              //    ${data[k].mechanismname}
              // </div>
              dom = `
                        <div  class="way-entitys-box mobile-way-entitys-box">
                            <div  class="way-sign-box ">
                                <img src="img/leftnav/map-panorama.png">
                            </div>
                        <div class="scene-entitys-box">
                            <div>${data[k].mechanismname}</div>
                            <img src="/img/leftnav/map-panorama.png" alt="">
                        </div>
                    `;
                        `;
            } else if (ourD.label == "AED") {
              dom = `
                        <div class="mobiletag-entitys-box">
@@ -328,15 +361,11 @@
                    `;
            } else if (ourD.label == "监控") {
              dom = `
                        <div class="mobiletag-entitys-box-pink">
                            <div class="tag-content">
                              监控
                            </div>
                            <div class="tag-angle-content">
                                <img src="${ourD.imgSrc}">
                            </div>
                        <div class="monitor-entitys-box">
                            <div>${data[k].mechanismname}</div>
                            <img class="monitor-entitys-box" src="/img/leftnav/map-monitor.png" alt="">
                        </div>
                    `;
                        `;
            }
            const divIcon = new that.DC.DivIcon(position[k], dom);
            //订阅事件
@@ -351,6 +380,7 @@
                video: data[k].videourl || "",
                from: "labels",
                introduce: data[k].introduce,
                panoramaurl: data[k].panoramaurl,
              };
              // 定制化窗体
              that.openPopupS(
@@ -362,9 +392,16 @@
            that[that.leftNavData[n].layer].addOverlay(divIcon); //加入图标
          }
          that[that.leftNavData[n].layer]["positions"] = position;
          that[that.leftNavData[n].layer].show = false;
          if (that.leftNavData[n].layer == "tagLayer") {
            // that.leftNavData[n].img = that.leftNavData[n].checked;
          } else {
            that[that.leftNavData[n].layer].show = false;
          }
        });
      }
      // setTimeout(() => {
      //   this.tagLayer.show = false;
      // }, 500);
    },
    changePoiton(data) {
      // console.log(data);
@@ -395,7 +432,7 @@
};
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.m-left-nav {
  position: fixed;
  bottom: 30px;
@@ -407,7 +444,7 @@
  .m-left-coutrol {
    position: absolute;
    left: -24px;
    top: 96px;
    top: 79px;
    width: 25px;
    height: 60px;
    background-color: #fff;
@@ -455,4 +492,7 @@
    }
  }
}
.nones {
  display: none;
}
</style>