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

91 lines
2.0 KiB

1 year ago
11 months ago
1 year ago
12 months ago
1 year ago
12 months ago
11 months ago
12 months ago
1 year ago
12 months ago
1 year ago
  1. <template>
  2. <view class="coachInfo">
  3. <view class="card">
  4. <view class="avatar">
  5. <!-- <image :src="FormData.photoPath" mode="" @error="handleImageError()"></image> -->
  6. <image :src="FormData.photoPathh" mode="" v-if="isImagePath(FormData.photoPath)"></image>
  7. <image src="@/static/images/index/avatar.png" mode="" v-else></image>
  8. </view>
  9. <view class="rightTxt">
  10. <view class="name_row">
  11. <view class="name">{{ FormData.coachName }}</view>
  12. <view class="tag active" v-if="vuex_userInfo.coachId==FormData.coachId">已绑定</view>
  13. <view class="tag" v-else>未绑定</view>
  14. </view>
  15. <moreRight text="预约其它教练课程"/>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props: ['FormData'],
  23. methods: {
  24. handleImageError() {
  25. console.log('图片加载失败')
  26. this.FormData.photoPath = require('@/static/images/index/avatar.png')
  27. },
  28. isImagePath(path) {
  29. // 定义常见的图片文件扩展名
  30. const imageExtensions = /\.(jpg|jpeg|png|gif|bmp|svg)$/i;
  31. // 使用正则表达式进行匹配
  32. return imageExtensions.test(path);
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .coachInfo {
  39. .card {
  40. width: 100%;
  41. height: 180rpx;
  42. display: flex;
  43. align-items: center;
  44. padding: 0 36rpx;
  45. .avatar {
  46. width: 100rpx;
  47. height: 98rpx;
  48. border-radius: 50%;
  49. overflow: hidden;
  50. background-color: #F2F2F2;
  51. }
  52. .rightTxt {
  53. flex: 1;
  54. padding: 0 0 0 34rpx;
  55. .name_row {
  56. display: flex;
  57. align-items: center;
  58. margin-bottom: 16rpx;
  59. .name {
  60. font-size: 32rpx;
  61. color: #333;
  62. font-weight: 550;
  63. }
  64. .tag {
  65. width: 98rpx;
  66. height: 40rpx;
  67. background: #F2F2F2;
  68. border-radius: 4rpx;
  69. text-align: center;
  70. line-height: 40rpx;
  71. text-align: center;
  72. margin-left: 24rpx;
  73. color: #959595;
  74. &.active {
  75. color: $themC;
  76. background: #E8F3FE;
  77. }
  78. }
  79. }
  80. moreright {
  81. }
  82. }
  83. }
  84. }
  85. </style>