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

127 lines
4.0 KiB

10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
9 months ago
8 months ago
10 months ago
9 months ago
10 months ago
9 months ago
8 months ago
8 months ago
10 months ago
9 months ago
9 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
10 months ago
9 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. if(!this.token) {
  45. this.$store.commit('goLogin')
  46. return this.$u.toast('请先登录')
  47. }
  48. this.trainProcess()
  49. },
  50. onShow() {
  51. this.init()
  52. // this.getStudentProcessFn()
  53. },
  54. methods: {
  55. async trainProcess() {
  56. await this.$store.dispatch('getUserInfo')
  57. // 培训进度(0:科目一培训中,1:完成科目一培训,3:完成科目二培训,5:完成科目三培训,7:完成科目二、科目三培训)
  58. let trainProcess = {}
  59. switch(this.vuex_userInfo.trainProcess) {
  60. case 1:
  61. trainProcess = {name: '科目二', id: 2}
  62. break;
  63. case 3:
  64. trainProcess = {name: '科目三', id: 3}
  65. break;
  66. case 5:
  67. trainProcess = {name: '科目四', id: 4}
  68. break;
  69. case 7:
  70. trainProcess = {name: '科目四', id: 4}
  71. break;
  72. default:
  73. trainProcess = {name: '科目一', id: 1}
  74. }
  75. console.log('trainProcess是几啊')
  76. console.log(trainProcess)
  77. console.log(this.vuex_userInfo.trainProcess)
  78. this.changeSubject(trainProcess)
  79. },
  80. init() {
  81. this.token = this.$store.state.user.vuex_loginInfo.accessToken
  82. if(!this.token) return this.$u.toast('请先登录')
  83. this.getStudentSubject1StatusFn()
  84. },
  85. // 切换科目
  86. changeSubject(val) {
  87. if(this.curObject==val) return
  88. this.curObject = val
  89. this.init()
  90. },
  91. async requestSingleFreshLocationFn() {
  92. await this.$store.dispatch('getCity')
  93. },
  94. async getStudentSubject1StatusFn() {
  95. let arrFn = [getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status]
  96. const {data: res} = await arrFn[this.curObject.id-1]({studentId: this.studentId})
  97. this.subjectStatus = res
  98. console.log(res)
  99. // console.log(this.subjectStatus.studentClassHourVO)
  100. },
  101. // async getStudentProcessFn() {
  102. // const {data: res} = await getStudentProcess({studentId: this.studentId})
  103. // let obj = {
  104. // ValidTtime: res.subjectOneValidTtime,
  105. // TotalTime: res.subjectOneTotalTime
  106. // }
  107. // if(this.curObject.id==2) {
  108. // obj.ValidTtime = res.subjectTwoValidTtime
  109. // obj.TotalTime = res.subjectTwoTotalTime
  110. // }else if(this.curObject.id==3) {
  111. // obj.ValidTtime = res.subjectThreeValidTtime
  112. // obj.TotalTime = res.subjectThreeTotalTime
  113. // }else if(this.curObject.id==4) {
  114. // obj.ValidTtime = res.subjectFourValidTtime
  115. // obj.TotalTime = res.subjectFourTotalTime
  116. // }
  117. // this.dynamics = obj
  118. // }
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. </style>