洛阳学员端
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
9 months ago
10 months ago
  1. <template>
  2. <view class="main">
  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. <u-loadmore :status="status" v-if="list.length>30" :icon-type="'flower'" />
  15. </view>
  16. </template>
  17. <script>
  18. import { coachPage } from '@/config/api.js'
  19. export default {
  20. data() {
  21. return {
  22. keyword: '',
  23. trainingSchoolId: '',
  24. list: [],
  25. params: {
  26. pageNo: 1,
  27. pageSize: 20,
  28. schoolId: '',
  29. name: ''
  30. },
  31. status: 'loading',
  32. }
  33. },
  34. onLoad(options) {
  35. this.params.schoolId = options.schoolId
  36. this.params.teachCarType = options.trainType
  37. this.coachPageFn()
  38. },
  39. onReachBottom() {
  40. if(status=='nomore') return
  41. this.coachPageFn()
  42. },
  43. methods: {
  44. chooseClick(item) {
  45. uni.$emit('upDateCoachItem', item)
  46. uni.navigateBack()
  47. },
  48. searchFn() {
  49. this.list = []
  50. this.params.pageNo = 1
  51. this.status = 'loading'
  52. this.coachPageFn()
  53. },
  54. // 获取教练
  55. async coachPageFn() {
  56. const {data:res} = await coachPage(this.params)
  57. this.list.push(...res.list)
  58. this.params.pageNo ++
  59. this.total = res.total
  60. if(this.list.length>=this.total) {
  61. this.status = 'nomore'
  62. }
  63. console.log('获取教练')
  64. console.log(this.list)
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .main {
  71. background-color: #f8f8f8;
  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>