teaList.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="stu">
  3. <view @click="goStu(item)" v-for="(item,index) in list" :key="index" class="stu-item">
  4. <view class="stu-item-img">
  5. <image v-if="item.teacher_photo == ''" style="width: 100%;height: 100%;border-radius: 50%;" src="@/static/image/male.png"
  6. mode="">
  7. </image>
  8. <image v-else style="width: 100%;height: 100%;border-radius: 50%;"
  9. :src="item.teacher_photo" mode="">
  10. </image>
  11. </view>
  12. <view class="stu-item-text">
  13. <view class="stu-item-text-top">
  14. {{item.teacher_name}}
  15. </view>
  16. <view class="stu-item-text-bottom">
  17. <text style="margin-right: 10rpx;" v-for="(item1,index1) in item.teacher_class"> {{item1.class_name}}</text>
  18. </view>
  19. </view>
  20. <view class="stu-item-icon">
  21. {{str}} <uni-icons color="#05CCA1" type="right" size="20"></uni-icons>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. props: {
  29. list: {
  30. type: Array,
  31. default: () => []
  32. },
  33. active: {
  34. type: Number,
  35. default: () => 0
  36. },
  37. str:{
  38. type: String,
  39. default: () => '查看课表'
  40. }
  41. },
  42. methods: {
  43. goStu(item) {
  44. this.$emit('itemClick', item)
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .stu {
  51. width: 100%;
  52. .stu-item {
  53. padding: 32rpx;
  54. box-sizing: border-box;
  55. display: flex;
  56. background-color: #fff;
  57. border-radius: 10rpx;
  58. box-shadow: 0px 0px 8px 0px rgba(147, 147, 147, 0.20);
  59. margin-bottom: 32rpx;
  60. .stu-item-img {
  61. width: 100rpx;
  62. height: 100rpx;
  63. margin-right: 32rpx;
  64. }
  65. .stu-item-text {
  66. flex: 1;
  67. .stu-item-text-top {
  68. font-size: 32rpx;
  69. margin-bottom: 10rpx;
  70. }
  71. .stu-item-text-bottom {
  72. color: #999;
  73. font-size: 24rpx;
  74. overflow: hidden;
  75. white-space: nowrap;
  76. text-overflow: ellipsis;
  77. width: 320rpx;
  78. }
  79. }
  80. .stu-item-icon {
  81. display: flex;
  82. align-items: center;
  83. color: #05CCA1;
  84. }
  85. }
  86. }
  87. </style>