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

87 lines
2.7 KiB

10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
9 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
9 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
9 months ago
9 months ago
9 months ago
9 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="dynamics"></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. }
  32. },
  33. onLoad() {
  34. // #ifdef MP-WEIXIN
  35. // initEid();
  36. // #endif
  37. },
  38. onShow() {
  39. this.getStudentSubject1StatusFn()
  40. this.getStudentProcessFn()
  41. },
  42. methods: {
  43. // 切换科目
  44. changeSubject(val) {
  45. console.log(val)
  46. this.curObject = val
  47. this.getStudentProcessFn()
  48. this.getStudentSubject1StatusFn()
  49. },
  50. async requestSingleFreshLocationFn() {
  51. await this.$store.dispatch('getCity')
  52. },
  53. async getStudentSubject1StatusFn() {
  54. let arrFn = [getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status]
  55. const {data: res} = await arrFn[this.curObject.id-1]({studentId: this.studentId})
  56. this.subjectStatus = res
  57. console.log(res)
  58. },
  59. async getStudentProcessFn() {
  60. const {data: res} = await getStudentProcess({studentId: this.studentId})
  61. let obj = {
  62. ValidTtime: res.subjectOneValidTtime,
  63. TotalTime: res.subjectOneTotalTime
  64. }
  65. if(this.curObject.id==2) {
  66. obj.ValidTtime = res.subjectTwoValidTtime
  67. obj.TotalTime = res.subjectTwoTotalTime
  68. }else if(this.curObject.id==3) {
  69. obj.ValidTtime = res.subjectThreeValidTtime
  70. obj.TotalTime = res.subjectThreeTotalTime
  71. }else if(this.curObject.id==4) {
  72. obj.ValidTtime = res.subjectFourValidTtime
  73. obj.TotalTime = res.subjectFourTotalTime
  74. }
  75. this.dynamics = obj
  76. console.log(this.dynamics)
  77. }
  78. }
  79. }
  80. </script>
  81. <style scoped lang="scss">
  82. </style>