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

197 lines
5.1 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
12 months ago
12 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" @updatedForm="updatedForm"></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": 20, "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.siteParams.carType = this.vuex_userInfo.trainType
  80. this.carParams.carType = this.vuex_userInfo.trainType
  81. // this.carType =
  82. let vuex_cityInfo = this.$store.state.user.vuex_cityInfo
  83. if(!vuex_cityInfo.lat) {
  84. this.$store.dispatch('getCity')
  85. }else {
  86. this.siteParams.latitude = vuex_cityInfo.lat
  87. this.siteParams.longitude = vuex_cityInfo.lng
  88. }
  89. this.examSitePageFn()
  90. },
  91. methods: {
  92. // 选择车型
  93. chooseCar(item) {
  94. this.FormData.carId = item.id
  95. this.FormData.carId = item.id
  96. this.FormData.licnum = item.licnum
  97. console.log(this.FormData.carId)
  98. },
  99. // 选择考场
  100. chooseSite(item) {
  101. this.FormData.examSiteId = item.id
  102. this.FormData.siteName = item.name
  103. this.carParams.pageNo = 1
  104. this.examCarPageFn()
  105. },
  106. // 获得考场
  107. async examSitePageFn() {
  108. const {data: res} = await examSitePage(this.siteParams)
  109. this.siteList = res
  110. },
  111. // 获得车辆
  112. async examCarPageFn() {
  113. this.carParams.examId = this.FormData.examSiteId
  114. const {data: res} = await examCarPage(this.carParams)
  115. this.carParams.pageNo++
  116. this.carList.push(...res.list)
  117. this.carTotal = res.total
  118. },
  119. changeStep(num) {
  120. this.currentStep = num
  121. },
  122. updatedForm(val) {
  123. this.FormData = val
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .top_row {
  130. width: 100%;
  131. padding-bottom: 36rpx;
  132. .step_row {
  133. display: flex;
  134. align-items: center;
  135. justify-content: space-between;
  136. width: 100%;
  137. padding: 0 32rpx;
  138. .dian {
  139. width: 180rpx;
  140. height: 100rpx;
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. position: relative;
  145. // background: red;
  146. }
  147. .num {
  148. width: 46rpx;
  149. height: 46rpx;
  150. background: #D1E7FE;
  151. line-height: 46rpx;
  152. border-radius: 50%;
  153. text-align: center;
  154. color: $themC;
  155. font-size: 24rpx;
  156. position: absolute;
  157. z-index: 9;
  158. &.active {
  159. border:2rpx solid $themC;
  160. &::before {
  161. content: '';
  162. width: 66rpx;
  163. height: 66rpx;
  164. border-radius: 50%;
  165. position: absolute;
  166. z-index: -1;
  167. left: 50%;
  168. top: 50%;
  169. transform: translate(-50%,-50%);
  170. background: rgba(255,255,255,0.6);
  171. filter: blur(6rpx);
  172. }
  173. }
  174. }
  175. .line {
  176. width: 60rpx;
  177. height: 4rpx;
  178. background: rgba(255,255,255,0.4);
  179. }
  180. }
  181. .step_text {
  182. display: flex;
  183. .txt {
  184. flex: 1;
  185. text-align: center;
  186. font-size: 28rpx;
  187. color: #fff;
  188. text-align: center;
  189. }
  190. }
  191. }
  192. </style>