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

191 lines
4.9 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months 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 class="line"></view>
  19. <view class="dian" @click="changeStep(4)">
  20. <view class="num" :class="{active: currentStep==4}">4</view>
  21. </view> -->
  22. <!-- <view class="line"></view>
  23. <view class="dian" @click="changeStep(5)">
  24. <view class="num" :class="{active: currentStep==5}">5</view>
  25. </view> -->
  26. </view>
  27. <view class="step_text">
  28. <!-- <view class="txt">选择科目</view> -->
  29. <view class="txt">选择考场</view>
  30. <!-- <view class="txt">选择车型</view> -->
  31. <view class="txt">选择车辆</view>
  32. <view class="txt">选择时间</view>
  33. </view>
  34. </view>
  35. <step1 v-if="currentStep==1" @changeStep="changeStep" :list="siteList" @chooseSite="chooseSite" :siteId="FormData.examSiteId"></step1>
  36. <step2 v-if="currentStep==2" @changeStep="changeStep" :list="carList" @chooseCar="chooseCar" :carId="FormData.carId"></step2>
  37. <step3 v-if="currentStep==3" @changeStep="changeStep" :FormData="FormData"></step3>
  38. <!-- <step4 v-if="currentStep==4" @changeStep="changeStep"></step4> -->
  39. <!-- <step5 v-if="currentStep==5" @changeStep="changeStep"></step5> -->
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import step1 from './comp/step1'
  45. import step2 from './comp/step2'
  46. import step3 from './comp/step3'
  47. import { examSitePage, examSimulationClass, examCarPage, } from '@/config/api'
  48. // import step5 from './comp/step5'
  49. export default {
  50. components: { step1, step2, step3,},
  51. data() {
  52. return {
  53. currentStep: 1,
  54. siteParams: {
  55. siteType: '2',
  56. carType: 'C1',
  57. longitude: '',
  58. latitude: ''
  59. },
  60. carParams: { "pageNo": 1, "pageSize": 10, "carType": 'C1',},
  61. FormData: {
  62. examSiteId: '',
  63. carId: '',
  64. subject: 2,
  65. classDate: '',
  66. classTime: '',
  67. licnum: '',
  68. siteName: '',
  69. trainType: 'C1'
  70. },
  71. siteList: [],
  72. carList: [],
  73. carTotal: 20
  74. }
  75. },
  76. onLoad(options) {
  77. if(options.subject) this.FormData.subject = options.subject
  78. this.FormData.trainType = this.vuex_userInfo.trainType
  79. // this.carType =
  80. let vuex_cityInfo = this.$store.state.user.vuex_cityInfo
  81. if(!vuex_cityInfo.lat) {
  82. this.$store.dispatch('getCity')
  83. }else {
  84. this.siteParams.latitude = vuex_cityInfo.lat
  85. this.siteParams.longitude = vuex_cityInfo.lng
  86. }
  87. this.examSitePageFn()
  88. },
  89. methods: {
  90. // 选择车型
  91. chooseCar(item) {
  92. this.FormData.carId = item.id
  93. this.FormData.carId = item.id
  94. this.FormData.licnum = item.licnum
  95. console.log(this.FormData.carId)
  96. },
  97. // 选择考场
  98. chooseSite(item) {
  99. this.FormData.examSiteId = item.id
  100. this.FormData.siteName = item.name
  101. this.examCarPageFn()
  102. },
  103. // 获得考场
  104. async examSitePageFn() {
  105. const {data: res} = await examSitePage(this.siteParams)
  106. this.siteList = res
  107. },
  108. // 获得车辆
  109. async examCarPageFn() {
  110. this.carParams.examId = this.FormData.examSiteId
  111. const {data: res} = await examCarPage(this.carParams)
  112. this.carParams.pageNo++
  113. this.carList.push(...res.list)
  114. this.carTotal = res.total
  115. },
  116. changeStep(num) {
  117. this.currentStep = num
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .top_row {
  124. width: 100%;
  125. padding-bottom: 36rpx;
  126. .step_row {
  127. display: flex;
  128. align-items: center;
  129. justify-content: space-between;
  130. width: 100%;
  131. padding: 0 32rpx;
  132. .dian {
  133. width: 180rpx;
  134. height: 100rpx;
  135. display: flex;
  136. align-items: center;
  137. justify-content: center;
  138. position: relative;
  139. // background: red;
  140. }
  141. .num {
  142. width: 46rpx;
  143. height: 46rpx;
  144. background: #D1E7FE;
  145. line-height: 46rpx;
  146. border-radius: 50%;
  147. text-align: center;
  148. color: $themC;
  149. font-size: 24rpx;
  150. position: absolute;
  151. z-index: 9;
  152. &.active {
  153. border:2rpx solid $themC;
  154. &::before {
  155. content: '';
  156. width: 66rpx;
  157. height: 66rpx;
  158. border-radius: 50%;
  159. position: absolute;
  160. z-index: -1;
  161. left: 50%;
  162. top: 50%;
  163. transform: translate(-50%,-50%);
  164. background: rgba(255,255,255,0.6);
  165. filter: blur(6rpx);
  166. }
  167. }
  168. }
  169. .line {
  170. width: 60rpx;
  171. height: 4rpx;
  172. background: rgba(255,255,255,0.4);
  173. }
  174. }
  175. .step_text {
  176. display: flex;
  177. .txt {
  178. flex: 1;
  179. text-align: center;
  180. font-size: 28rpx;
  181. color: #fff;
  182. text-align: center;
  183. }
  184. }
  185. }
  186. </style>