InfoPopupLite.vue 7.69 KB
<template>
  <div style="position: relative;">
    <!-- <div class="info-window-lite-wrapper">
      <div :style="{ width: (widow_info.width * 0.8) + 'px', overflow: 'auto' }">
        <div class="hideScrollBar info-window-title">
          <div class="checked">
            <span>{{ info.name }}</span>
          </div>
        </div>
          <div v-if="info?.details?.length > 3" @click="handleNavScroll()" style="position: fixed; right: 0.75rem; width: 1rem; background-color: #FFF;top: 1.5rem;">
            <van-icon v-if="!nav_scroll" name="arrow" color="#888" size="1.25rem" style="vertical-align: sub;" />
            <van-icon v-else name="arrow-left" color="#888" size="1.25rem" style="vertical-align: sub;" />
          </div>
      </div>
      <div class="van-hairline--top" style="margin: 1rem 0;">
        <div @click="goToLocation()"  style="width: 100%; float: left; text-align: center; margin-top: 1rem;">
          <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%89%8D%E5%BE%80@2x.png" size="1.25rem" color="#FFF"
            style="vertical-align: bottom;" />&nbsp;
          <span style="color: #AB8F57; font-size: 1rem;">前往</span>
        </div>
      </div>
    </div>
    <div class="leaflet-popup-tip-container" style="left: 50%; position: relative;">
      <div class="leaflet-popup-tip"></div>
    </div> -->

    <van-popup teleport="body" v-model:show="show_popup" position="bottom" :overlay="true" :close-on-click-overlay="false"
      :style="{ padding: '1rem', height: '50%' }">
      <van-icon name="cross" size="1.35rem" @click="show_popup = false" style="float: right; color: gray;" />
      <div class="popup-wrapper">
        <div class="info-window-lite-wrapper1">
          <div :style="{ width: (widow_info.width * 0.8) + 'px', overflow: 'auto' }">
            <div class="hideScrollBar info-window-title">
              <div class="checked">
                <span>{{ info.name }}</span>
              </div>
            </div>
              <div v-if="info?.details?.length > 3" @click="handleNavScroll()" style="position: fixed; right: 0.75rem; width: 1rem; background-color: #FFF;top: 1.5rem;">
                <van-icon v-if="!nav_scroll" name="arrow" color="#888" size="1.25rem" style="vertical-align: sub;" />
                <van-icon v-else name="arrow-left" color="#888" size="1.25rem" style="vertical-align: sub;" />
              </div>
          </div>
          <div class="van-hairline--top" style="margin: 1rem 0;">
            <div @click="goToLocation()"  style="width: 100%; float: left; text-align: center; margin-top: 1rem;">
              <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%89%8D%E5%BE%80@2x.png" size="1.25rem" color="#FFF"
                style="vertical-align: bottom;" />&nbsp;
              <span style="color: #AB8F57; font-size: 1rem;">前往</span>
            </div>
          </div>
        </div>
      </div>
    </van-popup>
  </div>
</template>

<script>
import $ from 'jquery'

export default {
  props: {
    infoWindow: {
      type: Object,
      default: () => { }
    },
    info: {
      type: Object,
      default: () => { }
    },
    rect: {
      type: Object,
      default: () => { }
    },
    show: {
      type: Boolean,
      default: false
    }
  },
  mounted() {
  },
  watch: {
    show(val) {
      this.show_popup = val;
    },
    rect(val) {
      this.widow_info = val;
    },
  },
  data() {
    return {
      show_popup: false,
      popup_title: '',
      popup_content: '',
      video_src: '',
      ind: '',
      is_play: false,
      audio: new Audio(),
      widow_info: {},
      play_time: '00:00',
      isActive: 0,
      nav_scroll: false,
    }
  },
  methods: {
    // 关闭
    close() {
      // 高德地图信息窗关闭的api
      this.infoWindow.close()
    },
    showDetail() {
      this.show_popup = true;
      this.popup_title = '三宝楼';
      this.popup_content = '尊敬的游客朋友们您好,欢迎来到西园寺,您现在所到的地方是“三宝楼......';
      this.video_src = 'https://video.pearvideo.com/mp4/short/20200209/cont-1650197-14888002-hd.mp4'
    },
    goTo(url) {
      location.href = this.info.details[this.isActive].url;
    },
    goToLocation() {
      // this.$emit('onLocation', this.info.position)
      this.$emit('onLocation', this.info.position)
    },
    onClose () {
      this.$emit('onClose')
    }
  }
}
</script>

