selectTest.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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">选择考试试卷</view>
  11. <view>
  12. <view class="note-item ddflex" style="font-size: 16px;" v-for="item,index in testList" :key="index+'test'">
  13. <view class="note-item-content" @click="item.resultId?'':toTest(item)">{{index+1}}. {{item.title}}</view>
  14. <view style="color: green;font-size: 14rpx;" v-if="item.resultId" @click="queryScore(item)">成绩查询</view>
  15. </view>
  16. </view>
  17. <!-- <uni-pagination style="margin-top: 30px;" title="标题文字" show-icon="true" total="50" current="2"></uni-pagination> -->
  18. <!-- <navigator class="back-btn ddflex" hover-class="none" open-type="navigateBack">
  19. <image src="/static/images/back3.png"></image>
  20. <text>返回上一页</text>
  21. </navigator> -->
  22. </view>
  23. <!-- 答题卡区域 -->
  24. <view class="test-info ddflex" v-if="false">
  25. <view class="test-people ddflex">
  26. <image :src="examResult.avatar"></image>
  27. <view class="test-people-info ddflex">
  28. <view class="ddflex">
  29. <view class="test-people-label">考生姓名</view>
  30. <view class="fflex">{{examResult.userName}}</view>
  31. </view>
  32. <view class="ddflex">
  33. <view class="test-people-label">准考证号</view>
  34. <view class="fflex" style="word-break: break-all;">{{examResult.admissionNo}}</view>
  35. </view>
  36. <view class="ddflex">
  37. <view class="test-people-label">考试科目</view>
  38. <view class="fflex">{{examResult.title}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="note-box">
  43. <view class="note-title ddflex">
  44. <image class="note-title-icon" src="/static/images/ksgg.png"></image>
  45. <view>考试公告</view>
  46. </view>
  47. <view>
  48. <view class="note-item ddflex" v-for="item,index in otherInfo" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
  49. <view class="note-item-content">{{item.title}}</view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 注意事项 -->
  54. <view class="note-box">
  55. <view class="note-title ddflex">
  56. <image class="note-title-icon" src="/static/images/zysx.png"></image>
  57. <view>注意事项</view>
  58. </view>
  59. <view>
  60. <view class="note-item ddflex" v-for="item,index in noteInfo" :key="index+'zy'" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
  61. <view class="note-item-content">{{item.title}}</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <Foot></Foot>
  68. </view>
  69. </template>
  70. <script>
  71. const app = getApp();
  72. const req = require('../../utils/request.js');
  73. const utils = require('../../utils/util.js');
  74. const api = require('../../utils/api.js')
  75. export default {
  76. data() {
  77. return {
  78. paperId:null,
  79. admissionNo:null,
  80. paper: '', //试卷详情
  81. examResult:{},//考试详情
  82. otherInfo:[],
  83. noteInfo:[],
  84. testList:[],
  85. userInfo:{}
  86. }
  87. },
  88. onReady() {},
  89. onLoad(options) {
  90. this.paperId = options.paperId;
  91. this.admissionNo = options.admissionNo;
  92. },
  93. onShow() {
  94. this.getTestProject()
  95. this.getUserInfo()
  96. },
  97. methods: {
  98. jumpUrl(url){
  99. uni.navigateTo({
  100. url:url
  101. })
  102. },
  103. // 考试信息
  104. getUserInfo(){
  105. req.getRequest('/api/v3/exam/user/manager/info',{},res=>{
  106. this.userInfo = res
  107. })
  108. },
  109. // 获取考试项目
  110. getTestProject(){
  111. req.getRequest('/api/v3/exam/user/manager/paper',{examId:this.paperId},res=>{
  112. this.testList = res
  113. })
  114. },
  115. // 去考试
  116. toTest(item){
  117. uni.showModal({
  118. title:'提示',
  119. content:`确定开始 ${item.title}?`,
  120. success: (res) => {
  121. if(res.confirm){
  122. uni.navigateTo({
  123. // url: '/pages/test/test?paperId='+this.paperId,
  124. url: '/pages/test/test?paperId='+item.id+'&testId='+this.paperId,
  125. success:()=> {
  126. this.close()
  127. }
  128. });
  129. }else{
  130. }
  131. }
  132. })
  133. },
  134. // 成绩查询
  135. queryScore(item){
  136. var formP = {
  137. admission: this.userInfo.admissionNo,
  138. paperId: item.id
  139. };
  140. console.log(this.userInfo)
  141. req.getRequest('/api/v3/exam/user/manager/result', formP, res => {
  142. uni.navigateTo({
  143. url:'/pages/scoreQuery/scoreQuery?paperId='+ item.id+'&admissionNo='+this.userInfo.admissionNo
  144. })
  145. });
  146. },
  147. }
  148. }
  149. </script>
  150. <style>
  151. @import url('./selectTest.css');
  152. </style>