<template>
  <div>
    <div class="block-1">
      <div class="avatar-block">
        <img class="edit btn" src="https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/edit_button.png" alt="">
        <img v-if="userInfo.avatar" :src="userInfo.avatar | img" alt="" class="avatar">
        <img v-else class="avatar" src="https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/head2.png" alt="">
        <div class="name">
          {{ userInfo.nickName }}
        </div>
      </div>
      <div class="change">
        <div class="id">
          ID: {{ userInfo.id && userInfo.id.substring(0, 6) }}
        </div>
        <div class="koi-point">
          <img style="width: 34px;" src="https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/coin_03.png" alt="">
          {{ userInfo.koiPoint && userInfo.koiPoint.toFixed(2) }}
        </div>
        <img class="btn" src="https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/chinese/redeem%20credit_button_zh.png" alt="">
      </div>
      <div class="gold-block">
        <div class="card-box">
          card
        </div>
        <div class="gold-box">
          <div>
            <img src="" alt="">
            <div>9.00</div>
          </div>
          <div>
            <img src="" alt="">
            <div>9.00</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data() {
    return {}
  },
  computed: {
    ...mapState([
      'userInfo',
    ]),
  },
}
</script>

<style lang="scss" scoped>
.block-1 {
  width: 100%;
  height: 120px;
  display: flex;
  .avatar-block {
    width: 80px;
    height: 90px;
    position: relative;
    background: #050505;
    border: 2px solid #313f32;
    border-radius: 6px;
    box-sizing: border-box;
    .edit {
      width: 20px;
      height: 20px;
      position: absolute;
      top: 0;
      right: 0;
    }
    .avatar {
      width: 80px;
      height: 70px;
      border-radius: 6px;
      display: block;
    }
    .name {
      line-height: 20px;
      font-size: 12px;
      color: #16b6c0;
      text-align: center;
    }
  }
  .change {
    background-image: url(https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/Rounded%20Rectangle%204%20copy.png);
    background-size: 100% 100%;
    width: 146px;
    height: 92px;
    padding: 2px;
    .id {
      color: #cca612;
      text-align: center;
      padding: 4px;
      font-size: 13px;
    }
    .koi-point {
      display: flex;
      padding: 0px 10px;
      align-items: center;
      justify-content: space-between;
      font-size: 13px;
      font-weight: bold;
    }
    .btn {
      width: 132px;
      display: block;
      margin: 6px auto;
    }
  }
  .gold-block {
    flex: 1;
    display: flex;
    padding-top: 4px;
    height: 102px;
    background-image: url(https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/juxing1.png);
    background-size: 100% 100%;
    border: 1px solid #065a6c;
    border-radius: 4px;
    box-sizing: border-box;
    .card-box {
      background-image: url(https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/Rounded%20Rectangle%204%20copy%202.png);
      background-size: 100% 100%;
      width: 150px;
    }
    .gold-box{
    }
  }
}

</style>
