<template>
  <div class="home">
    <div class="info">
      <van-image
        width="63"
        height="63"
        :src="require('../assets/img_touxiang.png')"
      />
      <div class="text">
        <div class="name">夏秋雨</div>
        <div class="sub">艺考考生</div>
      </div>
      <div class="btn">切换账号</div>
    </div>
    <van-tabs
      v-model="tab"
      :title-active-color="$colors.prim"
      :title-inactive-color="$colors.text2"
      :color="$colors.prim"
      line-width="26px"
      swipeable
    >
      <van-tab title="基础信息">
        <div class="base">
          <div class="code">
            <van-image
              :src="require('../assets/code.png')"
              width="220"
              height="220"
            />
          </div>

          <div class="base-info">
            <div class="base-info-item">
              <div class="text1">节目名称</div>
              <div class="text2">飞弦踏春</div>
            </div>
            <div class="base-info-item">
              <div class="text1">参演时间</div>
              <div class="text2">2021-03-14 15:00</div>
            </div>
            <div class="base-info-item">
              <div class="text1">参演人员</div>
              <div class="text2">岩洁 付妍元 俞贵</div>
            </div>

            <img
              class="left-icon icon"
              src="../assets/icon_lianjie.png"
              alt=""
            />
            <img
              class="right-icon icon"
              src="../assets/icon_lianjie.png"
              alt=""
            />
          </div>
        </div>
      </van-tab>
      <van-tab title="评奖信息">
        <div class="score">
          <div class="score-main">
            <div class="name">总得分</div>
            <div class="val">85</div>
          </div>

          <div class="score-list">
            <div class="score-item">
              <div class="name">得分明细1</div>
              <div class="val">30</div>
            </div>
            <div class="score-item">
              <div class="name">得分明细2</div>
              <div class="val">26</div>
            </div>
            <div class="score-item">
              <div class="name">得分明细3</div>
              <div class="val">29</div>
            </div>
          </div>
        </div>
      </van-tab>
      <van-tab title="查看证书">
        <div class="certificate">
          <div class="certificate-img">
            <img src="../assets/image.jpg" alt="" />
          </div>
          <div class="certificate-img">
            <img src="../assets/image.jpg" alt="" />
          </div>
        </div>
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
export default {
  name: "home",
  metaInfo() {
    return {
      title: "文旅局艺考"
    };
  },
  data() {
    return {
      tab: 0
    };
  }
};
</script>
<style lang="less" scoped>
.info {
  background-color: #fff;
  display: flex;
  padding: 16px;
  align-items: center;
  .text {
    flex-grow: 1;
    margin-left: 12px;
    .name {
      font-size: 22px;
      font-weight: bold;
      color: #000000;
      line-height: 30px;
    }

    .sub {
      font-size: 14px;
      color: #939599;
      line-height: 20px;
      margin-top: 2px;
    }
  }

  .btn {
    font-size: 14px;
    color: #c4c7cc;
    line-height: 20px;
    align-self: flex-end;
  }
}

.base {
  padding: 20px 16px;
  .code {
    padding: 30px 60px;
    background-color: #fff;
    border-radius: 12px;
  }

  .base-info {
    position: relative;
    padding: 22px 44px;
    background: #ffffff;
    border-radius: 12px;
    margin-top: 8px;
    .base-info-item {
      display: flex;
      align-items: center;
      font-size: 14px;
      color: #000000;
      line-height: 26px;

      .text1 {
        font-weight: bold;
      }

      .text2 {
        font-size: 16px;
        margin-left: 20px;
      }

      &:not(:first-child) {
        margin-top: 12px;
      }
    }
  }

  .icon {
    width: 10px;
    height: 54px;
    position: absolute;
    top: 0;
    transform: translateY(-50%);

    &.left-icon {
      left: 16px;
    }

    &.right-icon {
      right: 16px;
    }
  }
}

.score {
  margin: 20px 16px;
  background: #ffffff;
  border-radius: 12px;
  padding: 0 20px;

  .score-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 47px 0 20px;

    .name {
      font-size: 16px;
      color: #939599;
      line-height: 22px;
    }

    .val {
      font-size: 85px;
      font-weight: bold;
      color: #000000;
      line-height: 119px;
    }
  }

  .score-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 38px 0 48px;
    .score-item {
      display: flex;
      .name {
        font-size: 14px;
        color: #939599;
        line-height: 26px;
      }

      .val {
        font-size: 18px;
        font-weight: bold;
        color: #000000;
        line-height: 26px;
        margin-left: 20px;
      }

      &:not(:first-child) {
        margin-top: 16px;
      }
    }

    border-top: 1px solid #f5f7fa;
  }
}

.certificate {
  padding: 20px 16px;

  .certificate-img {
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    img {
      width: 331px;
      height: 197px;
      display: block;
    }

    &:not(:first-child) {
      margin-top: 12px;
    }
  }
}
</style>

<style lang="less">
.home {
  .van-tabs__line {
    bottom: 20px;
  }
  .van-tabs__wrap {
    height: 50px;
  }
  .van-tabs__nav {
    padding: 0 6px 15px;
  }
  .van-tab {
    flex: 0;
    white-space: nowrap;
    font-size: 16px;
    line-height: 22px;
    padding: 0 10px;

    &.van-tab--active {
      font-size: 20px;
      font-weight: bold;
    }
  }
}
</style>
