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

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