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

134 lines
3.2 KiB

  1. <template>
  2. <view class="main">
  3. <view class="tit">
  4. {{step}} {{title}}
  5. </view>
  6. <view class="address" @click="$goPage('/pages/indexInner/experienceCenter/experienceCenter')" v-if="step==2">查看体检地点</view>
  7. <u-tabs :list="list" :is-scroll="false" :current="currentTab" @change="change" inactive-color="#999" :bold="false" style="margin-bottom: 20rpx;" v-if="step==6"></u-tabs>
  8. <u-parse :html="content"></u-parse>
  9. <view class="footerBtn">
  10. <view class="" v-for="(item,index) in curTtnText" :key="index" class="btn" @click="changeStep(item.step)">
  11. {{item.text}}
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import { getDriveProcessDetails } from '@/config/api.js'; // 引入
  18. export default {
  19. data() {
  20. return {
  21. content: '',
  22. content1: '',
  23. content2: '',
  24. contentTemp: '',
  25. step: 1,
  26. title: '',
  27. btnText: [
  28. [{text:'回到首页',step: 0}, {text: '体检', step: 2}],
  29. [{text:'选择驾校',step: 1}, {text: '面签', step: 3}],
  30. [{text:'体检',step: 2}, {text: '报名缴费', step: 4}],
  31. [{text:'面签',step: 3}, {text: '理论学习', step: 5}],
  32. [{text:'面签',step: 3}, {text: '实操培训', step: 6}],
  33. [{text:'理论学习',step: 5}, {text: '安全文明考试(科目四)', step: 7}],
  34. [{text:'实操培训',step: 6}, {text: '拿证', step: 8}],
  35. [{text:'科目四',step: 7}, {text: '回到首页', step: 0}],
  36. ],
  37. list: [{
  38. name: '模拟训练'
  39. }, {
  40. name: '科目二'
  41. }, {
  42. name: '科目三',
  43. }],
  44. currentTab: 0
  45. }
  46. },
  47. computed: {
  48. curTtnText(val) {
  49. if(val) {
  50. return this.btnText[this.step-1]
  51. }
  52. }
  53. },
  54. onLoad(options) {
  55. // this.step = options.index*1 + 1
  56. this.CarLearningTraining()
  57. },
  58. methods: {
  59. change(index) {
  60. this.currentTab = index
  61. let arr = [this.contentTemp,this.content1,this.content2]
  62. this.content = arr[index]
  63. },
  64. // 学车培训
  65. async CarLearningTraining() {
  66. const res = await getDriveProcessDetails({driveProcessId: this.step})
  67. if(this.step==6) {
  68. this.content1 = res.data.content1
  69. this.content2 = res.data.content2
  70. this.contentTemp = res.data.content
  71. }
  72. if(res.data.content) {
  73. this.content = res.data.content
  74. this.title = res.data.title
  75. }
  76. console.log(res)
  77. },
  78. changeStep(step) {
  79. this.step = step
  80. if(!this.step) {
  81. uni.switchTab({
  82. url: '/pages/tabbar/index/index'
  83. })
  84. return
  85. }
  86. this.CarLearningTraining()
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .main {
  93. padding: 0 32rpx 120rpx 32rpx;
  94. min-height: 100vh;
  95. background: #fff;
  96. }
  97. .tit {
  98. width: 100%;
  99. text-align: center;
  100. padding: 20rpx 0 36rpx 0;
  101. font-size: 32rpx;
  102. }
  103. .footerBtn {
  104. display: flex;
  105. position: fixed;
  106. bottom: 0;
  107. left: 0;
  108. width: 100vw;
  109. .btn {
  110. flex: 1;
  111. white-space: normal;
  112. font-size: 28rpx;
  113. background-color: $themC;
  114. color: #fff;
  115. display: inline-block;
  116. text-align: center;
  117. line-height: 82rpx;
  118. text-align: center;
  119. &:first-child {
  120. border-right: 2px solid #fff;
  121. }
  122. }
  123. }
  124. .address {
  125. font-size: 28rpx;
  126. color: #1989FA;
  127. text-align: center;
  128. padding: 0 0 10rpx 0;
  129. position: relative;
  130. top: -10rpx;
  131. }
  132. </style>