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

105 lines
2.3 KiB

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