examInfo.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view style="width: 90vh;margin: auto;padding-bottom: 25px;">
  3. <uni-section>
  4. <uni-card class="box-card" style="background-color:#f0fff3; " v-if="exams.length===0&&!enter">
  5. <uni-row>
  6. <uni-col :span="4">
  7. </uni-col>
  8. <uni-col :span="16">
  9. <h1>当前无题库,若网络超时请刷新</h1>
  10. <br>
  11. </uni-col>
  12. </uni-row>
  13. </uni-card>
  14. <view v-if="exams.length>0&&!enter" v-for="o in exams" :key="o">
  15. <uni-card style="background-color:#f0fff3; " class="box-card" v-if="exams.length>1">
  16. <uni-row class="allceter">
  17. <uni-col :span="12" style="font-size: 20px;">
  18. {{ '题库名称: '}}<strong>{{o.title }}</strong>
  19. </uni-col>
  20. <uni-col :span="6">
  21. <uni-tag :text="o. state_dictText" type="success" />
  22. </uni-col>
  23. <uni-col :span="6">
  24. <button type="primary" @click="enterExam(o.id)">开始练习</button>
  25. </uni-col>
  26. </uni-row>
  27. <l-divider color="#251e75" />
  28. <uni-row>
  29. <uni-col :span="20"><strong>详情:</strong>{{o.questionRemark}}</uni-col>
  30. <!-- <uni-col :span="6"></uni-col>
  31. <uni-col :span="6"></uni-col> -->
  32. <uni-col :span="4"><strong>总数量:</strong>{{o.num}}</uni-col>
  33. </uni-row>
  34. </uni-card>
  35. </view>
  36. </uni-section>
  37. </view>
  38. <view style="width: 80vh;margin: auto;padding-bottom: 30px;">
  39. <view style="text-align: center;width: 300px;margin: auto;">
  40. <button type="primary" @click="infoExit()" v-if="exams.length>1&&!enter">退出
  41. </button>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. exit,
  48. request,
  49. getRepositoryList,
  50. getExamCreateExam,
  51. getExamOnlineExam,
  52. getExamQueryById,
  53. getExamListExamIn,
  54. getRepositoryById
  55. } from '../../examJs/examRequest';
  56. import {
  57. toExamStart,
  58. redirectTo,
  59. } from '../../examJs/examRoute.js'
  60. import screenfull from "screenfull";
  61. export default {
  62. name: 'examInfo',
  63. data() {
  64. return {
  65. isLoading: true,
  66. exams: [],
  67. enter: false,
  68. exam: {
  69. id: 1,
  70. message: ["点击开始考试后将自动开始练习,请遵守考场纪律诚信考试。", "考试试题,共3题。",
  71. "艺术类监测试卷分音乐和美术两个学科,其中音乐和美术各15分钟共计30分钟答卷时间,每一学科超时后将自动提交试卷。"
  72. ],
  73. Paper: []
  74. },
  75. user: {
  76. grade: "五年级"
  77. }
  78. }
  79. },
  80. mounted() {
  81. redirectTo()
  82. this.user = JSON.parse(sessionStorage.getItem("user"))
  83. getRepositoryList({
  84. pageNo: 1,
  85. pageSize: 80
  86. }).then((data) => {
  87. this.exams = data.data.result.records
  88. }).catch(xhr => {
  89. console.log(xhr);
  90. });
  91. },
  92. methods: {
  93. // 开始练习
  94. enterExam(index) {
  95. sessionStorage.setItem('repositoryId',index)
  96. toExamStart()
  97. },
  98. // 退出
  99. infoExit() {
  100. exit()
  101. },
  102. }
  103. }
  104. </script>
  105. <style scoped lang="scss">
  106. .text {
  107. padding-top: 15px;
  108. text-align: left;
  109. font-size: 14px;
  110. }
  111. .item {
  112. margin-bottom: 18px;
  113. }
  114. .clearfix:before,
  115. .clearfix:after {
  116. display: table;
  117. content: "";
  118. }
  119. .clearfix:after {
  120. clear: both
  121. }
  122. .box-card {
  123. margin: 20px auto auto;
  124. width: 100%;
  125. height: 11vh;
  126. min-height: 110px;
  127. max-height: 200px;
  128. }
  129. .allceter {
  130. display: flex;
  131. align-items: center;
  132. height: 50px;
  133. }
  134. .userInfo {
  135. display: inline-block;
  136. width: 15vh;
  137. min-width: 150px;
  138. }
  139. </style>