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

137 lines
2.9 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 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. teachType: '4',//准教类型(1:理论,2:模拟,4:实操,
  35. employStatus: 0,
  36. otherCoach: true
  37. },
  38. status: 'loading',
  39. list: [],
  40. total: 20
  41. }
  42. },
  43. created() {
  44. this.params.schoolId = this.vuex_userInfo.schoolId
  45. this.coachPageFn()
  46. },
  47. methods: {
  48. changeStep(val) {
  49. this.$emit('changeStep', val)
  50. },
  51. addCoachPage() {
  52. if(this.total>this.list.length) {
  53. this.coachPageFn()
  54. }
  55. },
  56. // 获取教练
  57. async coachPageFn() {
  58. const {data:res} = await coachPage(this.params)
  59. this.list.push(...res.list)
  60. this.params.pageNo ++
  61. this.total = res.total
  62. if(this.list.length>=this.total) {
  63. this.status = 'nomore'
  64. }
  65. console.log('获取教练')
  66. console.log(this.list)
  67. },
  68. searchFn(val) {
  69. this.params.name = val
  70. this.list = []
  71. this.params.pageNo = 1
  72. this.coachPageFn()
  73. },
  74. chooseCoach(item) {
  75. this.FormData.coachId = item.id
  76. this.FormData.coachName = item.name
  77. this.FormData.photoPath = item.photoPath
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .poz_btn {
  84. position: fixed;
  85. bottom: 0;
  86. left: 0;
  87. padding: 12rpx 32rpx;
  88. width: 100%;
  89. background: #F6F6F6;
  90. }
  91. .step2 {
  92. width: 100%;
  93. padding-bottom: 120rpx;
  94. .card {
  95. padding: 28rpx 36rpx;
  96. display: flex;
  97. align-items: center;
  98. margin-bottom: 20rpx;
  99. height: 100rpx;
  100. .name {
  101. font-size: 26rpx;
  102. color: #333;
  103. margin-left: 16rpx;
  104. text {
  105. margin-left: 10rpx;
  106. }
  107. }
  108. .icon {
  109. width: 30rpx;
  110. height: 30rpx;
  111. }
  112. }
  113. }
  114. .btn_row {
  115. display: flex;
  116. justify-content: space-between;
  117. padding-bottom: 20rpx;
  118. .btn {
  119. width: 47%;
  120. height: 72rpx;
  121. background: #1989FA;
  122. border-radius: 8rpx;
  123. font-size: 28rpx;
  124. color: #fff;
  125. text-align: center;
  126. line-height: 72rpx;
  127. &.border {
  128. background: rgba(25, 137, 250, 0.1);
  129. border: 2rpx solid $themC;
  130. color: $themC;
  131. }
  132. }
  133. }
  134. </style>