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

135 lines
3.1 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
1 year 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)">全部缺字段</view>
  10. <view class="tab" :class="{active: this.params.condition==1}" @click="changeTab(1)">匿名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. },
  39. // 0查全部 1有图 2最新 3有视频
  40. total: 20,
  41. status: 'loading'
  42. }
  43. },
  44. onLoad() {
  45. this.params.schoolId = this.vuex_schoolId
  46. this.schoolCommentPageFn()
  47. },
  48. onPullDownRefresh() {
  49. this.list = []
  50. this.params.pageNo = 1
  51. this.schoolCommentPageFn().then(()=>{uni.stopPullDownRefresh()})
  52. },
  53. onReachBottom() {
  54. if(this.total>this.list.length) {
  55. this.schoolCommentPageFn()
  56. }
  57. },
  58. methods: {
  59. searchFn(val) {
  60. this.params.studentName = val
  61. this.initList()
  62. },
  63. changeTab(val) {
  64. this.params.condition = val
  65. this.initList()
  66. },
  67. initList() {
  68. this.list = []
  69. this.params.pageNo = 1
  70. this.status = 'loading'
  71. this.schoolCommentPageFn()
  72. },
  73. async schoolCommentPageFn() {
  74. if(this.identity=='校长') {
  75. var {data: res} = await schoolCommentPage(this.params)
  76. }else {
  77. let obj = Object.assign({},this.params)
  78. obj.coachId = this.vuex_coachId
  79. var {data: res} = await coachCommentPage(obj)
  80. }
  81. this.params.pageNo ++
  82. let arr = res.list.map(item=>{
  83. if(item.images) {
  84. item.images = item.images.split(',')
  85. }
  86. return item
  87. })
  88. this.list.push(...arr)
  89. this.total = res.total
  90. if(this.list.length>=this.total) {
  91. this.status = 'nomore'
  92. }else {
  93. this.status = 'loading'
  94. }
  95. console.log(res)
  96. },
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .card {
  102. padding: 28rpx;
  103. margin-bottom: 20rpx;
  104. }
  105. .tabs {
  106. display: flex;
  107. justify-content: space-between;
  108. padding: 24rpx 12rpx;
  109. .tab {
  110. line-height: 76rpx;
  111. font-size: 28rpx;
  112. color: #fff;
  113. &.active {
  114. position: relative;
  115. &::before {
  116. position: absolute;
  117. content: '';
  118. left: 50%;
  119. bottom: 0;
  120. transform: translateX(-50%);
  121. width: 56rpx;
  122. height: 6rpx;
  123. background: #FFFFFF;
  124. border-radius: 3rpx;
  125. }
  126. }
  127. }
  128. }
  129. </style>