学员端小程序
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.2 KiB

  1. <template>
  2. <view class="main">
  3. <u-sticky>
  4. <view class="searchBox">
  5. <u-search placeholder="请输入教练姓名" v-model="params.coachName" :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.coachName}}</view>
  11. <view class="rigthT">{{item.mobilePhone}}</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 learnDrive from '@/api/learnDrive.js'
  19. export default {
  20. data() {
  21. return {
  22. keyword: '',
  23. trainingSchoolId: '',
  24. list: [
  25. {coachName: '张教练', mobilePhone: '15698236123'}
  26. ],
  27. params: {
  28. pageIndex: 1,
  29. pageSize: 30,
  30. trainingSchoolId: ''
  31. },
  32. status: 'loadmore',
  33. }
  34. },
  35. onLoad(options) {
  36. this.params.trainingSchoolId = options.trainingSchoolId
  37. this.querySchoolCoachFn()
  38. },
  39. onReachBottom() {
  40. if(status=='nomore') return
  41. this.querySchoolCoachFn()
  42. },
  43. methods: {
  44. chooseClick(item) {
  45. this.$store.commit('upDateCoachItem', item)
  46. uni.navigateBack()
  47. },
  48. searchFn() {
  49. this.list = []
  50. this.params.pageIndex = 1
  51. this.status = 'loadmore'
  52. this.querySchoolCoachFn()
  53. },
  54. // 获取教练
  55. async querySchoolCoachFn() {
  56. // const [nulls, res] = await learnDrive.querySchoolCoach(this.params)
  57. // this.list.push(...res.data)
  58. // this.params.pageIndex ++
  59. // if(res.data.length<this.params.pageSize) {
  60. // this.status = 'nomore'
  61. // }
  62. // console.log('获取教练')
  63. // console.log(res)
  64. },
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .main {
  70. background-color: #f8f8f8;
  71. .searchBox {
  72. background-color: #fff;
  73. padding: 16rpx 32rpx;
  74. }
  75. }
  76. .ul {
  77. width: 100%;
  78. border-bottom: 10rpx solid #f8f8f8;
  79. font-size: 30rpx;
  80. padding: 0 32rpx;
  81. color: #333333;
  82. background-color: #fff;
  83. .li {
  84. width: 100%;
  85. height: 98rpx;
  86. line-height: 98rpx;
  87. display: flex;
  88. font-size: 30rpx;
  89. justify-content: space-between;
  90. align-center: center;
  91. border-bottom: 1px solid #F5F7FA;
  92. }
  93. }
  94. </style>