<template>
  <div class="backTop">
    <div class="luojigouLogo">
      <img :src="luojigouLogo" alt="">
    </div>
    <div class="hotline">
      <div class="hotLineCode">
        <img :src="hotLineCode" alt="" />
      </div>
      <div class="hotLineImg"></div>
    </div>
    <div class="public">
      <div class="publicCode">
        <img :src="publicCode" alt="" srcset="">
      </div>
      <div class="publicImg"></div>
    </div>
    <a class="backTopBtn" v-show="backTopIsShow" @click="handleBackTop" href="javascript:;">
      <img :src="backTopBtn" />
    </a>
  </div>
</template>

<script>
export default {
  name: 'backTop',
  props: {
    backTopIsShow: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      luojigouLogo: "https://luojigou-app-commit-pic.luojigou.vip/FvmYmQjjoZftM_fiRYGM0lsC9vfw?imageView2/0/q/50|imageslim",
      hotLineCode: 'https://luojigou-app-commit-pic.luojigou.vip/FtIexWC2MZD5jk8YFf6OG11MQUGC?imageView2/0/q/50|imageslim',
      publicCode: 'https://luojigou-app-commit-pic.luojigou.vip/FsMJj5IIlzzeDqoOyq0VSUfJ1Cy0?imageView2/0/q/50|imageslim',
      backTopBtn: 'https://luojigou-app-commit-pic.luojigou.vip/Fnz0K17ERo2g1foAvu9KAnAOmw7O?imageView2/0/q/50|imageslim'
    }
  },
  methods: {
    handleBackTop() {
      this.$emit('handleBackTop')
    }
  }
}
</script>

<style lang="scss" scoped>
.backTop {
  position: fixed;
  right: 60px;
  top: 580px;
  z-index: 99999;
  width: 70px;
  // height: 140px;
  background: #FFFFFF;
  border-radius: 4px;
  border: 1px solid rgba(230, 230, 230, 0.8);
  .luojigouLogo {
    position: absolute;
    top: -55px;
    left: 4px;
    img {
      width: 60px;
      object-fit: cover;
    }
  }
  .hotline,
  .public {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 70px;
    height: 70px;
    .hotLineImg,
    .publicImg {
      width: 42px;
      height: 42px;
      background-image: url("~assets/images/backTop/hotline.png");
      background-size: cover;
      background-repeat: no-repeat;
    }
    .publicImg {
      width: 32px;
      height: 44px;
      background-image: url("~assets/images/backTop/public.png");
    }
  }
  .hotLineCode,
  .publicCode {
    display: none;
    position: absolute;
    top: -40px;
    left: -195px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(230, 230, 230, 0.8);
    background-color: #fff;
  }
  .hotline:hover {
    .hotLineImg {
      background-image: url("~assets/images/backTop/hotlined.png");
    }
    .hotLineCode {
      display: block;
    }
  }
  .public:hover {
    .publicImg {
      background-image: url("~assets/images/backTop/publiced.png");
    }
    .publicCode {
      display: block;
    }
  }
  .backTopBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 46px;
    img {
      width: 22px;
    }
  }
}
</style>