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

157 lines
3.9 KiB

1 year ago
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="模拟器训练预约"></topNavbar>
  4. <view class="pad">
  5. <view class="top_row">
  6. <view class="step_row">
  7. <view class="dian" @click="changeStep(1)">
  8. <view class="num" :class="{active: currentStep==1}">1</view>
  9. </view>
  10. <view class="line"></view>
  11. <view class="dian" @click="changeStep(2)">
  12. <view class="num" :class="{active: currentStep==2}">2</view>
  13. </view>
  14. <view class="line"></view>
  15. <view class="dian" @click="changeStep(3)">
  16. <view class="num" :class="{active: currentStep==3}">3</view>
  17. </view>
  18. </view>
  19. <view class="step_text">
  20. <view class="txt">选择模拟驾驶馆</view>
  21. <view class="txt">预约时间</view>
  22. <view class="txt">选择模拟器</view>
  23. </view>
  24. </view>
  25. <step1 v-if="currentStep==1" @changeStep="changeStep" :list="list1" :FormData="FormData" @choosePoint="choosePoint"></step1>
  26. <step2 v-if="currentStep==2" @changeStep="changeStep" :FormData="FormData" @updatedForm="updatedForm" ></step2>
  27. <step3 v-if="currentStep==3" @changeStep="changeStep" :FormData="FormData" @updatedForm="updatedForm"></step3>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import step1 from './comp/step1'
  33. import step2 from './comp/step2'
  34. import step3 from './comp/step3'
  35. import { simulationDevices, simulationPoint, simulationClass } from '@/config/api.js'
  36. export default {
  37. components: { step1, step2, step3 },
  38. data() {
  39. return {
  40. currentStep: 1,
  41. list1: [],
  42. FormData: {
  43. pointName: '',
  44. pointId: '',
  45. trainType: '',
  46. studentId: '',
  47. deviceName: '',
  48. classDate: '',
  49. classTime: '',
  50. deviceNum: '',
  51. courseIds: '',
  52. beginTime: '',
  53. }
  54. }
  55. },
  56. created() {
  57. this.simulationPointFn()
  58. this.FormData.trainType = this.vuex_userInfo.trainType
  59. this.FormData.studentId = this.studentId
  60. },
  61. methods: {
  62. updatedForm(val) {
  63. this.FormData = val
  64. },
  65. changeStep(num) {
  66. this.currentStep = num
  67. },
  68. // 选择模拟点
  69. choosePoint(item) {
  70. this.FormData.pointName = item.pointName
  71. this.FormData.pointId = item.id
  72. // this.simulationClassFn()
  73. },
  74. // 模拟点
  75. async simulationPointFn() {
  76. const {data: res} = await simulationPoint({schoolId: this.vuex_userInfo.schoolId,lat: this.vuex_cityInfo.lat,lng: this.vuex_cityInfo.lng})
  77. this.list1 = res
  78. },
  79. async simulationClassFn() {
  80. let obj = { "pointId": this.FormData.pointId, "trainType": this.FormData.trainType, "classDate": "2023-11-01", "studentId": this.FormData.studentId}
  81. const {data: res} = await simulationClass(obj)
  82. },
  83. async simulationDevicesFn() {
  84. const {data: res} = await simulationDevices()
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .top_row {
  91. width: 100%;
  92. padding-bottom: 36rpx;
  93. .step_row {
  94. display: flex;
  95. align-items: center;
  96. justify-content: space-between;
  97. width: 100%;
  98. padding: 0 32rpx;
  99. .dian {
  100. width: 180rpx;
  101. height: 100rpx;
  102. display: flex;
  103. align-items: center;
  104. justify-content: center;
  105. position: relative;
  106. // background: red;
  107. }
  108. .num {
  109. width: 46rpx;
  110. height: 46rpx;
  111. background: #D1E7FE;
  112. line-height: 46rpx;
  113. border-radius: 50%;
  114. text-align: center;
  115. color: $themC;
  116. font-size: 24rpx;
  117. position: absolute;
  118. z-index: 9;
  119. &.active {
  120. border:2rpx solid $themC;
  121. &::before {
  122. content: '';
  123. width: 66rpx;
  124. height: 66rpx;
  125. border-radius: 50%;
  126. position: absolute;
  127. z-index: -1;
  128. left: 50%;
  129. top: 50%;
  130. transform: translate(-50%,-50%);
  131. background: rgba(255,255,255,0.6);
  132. filter: blur(6rpx);
  133. }
  134. }
  135. }
  136. .line {
  137. width: 60rpx;
  138. height: 4rpx;
  139. background: rgba(255,255,255,0.4);
  140. }
  141. }
  142. .step_text {
  143. display: flex;
  144. .txt {
  145. flex: 1;
  146. text-align: center;
  147. font-size: 28rpx;
  148. color: #fff;
  149. text-align: center;
  150. }
  151. }
  152. }
  153. </style>