<template>
  <div class="my-examination">
    <div class="my-examination__header">
      <el-tabs v-model="activeName">
        <el-tab-pane label="考试预约" name="1"></el-tab-pane>
        <el-tab-pane label="考试成绩和证书" name="2"></el-tab-pane>
      </el-tabs>
    </div>

    <div class="my-examination__body">
      <!-- 考试预约 -->
      <template v-if="activeName == 1">
        <div class="tabs-list">
          <div
            class="tabs-list__item"
            :class="{ 'tabs-list__item--active': tabIndex == 0 }"
            @click="tabIndex = 0"
          >
            已预约（2）
          </div>
          <div
            class="tabs-list__item"
            :class="{ 'tabs-list__item--active': tabIndex == 1 }"
            @click="tabIndex = 1"
          >
            已取消（2）
          </div>
          <div
            class="tabs-list__item"
            :class="{ 'tabs-list__item--active': tabIndex == 2 }"
            @click="tabIndex = 2"
          >
            已过期（2）
          </div>
        </div>

        <div class="content-list">
          <div
            class="content-list__item"
            v-for="(item, index) in 3"
            :key="index"
          >
            <div class="content-list__item__header">
              <div class="text">
                <div class="title">二级建造师建设工程施工管理</div>
                <div class="desc">2022-12-1 17:51:51</div>
              </div>
              <div class="btn">取消预约</div>
            </div>
            <div class="content-list__item__body clearfix">
              <div class="left-box">
                <div class="title">报考学员信息</div>
                <div class="desc-list">
                  <div class="desc-list__item">
                    姓名：<span class="note">倪虹洁</span>
                  </div>
                  <div class="desc-list__item">
                    身份证：<span class="note">440463548723689646352</span>
                  </div>
                  <div class="desc-list__item">
                    考试身份：<span class="note">非补考学员</span>
                  </div>
                </div>
              </div>
              <div class="center-box">
                <div class="title">考试预约信息</div>
                <div class="desc-list">
                  <div class="desc-list__item desc-list__item--red">
                    报名开放时间: 2022-03-01至2022-03-31
                  </div>
                  <div class="desc-list__item">
                    报考专业：<span class="note">一级建造师</span>
                  </div>
                  <div class="desc-list__item">
                    考试地点：<span class="note">广州市天河区燕岭路123号</span>
                  </div>
                  <div class="desc-list__item">
                    考试时间：<span class="note">2022-03-30 10:00:00</span>
                  </div>
                  <div class="desc-list__item">
                    考前培训地点：<span class="note"
                      >广州市天河区燕岭路123号</span
                    >
                  </div>
                  <div class="desc-list__item">
                    考前培训时间：<span class="note">2022-03-30 10:00:00</span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </template>
      <!-- 考试成绩和证书 -->
      <template v-if="activeName == 2">
        <div class="tabs-list">
          <div
            class="tabs-list__item"
            :class="{ 'tabs-list__item--active': tabIndex == 0 }"
            @click="tabIndex = 0"
          >
            通过
          </div>
          <div
            class="tabs-list__item"
            :class="{ 'tabs-list__item--active': tabIndex == 1 }"
            @click="tabIndex = 1"
          >
            未通过
          </div>
        </div>

        <div class="content-list">
          <div
            class="content-list__item"
            v-for="(item, index) in 3"
            :key="index"
          >
            <div class="content-list__item__header">
              <div class="text">
                <div class="title">二级建造师建设工程施工管理</div>
                <div class="desc">2022-12-1 17:51:51</div>
              </div>
              <div class="btn">取消预约</div>
            </div>
            <div class="content-list__item__body clearfix">
              <div class="left-box">
                <div class="title">报考学员信息</div>
                <div class="desc-list">
                  <div class="desc-list__item">
                    姓名：<span class="note">倪虹洁</span>
                  </div>
                  <div class="desc-list__item">
                    身份证：<span class="note">440463548723689646352</span>
                  </div>
                  <div class="desc-list__item">
                    考试身份：<span class="note">非补考学员</span>
                  </div>
                </div>
              </div>
              <div class="center-box">
                <div class="title">考试预约信息</div>
                <div class="desc-list">
                  <div class="desc-list__item desc-list__item--red">
                    报名开放时间: 2022-03-01至2022-03-31
                  </div>
                  <div class="desc-list__item">
                    报考专业：<span class="note">一级建造师</span>
                  </div>
                  <div class="desc-list__item">
                    考试地点：<span class="note">广州市天河区燕岭路123号</span>
                  </div>
                  <div class="desc-list__item">
                    考试时间：<span class="note">2022-03-30 10:00:00</span>
                  </div>
                  <div class="desc-list__item">
                    考前培训地点：<span class="note"
                      >广州市天河区燕岭路123号</span
                    >
                  </div>
                  <div class="desc-list__item">
                    考前培训时间：<span class="note">2022-03-30 10:00:00</span>
                  </div>
                </div>
              </div>
              <div class="right-box">
                <div class="title">考试成绩和证书信息</div>
                <div class="desc-list">
                  <div class="desc-list__item">
                    考试成绩：<span class="note">100分</span>
                  </div>
                  <div class="desc-list__item">
                    考试结果：<span class="note">通过</span>
                  </div>
                  <div class="desc-list__item">
                    证书编号：<span class="note">ZSBH2022384987</span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </template>
    </div>
  </div>
