newStudent.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <el-dialog title="" class="sss" :visible.sync="studentInfo.dialogVisible" :close-on-click-modal="false">
  3. <div :class="[{'newStudentContainer':true}]">
  4. <div class="info">
  5. <ul :class="[{'many':studentInfo.Rs.length > 6},{'two':studentInfo.Rs.length >= 2 && studentInfo.Rs.length <= 6}]">
  6. <li v-for="(s,i) in studentInfo.Rs" v-if="i < 12"
  7. :class="[{'bigLi':studentInfo.Rs.length <= 4},{'smallLi':studentInfo.Rs.length > 4}]">
  8. <img :src="s.Head" alt="" v-if="s.Head" :class="[{'boy':s.Sex == 1},{'girl':s.Sex == 2}]">
  9. <img src="../static/img/people/flyhead.png" alt="" v-if="!s.Head">
  10. <span class="names">{{ s.Name }}</span>
  11. </li>
  12. </ul>
  13. </div>
  14. </div>
  15. </el-dialog>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. percent: 0,
  22. totalTime: 0,
  23. sumTime: 4,
  24. bg: 0,
  25. };
  26. },
  27. props: ['studentInfo'],
  28. watch: {
  29. studentInfo: {
  30. handler(newName, oldName) {
  31. let that = this;
  32. if (newName.Rs != '') {
  33. if (newName.Rs.length > 3) {
  34. that.bg = 0
  35. } else {
  36. that.bg = 1
  37. }
  38. }
  39. },
  40. deep: true,
  41. immediate: true
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. @mixin cube {
  48. width: 100%;
  49. overflow: hidden;
  50. display: block;
  51. margin: 0 auto;
  52. }
  53. /*成就彩蛋*/
  54. /deep/ .el-dialog {
  55. width: 80%;
  56. height: 6rem;
  57. background: none;
  58. box-shadow: none;
  59. border: none;
  60. padding-bottom: 1rem;
  61. }
  62. /deep/ .el-dialog__header {
  63. display: none;
  64. }
  65. .newStudentContainer {
  66. height: 6rem;
  67. margin-top: 0;
  68. background: url("../assets/imgs/newStudent/bg.svg");
  69. background-position: top center;
  70. background-repeat: no-repeat;
  71. background-size: 100% 100%;
  72. }
  73. ul {
  74. @include cube;
  75. width: 70%;
  76. display: inline-flex;
  77. align-items: center;
  78. align-content: center;
  79. justify-content: center;
  80. flex-wrap: wrap;
  81. flex-grow: 1;
  82. padding-top: 15%;
  83. &.two {
  84. justify-content: space-around;
  85. padding-top: 16%;
  86. width: 70%;
  87. .bigLi img {
  88. width: 1.9rem;
  89. }
  90. }
  91. &.many {
  92. justify-content: space-around;
  93. // justify-content: space-between;
  94. padding-top: 11.5%;
  95. }
  96. li {
  97. height: 2rem;
  98. overflow: hidden;
  99. img {
  100. @include cube;
  101. width: 1.6rem;
  102. border-radius: 250rem;
  103. &.girl {
  104. border: 2px solid #EA26EA;
  105. }
  106. &.boy {
  107. border: 2px solid #39B6FF;
  108. }
  109. }
  110. &.smallLi {
  111. height: 2rem;
  112. img {
  113. width: 1.6rem;
  114. }
  115. }
  116. &.bigLi {
  117. height: 3rem;
  118. img {
  119. width: 2.3rem;
  120. }
  121. }
  122. }
  123. .names {
  124. @include cube;
  125. width: 1.6rem;
  126. background: rgba(0, 0, 0, 0.7);
  127. font-size: 0.25rem;
  128. text-align: center;
  129. padding: 0% 1%;
  130. border-radius: 250rem;
  131. position: relative;
  132. bottom: 0.3rem;
  133. color: #fff;
  134. line-height: 0.3rem;
  135. }
  136. }
  137. </style>