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

97 lines
3.0 KiB

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