shuishen
2022-07-21 58060e64e1fa9cf3ffcf5e29f09c4c2edf8f2126
src/components/mobilePopupOurOnce/index.vue
@@ -23,9 +23,7 @@
        <div
          class="mobilePopupOurOnce_r_up"
          @click.self.stop="openOnce('定位')"
        >
          {{ onceData.name }}
        </div>
                >{{ onceData.name }}</div>
        <div class="mobilePopupOurOnce_r_down">
          <div v-for="(item, index) in seebut" :key="index">
            <el-link
@@ -40,8 +38,7 @@
              "
              class="mobilePopupOurOnce_r_d_in"
              @click="openOnce(item.name)"
              >{{ item.name }}</el-link
            >
                        >{{ item.name }}</el-link>
            <el-divider
              direction="vertical"
              class="mobilePopupOurOnce_r_d_in"
@@ -55,101 +52,110 @@
</template>
<script>
import { mapGetters } from "vuex";
import { getChildNavDetail } from "@/api/mobile/public/arc";
import { mapGetters } from 'vuex'
import { getChildNavDetail } from '@/api/mobile/public/arc'
export default {
  props: ["onceData", "ends"],
  name: "mobilePopupOurOnce",
    props: ['onceData', 'ends'],
    name: 'mobilePopupOurOnce',
  created() {
    if (this.onceData.icon) {
      this.srcList = this.onceData.icon;
      this.icon = this.srcList[0];
            this.srcList = this.onceData.icon
            this.icon = this.srcList[0]
    }
    if (this.onceData.from == "校区建筑" || this.onceData.from == "文化风景") {
      this.getOnceCampus(this.onceData.id);
        if (this.onceData.from == '校区建筑' || this.onceData.from == '文化风景') {
            this.getOnceCampus(this.onceData.id)
    } else {
      this.ourData = this.onceData;
            this.ourData = this.onceData
    }
  },
  data() {
    return {
      icon: "",
            icon: '',
      srcList: [],
      ourData: {},
    };
            ourData: {}
        }
  },
  computed: {
    ...mapGetters(["mviewer"]),
        ...mapGetters(['mviewer']),
    seebut() {
      const buts = this.onceData.buts;
      let b = [];
            const buts = this.onceData.buts
            let b = []
      for (const k in buts) {
        if (buts[k] == "实景") {
          continue;
                if (buts[k] == '实景') {
                    continue
        }
        b.push({
          name: buts[k],
        });
                    name: buts[k]
                })
      }
      if (this.ourData.panoramaurl) {
        b.push({
          name: "实景",
        });
                    name: '实景'
                })
      } else {
        b = b.filter((res) => {
          return res.name != "实景";
        });
                    return res.name != '实景'
                })
      }
      return b;
    },
            return b
        }
  },
  methods: {
    openOnce(val) {
      console.log(this.ourData);
      if (!this.ourData.name) {
        console.log("数据传输失败");
        return;
        coordinate (item) {
            const arr = item.split(',')
            return {
                lng: arr[0],
                lat: arr[1]
      }
      const that = this;
      if (val == "定位") {
        },
        openOnce (val) {
            const positionObj = this.coordinate(this.ourData.x)
            if (!this.ourData.name) {
                console.log('数据传输失败')
                return
            }
            const that = this
            if (val == '定位') {
        // 活动定位
        if (this.ourData.name == "活动") {
          console.log(this.ourData);
          return;
                if (this.ourData.name == '活动') {
                    console.log(this.ourData)
                    return
        }
        // 随地图移动窗口
        this.$store.commit("MSET_BIGPOPUP", false); // 关闭全屏弹窗
                this.$store.commit('MSET_BIGPOPUP', false) // 关闭全屏弹窗
        setTimeout(() => {
          //   // 定制化窗体
          const d = {
            position: {},
            lntLat: that.ourData.lntLat,
                        lntLat: [positionObj.lng, positionObj.lat],
            query: { ...this.ourData, seebut: this.seebut },
            useJWD: true, // 仅使用经纬度
            from: "PopupOurOnce",
          };
          that.$store.dispatch("setMobileWindows", d);
        }, 500);
                        from: 'PopupOurOnce'
                    }
                    that.$store.dispatch('setMobileWindows', d)
                }, 500)
        // 固定窗口
        // that.$store.dispatch("SET_OPENWIDOWFIXED", d);
      } else if (val == "实景") {
        this.$store.commit("MSET_OPENMOBILEPANORAMA", this.ourData.panoramaurl);
            } else if (val == '实景') {
                this.$store.commit('MSET_OPENMOBILEPANORAMA', this.ourData.panoramaurl)
        // if(this.ourData.panoramaurl){
        // }
        // console.log(this.ourData.panoramaurl);
      } else if (val == "图集") {
            } else if (val == '图集') {
        const imgsDom = document.getElementById(
          "mobileBigImgs" + this.icon + ""
        );
        imgsDom.click();
                    'mobileBigImgs' + this.icon + ''
                )
                imgsDom.click()
      }
    },
    // "校区建筑"↓
    getOnceCampus(id) {
      console.log(id);
      getChildNavDetail({ id: id }).then((res) => {
        console.log(res, 5656);
        var result = res.data.data[0].list;
                console.log(res, 5656)
                var result = res.data.data[0].list
        const d = {
          name: result.mechanismname,
          lntLat: [result.jd, result.wd],
@@ -164,14 +170,15 @@
          address: result.address,
          introduce: result.introduce,
          video: result.videourl,
          panoramaurl: result.panoramaurl, // 全景
        };
        this.ourData = d;
      });
    },
                    panoramaurl: result.panoramaurl,
                    x: result.x // 全景
                }
                this.ourData = d
            })
        }
    // "校区建筑"↑
  },
};
    }
}
</script>
<style lang="scss" scoped>