学员端小程序
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.

132 lines
3.1 KiB

1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="tabCon">
  3. <view class="tab1" v-if="coachList.length">
  4. <view class="card" v-for="(item,index) in coachList" :key="index">
  5. <view class="avatar">
  6. <image :src="item.photoPath" mode="" v-if="isImagePath(item.photoPath)"></image>
  7. <image src="@/static/images/index/avatar.png" mode="" v-else></image>
  8. </view>
  9. <view class="rightCon">
  10. <view class="flex">
  11. <view class="name">{{ item.name }}</view>
  12. <!-- <view class="age">10年教龄</view> -->
  13. </view>
  14. <view class="flex-b">
  15. <view class="starBox">
  16. <u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" :value="item.stars" disabled style="pointer-events: none;"></u-rate>
  17. <view class="num">{{item.stars || 0}}</view>
  18. </view>
  19. <view class="btn" v-if="showSign" @click="goPageSign(item)">报名</view>
  20. <view class="more" v-else @click="goPageDetail(item)">
  21. <view class="moreText">查看详情</view>
  22. <u-icon name="arrow-right"></u-icon>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view style="padding-bottom: 20rpx;" v-if="coachList.length>20">
  29. <u-loadmore :status="status" />
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. props: ['showSign', 'coachList', 'status'],
  36. methods: {
  37. // 去详情
  38. goPageDetail(item) {
  39. let objStr = encodeURIComponent(JSON.stringify(item))
  40. this.$goPage('/pages/indexEntry/findShcool/coachComment/coachComment?item='+ objStr)
  41. },
  42. // 去报名
  43. goPageSign(item) {
  44. this.$store.commit('upDateSchoolClass', {})
  45. this.$store.commit('upDateSchoolCoach', item)
  46. this.$goPage('/pages/indexEntry/enroll/enroll')
  47. },
  48. handleImageError(item) {
  49. item.photoPath = require('@/static/images/index/avatar.png')
  50. },
  51. isImagePath(path) {
  52. // 定义常见的图片文件扩展名
  53. const imageExtensions = /\.(jpg|jpeg|png|gif|bmp|svg)$/i;
  54. // 使用正则表达式进行匹配
  55. return imageExtensions.test(path);
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. .tabCon {
  62. width: 100%;
  63. .tab1 {
  64. width: 100%;
  65. .card {
  66. width: 100%;
  67. display: flex;
  68. align-items: center;
  69. padding: 36rpx;
  70. margin-top: 20rpx;
  71. .avatar {
  72. width: 100rpx;
  73. height: 98rpx;
  74. border-radius: 50%;
  75. margin-right: 34rpx;
  76. background-color: #f6f6f6;
  77. }
  78. .rightCon {
  79. flex: 1;
  80. width: 0;
  81. .flex {
  82. .name {
  83. font-size: 32rpx;
  84. color: #333;
  85. font-weight: 500;
  86. }
  87. .age {
  88. width: 142rpx;
  89. height: 40rpx;
  90. background: #E8F3FE;
  91. border-radius: 4rpx;
  92. color: $themC;
  93. text-align: center;
  94. line-height: 40rpx;
  95. margin-left: 24rpx;
  96. font-size: 24rpx;
  97. }
  98. }
  99. .flex-b {
  100. margin-top: 14rpx;
  101. .more {
  102. display: flex;
  103. align-items: center;
  104. .moreText {
  105. font-size: 24rpx;
  106. color: #686B73;
  107. margin-right: 10rpx;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. .btn {
  116. width: 130rpx;
  117. height: 60rpx;
  118. background: #1989FA;
  119. border-radius: 8rpx;
  120. color: #fff;
  121. text-align: center;
  122. line-height: 60rpx;
  123. font-size: 28rpx;
  124. }
  125. </style>