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

130 lines
3.8 KiB

10 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
10 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
9 months ago
9 months ago
10 months ago
  1. <template>
  2. <view class="comp">
  3. <!-- 学习状态 -->
  4. <view class="learnStatus">
  5. <view class="h1"><text class="active">学习状态</text></view>
  6. <view class="exam" v-if="showExam">
  7. <view class="card" v-if="info.studentExamVO.pass">
  8. <view class="flex-b padTb">
  9. <view class="lab">科目三安全文明常识成绩已通过</view>
  10. <view class="date">
  11. {{ $u.timeFormat(info.studentExamVO.examTime, 'yyyy-mm-dd hh:MM:ss') }}
  12. </view>
  13. </view>
  14. <view class="flex-b bg">
  15. <view class="row">
  16. <view class="text">考试成绩{{ info.studentExamVO.examResult }}
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="card" v-else>
  22. <view class="flex-b padTb">
  23. <view class="lab">科目三安全文明常识未通过</view>
  24. <view class="date">{{ $u.timeFormat(info.studentExamVO.examTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  25. </view>
  26. <view class="bg">
  27. <view class="row bg">
  28. <view class="text">前往"12123"APP预约考试</view>
  29. <view class="btn" @click="$u.toast('请打开12123App预约')">去预约</view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="card" v-if="showAppointment">
  35. <view class="flex-b padTb">
  36. <view class="lab">科目三安全文明常识 {{ examReservationStatus[info.examReservationVO.examReservationStatus] }}</view>
  37. <view class="date">{{ $u.timeFormat(info.examReservationVO.examReservationTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  38. </view>
  39. <view class="bg">
  40. <view class="row">
  41. <view class="text">考试场地{{info.examReservationVO.examAddress}}</view>
  42. </view>
  43. <view class="row">
  44. <view class="text">考试时间{{ $u.timeFormat(info.examReservationVO.examTime, 'yyyy-mm-dd hh:MM:ss') }} </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="card" v-if="!showAppointment&&!showExam">
  49. <view class="flex-b padTb">
  50. <view class="lab">科目三安全文明常识考试待预约</view>
  51. </view>
  52. <view class="bg">
  53. <view class="row bg">
  54. <view class="text">前往"12123"APP预约考试</view>
  55. <view class="btn">去预约</view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. getStudentSubject1Status,
  65. } from '@/config/api.js'
  66. export default {
  67. props: ['subjectStatus'],
  68. data() {
  69. return {
  70. info: {},
  71. showExam: false,//考试状态
  72. showAppointment: false,//预约状态
  73. examReservationStatus: ['预约失败', '预约通过', '-预约中']
  74. }
  75. },
  76. created() {
  77. this.showExam = false//考试状态
  78. this.showAppointment = false//预约状态
  79. },
  80. watch: {
  81. subjectStatus: {
  82. handler: function(res) {
  83. console.log('obj4改变了')
  84. this.getStudentSubject4StatusFn(res)
  85. },
  86. // immediate: true,
  87. deep: true
  88. }
  89. },
  90. methods: {
  91. async getStudentSubject4StatusFn(res) {
  92. // const {
  93. // data: res
  94. // } = await getStudentSubject1Status({
  95. // studentId: this.studentId
  96. // })
  97. this.info = res
  98. // 1如果返回了考试时间和预约时间
  99. if(res.studentExamVO&&res.examReservationVO) {
  100. // 如果考试的时间大于或等于预约的时间
  101. if(res.studentExamVO.examTime>res.examReservationVO.examTime||res.studentExamVO.examTime==res.examReservationVO.examTime) {
  102. this.showExam = true
  103. this.showAppointment = false
  104. }else {
  105. this.showAppointment = true
  106. this.showExam = false
  107. }
  108. }else if (res.studentExamVO&&!res.examReservationVO) {
  109. // 2如果只返回了考试时间
  110. this.showExam = true
  111. this.showAppointment = false
  112. }else if(res.studentExamVO&&!res.examReservationVO){
  113. // 3如果只返了预约时间
  114. this.showExam = false
  115. this.showAppointment = true
  116. }
  117. console.log(res)
  118. },
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. @import './comp.scss';
  124. </style>