洛阳学员端
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.

135 lines
3.2 KiB

10 months ago
  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 :content="content"></u-parse>
  9. <view class="footerBtn">
  10. <view 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(curItem) {
  60. this.currentTab = curItem.index
  61. console.log(this.currentTab)
  62. let arr = [this.contentTemp,this.content1,this.content2]
  63. this.content = arr[this.currentTab]
  64. },
  65. // 学车培训
  66. async CarLearningTraining() {
  67. const res = await getDriveProcessDetails({id: this.step})
  68. if(this.step==6) {
  69. this.content1 = res.data.content1
  70. this.content2 = res.data.content2
  71. this.contentTemp = res.data.content
  72. }
  73. if(res.data.content) {
  74. this.content = res.data.content
  75. this.title = res.data.title
  76. }
  77. console.log(this.content)
  78. },
  79. changeStep(step) {
  80. this.step = step
  81. if(!this.step) {
  82. uni.switchTab({
  83. url: '/pages/tabbar/index/index'
  84. })
  85. return
  86. }
  87. this.CarLearningTraining()
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .main {
  94. padding: 0 32rpx 120rpx 32rpx;
  95. min-height: 100vh;
  96. background: #fff;
  97. }
  98. .tit {
  99. width: 100%;
  100. text-align: center;
  101. padding: 20rpx 0 36rpx 0;
  102. font-size: 32rpx;
  103. }
  104. .footerBtn {
  105. display: flex;
  106. position: fixed;
  107. bottom: 0;
  108. left: 0;
  109. width: 100vw;
  110. .btn {
  111. flex: 1;
  112. white-space: normal;
  113. font-size: 28rpx;
  114. background-color: $themC;
  115. color: #fff;
  116. display: inline-block;
  117. text-align: center;
  118. line-height: 82rpx;
  119. text-align: center;
  120. &:first-child {
  121. border-right: 2px solid #fff;
  122. }
  123. }
  124. }
  125. .address {
  126. font-size: 28rpx;
  127. color: #1989FA;
  128. text-align: center;
  129. padding: 0 0 10rpx 0;
  130. position: relative;
  131. top: -10rpx;
  132. }
  133. </style>