<template>
  <div class="fixed-contact">
    <ul class="fixed-contact-list">
      <li class="fixed-contact-item">
        <a href="http://dct.zoosnet.net/LR/Chatpre.aspx?id=DCT66957702" target="_blank">
          <svg-icon icon-class="z_msg" class-name="icon" />
          <div class="label">在线客服</div>
        </a>
        <div class="line-s" />
      </li>
      <li class="fixed-contact-item">
        <svg-icon icon-class="z_erweima" class-name="icon" />
        <div class="label">关注微信</div>
        <div class="line-s" />
        <div class="fixed-contact-popover" style="top: 20px">
          <div class="fixed-contact-popover-img">
            <img src="@/assets/home_images/wx_qr_code.png">
          </div>
        </div>
      </li>
      <li class="fixed-contact-item">
        <svg-icon icon-class="z_dianhua" class-name="icon" />
        <div class="label">电话咨询</div>
        <div class="line-s" />
        <div class="fixed-contact-popover" style="top: 20px">
          <div class="fixed-contact-popover-img" style="padding: 0">
            <img src="@/assets/home_images/telephone.png">
          </div>
          <span style="font-size: 18px;font-weight: bolder;line-height: 30px;user-select: none;">咨询电话<br></span>
          <span style="line-height: 20px;color: #1482f0">400-0631-598</span>
        </div>
      </li>
      <li class="fixed-contact-item" @click="goTop">
        <svg-icon icon-class="z_fanhuidingbu" class-name="icon" />
        <div class="label" style="margin-bottom: 10px">返回顶部</div>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {

    }
  },
  mounted() {
    this.$nextTick(() => {

    })
  },
  methods: {
    goTop() {
      this.$parent.goTop()
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.fixed-contact {
  position: fixed;
  left: inherit;
  right: 2vw;
  margin-left: 0;
  bottom: 200px;
  width: 76px;
  z-index: 99;
  .fixed-contact-list {
    background-color: #1482f0;
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    text-align: center;
    padding: 0;
    margin: 0;
    .fixed-contact-item {
      padding: 0 10px;
      cursor: pointer;
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      &:hover {
        .icon {
          color: wheat;
        }
        .fixed-contact-popover {
          display: block;
        }
      }
      .icon {
        color: #fff;
        font-size: 28px;
        margin: 10px 0 5px;
      }
      .label {
        white-space: nowrap;
        font-size: 12px;
        transform: scale(0.83,0.83) ;
        color: white;
      }
      .line-s {
        width: 100%;
        margin-top: 10px;
        padding: 0 10px;
        border-top: 1px solid #e4e4e4;
      }
      .fixed-contact-popover {
        display: none;
        width: 150px;
        padding: 12px;
        background: #fff;
        border: 1px solid #e4e4e4;
        box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1);
        border-radius: 4px;
        font-size: 14px;
        text-align: center;
        line-height: 12px;
        left: -160px;
        position: absolute;
        top: 0;
        margin-top: -53px;
        z-index: 10000;
        transition: .5s ease-in;
        cursor: default;
        &::before {
          content: "";
          position: absolute;
          right: -14px;
          width: 14px;
          height: 100%;
        }
        &::after {
          content: "";
          position: absolute;
          right: -16px;
          top: 50%;
          width: 0;
          height: 0;
          border-width: 8px;
          border-color: transparent transparent transparent #fff;
          border-style: solid;
          margin-top: -20px;
        }
        .fixed-contact-popover-img {
          width: 100%;
          user-select: none;
          & > img {
            width: 100%;
          }
        }
      }
    }
  }
  .fixed-contact-list + .fixed-contact-list {
    margin-top: 10px;
  }
}
</style>
