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

128 lines
4.0 KiB

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