<template>
  <el-dialog title="" :visible.sync="toperInfo.dialogVisible" :close-on-click-modal="false">
    <div class="eggContainer">
      <div class="eggBg">
        <div class="toper">
          <img :src="toperInfo.toper.Head" alt="" v-if="toperInfo.toper.Head"
               :class="[{'boy':toperInfo.toper.Sex == 1},{'girl':toperInfo.toper.Sex == 2}]">
          <img src="../static/img/people/flyhead.png" alt="" v-if="!toperInfo.toper.Head"
               :class="[{'boy':toperInfo.toper.Sex == 1},{'girl':toperInfo.toper.Sex == 2}]">
          <span class="names">{{ toperInfo.toper.UserName }}</span>
        </div>
        <div class="info">
          <div class="type">
            CK
          </div>
          <div class="detail">
            <em>{{ toperInfo.toper.Ck|fmtFloat }}</em>
          </div>
        </div>
      </div>
    </div>
  </el-dialog>

</template>

<script>
export default {
  data() {
    return {
      dialogTableVisible: true,
      dialogFormVisible: false,
    };
  },
  props: ['toperInfo'],
  filters: {
    fmtNum(val) {
      if (val == 0) {
        return '--'
      } else {
        if (parseInt(val) < 0) return 0;
        if (parseInt(val) > 0) return val
      }
    },
    fmtFloat(val) {
      if (val == 0) {
        return '0'
      } else {
        return parseFloat(val).toFixed(1);
      }
    },
    fmtInt(val) {
      if (val == 0) {
        return '0'
      } else {
        return parseInt(val);
      }
    },
  },
}
</script>

<style lang="scss" scoped>
@mixin cube {
  width: 100%;
  overflow: hidden;
  display: block;
  margin: 0 auto;
}

/*成就彩蛋*/
/deep/ .el-dialog {
  @include cube;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 6.5rem;
  //background: url("../assets/imgs/newRecord/bg.svg");
  background: url("../assets/imgs/newRecord/newRecordBg.svg");
  background-position: top center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: none;
  background-color: transparent;
  margin-top: 0 !important;


}

.eggContainer {
  @include cube;

  .eggBg {
    @include cube;
    //background: url("../assets/imgs/newRecord/bg.svg");
    padding-left: 5%;
    background-position: top center;
    background-repeat: no-repeat;
    background-size: 100%;
    margin-top: 30%;
    overflow: visible;

    .toper {
      @include cube;
      position: relative;
      top: -50%;

      img {
        @include cube;
        width: 2.5rem;
        border-radius: 250rem;

        &.girl {
          border: 2px solid #EA26EA;
        }

        &.boy {
          border: 2px solid #39B6FF;
        }
      }

      .names {
        @include cube;
        width: 2rem;
        height: 0.4rem;
        background: rgba(0, 0, 0, 0.7);
        font-size: 0.3rem;
        text-align: center;
        border-radius: 250rem;
        position: relative;
        bottom: 0.4rem;
        color: #fff;
        line-height: 0.4rem;
      }
    }
  }

  .type {
    height: 2rem;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    line-height: 2rem;
    margin-top: 0.6rem;
  }

  .info {
    @include cube;

    em {
      @include cube;
      font-weight: bold;
      font-size: 1.1rem;
      text-align: center;
      font-family: "Arial";
      color: #b5000f;
      text-shadow: 0px 4px 8px #fff;
      font-style: normal !important;
      text-decoration: none;
      margin-top: 0;
    }
  }
}


</style>