</template>

<script>
export default {
  name: "MyExamination",
  data() {
    return {
      tabIndex: 0,
      activeName: "1",
    };
  },
  mounted() {},
  methods: {},
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.my-examination {
  &__header {
    /deep/ .el-tabs__header {
      margin-bottom: 0;
    }
  }
  &__body {
    .tabs-list {
      border-bottom: 1px solid #eee;
      font-size: 0;
      &__item {
        cursor: pointer;
        display: inline-block;
        padding: 0 30px;
        height: 40px;
        line-height: 40px;
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #666666;

        &--active {
          color: #3f8dfd;
        }
      }
    }

    .content-list {
      margin-top: 10px;

      &__item {
        margin-bottom: 24px;
        height: 320px;
        background: #fafbfc;
        border: 1px solid #eeeeee;
        box-shadow: 0px 0px 7px 1px rgba(0, 0, 0, 0.04);
        border-radius: 8px;
        &__header {
          height: 64px;
          display: flex;
          align-items: center;
          padding: 0 14px;
          border-bottom: 1px solid #eee;

          .text {
            flex: 1;
            .title {
              font-size: 16px;
              font-family: Microsoft YaHei;
              font-weight: bold;
              color: #333333;
            }

            .desc {
              margin-top: 8px;
              font-size: 12px;
              font-family: Microsoft YaHei;
              font-weight: 400;
              color: #999999;
            }
          }

          .btn {
            width: 122px;
            height: 32px;
            border: 1px solid #3f8dfd;
            border-radius: 16px;
            text-align: center;
            line-height: 30px;
            color: #3f8dfd;
            font-size: 16px;
            cursor: pointer;
          }
        }

        &__body {
          .left-box,
          .center-box,
          .right-box {
            float: left;
            width: 300px;
            padding: 0 14px;

            .title {
              font-size: 16px;
              font-family: Microsoft YaHei;
              font-weight: 400;
              color: #3f8dfd;
              padding: 0 14px;
              margin: 14px 0;
              border-left: 2px solid #3f8dfd;
            }

            .desc-list {
              &__item {
                line-height: 28px;
                font-size: 16px;
                font-family: Microsoft YaHei;
                font-weight: 400;
                color: #333333;

                &--red {
                  color: #ff3b30;
                }

                .note {
                  font-size: 16px;
                  font-family: Microsoft YaHei;
                  font-weight: 400;
                  color: #666666;
                }
              }
            }
          }

          .center-box {
            width: 500px;
          }

          .right-box {
            width: 300px;
          }
        }
      }
    }
  }
}
</style>
