洛阳学员端
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.

88 lines
1.9 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="infoBox pad">
  4. <info :showSign="true" :item="info"></info>
  5. </view>
  6. <view class="pad">
  7. <view class="card">
  8. <view class="h1"><text class="active">教练评价</text></view>
  9. <comments :list="list" @changeNav="changeNav"></comments>
  10. <view style="padding-bottom: 20rpx;" v-if="list.length">
  11. <u-loadmore :status="status" />
  12. </view>
  13. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import comments from '../comments/comments.vue'
  20. import info from './coachInfo.vue'
  21. import { getBycoachId, } from '@/config/api.js'
  22. export default {
  23. components: { comments, info},
  24. data() {
  25. return {
  26. params: {
  27. pageNo: 1,
  28. pageSize: 20,
  29. coachId: '',
  30. condition: 0
  31. },
  32. total: 20,
  33. list: [],
  34. coachList: [],
  35. status: 'loading'
  36. }
  37. },
  38. onLoad(options) {
  39. if(!options.item) return
  40. this.info = JSON.parse(decodeURIComponent(options.item))
  41. console.log(this.info)
  42. this.params.coachId = this.info.id
  43. this.getBycoachIdFn()
  44. },
  45. methods: {
  46. changeNav(val) {
  47. if(this.params.condition == val) return
  48. this.params.condition = val
  49. this.initList()
  50. },
  51. initList() {
  52. this.params.pageNo = 1
  53. this.status = 'loading'
  54. this.list = []
  55. this.getBycoachIdFn()
  56. },
  57. async getBycoachIdFn() {
  58. const {data: res} = await getBycoachId(this.params)
  59. this.params.pageNo ++
  60. this.total = res.total
  61. let arr = res.list.map(item=>{
  62. if(item.images) {
  63. item.images = item.images.split(',')
  64. }
  65. return item
  66. })
  67. this.list.push(...arr)
  68. if(this.list.length>=this.list.length) this.status = 'nomore'
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .card {
  75. padding: 20rpx 0;
  76. margin-top: 20rpx;
  77. }
  78. .h1 {
  79. padding: 0 20rpx;
  80. margin-bottom: 20rpx;
  81. }
  82. .infoBox {
  83. background: #F6F6F6;
  84. overflow: hidden;
  85. }
  86. </style>