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

93 lines
3.0 KiB

10 months ago
9 months ago
8 months ago
9 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
10 months ago
9 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 pad">
  3. <view class="status_bar"></view>
  4. <view class="" style="height: 100rpx;"></view>
  5. <!-- <u-button @click="requestSingleFreshLocationFn">单次定位</u-button> -->
  6. <!-- <u-button @click="getInitFaceVerifyFn">人脸核身</u-button> -->
  7. <topInfo :carType="curObject.name" @changeSubject="changeSubject" :dynamics="subjectStatus.studentClassHourVO"></topInfo>
  8. <view class="" v-if="token">
  9. <subject1 v-if="curObject.id==1" :subjectStatus="subjectStatus"></subject1>
  10. <subject2 v-if="curObject.id==2" :subjectStatus="subjectStatus"></subject2>
  11. <subject3 v-if="curObject.id==3" :subjectStatus="subjectStatus"></subject3>
  12. <subject4 v-if="curObject.id==4" :subjectStatus="subjectStatus"></subject4>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import topInfo from './comp/topInfo.vue'
  18. import subject1 from './comp/subject1.vue'
  19. import subject2 from './comp/subject2.vue'
  20. import subject3 from './comp/subject3.vue'
  21. import subject4 from './comp/subject4.vue'
  22. import { getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status, getStudentProcess } from '@/config/api.js'
  23. export default {
  24. components: { topInfo, subject1, subject2,subject3,subject4 },
  25. data() {
  26. return {
  27. curObject: {
  28. name: '科目二',
  29. id: 2,
  30. },
  31. dynamics: {},
  32. subjectStatus: {
  33. studentClassHourVO: {}
  34. },
  35. token: ''
  36. }
  37. },
  38. onPullDownRefresh() {
  39. this.init()
  40. },
  41. onShow() {
  42. this.init()
  43. // this.getStudentProcessFn()
  44. },
  45. methods: {
  46. init() {
  47. this.token = this.$store.state.user.vuex_loginInfo.accessToken
  48. if(!this.token) return this.$u.toast('请先登录')
  49. this.getStudentSubject1StatusFn()
  50. },
  51. // 切换科目
  52. changeSubject(val) {
  53. if(this.curObject==val) return
  54. this.curObject = val
  55. this.init()
  56. },
  57. async requestSingleFreshLocationFn() {
  58. await this.$store.dispatch('getCity')
  59. },
  60. async getStudentSubject1StatusFn() {
  61. let arrFn = [getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status]
  62. const {data: res} = await arrFn[this.curObject.id-1]({studentId: this.studentId})
  63. this.subjectStatus = res
  64. console.log(res)
  65. // console.log(this.subjectStatus.studentClassHourVO)
  66. },
  67. // async getStudentProcessFn() {
  68. // const {data: res} = await getStudentProcess({studentId: this.studentId})
  69. // let obj = {
  70. // ValidTtime: res.subjectOneValidTtime,
  71. // TotalTime: res.subjectOneTotalTime
  72. // }
  73. // if(this.curObject.id==2) {
  74. // obj.ValidTtime = res.subjectTwoValidTtime
  75. // obj.TotalTime = res.subjectTwoTotalTime
  76. // }else if(this.curObject.id==3) {
  77. // obj.ValidTtime = res.subjectThreeValidTtime
  78. // obj.TotalTime = res.subjectThreeTotalTime
  79. // }else if(this.curObject.id==4) {
  80. // obj.ValidTtime = res.subjectFourValidTtime
  81. // obj.TotalTime = res.subjectFourTotalTime
  82. // }
  83. // this.dynamics = obj
  84. // }
  85. }
  86. }
  87. </script>
  88. <style scoped lang="scss">
  89. </style>