studentInfo.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="studentInfo">
  3. <img class="studentIcon" :src="defaultAvatar" alt="" />
  4. <div class="student">
  5. <div class="nameWrap">
  6. <p class="name">{{ studetnInfo.username }}</p>
  7. <div class="userNumWrap">
  8. <img src="../images/icon.png" alt="" />
  9. <p>学员编号:{{ studetnInfo.id }}</p>
  10. </div>
  11. </div>
  12. <p class="phone">{{ studetnInfo.phone }}</p>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. // import { queryUserInfo } from "@/api/login";
  18. export default {
  19. data() {
  20. return {
  21. studetnInfo: {
  22. phone: "学生电话",
  23. username: "学生姓名",
  24. id: "学生编号",
  25. avatar: "",
  26. },
  27. defaultAvatar: require("@/assets/images/icon_new_student.png"),
  28. };
  29. },
  30. //
  31. async mounted() {
  32. // const state = this.$store.state;
  33. // console.log(state.user);
  34. // if (state && state.user && state.user.data&&state.user.data.userId) {
  35. // await queryUserInfo().then((res) => {
  36. // let result = res.data;
  37. // if (res.data) {
  38. // this.studetnInfo = { ...res.data };
  39. // }
  40. // });
  41. // }
  42. },
  43. };
  44. </script>
  45. <style lang="less" scoped>
  46. .studentInfo {
  47. margin: 0 12px 10px;
  48. background-color: #fff;
  49. padding: 16px 12px;
  50. display: flex;
  51. flex-direction: row;
  52. border-radius: 10px;
  53. .studentIcon {
  54. width: 52px;
  55. height: 52px;
  56. }
  57. .student {
  58. margin-left: 15px;
  59. display: flex;
  60. align-self: center;
  61. flex-direction: column;
  62. .phone {
  63. color: #505050;
  64. line-height: 20px;
  65. font-size: 14px;
  66. }
  67. }
  68. .nameWrap {
  69. display: flex;
  70. flex-direction: row;
  71. align-items: center;
  72. .name {
  73. font-size: 18px;
  74. font-weight: 500;
  75. color: #1a1a1a;
  76. line-height: 25px;
  77. margin-right: 10px;
  78. }
  79. .userNumWrap {
  80. background: #f5f5f5;
  81. height: 22px;
  82. border-radius: 11px;
  83. display: flex;
  84. flex-direction: row;
  85. align-items: center;
  86. padding: 0 9px;
  87. img {
  88. width: 12px;
  89. height: 12px;
  90. margin-right: 7px;
  91. }
  92. p {
  93. font-size: 11px;
  94. font-weight: 500;
  95. color: #f57d4c;
  96. line-height: 16px;
  97. }
  98. }
  99. }
  100. }
  101. </style>