江西小程序管理端
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.

136 lines
2.9 KiB

12 months ago
12 months ago
12 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <view class="status_bar"></view>
  4. <view class="navH"></view>
  5. <view class="pad">
  6. <view class="searchBox">
  7. <searchRow placeholder="搜索学员姓名"></searchRow>
  8. </view>
  9. <view class="tabs">
  10. <view class="tab active">全部10</view>
  11. <view class="tab">匿名1</view>
  12. <view class="tab">有图2</view>
  13. <view class="tab">有视频6</view>
  14. </view>
  15. <view class="list" v-if="list.length">
  16. <view class="card" v-for="(item,index) in index" :key="index">
  17. <commentItem :item="item"/>
  18. </view>
  19. </view>
  20. <view style="padding-bottom: 20rpx;" v-if="list.length">
  21. <u-loadmore :status="status" />
  22. </view>
  23. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  24. </view>
  25. <UserTab name ='学员评价'></UserTab>
  26. </view>
  27. </template>
  28. <script>
  29. import { coachCommentPage } from '@/config/api.js'
  30. export default {
  31. data() {
  32. return {
  33. list: [],
  34. params: {
  35. pageNo: 1,
  36. pageSize: 20,
  37. schoolId: '',
  38. condition: 0,
  39. studentName: '',
  40. coachType: '3', //1.教练 2.模拟教练 3.模拟器老师
  41. },
  42. // 0查全部 1有图 2最新 3有视频
  43. total: 20,
  44. status: 'loading'
  45. }
  46. },
  47. created() {
  48. this.params.schoolId = this.vuex_schoolId
  49. // if(this.identity=='实操教练') {
  50. // this.params.coachType = 1
  51. // }else if(this.identity=='考场模拟教练'){
  52. // this.params.coachType = 2
  53. // }else if(this.identity=='模拟器老师'){
  54. // this.params.coachType = 3
  55. // }
  56. this.coachCommentPageFn()
  57. },
  58. onReachBottom() {
  59. if(this.total>this.list.length) {
  60. this.coachCommentPageFn()
  61. }
  62. },
  63. methods: {
  64. searchFn(val) {
  65. this.params.studentName = val
  66. this.initList()
  67. },
  68. changeTab(val) {
  69. this.params.condition = val
  70. this.initList()
  71. },
  72. initList() {
  73. this.list = []
  74. this.params.pageNo = 1
  75. this.status = 'loading'
  76. this.coachCommentPageFn()
  77. },
  78. async coachCommentPageFn() {
  79. var {data: res} = await coachCommentPage(this.params)
  80. this.params.pageNo ++
  81. let arr = res.list.map(item=>{
  82. if(item.images) {
  83. item.images = item.images.split(',')
  84. }
  85. return item
  86. })
  87. this.list.push(...arr)
  88. this.total = res.total
  89. if(this.list.length>=this.total) {
  90. this.status = 'nomore'
  91. }else {
  92. this.status = 'loading'
  93. }
  94. console.log(res)
  95. },
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .navH {
  101. width: 100%;
  102. height: 90rpx;
  103. }
  104. .card {
  105. padding: 28rpx;
  106. margin-bottom: 20rpx;
  107. }
  108. .tabs {
  109. display: flex;
  110. justify-content: space-between;
  111. padding: 24rpx 12rpx;
  112. .tab {
  113. line-height: 76rpx;
  114. font-size: 28rpx;
  115. color: #fff;
  116. &.active {
  117. position: relative;
  118. &::before {
  119. position: absolute;
  120. content: '';
  121. left: 50%;
  122. bottom: 0;
  123. transform: translateX(-50%);
  124. width: 56rpx;
  125. height: 6rpx;
  126. background: #FFFFFF;
  127. border-radius: 3rpx;
  128. }
  129. }
  130. }
  131. }
  132. </style>