洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.2 KiB

10 months ago
9 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="card">
  3. <view class="avatar">
  4. <image :src="item.photoPath" mode="" v-if="isImagePath(item.photoPath)"></image>
  5. <image src="@/static/images/index/avatar.png" mode="" v-else></image>
  6. </view>
  7. <view class="info">
  8. <view class="name">{{ item.name}}</view>
  9. <view class="star_row">
  10. <u-rate active-color="#FCAC00" inactive-color="#FCAC00" gutter="1" :size="16" :value="item.stars" :count="5" :readonly="true" allowHalf></u-rate>
  11. <view class="num">{{ item.stars }}</view>
  12. </view>
  13. <view class="flex-b">
  14. <view class="carType">准教车型{{ item.teachCarType }}</view>
  15. <view class="btn" @click="goSign">报名</view>
  16. </view>
  17. <view class="schoolName">{{ item.schoolName }}</view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: ['item'],
  24. methods: {
  25. isImagePath(path) {
  26. // 定义常见的图片文件扩展名
  27. const imageExtensions = /\.(jpg|jpeg|png|gif|bmp|svg)$/i;
  28. // 使用正则表达式进行匹配
  29. return imageExtensions.test(path);
  30. },
  31. async goSign() {
  32. this.$store.commit('upDateSchoolCoach', this.item)
  33. this.$store.commit('upDateSchoolClass', {})
  34. this.$u.utils.clickSignUp()
  35. }
  36. },
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .card {
  41. padding: 20rpx !important;
  42. display: flex;
  43. .avatar {
  44. width: 134rpx;
  45. height: 134rpx;
  46. border-radius: 50%;
  47. }
  48. .info {
  49. flex: 1;
  50. padding: 0 20rpx;
  51. .name {
  52. font-size: 28rpx;
  53. color: #333;
  54. font-weight: 700;
  55. }
  56. .star_row {
  57. display: flex;
  58. align-items: center;
  59. margin: 10rpx 0;
  60. .num {
  61. font-size: 24rpx;
  62. font-weight: 700;
  63. }
  64. }
  65. .carType {
  66. padding: 0 20rpx;
  67. height: 46rpx;
  68. background: rgba(80,165,255,0.1);
  69. border: 1px solid #50A5FF;
  70. border-radius: 10rpx;
  71. line-height: 46rpx;
  72. color: $themC;
  73. font-size: 24rpx;
  74. display: inline-block;
  75. }
  76. .schoolName {
  77. font-size: 24rpx;
  78. color: #999;
  79. margin-top: 20rpx;
  80. }
  81. }
  82. .btn {
  83. width: 112rpx;
  84. height: 55rpx;
  85. background: $themC;
  86. border-radius: 28rpx;
  87. line-height: 55rpx;
  88. text-align: center;
  89. color: #fff;
  90. font-size: 24rpx;
  91. margin-top: -20rpx;
  92. }
  93. }
  94. </style>