<template>
  <div class="result-box">
    <div class="pop-layer"></div>
    <report @getScore="getScore">
      <div class="trophy-box">
        <img src="https://webapp-pub.ezijing.com/x-training-new/trophy.png" />
        <div class="text">
          你的得分是<span>{{ score }}</span
          >分
        </div>
      </div>
    </report>
  </div>
</template>

<script>
import Report from '../components/Report.vue'
export default {
  components: { Report },
  data() {
    return {
      score: ''
    }
  },
  created() {
    document.body.scrollTop = document.documentElement.scrollTop = 0
  },
  methods: {
    getScore(res) {
      this.score = res.score
    }
  }
}
</script>

<style lang="scss" scoped>
.result-box {
  margin: 66px auto;
  width: 714px;
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  .pop-layer {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 99;
    width: 100%;
    height: 100%;
  }
  .trophy-box {
    padding: 50px 0 38px 0;
    position: relative;
    &::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 620px;
      border-bottom: 1px dashed #c0c0c0;
    }
    img {
      width: 69px;
      display: block;
      margin: 0 auto;
    }
    .text {
      font-size: 18px;
      color: #666666;
      text-align: center;
      margin-top: 18px;
      span {
        color: rgba(67, 169, 143, 1);
        font-size: 26px;
      }
    }
  }
}
</style>
