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

134 lines
3.0 KiB

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