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

131 lines
2.9 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('upDateSchoolCoach', item)
  45. this.$u.utils.clickSignUp()
  46. },
  47. handleImageError(item) {
  48. item.photoPath = require('@/static/images/index/avatar.png')
  49. },
  50. isImagePath(path) {
  51. // 定义常见的图片文件扩展名
  52. const imageExtensions = /\.(jpg|jpeg|png|gif|bmp|svg)$/i;
  53. // 使用正则表达式进行匹配
  54. return imageExtensions.test(path);
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .tabCon {
  61. width: 100%;
  62. .tab1 {
  63. width: 100%;
  64. .card {
  65. width: 100%;
  66. display: flex;
  67. align-items: center;
  68. padding: 36rpx;
  69. border-bottom: 1rpx solid #f4f4f4;
  70. .avatar {
  71. width: 100rpx;
  72. height: 98rpx;
  73. border-radius: 50%;
  74. margin-right: 34rpx;
  75. background-color: #f6f6f6;
  76. }
  77. .rightCon {
  78. flex: 1;
  79. width: 0;
  80. .flex {
  81. .name {
  82. font-size: 32rpx;
  83. color: #333;
  84. font-weight: 500;
  85. }
  86. .age {
  87. width: 142rpx;
  88. height: 40rpx;
  89. background: #E8F3FE;
  90. border-radius: 4rpx;
  91. color: $themC;
  92. text-align: center;
  93. line-height: 40rpx;
  94. margin-left: 24rpx;
  95. font-size: 24rpx;
  96. }
  97. }
  98. .flex-b {
  99. margin-top: 14rpx;
  100. .more {
  101. display: flex;
  102. align-items: center;
  103. .moreText {
  104. font-size: 24rpx;
  105. color: #686B73;
  106. margin-right: 10rpx;
  107. }
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. .btn {
  115. width: 130rpx;
  116. height: 60rpx;
  117. background: #1989FA;
  118. border-radius: 8rpx;
  119. color: #fff;
  120. text-align: center;
  121. line-height: 60rpx;
  122. font-size: 28rpx;
  123. }
  124. </style>