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

8 months 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. {{item.stars || '无'}}
  17. </view>
  18. <view class="btn" v-if="showSign" @click="goPageSign(item)">报名</view>
  19. <view class="more" v-else @click="goPageDetail(item)">
  20. <view class="moreText">查看详情</view>
  21. <u-icon name="arrow-right"></u-icon>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view style="padding-bottom: 20rpx;" v-if="coachList.length>20">
  28. <u-loadmore :status="status" />
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. props: ['showSign', 'coachList', 'status'],
  35. methods: {
  36. // 去详情
  37. goPageDetail(item) {
  38. let objStr = encodeURIComponent(JSON.stringify(item))
  39. this.$goPage('/pages/indexEntry/findShcool/coachComment/coachComment?item='+ objStr)
  40. },
  41. // 去报名
  42. goPageSign(item) {
  43. this.$store.commit('upDateSchoolClass', {})
  44. this.$store.commit('updateSchool', {})
  45. this.$store.commit('upDateSchoolCoach', item)
  46. this.$u.utils.clickSignUp()
  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. border-bottom: 1rpx solid #f4f4f4;
  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>