index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="student">
  3. <view class="student-title">
  4. <view class="student-title-left">
  5. <view class="student-title-left-img">
  6. <image @click="go" style="width: 100%;height: 100%;" src="@/static/image/male.png" mode=""></image>
  7. </view>
  8. <view class="student-title-left-text">
  9. <view class="student-title-left-text-name">
  10. <view class="student-title-left-text-name-text">
  11. {{info.name}}
  12. </view>
  13. <!-- <view class="student-title-left-text-name-color">
  14. </view>
  15. <view class="student-title-left-text-name-status">
  16. 在校
  17. </view> -->
  18. </view>
  19. <view class="student-title-left-text-school">
  20. 新田园希望小学
  21. </view>
  22. <view class="student-title-left-text-school">
  23. {{info.student_number}}
  24. </view>
  25. </view>
  26. </view>
  27. <view @click="goHome" class="student-title-right">
  28. <image style="width: 24rpx;height: 24rpx;margin-right: 10rpx;" src="@/static/image/cut.png" mode="">
  29. </image>
  30. 切换孩子
  31. </view>
  32. </view>
  33. <view class="student-bottom">
  34. <view v-for="(item,index) in list" :key="index" class="student-bottom-item"
  35. style="`border:${index== list.length-1 ?0:'' }`">
  36. <view class="student-bottom-top">
  37. {{item.name}}
  38. </view>
  39. <view v-if="item.name == '在校状态'" class="student-bottom-bottom">
  40. {{info[item.key] == 0 ? '在校':'离校' }}
  41. </view>
  42. <view v-else class="student-bottom-bottom">
  43. {{info[item.key] }}
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. props: {
  52. info: {
  53. type: Object,
  54. default: () => {}
  55. }
  56. },
  57. data() {
  58. return {
  59. list: [{
  60. name: '班级',
  61. key: 'class_name'
  62. }, {
  63. name: '班主任',
  64. key: 'teacher_name'
  65. }, {
  66. name: '在校状态',
  67. key: 'in_school'
  68. }]
  69. }
  70. },
  71. methods: {
  72. goHome() {
  73. this.$emit('cutClass')
  74. },
  75. go(){
  76. uni.navigateTo({
  77. url:`/pages/StudentPortrait/StudentPortrait?id=${this.info.id}`
  78. })
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .student {
  85. width: 100%;
  86. height: 100%;
  87. padding: 32rpx;
  88. box-sizing: border-box;
  89. .student-title {
  90. display: flex;
  91. justify-content: space-between;
  92. .student-title-left {
  93. display: flex;
  94. .student-title-left-img {
  95. width: 140rpx;
  96. height: 140rpx;
  97. margin-right: 24rpx;
  98. }
  99. .student-title-left-text {
  100. font-size: 32rpx;
  101. color: #333;
  102. .student-title-left-text-school {
  103. font-size: 24rpx;
  104. color: #999;
  105. margin-top: 10rpx;
  106. }
  107. .student-title-left-text-name {
  108. display: flex;
  109. align-items: center;
  110. .student-title-left-text-name-status {
  111. color: #05CCA1;
  112. }
  113. .student-title-left-text-name-color {
  114. width: 22rpx;
  115. height: 22rpx;
  116. background-color: #05CCA1;
  117. border-radius: 50%;
  118. margin: 0 12rpx;
  119. }
  120. }
  121. }
  122. }
  123. .student-title-right {
  124. font-size: 24rpx;
  125. color: #999;
  126. }
  127. }
  128. .student-bottom {
  129. width: 100%;
  130. margin-top: 32rpx;
  131. display: flex;
  132. justify-content: space-between;
  133. .student-bottom-item {
  134. flex: 1;
  135. display: flex;
  136. flex-direction: column;
  137. justify-content: center;
  138. align-items: center;
  139. border-right: 0.33px solid #e5e5e5;
  140. .student-bottom-top {
  141. font-size: 28rpx;
  142. color: #333;
  143. }
  144. .student-bottom-bottom {
  145. color: #999;
  146. font-size: 24rpx;
  147. }
  148. }
  149. .student-bottom-item:nth-child(3) {
  150. border: 0;
  151. }
  152. }
  153. }
  154. </style>