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

144 lines
3.1 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 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: curData.coachId==item.coachId}" @click="chooseCoach(item)">
  5. <view class="icon">
  6. <image src="@/static/images/index/radio_cli.png" mode="" v-if="curData.coachId==item.coachId"></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(0)">返回上一步</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. curData:{}
  42. }
  43. },
  44. created() {
  45. this.params.schoolId = this.vuex_userInfo.schoolId
  46. this.coachPageFn()
  47. },
  48. methods: {
  49. changeStep(val) {
  50. if(val) {
  51. this.$emit('updatedForm', Object.assign({}, this.FormData, this.curData))
  52. }
  53. this.$emit('changeStep', 1)
  54. },
  55. addCoachPage() {
  56. if(this.total>this.list.length) {
  57. this.coachPageFn()
  58. }
  59. },
  60. // 获取教练
  61. async coachPageFn() {
  62. const {data:res} = await coachPage(this.params)
  63. this.list.push(...res.list)
  64. this.params.pageNo ++
  65. this.total = res.total
  66. if(this.list.length>=this.total) {
  67. this.status = 'nomore'
  68. }
  69. console.log('获取教练')
  70. console.log(this.list)
  71. },
  72. searchFn(val) {
  73. this.params.name = val
  74. this.list = []
  75. this.params.pageNo = 1
  76. this.coachPageFn()
  77. },
  78. chooseCoach(item) {
  79. console.log(item)
  80. this.curData = {
  81. coachId: item.coachId,
  82. coachName: item.name,
  83. photoPath: item.photoPath
  84. }
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .poz_btn {
  91. position: fixed;
  92. bottom: 0;
  93. left: 0;
  94. padding: 12rpx 32rpx;
  95. width: 100%;
  96. background: #F6F6F6;
  97. }
  98. .step2 {
  99. width: 100%;
  100. padding-bottom: 120rpx;
  101. .card {
  102. padding: 28rpx 36rpx;
  103. display: flex;
  104. align-items: center;
  105. margin-bottom: 20rpx;
  106. height: 100rpx;
  107. .name {
  108. font-size: 26rpx;
  109. color: #333;
  110. margin-left: 16rpx;
  111. text {
  112. margin-left: 10rpx;
  113. }
  114. }
  115. .icon {
  116. width: 30rpx;
  117. height: 30rpx;
  118. }
  119. }
  120. }
  121. .btn_row {
  122. display: flex;
  123. justify-content: space-between;
  124. padding-bottom: 20rpx;
  125. .btn {
  126. width: 47%;
  127. height: 72rpx;
  128. background: #1989FA;
  129. border-radius: 8rpx;
  130. font-size: 28rpx;
  131. color: #fff;
  132. text-align: center;
  133. line-height: 72rpx;
  134. &.border {
  135. background: rgba(25, 137, 250, 0.1);
  136. border: 2rpx solid $themC;
  137. color: $themC;
  138. }
  139. }
  140. }
  141. </style>