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

123 lines
3.9 KiB

10 months ago
7 months ago
8 months ago
7 months ago
8 months ago
10 months ago
8 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
7 months ago
8 months ago
10 months ago
9 months ago
8 months ago
7 months ago
7 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
8 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <view class="pad">
  4. <view class="status_bar"></view>
  5. <view class="" style="height: 100rpx;"></view>
  6. <!-- <u-button @click="requestSingleFreshLocationFn">单次定位</u-button> -->
  7. <!-- <u-button @click="getInitFaceVerifyFn">人脸核身</u-button> -->
  8. <topInfo :carType="curObject" @changeSubject="changeSubject" :dynamics="subjectStatus.studentClassHourVO"></topInfo>
  9. <view class="" v-if="token">
  10. <subject1 v-if="curObject.id==1" :subjectStatus="subjectStatus"></subject1>
  11. <subject2 v-if="curObject.id==2" :subjectStatus="subjectStatus"></subject2>
  12. <subject3 v-if="curObject.id==3" :subjectStatus="subjectStatus"></subject3>
  13. <subject4 v-if="curObject.id==4" :subjectStatus="subjectStatus"></subject4>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import topInfo from './comp/topInfo.vue'
  20. import subject1 from './comp/subject1.vue'
  21. import subject2 from './comp/subject2.vue'
  22. import subject3 from './comp/subject3.vue'
  23. import subject4 from './comp/subject4.vue'
  24. import { getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status, getStudentProcess } from '@/config/api.js'
  25. export default {
  26. components: { topInfo, subject1, subject2,subject3,subject4 },
  27. data() {
  28. return {
  29. curObject: {
  30. name: '科目一',
  31. id: 1,
  32. },
  33. dynamics: {},
  34. subjectStatus: {
  35. studentClassHourVO: {}
  36. },
  37. token: ''
  38. }
  39. },
  40. onPullDownRefresh() {
  41. this.init()
  42. },
  43. onLoad() {
  44. this.trainProcess()
  45. },
  46. onShow() {
  47. this.init()
  48. // this.getStudentProcessFn()
  49. },
  50. methods: {
  51. async trainProcess() {
  52. await this.$store.dispatch('getUserInfo')
  53. // 培训进度(0:科目一培训中,1:完成科目一培训,3:完成科目二培训,5:完成科目三培训,7:完成科目二、科目三培训)
  54. let trainProcess = {}
  55. switch(this.vuex_userInfo.trainProcess) {
  56. case 1:
  57. trainProcess = {name: '科目二', id: 2}
  58. break;
  59. case 3:
  60. trainProcess = {name: '科目三', id: 3}
  61. break;
  62. case 5:
  63. trainProcess = {name: '科目四', id: 4}
  64. break;
  65. case 7:
  66. trainProcess = {name: '科目四', id: 4}
  67. break;
  68. default:
  69. trainProcess = {name: '科目一', id: 1}
  70. }
  71. console.log('trainProcess是几啊')
  72. console.log(trainProcess)
  73. console.log(this.vuex_userInfo.trainProcess)
  74. this.changeSubject(trainProcess)
  75. },
  76. init() {
  77. this.token = this.$store.state.user.vuex_loginInfo.accessToken
  78. if(!this.token) return this.$u.toast('请先登录')
  79. this.getStudentSubject1StatusFn()
  80. },
  81. // 切换科目
  82. changeSubject(val) {
  83. if(this.curObject==val) return
  84. this.curObject = val
  85. this.init()
  86. },
  87. async requestSingleFreshLocationFn() {
  88. await this.$store.dispatch('getCity')
  89. },
  90. async getStudentSubject1StatusFn() {
  91. let arrFn = [getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status]
  92. const {data: res} = await arrFn[this.curObject.id-1]({studentId: this.studentId})
  93. this.subjectStatus = res
  94. console.log(res)
  95. // console.log(this.subjectStatus.studentClassHourVO)
  96. },
  97. // async getStudentProcessFn() {
  98. // const {data: res} = await getStudentProcess({studentId: this.studentId})
  99. // let obj = {
  100. // ValidTtime: res.subjectOneValidTtime,
  101. // TotalTime: res.subjectOneTotalTime
  102. // }
  103. // if(this.curObject.id==2) {
  104. // obj.ValidTtime = res.subjectTwoValidTtime
  105. // obj.TotalTime = res.subjectTwoTotalTime
  106. // }else if(this.curObject.id==3) {
  107. // obj.ValidTtime = res.subjectThreeValidTtime
  108. // obj.TotalTime = res.subjectThreeTotalTime
  109. // }else if(this.curObject.id==4) {
  110. // obj.ValidTtime = res.subjectFourValidTtime
  111. // obj.TotalTime = res.subjectFourTotalTime
  112. // }
  113. // this.dynamics = obj
  114. // }
  115. }
  116. }
  117. </script>
  118. <style scoped lang="scss">
  119. </style>