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

152 lines
3.8 KiB

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="模拟器训练预约"></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"></step2>
  27. <step3 v-if="currentStep==3" @changeStep="changeStep" :FormData="FormData"></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. }
  52. }
  53. },
  54. created() {
  55. this.simulationPointFn()
  56. this.FormData.trainType = this.vuex_userInfo.trainType
  57. this.FormData.studentId = this.studentId
  58. },
  59. methods: {
  60. changeStep(num) {
  61. this.currentStep = num
  62. },
  63. // 选择模拟点
  64. choosePoint(item) {
  65. this.FormData.pointName = item.pointName
  66. this.FormData.pointId = item.id
  67. // this.simulationClassFn()
  68. },
  69. // 模拟点
  70. async simulationPointFn() {
  71. const {data: res} = await simulationPoint({schoolId: this.vuex_userInfo.schoolId,lat: this.vuex_cityInfo.lat,lng: this.vuex_cityInfo.lng})
  72. this.list1 = res
  73. },
  74. async simulationClassFn() {
  75. let obj = { "pointId": this.FormData.pointId, "trainType": this.FormData.trainType, "classDate": "2023-11-01", "studentId": this.FormData.studentId}
  76. const {data: res} = await simulationClass(obj)
  77. },
  78. async simulationDevicesFn() {
  79. const {data: res} = await simulationDevices()
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .top_row {
  86. width: 100%;
  87. padding-bottom: 36rpx;
  88. .step_row {
  89. display: flex;
  90. align-items: center;
  91. justify-content: space-between;
  92. width: 100%;
  93. padding: 0 32rpx;
  94. .dian {
  95. width: 180rpx;
  96. height: 100rpx;
  97. display: flex;
  98. align-items: center;
  99. justify-content: center;
  100. position: relative;
  101. // background: red;
  102. }
  103. .num {
  104. width: 46rpx;
  105. height: 46rpx;
  106. background: #D1E7FE;
  107. line-height: 46rpx;
  108. border-radius: 50%;
  109. text-align: center;
  110. color: $themC;
  111. font-size: 24rpx;
  112. position: absolute;
  113. z-index: 9;
  114. &.active {
  115. border:2rpx solid $themC;
  116. &::before {
  117. content: '';
  118. width: 66rpx;
  119. height: 66rpx;
  120. border-radius: 50%;
  121. position: absolute;
  122. z-index: -1;
  123. left: 50%;
  124. top: 50%;
  125. transform: translate(-50%,-50%);
  126. background: rgba(255,255,255,0.6);
  127. filter: blur(6rpx);
  128. }
  129. }
  130. }
  131. .line {
  132. width: 60rpx;
  133. height: 4rpx;
  134. background: rgba(255,255,255,0.4);
  135. }
  136. }
  137. .step_text {
  138. display: flex;
  139. .txt {
  140. flex: 1;
  141. text-align: center;
  142. font-size: 28rpx;
  143. color: #fff;
  144. text-align: center;
  145. }
  146. }
  147. }
  148. </style>