shuishen
2022-01-14 eecadc9f4fc4f067dba0221125bacb180ce3b0e2
Merge branch 'master' of http://192.168.0.105:10010/r/school-web
8 files modified
3 files added
479 ■■■■■ changed files
src/components/mobileActivity copy/index.vue 37 ●●●●● patch | view | raw | blame | history
src/components/mobileActivity/index.vue 27 ●●●●● patch | view | raw | blame | history
src/components/mobileCloseRouter/index.vue 5 ●●●●● patch | view | raw | blame | history
src/components/mobileCloseRouterMany/index.vue 124 ●●●●● patch | view | raw | blame | history
src/components/mobileCortrolButtom/index.vue 19 ●●●●● patch | view | raw | blame | history
src/components/mobilePopupOur/index.vue 42 ●●●●● patch | view | raw | blame | history
src/components/mobilePopupOurOnce/index.vue 8 ●●●● patch | view | raw | blame | history
src/components/mobileWindow/index.vue 51 ●●●●● patch | view | raw | blame | history
src/components/mobilemap/index.vue 4 ●●●● patch | view | raw | blame | history
src/store/getters.js 12 ●●●●● patch | view | raw | blame | history
src/store/modules/mobile.js 150 ●●●●● patch | view | raw | blame | history
src/components/mobileActivity copy/index.vue
New file
@@ -0,0 +1,37 @@
<template>
  <div id="mobileActivity">
    <div class="mobileActivity_in">showActivity</div>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  name: "mobileActivity",
  computed: {
    ...mapGetters(["showActivity"]),
  },
};
</script>
<style lang="scss" scoped>
#mobileActivity {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  background-color: rgba($color: #000000, $alpha: 0.3);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  .mobileActivity_in {
    border-radius: 25px 25px 10px 10px;
    width: 70%;
    height: 50%;
    background-color: #fff;
    box-sizing: border-box;
    padding: 10px;
  }
}
</style>
src/components/mobileActivity/index.vue
New file
@@ -0,0 +1,27 @@
<template>
  <div id="mobileActivity">
    <div class="mobileActivity_in">showActivity</div>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  name: "mobileActivity",
  computed: {
    ...mapGetters(["showActivity"]),
  },
};
</script>
<style lang="scss">
#mobileActivity {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: 999;
}
</style>
src/components/mobileCloseRouter/index.vue
@@ -60,7 +60,7 @@
        return;
      }
      this.$store.commit("set_choiceRouterS", index);
      this.$store.dispatch("MSET_DRAWALINELAYER", Str);
      this.$store.dispatch("MSET_DRAWALINELAYER", [Str]);
    },
  },
};
@@ -91,7 +91,7 @@
.mobileCloseRouterOpen {
  position: fixed;
  // width: 127px;
  width: 80px;
  width: 50px;
  height: 32px;
  background-color: #fff;
  z-index: 600;
@@ -114,6 +114,7 @@
  opacity: 1;
}
.mobileCloseActiveOpen {
  width: 80px;
  border: 1px solid #409eff;
  background-color: #409eff;
  color: #fff;
src/components/mobileCloseRouterMany/index.vue
New file
@@ -0,0 +1,124 @@
<template>
  <!-- v-show="isOpenDrawALine" -->
  <div class="routersMany">
    <div
      :class="[
        'mobileCloseRouterMany',
        isOpenDrawALineMany ? 'mobileCloseActiveMany' : '',
      ]"
      @click="mobileRouterCloseMany"
    >
      退出活动展示
    </div>
    <!-- <div
      v-for="(item, index) in routerS"
      :key="item.Str"
      :style="{ bottom: 357 + index * 37 + 'px' }"
      :class="[
        'mobileCloseRouterOpen',
        index < lengthS && isOpenDrawALine ? 'mobileCloseActive' : '',
        choiceRouterS == index ? 'mobileCloseActiveOpen' : '',
      ]"
      @click="mobileRouterCloseOpen(item.Str, index)"
    >
      路径{{ index + 1 }}
    </div> -->
  </div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  name: "mobileCloseRouterMany",
  computed: {
    ...mapGetters(["isOpenDrawALineMany"]),
  },
  // data() {
  //   return {
  //     lengthS: 0,
  //   };
  // },
  // watch: {
  // isOpenDrawALine() {
  //   if (this.isOpenDrawALine) {
  //   } else {
  //   }
  // },
  // routerS() {
  //   if (this.routerS.length == 0) {
  //     this.lengthS = 0;
  //   }
  //   setTimeout(() => {
  //     this.lengthS++;
  //   }, 200);
  // },
  // },
  methods: {
    mobileRouterCloseMany() {
      this.$store.commit("removePolylineMany");
    },
    // mobileRouterCloseOpen(Str, index) {
    //   if (this.choiceRouterS == index) {
    //     return;
    //   }
    //   this.$store.commit("set_choiceRouterS", index);
    //   this.$store.dispatch("MSET_DRAWALINELAYER", Str);
    // },
  },
};
</script>
<style lang="scss" scoped>
.routersMany {
  width: 0;
  height: 0;
}
.mobileCloseRouterMany {
  position: fixed;
  width: 105px;
  height: 32px;
  background-color: #409eff;
  z-index: 600;
  right: -100px;
  opacity: 0;
  bottom: 320px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 0 0 8px;
  color: #fff;
  transition: all 0.5s;
}
// .mobileCloseRouterOpen {
//   position: fixed;
//   // width: 127px;
//   width: 50px;
//   height: 32px;
//   background-color: #fff;
//   z-index: 600;
//   right: -100px;
//   opacity: 0;
//   bottom: 357px;
//   font-size: 14px;
//   display: flex;
//   align-items: center;
//   justify-content: center;
//   border-radius: 8px 0 0 8px;
//   color: #000;
//   border-left: 1px solid #a4d1ff;
//   border-top: 1px solid #a4d1ff;
//   border-bottom: 1px solid #a4d1ff;
//   transition: all 0.5s;
// }
.mobileCloseActiveMany {
  right: 0px;
  opacity: 1;
}
// .mobileCloseActiveOpen {
//   width: 80px;
//   border: 1px solid #409eff;
//   background-color: #409eff;
//   color: #fff;
// }
</style>
src/components/mobileCortrolButtom/index.vue
@@ -20,6 +20,9 @@
    <div class="m-l-inbut" @click="openBigPopupAfter">
      <i class="el-icon-menu"></i>
    </div>
    <div class="m-l-inbut" @click="openActivity">
      <i class="el-icon-s-opportunity"></i>
    </div>
    <!-- <div class="m-l-inbut" @click="goOn"><i class="el-icon-location"></i></div> -->
  </div>