<style lang="less">
.info-window-lite-wrapper1 {
  background: #fff;
  color: #333;
  // -webkit-box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
  // box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
  // text-align: left;
  // border-radius: 5px;
  // padding: 1rem 1.25rem;
  overflow: auto;

  .info-text {
    // width: 100%;
    line-height: 1.5;
    float: left;
    color: #7A6C6C;
    font-size: 0.9rem;
    margin-top: 0.5rem;
  }
  .info-text-audio {
    width: 80%;
    line-height: 1.5;
    float: left;
    color: #7A6C6C;
  }

  .info-control {
    width: 20%;
    float: left;
    text-align: center;
    color: #AB8F57;

    .control-play {
      text-align: center;
      margin-bottom: 0.5rem;

      i {
        margin-top: 0 !important;
      }
    }
  }

  // .t-popup-content {
  //   position: relative;
  //   width: 25rem;
  //   padding: 0;
  //   margin: 0;
  //   border-radius: 0.1rem;
  //   background: rgba(255, 255, 255, 0.9);
  //   -webkit-box-shadow: 0 0.02rem 0.05rem 0 rgba(0, 0, 0, 0.1);
  //   box-shadow: 0 0.02rem 0.05rem 0 rgba(0, 0, 0, 0.1);
  //   line-height: 1.4;

  //   .view-name {
  //     margin: 0;
  //     padding: 0.5rem;
  //     width: 25rem;
  //     height: 2.5rem;
  //     font-size: 1.2rem;
  //     text-indent: 0.2rem;
  //     white-space: nowrap;
  //     text-overflow: ellipsis;
  //     color: #5b5b5b;
  //     -webkit-box-sizing: border-box;
  //     box-sizing: border-box;
  //     border-bottom: solid 1px #e8e8e8;
  //     border-radius: 0.1rem 0.1rem 0 0;
  //     background: #f7f7f7;
  //     overflow: hidden;
  //   }

  //   .view-photo {
  //     display: block;
  //     float: left;
  //     margin: 0.5rem;
  //     height: 100%;
  //     width: 9rem;
  //     height: 9rem;
  //     border-radius: 3px;
  //   }

  //   .introduction {
  //     float: left;
  //     margin: 0.2rem 0;
  //     width: 13.5rem;
  //     height: 6.75rem;
  //     font-size: 0.9rem;
  //     color: #202020;
  //     overflow: hidden;
  //   }

  //   // .control-play {
  //   //   display: block;
  //   //   float: left;
  //   //   margin-right: 0.5rem;
  //   //   width: 7rem;
  //   //   height: 3rem;
  //   //   border-radius: 2px;
  //   //   background: #ffdd02 center no-repeat;
  //   //   background-size: 6.5rem 3rem;
  //   // }

  //   .show-details {
  //     display: block;
  //     float: left;
  //     width: 7rem;
  //     height: 3rem;
  //     border-radius: 2px;
  //     background: #9196a9 center no-repeat;
  //     background-size: 6.5rem 3rem;
  //   }
  // }

  .info-window-title {
    display: flex;
    overflow-x: scroll;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    text-align: left;

    .item {
      width: 33.333%;
      flex-shrink: 0;
      color: #888;
      font-size: 1.1rem;
      margin-bottom: 0.75rem;
      display: inline-block;
    }

    .checked {
      color: #AB8F57;
      span {
        border-bottom: 1.5px solid #AB8F57; padding-bottom: 3px;
      }
    }
  }
}

.leaflet-popup-tip-container {
  margin-top: -1px;
  width: 2rem;
  height: 2rem;
  margin-left: -10px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 1rem;
  height: 1rem;
  -webkit-transform: rotate(0);
  transform: rotate(0);
  background: transparent url(https://map.365daoyou.cn/web/images/info-sharp.png) center no-repeat;
  background-size: 1rem 1rem;
  box-shadow: none;
}

</style>