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

121 lines
3.6 KiB

10 months ago
10 months ago
8 months ago
10 months ago
8 months ago
8 months ago
10 months ago
8 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 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. data() {
  68. return {
  69. info: {},
  70. showExam: false,//考试状态
  71. showAppointment: false,//预约状态
  72. examReservationStatus: ['预约失败', '预约通过', '-预约中']
  73. }
  74. },
  75. created() {
  76. this.showExam = false,//考试状态
  77. this.showAppointment = false,//预约状态
  78. this.getStudentSubject1StatusFn()
  79. },
  80. methods: {
  81. async getStudentSubject1StatusFn() {
  82. const {
  83. data: res
  84. } = await getStudentSubject1Status({
  85. studentId: this.studentId
  86. })
  87. this.info = res
  88. // 1如果返回了考试时间和预约时间
  89. if(res.studentExamVO&&res.examReservationVO) {
  90. // 如果考试的时间大于或等于预约的时间
  91. if(res.studentExamVO.examTime>res.examReservationVO.examTime||res.studentExamVO.examTime==res.examReservationVO.examTime) {
  92. this.showExam = true
  93. this.showAppointment = false
  94. }else {
  95. this.showAppointment = true
  96. this.showExam = false
  97. }
  98. }else if (res.studentExamVO&&!res.examReservationVO) {
  99. // 2如果只返回了考试时间
  100. this.showExam = true
  101. this.showAppointment = false
  102. }else if(res.studentExamVO&&!res.examReservationVO){
  103. // 3如果只返了预约时间
  104. this.showExam = false
  105. this.showAppointment = true
  106. }
  107. console.log(res)
  108. },
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. @import './comp.scss';
  114. </style>