</template>
@@ -28,6 +31,7 @@
import { mapGetters } from "vuex";
import { getIp, getUsers } from "@/api/mobile/ip/index";
import { getListarc } from "@/api/mobile/public/arc";
import { getActivity } from "@/api/mobile/hd/hd";
export default {
  name: "mobileCortrolButtom",
  data() {
@@ -63,6 +67,21 @@
  },
  mounted() {},
  methods: {
    openActivity() {
      let d = {
        main: [
          {
            name: "活动",
            type: 1,
            method: getActivity,
          },
        ],
        qurey: "活动",
      };
      this.$store.commit("MSET_POPUPOUROPENDATA", d);
      this.$store.commit("MSET_BIGPOPUP", { name: "活动" });
      // this.$store.commit("set_showActivity", true);
    },
    mubiao() {
      let that = this;
      //测试fllyTo
src/components/mobilePopupOur/index.vue
@@ -143,7 +143,7 @@
      this.$store.commit("MSET_BIGPOPUP", false);
    },
    getDataHeardDown() {
      if (this.choiceMain == "机构单位") {
      if (this.choiceMain == "机构单位" || this.choiceMain == "活动") {
        //不请求头部标签页数据
        this.getOutList(this.choiceKey);
        return;
@@ -212,6 +212,44 @@
                  : ["定位"],
            });
          });
        } else if (this.mBigPopup.name == "活动") {
          // 社区建筑使用该id获取具体信息
          data.records.forEach((item) => {
            let icon = item.tpurl.split(",");
            let useData = {
              name: item.hdname,
              // lntLat: [item.jd, item.wd],
              // alt: item.gd,
              // heading: item.heading,
              // pitch: item.pitch,
              // roll: item.roll,
              bgImg: item.tpurl,
              icon: icon,
              icons: icon + item.hdname, //图片响应改变
              from: this.choiceMain,
              // QRImg: item.codeurl,
              websiteUrl: item.websiteurl,
              telePhone: item.telephone,
              // address: item.address,
              introduce: item.context,
              video: item.videourl,
              buts:
                that.mBigPopup.name == "社区建筑" ||
                that.mBigPopup.name == "文化风景"
                  ? ["定位", "实景", "图集"]
                  : ["定位"],
              //活动添加的字段
              addressname: item.addressname.split(";"),
              address: item.address.split(";"),
              lxname: item.lxname.split(";"),
              lx: item.lx.split(";"),
              lntLat: [
                item.address.split(";")[0].split(",")[0],
                item.address.split(";")[0].split(",")[1],
              ],
            };
            outList.push(useData);
          });
        } else {
          //正常获取全部数据
          data.records.forEach((item) => {
@@ -243,7 +281,7 @@
          });
        }
        that.fullscreenLoading = false;
        if (this.choiceMain == "机构单位") {
        if (this.choiceMain == "机构单位" || this.choiceMain == "活动") {
          that.onlyData = outList;
          return;
        }
src/components/mobilePopupOurOnce/index.vue
@@ -94,8 +94,12 @@
        return;
      }
      let that = this;
      // console.log(that.ourData.lntLat);
      if (val == "定位") {
        //活动定位
        if (this.ourData.name == "活动") {
          console.log(this.ourData);
          return;
        }
        //随地图移动窗口
        this.$store.commit("MSET_BIGPOPUP", false); //关闭全屏弹窗
        setTimeout(() => {
@@ -202,4 +206,4 @@
    }
  }
}
</style>
</style>
src/components/mobileWindow/index.vue
@@ -107,11 +107,20 @@
      if (!this.MobileWindowsHide) {
        this.video = ""; //清除视频
        let queryData = this.query.query;
        // console.log(queryData);
        console.log(queryData, 789);
        this.title = queryData.name;
        if (queryData.seebut) {
          this.seebut = queryData.seebut;
          if (queryData.from == "活动") {
            this.seebut = [];
            this.seebut.push({
              name: "图集",
            });
            this.seebut.push({
              name: "显示活动",
            });
          }
          for (let k in this.seebut) {
            if (this.seebut[k].name == "定位") {
              this.seebut.splice(k, k + 1);
@@ -152,7 +161,12 @@
        this.center = [];
        for (let k in queryData) {
          for (let n in this.getCenter) {
            if (k == this.getCenter[n].name && queryData[k]) {
            if (
              k == this.getCenter[n].name &&
              queryData[k] &&
              queryData.from != "活动" &&
              this.getCenter[n].value == "地址"
            ) {
              this.center.push({
                name: this.getCenter[n].value,
                value: queryData[k] ? queryData[k] : "暂无",
@@ -210,9 +224,10 @@
      let that = this;
      that.routerS = [];
      let once = true;
      let query = this.query.query;
      if (val == "去这") {
        //定位
        console.log(this.query.query);
        // console.log(this.query.query);
        // that.$store.commit("set_endPosition", this.query.query.lntLat);
        let ints = {
          // start: [114.039946, 27.628475],
@@ -227,7 +242,7 @@
              once = false;
              //加载第一条线路
              that.$store.commit("set_choiceRouterS", 0);
              that.$store.dispatch("MSET_DRAWALINELAYER", datas.Str);
              that.$store.dispatch("MSET_DRAWALINELAYER", [datas.Str, query]);
              that.$store.commit("cameraSetView", ints.start);
            }
          },
@@ -249,8 +264,36 @@
      } else if (val == "返回") {
        this.seebut[this.seebut.length - 1].name = "视频";
        this.video = "";
      } else if (val == "显示活动") {
        let addressOur = this.changeData(query, "addressname", "address");
        let lxOur = this.changeData(query, "lxname", "lx");
        console.log(addressOur, lxOur);
        that.$store.dispatch("MSET_DRAWALINELAYERMANY", [
          lxOur,
          addressOur,
          query,
        ]);
      }
    },
    changeData(data, name, value) {
      let arr = [];
      for (let k in data[name]) {
        arr.push({
          name: data[name][k],
          value:
            name == "lxname"
              ? data[value][k]
                  .split("(")[1]
                  .split(")")[0]
                  .split(",")
                  .join(";")
                  .split(" ")
                  .join(",")
              : [+data[value][k].split(",")[0], +data[value][k].split(",")[1]],
        });
      }
      return arr;
    },
    closeWindow() {
      if (!this.MobileWindowsHide) {
        this.$store.dispatch("closeMobileWindowsDom"); //关闭随地图弹窗
src/components/mobilemap/index.vue
@@ -24,6 +24,10 @@
    <mobilePanorama></mobilePanorama>
    <!-- 退出导航 -->
    <mobileCloseRouter></mobileCloseRouter>
    <!-- 退出活动 -->
    <mobileCloseRouterMany></mobileCloseRouterMany>
    <!-- 活动窗口 -->
    <!-- <mobileActivity></mobileActivity> -->
    <!-- 盖住左下角 -->
    <div class="cover_mobileMap">智慧社区</div>
  </div>
src/store/getters.js
@@ -22,12 +22,24 @@
    perspectiveControl: (state) => state.mobile.perspectiveControl, /// 视角控制:高度、角度  ()=>{}
    audioState: (state) => state.mobile.audioState, // 文字转语音状态
<<<<<<< HEAD
  isOpenDrawALine: (state) => state.mobile.isOpenDrawALine, //是否开启路线
  isendPosition: (state) => state.mobile.isendPosition, //路线导航终点数据改变
  endPosition: (state) => state.mobile.endPosition, //路线导航终点数据
  routerS: (state) => state.mobile.routerS, //所有路径
  choiceRouterS: (state) => state.mobile.choiceRouterS, //当前选择路径
  showActivity: (state) => state.mobile.showActivity, //显影活动弹窗
  isOpenDrawALineMany: (state) => state.mobile.isOpenDrawALineMany, //显影活动弹窗
};
=======
    isOpenDrawALine: (state) => state.mobile.isOpenDrawALine, // 是否开启路线
    isendPosition: (state) => state.mobile.isendPosition, // 路线导航终点数据改变
    endPosition: (state) => state.mobile.endPosition, // 路线导航终点数据
    routerS: (state) => state.mobile.routerS, // 所有路径
    choiceRouterS: (state) => state.mobile.choiceRouterS // 当前选择路径
}
>>>>>>> acb45c731c3ccd0a67061efb4e7bdf4f56005672
const navigation = {
    campusNavFlag: (state) => state.navigation.campusNavFlag,
src/store/modules/mobile.js
@@ -61,6 +61,10 @@
    isendPosition: false, //传送终点经纬度--感应数据
    routerS: [], //所有路径
    choiceRouterS: 0, //当前选择路径
    showActivity: false, //是否显示活动弹窗
    drawALineLayerMany: null, //活动路线图层
    isOpenDrawALineMany: null, //是否开启活动
  },
  mutations: {
    MSET_VIEWER(state, viewer) {
@@ -266,6 +270,13 @@
        state.isOpenDrawALine = false;
      }
    },
    removePolylineMany(state) {
      if (state.drawALineLayerMany) {
        state.drawALineLayerMany.remove();
        state.drawALineLayerMany = null;
        state.isOpenDrawALineMany = false;
      }
    },
    //传送终点数据
    set_endPosition(state, data) {
      state.isendPosition = !state.isendPosition;
@@ -274,6 +285,10 @@
    //传送当前选择的路径
    set_choiceRouterS(state, data) {
      state.choiceRouterS = data;
    },
    //活动窗口是否显示
    set_showActivity(state, data) {
      state.showActivity = data;
    },
  },
  actions: {
@@ -708,6 +723,7 @@
            titles: titles,
            Str: Str,
          };
          // console.log(Str);
          state.routerS.push(dataS);
          return val.fn(dataS);
        } else {
@@ -717,9 +733,11 @@
    },
    //导航系统↑
    //绘画线路
    MSET_DRAWALINELAYER({ state, commit, dispatch }, Str) {
    MSET_DRAWALINELAYER({ state, commit, dispatch }, value) {
      let Str = value[0];
      //检查是否存在路线
      commit("removePolyline");
      commit("removePolylineMany");
      let color =
        global.DC.Namespace.Cesium.Color.fromCssColorString("#409EFF");
      let material = new global.DC.PolylineTrailMaterialProperty({
@@ -735,10 +753,140 @@
        clampToGround: true,
      });
      drawALineLayer.addOverlay(polyline);
      //如果是添加  给第一个点加入图标 和事件
      if (value[1]) {
        let post = Str.split(";")[0].split(",");
        let position = new global.DC.Position(post[0], post[1]);
        let billboard = new global.DC.Billboard(
          position,
          "img/dingwei/dingwei4.png"
        ); //加入绘画点
        billboard.setStyle({
          pixelOffset: { x: 0, y: -17 }, //偏移像素
        });
        //订阅事件
        billboard.on(global.DC.MouseEventType.CLICK, (e) => {
          // console.log(e);
          // return;
          // 定制化窗体
          let position = e.position,
            lntLat = [e.overlay._position._lng, e.overlay._position._lat];
          let windowData = {
            position,
            lntLat,
            query: { ...(value[1] || {}), position, lntLat },
            useJWD: true, //仅使用经纬度
          };
          dispatch("setMobileWindows", windowData);
        });
        drawALineLayer.addOverlay(billboard);
      }
      state.drawALineLayer = drawALineLayer;
      state.isOpenDrawALine = true;
      // commit("cameraSetView", state.navigationStartLngLat); //移动
    },
    //绘画线路活动多条
    MSET_DRAWALINELAYERMANY({ state, commit, dispatch }, value) {
      //检查是否存在路线
      commit("removePolylineMany");
      commit("removePolyline");
      let Strs = value[0];
      let red = global.DC.Namespace.Cesium.Color.fromCssColorString("#FF0000");
      let white = global.DC.Namespace.Cesium.Color.fromCssColorString("#fff");
      let blue = global.DC.Namespace.Cesium.Color.fromCssColorString("#2196F3");
      let material = new global.DC.PolylineTrailMaterialProperty({
        color: red,
        speed: 10,
      });
      let drawALineLayerMany = new global.DC.VectorLayer("layer");
      state.mviewer.addLayer(drawALineLayerMany);
      //多条线
      for (let k in Strs) {
        let polyline = new global.DC.Polyline(Strs[k].value); //加入绘画点
        polyline.setStyle({
          width: 3,
          material: material,
          clampToGround: true,
        });
        drawALineLayerMany.addOverlay(polyline);
        let post = Strs[k].value.split(";")[0].split(",");
        let position = new global.DC.Position(post[0], post[1]);
        let Label = new global.DC.Label(position, Strs[k].name);
        Label.setStyle({
          font: "16px sans-serif", // CSS 字体设置
          scale: 1, //比例
          fillColor: white, //文字颜色
          showBackground: true, //是否显示背景
          backgroundColor: blue, //背景颜色
          // outlineColor: white, //边框颜色
          // outlineWidth: 10, //边框大小,
        });
        drawALineLayerMany.addOverlay(Label);
      }
      //多个点
      let point = value[1];
      for (let k in point) {
        let post = point[k].value;
        let position = new global.DC.Position(post[0], post[1]);
        let billboard = new global.DC.Billboard(
          position,
          "img/dingwei/dingwei4.png"
        ); //加入绘画点
        billboard.setStyle({
          pixelOffset: { x: 0, y: -17 }, //偏移像素
        });
        //订阅事件
        billboard.on(global.DC.MouseEventType.CLICK, (e) => {
          // console.log(e);
          // return;
          // 定制化窗体
          let position = e.position,
            lntLat = [e.overlay._position._lng, e.overlay._position._lat];
          let windowData = {
            position,
            lntLat,
            query: { ...(value[2] || {}), position, lntLat },
            useJWD: true, //仅使用经纬度
          };
          dispatch("setMobileWindows", windowData);
        });
        drawALineLayerMany.addOverlay(billboard);
        let Labels = new global.DC.Label(position, point[k].name);
        Labels.setStyle({
          font: "16px sans-serif", // CSS 字体设置
          scale: 1, //比例
          fillColor: white, //文字颜色
          showBackground: true, //是否显示背景
          backgroundColor: blue, //背景颜色
          // outlineColor: white, //边框颜色
          // outlineWidth: 1, //边框大小,
          pixelOffset: { x: 0, y: -47 }, //偏移像素
        });
        //订阅事件
        Labels.on(global.DC.MouseEventType.CLICK, (e) => {
          // console.log(e);
          // return;
          // 定制化窗体
          let position = e.position,
            lntLat = [e.overlay._position._lng, e.overlay._position._lat];
          let windowData = {
            position,
            lntLat,
            query: { ...(value[2] || {}), position, lntLat },
            useJWD: true, //仅使用经纬度
          };
          dispatch("setMobileWindows", windowData);
        });
        drawALineLayerMany.addOverlay(Labels);
        // console.log(point[k]);
      }
      state.drawALineLayerMany = drawALineLayerMany;
      state.isOpenDrawALineMany = true;
      // commit("cameraSetView", state.navigationStartLngLat); //移动
    },
  },
};