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

99 lines
2.1 KiB

10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
8 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="pageBg">
  3. <u-sticky>
  4. <view class="searchBox">
  5. <u-search placeholder="请输入教练姓名" v-model="params.name" :show-action="false" @search="searchFn"> </u-search>
  6. </view>
  7. </u-sticky>
  8. <view class="ul">
  9. <view class="li" v-for="(item,index) in list" :key="index" @click="chooseClick(item)">
  10. <view class="leftT">{{item.name}}</view>
  11. <view class="rigthT">{{item.mobile}}</view>
  12. </view>
  13. </view>
  14. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  15. <u-loadmore :status="status" v-if="list.length>30" :icon-type="'flower'" />
  16. </view>
  17. </template>
  18. <script>
  19. import { coachPage } from '@/config/api.js'
  20. export default {
  21. data() {
  22. return {
  23. keyword: '',
  24. trainingSchoolId: '',
  25. list: [],
  26. params: {
  27. pageNo: 1,
  28. pageSize: 20,
  29. schoolId: '',
  30. name: ''
  31. },
  32. status: 'loading',
  33. }
  34. },
  35. onLoad(options) {
  36. this.params.schoolId = options.schoolId
  37. this.params.teachCarType = options.trainType
  38. this.coachPageFn()
  39. },
  40. onReachBottom() {
  41. if(this.status=='nomore') return
  42. this.coachPageFn()
  43. },
  44. methods: {
  45. chooseClick(item) {
  46. uni.$emit('upDateCoachItem', item)
  47. uni.navigateBack()
  48. },
  49. searchFn() {
  50. this.list = []
  51. this.params.pageNo = 1
  52. this.status = 'loading'
  53. this.coachPageFn()
  54. },
  55. // 获取教练
  56. async coachPageFn() {
  57. const {data:res} = await coachPage(this.params)
  58. this.list.push(...res.list)
  59. this.params.pageNo ++
  60. this.total = res.total
  61. if(this.list.length>=this.total) {
  62. this.status = 'nomore'
  63. }
  64. console.log('获取教练')
  65. console.log(this.list)
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .pageBg {
  72. .searchBox {
  73. background-color: #fff;
  74. padding: 16rpx 32rpx;
  75. }
  76. }
  77. .ul {
  78. width: 100%;
  79. border-bottom: 10rpx solid #f8f8f8;
  80. font-size: 30rpx;
  81. padding: 0 32rpx;
  82. color: #333333;
  83. background-color: #fff;
  84. .li {
  85. width: 100%;
  86. height: 98rpx;
  87. line-height: 98rpx;
  88. display: flex;
  89. font-size: 30rpx;
  90. justify-content: space-between;
  91. align-center: center;
  92. border-bottom: 1px solid #F5F7FA;
  93. }
  94. }
  95. </style>