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

180 lines
4.1 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 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 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar :title="title"></topNavbar>
  4. <view class="pad" style="padding-bottom: 60rpx;">
  5. <step1 v-if="currentStep==1" @openPopup="openPopup" :FormData="FormData" @showStep2="showStep2"></step1>
  6. <step2 v-if="currentStep==2" @changeStep="changeStep" :FormData="FormData" ref="step2Ref"></step2>
  7. </view>
  8. <u-popup :show="show" mode="center" :round="8">
  9. <view class="popupCon">
  10. <view class="h2">再次确认预约信息</view>
  11. <view class="content">
  12. <view class="row">
  13. <view class="lab">预约类型</view>
  14. <view class="val">实操训练预约</view>
  15. </view>
  16. <view class="row">
  17. <view class="lab">预约科目</view>
  18. <view class="val">{{FormData.subject==2?'科目二': '科目三'}}</view>
  19. </view>
  20. <view class="row">
  21. <view class="lab">预约场地</view>
  22. <view class="val">{{FormData.siteName}}</view>
  23. </view>
  24. <view class="row">
  25. <view class="lab">预约车辆</view>
  26. <view class="val">{{ FormData.carNumber }}</view>
  27. </view>
  28. <view class="row">
  29. <view class="lab">预约时间</view>
  30. <view class="val">{{ FormData.classDate}} {{FormData.classTime}}</view>
  31. </view>
  32. </view>
  33. <view class="btn_row">
  34. <view class="border btn" @click="show = false">返回修改</view>
  35. <view class="btn" @click="masterCreateFn">确认</view>
  36. </view>
  37. </view>
  38. </u-popup>
  39. </view>
  40. </template>
  41. <script>
  42. import step1 from './comp/step1'
  43. import step2 from './comp/step2'
  44. import { masterCreate } from '@/config/api.js'
  45. export default {
  46. components: { step1, step2,},
  47. data() {
  48. return {
  49. currentStep: 1,
  50. title: '实操训练预约',
  51. FormData: {
  52. carId: '',
  53. subject: 2,
  54. classDate: '',
  55. classTime: '',
  56. licnum: '',
  57. trainType: 'C1',
  58. coachId: '',
  59. coachName: '',
  60. carNumber: '',//车牌号
  61. siteName: '',//场地名称
  62. siteAddress: '',//场地地址
  63. photoPath: ''
  64. },
  65. show: false
  66. }
  67. },
  68. onLoad(options) {
  69. this.subject = options.subject
  70. if(this.subject==2) {
  71. this.title = '实操训练科目二预约'
  72. }else if(this.subject==3) {
  73. this.title = '实操训练科目三预约'
  74. }
  75. if(options.subject) this.FormData.subject = options.subject
  76. this.FormData.trainType = this.vuex_userInfo.trainType
  77. this.FormData.studentId = this.vuex_userInfo.id
  78. this.FormData.coachId = this.vuex_userInfo.coachId
  79. this.FormData.coachName = this.vuex_userInfo.coachName
  80. },
  81. onReachBottom() {
  82. if(this.currentStep==2) {
  83. this.$refs.step2Ref.addCoachPage()
  84. }
  85. },
  86. methods: {
  87. changeStep(num) {
  88. this.currentStep = num
  89. },
  90. openPopup() {
  91. this.show = true
  92. },
  93. showStep2() {
  94. this.currentStep = 2
  95. },
  96. async masterCreateFn() {
  97. this.show = false
  98. let obj = {
  99. "studentId": this.FormData.studentId,
  100. "coachId": this.FormData.coachId,
  101. "classDate": this.FormData.classDate,
  102. "selectScheduleClass": [this.FormData.courseIds],
  103. // classId: [this.FormData.courseIds]
  104. }
  105. const {data: res} = await masterCreate(obj)
  106. if(res) {
  107. this.$u.toast('预约成功')
  108. setTimeout(()=>{
  109. this.$goPage('/pages/mineEntry/myAppointment/myAppointment?currentTab=2')
  110. },1500)
  111. }
  112. console.log(res)
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .popupCon {
  119. padding: 30rpx 50rpx;
  120. .h2 {
  121. font-weight: 600;
  122. color: #333333;
  123. line-height: 70rpx;
  124. font-size: 36rpx;
  125. text-align: center;
  126. margin-bottom: 20rpx;
  127. }
  128. .content {
  129. padding-bottom: 20rpx;
  130. .row {
  131. padding: 22rpx 0;
  132. display: flex;
  133. font-size: 28rpx;
  134. align-items: center;
  135. .lab {
  136. width: 180rpx;
  137. color: #686B73;
  138. }
  139. .val {
  140. flex: 1;
  141. font-weight: 500;
  142. }
  143. }
  144. }
  145. }
  146. .btn_row {
  147. display: flex;
  148. justify-content: space-between;
  149. padding-bottom: 30rpx;
  150. .btn {
  151. width: 47%;
  152. height: 72rpx;
  153. background: #1989FA;
  154. border-radius: 8rpx;
  155. font-size: 28rpx;
  156. color: #fff;
  157. text-align: center;
  158. line-height: 72rpx;
  159. &.border {
  160. background: rgba(25, 137, 250, 0.1);
  161. border: 2rpx solid $themC;
  162. color: $themC;
  163. }
  164. }
  165. }
  166. </style>