scoreQuery.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view>
  3. <Headers></Headers>
  4. <view class="project">
  5. <view style="width: 1200px;margin: auto;">在线考试系统</view>
  6. </view>
  7. <view class="project-content ddflex">
  8. <!-- 成绩区域 -->
  9. <view class="test-box">
  10. <view class="test-title">{{examResult.title}}</view>
  11. <view class="test-time">
  12. <text style="color: #999999;margin-right: 10px;">考试时间</text>
  13. <text>{{examResult.createDate}}</text>
  14. </view>
  15. <!-- 用户考试状态 0未交卷 1已交卷 2阅卷中 3缺考 4 阅卷完成 -->
  16. <view v-if="examResult.state!=4">
  17. <image class="yj-icon" src="/static/images/yuejuan.png"></image>
  18. <view class="yj-label">
  19. <block v-if="examResult.state==0">未交卷</block>
  20. <block v-if="examResult.state==1">已交卷,等待阅卷中</block>
  21. <block v-if="examResult.state==3">缺考</block>
  22. </view>
  23. </view>
  24. <view v-else class="chufen-number" :style="examResult.score>=paper.passScore?'color:green;':''">
  25. {{examResult.score}}<text style="font-size: 18px;margin-left: 10px;">分</text>
  26. <view style="font-size: 16px;">
  27. {{examResult.score>=paper.passScore?'考试合格':'考试不合格'}}
  28. </view>
  29. </view>
  30. <view class="score ddflex" >
  31. <view>
  32. <view class="score-label">总题数</view>
  33. <view class="score-value">{{examResult.questionCount?examResult.questionCount:0}}</view>
  34. </view>
  35. <view class="line"></view>
  36. <view>
  37. <view class="score-label">考试用时</view>
  38. <view class="score-value">{{examResult.time?timeChangeHMS(examResult.time):'00:00:00'}}</view>
  39. </view>
  40. </view>
  41. <navigator class="back-btn ddflex" hover-class="none" open-type="navigateBack">
  42. <image src="/static/images/back3.png"></image>
  43. <text>返回上一页</text>
  44. </navigator>
  45. </view>
  46. <!-- 答题卡区域 -->
  47. <view class="test-info ddflex">
  48. <view class="test-people ddflex">
  49. <image :src="examResult.avatar"></image>
  50. <view class="test-people-info ddflex">
  51. <view class="ddflex">
  52. <view class="test-people-label">考生姓名</view>
  53. <view class="fflex">{{examResult.userName}}</view>
  54. </view>
  55. <view class="ddflex">
  56. <view class="test-people-label">准考证号</view>
  57. <view class="fflex" style="word-break: break-all;">{{examResult.admissionNo}}</view>
  58. </view>
  59. <view class="ddflex">
  60. <view class="test-people-label">考试科目</view>
  61. <view class="fflex">{{examResult.title}}</view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="note-box">
  66. <view class="note-title ddflex">
  67. <image class="note-title-icon" src="/static/images/ksgg.png"></image>
  68. <view>考试公告</view>
  69. </view>
  70. <view>
  71. <view class="note-item ddflex" v-for="item,index in otherInfo" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
  72. <view class="note-item-content">{{item.title}}</view>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 注意事项 -->
  77. <view class="note-box">
  78. <view class="note-title ddflex">
  79. <image class="note-title-icon" src="/static/images/zysx.png"></image>
  80. <view>注意事项</view>
  81. </view>
  82. <view>
  83. <view class="note-item ddflex" v-for="item,index in noteInfo" :key="index+'zy'" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
  84. <view class="note-item-content">{{item.title}}</view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <Foot></Foot>
  91. </view>
  92. </template>
  93. <script>
  94. const app = getApp();
  95. const req = require('../../utils/request.js');
  96. const utils = require('../../utils/util.js');
  97. const api = require('../../utils/api.js')
  98. export default {
  99. data() {
  100. return {
  101. userInfo:{},
  102. paperId:null,
  103. admissionNo:null,
  104. paper: '', //试卷详情
  105. examResult:{},//考试详情
  106. otherInfo:[],
  107. noteInfo:[]
  108. }
  109. },
  110. onReady() {},
  111. onLoad(options) {
  112. this.paperId = options.paperId;
  113. this.admissionNo = options.admissionNo;
  114. this.getUserInfo()
  115. this.getPaper()
  116. this.getTextOtherInfo()
  117. this.getTextNoteInfo()
  118. },
  119. methods: {
  120. jumpUrl(url){
  121. uni.navigateTo({
  122. url:url
  123. })
  124. },
  125. getUserInfo(){
  126. req.getRequest('/api/v3/exam/user/manager/info',{},res=>{
  127. this.userInfo = res
  128. })
  129. },
  130. //获取考试对象
  131. getPaper() {
  132. var _ts = this;
  133. req.getRequest(api.paper_detail + _ts.paperId, {}, res => {
  134. _ts.paper = res;
  135. this.getResult()
  136. });
  137. },
  138. // 获取考试对象的答题记录
  139. getResult(){
  140. req.getRequest('/api/v3/exam/user/manager/result', {admission:this.admissionNo,paperId:this.paperId}, res => {
  141. this.examResult = res;
  142. });
  143. },
  144. // 考试公告
  145. getTextOtherInfo(){
  146. let form={
  147. code:req.public.ksggCode,
  148. page:1,
  149. limit:3
  150. }
  151. req.getRequest('/api/content/list',form,res=>{
  152. this.otherInfo = res
  153. })
  154. },
  155. // 注意事项
  156. getTextNoteInfo(){
  157. let form={
  158. code:req.public.zysxCode,
  159. page:1,
  160. limit:3
  161. }
  162. req.getRequest('/api/content/list',form,res=>{
  163. this.noteInfo = res
  164. })
  165. },
  166. // 秒转换时分秒
  167. timeChangeHMS(time){
  168. let _ts = this
  169. var times = {};
  170. times.hour = _ts.cut22(Math.floor(time / 3600));
  171. var leave2 = time % 3600;
  172. times.minutes = _ts.cut22(Math.floor(leave2 / 60));
  173. var leave3 = leave2 % 60;
  174. times.seconds = _ts.cut22(Math.round(leave3));
  175. return times.hour+":"+times.minutes+":"+times.seconds
  176. },
  177. cut22(n) {
  178. n = n.toString();
  179. return n[1] ? n : '0' + n;
  180. },
  181. }
  182. }
  183. </script>
  184. <style>
  185. @import url('./scoreQuery.css');
  186. </style>