洛阳学员端
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.

104 lines
2.3 KiB

10 months ago
9 months ago
8 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. console.log('没有数据??')
  33. console.log(this.item)
  34. this.$store.commit('upDateSchoolCoach', this.item)
  35. this.$store.commit('upDateSchoolClass', {})
  36. this.$u.utils.clickSignUp()
  37. }
  38. },
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .card {
  43. padding: 20rpx !important;
  44. display: flex;
  45. .avatar {
  46. width: 134rpx;
  47. height: 134rpx;
  48. border-radius: 50%;
  49. }
  50. .info {
  51. flex: 1;
  52. padding: 0 20rpx;
  53. .name {
  54. font-size: 28rpx;
  55. color: #333;
  56. font-weight: 700;
  57. }
  58. .star_row {
  59. display: flex;
  60. align-items: center;
  61. margin: 10rpx 0;
  62. .num {
  63. font-size: 24rpx;
  64. font-weight: 700;
  65. }
  66. }
  67. .carType {
  68. padding: 0 20rpx;
  69. height: 46rpx;
  70. background: rgba(80,165,255,0.1);
  71. border: 1px solid #50A5FF;
  72. border-radius: 10rpx;
  73. line-height: 46rpx;
  74. color: $themC;
  75. font-size: 24rpx;
  76. display: inline-block;
  77. }
  78. .schoolName {
  79. font-size: 24rpx;
  80. color: #999;
  81. margin-top: 20rpx;
  82. }
  83. }
  84. .btn {
  85. width: 112rpx;
  86. height: 55rpx;
  87. background: $themC;
  88. border-radius: 28rpx;
  89. line-height: 55rpx;
  90. text-align: center;
  91. color: #fff;
  92. font-size: 24rpx;
  93. margin-top: -20rpx;
  94. }
  95. }
  96. </style>