<template>
  <div class="studentInfo">
    <img class="studentIcon" :src="defaultAvatar" alt="" />
    <div class="student">
      <div class="nameWrap">
        <p class="name">{{ studetnInfo.username }}</p>
        <div class="userNumWrap">
          <img src="../images/icon.png" alt="" />
          <p>学员编号：{{ studetnInfo.id }}</p>
        </div>
      </div>
      <p class="phone">{{ studetnInfo.phone }}</p>
    </div>
  </div>
</template>
<script>
// import { queryUserInfo } from "@/api/login";
export default {
  data() {
    return {
      studetnInfo: {
        phone: "学生电话",
        username: "学生姓名",
        id: "学生编号",
        avatar: "",
      },
      defaultAvatar: require("@/assets/images/icon_new_student.png"),
    };
  },
  //
  async mounted() {
    // const state = this.$store.state;
    // console.log(state.user);
    // if (state && state.user && state.user.data&&state.user.data.userId) {
    //   await queryUserInfo().then((res) => {
    //     let result = res.data;
    //     if (res.data) {
    //       this.studetnInfo = { ...res.data };
    //     }
    //   });
    // }

  },

};
</script>
<style lang="less" scoped>
.studentInfo {
  margin: 0 12px 10px;
  background-color: #fff;
  padding: 16px 12px;
  display: flex;
  flex-direction: row;
  border-radius: 10px;
  .studentIcon {
    width: 52px;
    height: 52px;
  }
  .student {
    margin-left: 15px;
    display: flex;
    align-self: center;
    flex-direction: column;
    .phone {
      color: #505050;
      line-height: 20px;
      font-size: 14px;
    }
  }
  .nameWrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    .name {
      font-size: 18px;
      font-weight: 500;
      color: #1a1a1a;
      line-height: 25px;
      margin-right: 10px;
    }
    .userNumWrap {
      background: #f5f5f5;
      height: 22px;
      border-radius: 11px;
      display: flex;
      flex-direction: row;
      align-items: center;
      padding: 0 9px;
      img {
        width: 12px;
        height: 12px;
        margin-right: 7px;
      }
      p {
        font-size: 11px;
        font-weight: 500;
        color: #f57d4c;
        line-height: 16px;
      }
    }
  }
}
</style>
