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

138 lines
3.0 KiB

10 months 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. this.$emit('updatedForm', this.FormData)
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .poz_btn {
  85. position: fixed;
  86. bottom: 0;
  87. left: 0;
  88. padding: 12rpx 32rpx;
  89. width: 100%;
  90. background: #F6F6F6;
  91. }
  92. .step2 {
  93. width: 100%;
  94. padding-bottom: 120rpx;
  95. .card {
  96. padding: 28rpx 36rpx;
  97. display: flex;
  98. align-items: center;
  99. margin-bottom: 20rpx;
  100. height: 100rpx;
  101. .name {
  102. font-size: 26rpx;
  103. color: #333;
  104. margin-left: 16rpx;
  105. text {
  106. margin-left: 10rpx;
  107. }
  108. }
  109. .icon {
  110. width: 30rpx;
  111. height: 30rpx;
  112. }
  113. }
  114. }
  115. .btn_row {
  116. display: flex;
  117. justify-content: space-between;
  118. padding-bottom: 20rpx;
  119. .btn {
  120. width: 47%;
  121. height: 72rpx;
  122. background: #1989FA;
  123. border-radius: 8rpx;
  124. font-size: 28rpx;
  125. color: #fff;
  126. text-align: center;
  127. line-height: 72rpx;
  128. &.border {
  129. background: rgba(25, 137, 250, 0.1);
  130. border: 2rpx solid $themC;
  131. color: $themC;
  132. }
  133. }
  134. }
  135. </style>