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

94 lines
3.0 KiB

10 months ago
9 months ago
8 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
10 months ago
9 months ago
  1. <template>
  2. <view class="pageBgImg pad">
  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.name" @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: 2,
  32. },
  33. dynamics: {},
  34. subjectStatus: {
  35. studentClassHourVO: {}
  36. },
  37. token: ''
  38. }
  39. },
  40. onPullDownRefresh() {
  41. this.init()
  42. },
  43. onShow() {
  44. this.init()
  45. // this.getStudentProcessFn()
  46. },
  47. methods: {
  48. init() {
  49. this.token = this.$store.state.user.vuex_loginInfo.accessToken
  50. if(!this.token) return this.$u.toast('请先登录')
  51. this.getStudentSubject1StatusFn()
  52. },
  53. // 切换科目
  54. changeSubject(val) {
  55. if(this.curObject==val) return
  56. this.curObject = val
  57. this.init()
  58. },
  59. async requestSingleFreshLocationFn() {
  60. await this.$store.dispatch('getCity')
  61. },
  62. async getStudentSubject1StatusFn() {
  63. let arrFn = [getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status]
  64. const {data: res} = await arrFn[this.curObject.id-1]({studentId: this.studentId})
  65. this.subjectStatus = res
  66. console.log(res)
  67. // console.log(this.subjectStatus.studentClassHourVO)
  68. },
  69. // async getStudentProcessFn() {
  70. // const {data: res} = await getStudentProcess({studentId: this.studentId})
  71. // let obj = {
  72. // ValidTtime: res.subjectOneValidTtime,
  73. // TotalTime: res.subjectOneTotalTime
  74. // }
  75. // if(this.curObject.id==2) {
  76. // obj.ValidTtime = res.subjectTwoValidTtime
  77. // obj.TotalTime = res.subjectTwoTotalTime
  78. // }else if(this.curObject.id==3) {
  79. // obj.ValidTtime = res.subjectThreeValidTtime
  80. // obj.TotalTime = res.subjectThreeTotalTime
  81. // }else if(this.curObject.id==4) {
  82. // obj.ValidTtime = res.subjectFourValidTtime
  83. // obj.TotalTime = res.subjectFourTotalTime
  84. // }
  85. // this.dynamics = obj
  86. // }
  87. }
  88. }
  89. </script>
  90. <style scoped lang="scss">
  91. </style>