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

167 lines
4.1 KiB

1 year ago
10 months ago
1 year ago
8 months ago
1 year ago
11 months ago
1 year ago
10 months ago
8 months ago
1 year ago
8 months ago
11 months ago
10 months ago
10 months ago
11 months ago
8 months ago
11 months ago
11 months ago
10 months ago
8 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
8 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
8 months ago
11 months ago
10 months ago
11 months ago
1 year ago
11 months 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)">全部{{ totalType.total1 }}</view>
  10. <view class="tab" :class="{active: this.params.condition==1}" @click="changeTab(1)">匿名{{ totalType.total2 }}</view>
  11. <view class="tab" :class="{active: this.params.condition==2}" @click="changeTab(2)">有图{{ totalType.total3 }}</view>
  12. <view class="tab" :class="{active: this.params.condition==3}" @click="changeTab(3)">有视频{{ totalType.total4 }}</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'" style="margin-top: 100rpx;"></nodata>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { schoolCommentPage, coachCommentPage, commentPagetotal, pageCoachCommentTotal} 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. totalType: {
  43. total1: 0,
  44. total2: 0,
  45. total3: 0,
  46. total4: 0,
  47. },
  48. status: 'loading'
  49. }
  50. },
  51. onLoad() {
  52. this.params.schoolId = this.vuex_schoolId
  53. if(this.identity=='实操教练') {
  54. this.params.coachType = 1
  55. }else if(this.identity=='考场模拟教练'){
  56. this.params.coachType = 2
  57. }else if(this.identity=='模拟器老师'){
  58. this.params.coachType = 3
  59. }
  60. this.initList()
  61. },
  62. onPullDownRefresh() {
  63. this.initList()
  64. },
  65. onReachBottom() {
  66. if(this.total>this.list.length) {
  67. this.schoolCommentPageFn()
  68. }
  69. },
  70. methods: {
  71. searchFn(val) {
  72. this.params.studentName = val
  73. this.initList()
  74. },
  75. changeTab(val) {
  76. this.params.condition = val
  77. this.initList()
  78. },
  79. initList() {
  80. this.list = []
  81. this.params.pageNo = 1
  82. this.status = 'loading'
  83. this.schoolCommentPageFn()
  84. this.commentPagetotalFn()
  85. },
  86. // 查条数
  87. async commentPagetotalFn() {
  88. let obj = {schoolId: this.params.schoolId}
  89. // 教练角色
  90. if(this.params.coachType) {
  91. obj.coachType = this.params.coachType
  92. obj.coachId = this.vuex_coachId
  93. var {data: res} = await pageCoachCommentTotal(obj)
  94. }else {
  95. var {data: res} = await commentPagetotal(obj)
  96. }
  97. this.totalType = {
  98. total1: res.total1,
  99. total2: res.total2,
  100. total3: res.total3,
  101. total4: res.total4,
  102. }
  103. },
  104. async schoolCommentPageFn() {
  105. if(this.identity=='校长') {
  106. var {data: res} = await schoolCommentPage(this.params)
  107. }else {
  108. let obj = Object.assign({},this.params)
  109. obj.coachId = this.vuex_coachId
  110. var {data: res} = await coachCommentPage(obj)
  111. }
  112. this.params.pageNo ++
  113. let arr = res.list.map(item=>{
  114. if(item.images) {
  115. item.images = item.images.split(',')
  116. }
  117. return item
  118. })
  119. this.list.push(...arr)
  120. this.total = res.total
  121. if(this.list.length>=this.total) {
  122. this.status = 'nomore'
  123. }else {
  124. this.status = 'loading'
  125. }
  126. console.log(res)
  127. },
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. .card {
  133. padding: 28rpx;
  134. margin-bottom: 20rpx;
  135. }
  136. .tabs {
  137. display: flex;
  138. justify-content: space-between;
  139. padding: 24rpx 12rpx;
  140. .tab {
  141. line-height: 76rpx;
  142. font-size: 28rpx;
  143. color: #fff;
  144. &.active {
  145. position: relative;
  146. &::before {
  147. position: absolute;
  148. content: '';
  149. left: 50%;
  150. bottom: 0;
  151. transform: translateX(-50%);
  152. width: 56rpx;
  153. height: 6rpx;
  154. background: #FFFFFF;
  155. border-radius: 3rpx;
  156. }
  157. }
  158. }
  159. }
  160. </style>