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

199 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.carList = []
  105. this.examCarPageFn()
  106. },
  107. // 获得考场
  108. async examSitePageFn() {
  109. const {data: res} = await examSitePage(this.siteParams)
  110. this.siteList = res
  111. },
  112. // 获得车辆
  113. async examCarPageFn() {
  114. this.carParams.examId = this.FormData.examSiteId
  115. const {data: res} = await examCarPage(this.carParams)
  116. this.carParams.pageNo++
  117. this.carList.push(...res.list)
  118. this.carTotal = res.total
  119. },
  120. changeStep(num) {
  121. this.currentStep = num
  122. },
  123. updatedForm(val) {
  124. this.FormData = val
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .top_row {
  131. width: 100%;
  132. padding-bottom: 36rpx;
  133. .step_row {
  134. display: flex;
  135. align-items: center;
  136. justify-content: space-between;
  137. width: 100%;
  138. padding: 0 32rpx;
  139. .dian {
  140. width: 180rpx;
  141. height: 100rpx;
  142. display: flex;
  143. align-items: center;
  144. justify-content: center;
  145. position: relative;
  146. // background: red;
  147. }
  148. .num {
  149. width: 46rpx;
  150. height: 46rpx;
  151. background: #D1E7FE;
  152. line-height: 46rpx;
  153. border-radius: 50%;
  154. text-align: center;
  155. color: $themC;
  156. font-size: 24rpx;
  157. position: absolute;
  158. z-index: 9;
  159. &.active {
  160. border:2rpx solid $themC;
  161. &::before {
  162. content: '';
  163. width: 66rpx;
  164. height: 66rpx;
  165. border-radius: 50%;
  166. position: absolute;
  167. z-index: -1;
  168. left: 50%;
  169. top: 50%;
  170. transform: translate(-50%,-50%);
  171. background: rgba(255,255,255,0.6);
  172. filter: blur(6rpx);
  173. }
  174. }
  175. }
  176. .line {
  177. width: 60rpx;
  178. height: 4rpx;
  179. background: rgba(255,255,255,0.4);
  180. }
  181. }
  182. .step_text {
  183. display: flex;
  184. .txt {
  185. flex: 1;
  186. text-align: center;
  187. font-size: 28rpx;
  188. color: #fff;
  189. text-align: center;
  190. }
  191. }
  192. }
  193. </style>