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

127 lines
2.7 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="step2">
  3. <searchBox placeholder="搜索教练姓名或手机号" @searchFn="searchFn"></searchBox>
  4. <view class="card" v-for="(item,index) in list" :key="index" :class="{active: FormData.coachId==item.id}" @click="chooseCoach(item)">
  5. <view class="icon">
  6. <image src="@/static/images/index/radio_cli.png" mode="" v-if="FormData.coachId==item.id"></image>
  7. <image src="@/static/images/index/radio_nor.png" mode="" v-else></image>
  8. </view>
  9. <view class="name">
  10. {{item.name}} <text>{{item.mobile}}</text>
  11. </view>
  12. </view>
  13. <view class="poz_btn">
  14. <view class="btn_row" >
  15. <view class="border btn" @click="changeStep(1)">返回上一步</view>
  16. <view class="btn" @click="changeStep(1)">下一步</view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import searchBox from './searchBox'
  23. import { coachPage } from '@/config/api.js'
  24. export default {
  25. props: ['FormData'],
  26. components: { searchBox },
  27. data() {
  28. return {
  29. params: {
  30. pageNo: 1,
  31. pageSize: 20,
  32. schoolId: '',
  33. name: ''
  34. },
  35. status: 'loading',
  36. list: [],
  37. total: 20
  38. }
  39. },
  40. created() {
  41. this.params.schoolId = this.vuex_userInfo.schoolId
  42. this.coachPageFn()
  43. },
  44. methods: {
  45. changeStep(val) {
  46. this.$emit('changeStep', val)
  47. },
  48. // 获取教练
  49. async coachPageFn() {
  50. const {data:res} = await coachPage(this.params)
  51. this.list.push(...res.list)
  52. this.params.pageNo ++
  53. this.total = res.total
  54. if(this.list.length>=this.total) {
  55. this.status = 'nomore'
  56. }
  57. console.log('获取教练')
  58. console.log(this.list)
  59. },
  60. searchFn(val) {
  61. this.params.name = val
  62. this.list = []
  63. this.params.pageNo = 1
  64. this.coachPageFn()
  65. },
  66. chooseCoach(item) {
  67. this.FormData.coachId = item.id
  68. this.FormData.coachName = item.name
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .poz_btn {
  75. position: fixed;
  76. bottom: 0;
  77. left: 0;
  78. padding: 12rpx 32rpx;
  79. width: 100%;
  80. background: #F6F6F6;
  81. }
  82. .step2 {
  83. width: 100%;
  84. padding-bottom: 120rpx;
  85. .card {
  86. padding: 28rpx 36rpx;
  87. display: flex;
  88. align-items: center;
  89. margin-bottom: 20rpx;
  90. height: 100rpx;
  91. .name {
  92. font-size: 26rpx;
  93. color: #333;
  94. margin-left: 16rpx;
  95. text {
  96. margin-left: 10rpx;
  97. }
  98. }
  99. .icon {
  100. width: 30rpx;
  101. height: 30rpx;
  102. }
  103. }
  104. }
  105. .btn_row {
  106. display: flex;
  107. justify-content: space-between;
  108. padding-bottom: 20rpx;
  109. .btn {
  110. width: 47%;
  111. height: 72rpx;
  112. background: #1989FA;
  113. border-radius: 8rpx;
  114. font-size: 28rpx;
  115. color: #fff;
  116. text-align: center;
  117. line-height: 72rpx;
  118. &.border {
  119. background: rgba(25, 137, 250, 0.1);
  120. border: 2rpx solid $themC;
  121. color: $themC;
  122. }
  123. }
  124. }
  125. </style>