 <template>
  <section class="back-top">
    <div class="back-btn" @click="backTop">
      <img src="../../images/backTop.png">
    </div>
  </section>
</template>

<script>
export default {
  data() {
    return {
      objPoint: {}
    };
  },
  props: {
    burialPoint: {
      default: "",
      type: String
    }
  },
  mounted() {
    if (this.burialPoint == "activity") {
      this.objPoint = {
        menuLevel: 2,
        menuFromCode: "m_home",
        menuCode: "m_content_list",
        functionCode: "f_activity",
        actionCode: "c_top"
      };
    }
  },
  methods: {
    backTop: function() {
      if (this.burialPoint == "activity") {
        this.pageBurialPoin(this.objPoint);
      }
      var osTop = document.documentElement.scrollTop || document.body.scrollTop;
      if (osTop > 0) {
        document.documentElement.scrollTop = document.body.scrollTop = 0;
      }
    }
  }
};
</script>

<style lang="less" scoped>
.back-btn {
  position: fixed;
  width: 35px;
  height: 35px;
  right: 15px;
  z-index: 100;
  bottom: 80px;
  img {
    width: 100%;
    height: 100%;
    display: block;
  }
}
</style>

