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

89 lines
2.8 KiB

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
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
7 months ago
7 months ago
7 months ago
7 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. <subject1 v-if="curObject.id==1"></subject1>
  9. <subject2 v-if="curObject.id==2" :subjectStatus="subjectStatus"></subject2>
  10. <subject3 v-if="curObject.id==3" :subjectStatus="subjectStatus"></subject3>
  11. <subject4 v-if="curObject.id==4" :subjectStatus="subjectStatus"></subject4>
  12. </view>
  13. </template>
  14. <script>
  15. import topInfo from './comp/topInfo.vue'
  16. import subject1 from './comp/subject1.vue'
  17. import subject2 from './comp/subject2.vue'
  18. import subject3 from './comp/subject3.vue'
  19. import subject4 from './comp/subject4.vue'
  20. import { getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status, getStudentProcess } from '@/config/api.js'
  21. export default {
  22. components: { topInfo, subject1, subject2,subject3,subject4 },
  23. data() {
  24. return {
  25. curObject: {
  26. name: '科目二',
  27. id: 2,
  28. },
  29. dynamics: {},
  30. subjectStatus: {
  31. studentClassHourVO: {}
  32. }
  33. }
  34. },
  35. onLoad() {
  36. // #ifdef MP-WEIXIN
  37. // initEid();
  38. // #endif
  39. },
  40. onShow() {
  41. this.getStudentSubject1StatusFn()
  42. // this.getStudentProcessFn()
  43. },
  44. methods: {
  45. // 切换科目
  46. changeSubject(val) {
  47. console.log(val)
  48. this.curObject = val
  49. // this.getStudentProcessFn()
  50. this.getStudentSubject1StatusFn()
  51. },
  52. async requestSingleFreshLocationFn() {
  53. await this.$store.dispatch('getCity')
  54. },
  55. async getStudentSubject1StatusFn() {
  56. let arrFn = [getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status]
  57. const {data: res} = await arrFn[this.curObject.id-1]({studentId: this.studentId})
  58. this.subjectStatus = res
  59. // console.log(res)
  60. console.log(this.subjectStatus.studentClassHourVO)
  61. },
  62. async getStudentProcessFn() {
  63. const {data: res} = await getStudentProcess({studentId: this.studentId})
  64. let obj = {
  65. ValidTtime: res.subjectOneValidTtime,
  66. TotalTime: res.subjectOneTotalTime
  67. }
  68. if(this.curObject.id==2) {
  69. obj.ValidTtime = res.subjectTwoValidTtime
  70. obj.TotalTime = res.subjectTwoTotalTime
  71. }else if(this.curObject.id==3) {
  72. obj.ValidTtime = res.subjectThreeValidTtime
  73. obj.TotalTime = res.subjectThreeTotalTime
  74. }else if(this.curObject.id==4) {
  75. obj.ValidTtime = res.subjectFourValidTtime
  76. obj.TotalTime = res.subjectFourTotalTime
  77. }
  78. this.dynamics = obj
  79. }
  80. }
  81. }
  82. </script>
  83. <style scoped lang="scss">
  84. </style>