exam.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. <template>
  2. <view class="phone-kaoshi-page">
  3. <!-- 导航区域 -->
  4. <customNavbarVue :title="data.ksName" :show-back-btn="true" @back="handleBack"></customNavbarVue>
  5. <!-- 第一行 -->
  6. <view class="kaoshi-page-title">
  7. <view v-if="activeSt" class="title-types">{{dlName}}</view>
  8. <!-- 倒计时 -->
  9. <view v-if="!!data.endSecond">
  10. <uni-countdown :show-day="false" :showHour="true" :showMinute="true" :second="data.endSecond"
  11. @timeup="onTimeUp" :start="startCountDown"></uni-countdown>
  12. </view>
  13. </view>
  14. <view class="kaoshi-shiti-content">
  15. <!-- 内容区域 -->
  16. <!-- 试题区域 -->
  17. <view v-if="activeSt">
  18. <template v-if="activeSt.stTypeId == 1">
  19. <!-- 单选 -->
  20. <danxuan :question="activeSt" :key="activeSt.stId"></danxuan>
  21. </template>
  22. <template v-if="activeSt.stTypeId == 2">
  23. <!-- 多选 -->
  24. <duoxuan :question="activeSt" :key="activeSt.stId"></duoxuan>
  25. </template>
  26. <template v-if="activeSt.stTypeId == 3">
  27. <!-- 判断 -->
  28. <panduan :question="activeSt" :key="activeSt.stId"></panduan>
  29. </template>
  30. <template v-if="activeSt.stTypeId == 4">
  31. <!-- 填空 -->
  32. <tiankong :question="activeSt" :key="activeSt.stId"></tiankong>
  33. </template>
  34. </view>
  35. </view>
  36. <view class="kaoshi-bottom-box">
  37. <button class="phone-green-btn bj-btn" hover-class="none" type="default" size="mini"
  38. @click="handleBiaoji">{{activeSt && activeSt.marked ? '取标':'标记'}}</button>
  39. <view @click="showAnswerCard" class="shiti-num-box">
  40. <icon class="shiti-num-icon" :style="{ backgroundImage: 'url(' + data.imgsArr.shitiNumIcon + ')' }">
  41. </icon>
  42. <text
  43. class="active-num">{{activeSt ? activeSt.onlyNum: 0}}</text>/<text>{{data.StListForSearch.length}}</text>
  44. </view>
  45. <button class="phone-green-btn save-btn" hover-class="none" type="default" size="mini"
  46. @click="handleSave(true)">保存</button>
  47. </view>
  48. <template v-if="activeSt">
  49. <button type="default" size="mini" hover-class="none" class="phone-green-btn ks-btn-prev"
  50. @click="handlePrev" v-if="!isFistStId">上一题</button>
  51. <button type="default" size="mini" hover-class="none" class="phone-green-btn ks-btn-next"
  52. @click="handleNext" v-if="!isLastStId">下一题</button>
  53. <button type="default" size="mini" hover-class="none" class="phone-green-btn ks-btn-next"
  54. @click="handleJiaojuan" v-if="isLastStId">交卷</button>
  55. </template>
  56. <!-- 答题卡 -->
  57. <uni-popup ref="popupRef" background-color="#fff" :animation="false" :is-mask-click="false" :mask-click="false">
  58. <view class="answer-card-popup">
  59. <customNavbarVue title="答题卡" :show-back-btn="true" @back="handlePopupBack"></customNavbarVue>
  60. <view class="card-content-box">
  61. <view class="answer-card-content" v-for="(paragraph,paragraphIndex) in questionData"
  62. :key="paragraphIndex">
  63. <view class="paragraph-title">
  64. {{paragraph.name}}
  65. </view>
  66. <view class="paragraph-qa" v-for="(qa,qaIndex) in paragraph.qas" :key="qaIndex"
  67. :class="getQaClass(qa)" @click="answerCardItemClick(qa)">{{qa.onlyNum}}
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </uni-popup>
  73. <!-- 摄像头 -->
  74. <template v-if="data.zhuapai && data.zhuapai > 0">
  75. <!-- 抓拍 -->
  76. <zhuapaiVue ref="zhuapaiRef" @error="zpError" @success="zpSuccess" key="2" @progress="onProgress">
  77. </zhuapaiVue>
  78. </template>
  79. <!-- 交卷确认 -->
  80. <answerQueren ref="answerQrRef" @confirm="handleQuerenConfirm"></answerQueren>
  81. <!-- 考试得分 -->
  82. <submitScoreVue ref="subScoreRef" @confirm="handleScoreConfirm" @close="handleScoreClose"></submitScoreVue>
  83. <!-- 切屏确认弹窗 -->
  84. <qiepingDlVue ref="qiepingDlRef" :content="messageContent" title="注意" okBtn="知道了"></qiepingDlVue>
  85. </view>
  86. </template>
  87. <script setup>
  88. import cacheManager from '@/utils/cacheManager.js';
  89. import {
  90. ref,
  91. reactive,
  92. computed,
  93. watch,
  94. nextTick
  95. } from "vue";
  96. import zhuapaiVue from "@/components/zhuapaiConfirm/zhuapai.vue";
  97. import zhuapaiConfirm from "@/components/zhuapaiConfirm/index.vue";
  98. import answerQueren from "@/components/zhuapaiConfirm/answerQueren.vue";
  99. import submitScoreVue from "@/components/zhuapaiConfirm/submitScore.vue";
  100. import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
  101. import {
  102. onLoad,
  103. onShow,
  104. onHide
  105. } from "@dcloudio/uni-app";
  106. import * as ksApi from "@/api/kaoshi.js"
  107. import danxuan from "@/components/questions/danxuan.vue";
  108. import duoxuan from "@/components/questions/duoxuan.vue";
  109. import tiankong from "@/components/questions/tiankong.vue";
  110. import panduan from "@/components/questions/panduan.vue";
  111. import {
  112. useQuestionTools
  113. } from "@/components/questions/useQuestionTools.js";
  114. import {
  115. useKaoShiCache
  116. } from "./examTools"
  117. import qiepingDlVue from "@/components/dialog/qiepingDl.vue";
  118. import {
  119. useQiePing
  120. } from "@/utils/useQieping.js"
  121. const {
  122. checkDanxuanReply,
  123. checkDuoxuanReply,
  124. checkPanduanReply,
  125. checkTiankongReply,
  126. getLetterByIndex
  127. } = useQuestionTools();
  128. const {
  129. saveCacheKs,
  130. getCacheKs,
  131. removeCacheKs
  132. } = useKaoShiCache();
  133. const {
  134. init: qiepingInit
  135. } = useQiePing();
  136. onLoad((option) => {
  137. data.ksId = option.ksId;
  138. data.zhuapai = option.zhuapai;
  139. data.userKaozhengId = option.userKaozhengId;
  140. data.from = option.from;
  141. data.imgsArr.shitiNumIcon = cacheManager.get('projectImg').shiti_num_icon;
  142. setTimeout(() => {
  143. initKaoshi();
  144. }, 1000)
  145. /* if (data.zhuapai && data.zhuapai != 0) {
  146. // 考试前确认摄像头
  147. nextTick(() => {
  148. initBeforKaoshi();
  149. })
  150. } else {
  151. initKaoshi();
  152. } */
  153. })
  154. const popupRef = ref(null)
  155. const zhuapaiRef = ref(null)
  156. const qiepingRef = ref(null)
  157. const zhuapaiConfirmRef = ref(null)
  158. const answerQrRef = ref(null);
  159. const startCountDown = ref(false);
  160. const subScoreRef = ref(null);
  161. const messageContent = ref('');
  162. const qiepingDlRef = ref(null);
  163. const timer1 = ref(null);
  164. const data = reactive({
  165. ksId: null,
  166. operId: null,
  167. ksName: '',
  168. stTotal: 0,
  169. stScore: 0,
  170. biaoji: {},
  171. endSecond: 0,
  172. pageSize: 0,
  173. toggleScreenFlag: 0,
  174. toggleScreenSecond: 0,
  175. zhuapai: 0,
  176. duanluo: [],
  177. StListForSearch: [],
  178. from: '',
  179. hisId: '',
  180. userKaozhengId: '',
  181. imgsArr: {
  182. shitiNumIcon: '',
  183. },
  184. })
  185. const markDB = ref([]);
  186. const questionData = ref([]);
  187. const progress = reactive({
  188. dlIndex: 0,
  189. dtIndex: 0
  190. })
  191. const dlName = computed(() => {
  192. if (data.StListForSearch && activeSt.value) {
  193. return data.StListForSearch[activeSt.value.onlyNum - 1].paragraphName
  194. } else {
  195. return ''
  196. }
  197. })
  198. watch(() => data.duanluo, (newVal) => {
  199. // 计算已答试题数量
  200. }, {
  201. deep: true
  202. })
  203. const activeSt = computed(() => {
  204. if (questionData.value.length) {
  205. return questionData.value.length && questionData.value[progress.dlIndex].qas[progress.dtIndex];
  206. } else {
  207. return null
  208. }
  209. })
  210. const isFistStId = computed(() => {
  211. if (data.StListForSearch.length) {
  212. return data.StListForSearch[0].stId == activeSt.value.stId
  213. } else {
  214. return false
  215. }
  216. });
  217. const isLastStId = computed(() => {
  218. if (data.StListForSearch.length) {
  219. return data.StListForSearch[data.StListForSearch.length - 1].stId == activeSt.value.stId
  220. } else {
  221. return false
  222. }
  223. });
  224. function handleScoreClose() {
  225. handleBack()
  226. }
  227. // 考试得分相关 start
  228. function handleScoreConfirm() {
  229. uni.redirectTo({
  230. url: `/pages/client/Chengji/ksScoreShijuan?hisId=${data.hisId}&from=kaoshi`
  231. })
  232. }
  233. // 考试得分相关 end
  234. // 保存相关
  235. function handleSave(showToast) {
  236. if (timer1.value) {
  237. uni.showToast({
  238. title: '请勿连续保存',
  239. icon: 'none'
  240. })
  241. return
  242. }
  243. timer1.value = setTimeout(() => {
  244. clearTimeout(timer1.value);
  245. }, 10 * 1000);
  246. console.log(questionData.value)
  247. const result = []
  248. const option = {
  249. force: false,
  250. operId: data.operId,
  251. replyList: []
  252. }
  253. questionData.value.forEach(dl => {
  254. dl.qas.forEach(st => {
  255. const opt = {
  256. stId: st.stId,
  257. reply: st.reply,
  258. }
  259. result.push(opt)
  260. option.replyList.push(opt)
  261. })
  262. })
  263. // 保存试题答案
  264. saveCacheKs(data.operId, {
  265. replyList: result,
  266. position: {
  267. dlIndex: progress.dlIndex,
  268. dtIndex: progress.dtIndex
  269. }
  270. })
  271. // 保存答题进度
  272. ksApi.getClientKsSave(option).then(res => {
  273. if (res.data && showToast) {
  274. uni.showToast({
  275. title: '保存成功',
  276. })
  277. }
  278. })
  279. }
  280. // 交卷相关功能 start
  281. function checkJiaojuan() {
  282. const result = []
  283. let count = 0;
  284. let total = 0;
  285. questionData.value.forEach(dl => {
  286. dl.qas.forEach(st => {
  287. const opt = {
  288. stId: st.stId,
  289. reply: st.reply,
  290. stTypeId: st.stTypeId
  291. }
  292. result.push(opt)
  293. })
  294. })
  295. result.forEach(item => {
  296. total++;
  297. if (item.stTypeId == 1 && !checkDanxuanReply(item)) {
  298. count++;
  299. }
  300. if (item.stTypeId == 2 && !checkDuoxuanReply(item)) {
  301. count++;
  302. }
  303. if (item.stTypeId == 3 && !checkPanduanReply(item)) {
  304. count++;
  305. }
  306. if (item.stTypeId == 4 && !checkTiankongReply(item)) {
  307. count++;
  308. }
  309. })
  310. return {
  311. total,
  312. count,
  313. }
  314. }
  315. function handleJiaojuan() {
  316. const result = checkJiaojuan()
  317. console.log(result)
  318. if (result.count) {
  319. // 提示
  320. answerQrRef.value.showDialog({
  321. answercartsCount: result.total - result.count,
  322. answercartsTotal: result.total,
  323. })
  324. } else {
  325. handleSubmit()
  326. }
  327. }
  328. function handleQuerenConfirm() {
  329. handleSubmit()
  330. }
  331. function handleSubmit(force = false) {
  332. const result = {
  333. force,
  334. operId: data.operId,
  335. replyList: []
  336. };
  337. console.log(questionData.value)
  338. // uni.showLoading({
  339. // title: '提交中'
  340. // })
  341. questionData.value.forEach(dl => {
  342. dl.qas.forEach(st => {
  343. const opt = {
  344. stId: st.stId,
  345. reply: st.reply
  346. }
  347. result.replyList.push(opt)
  348. })
  349. })
  350. ksApi.getClientKsSubmit(result).then(res => {
  351. if (res.code == 0) {
  352. subScoreRef.value.showDialog(res.data);
  353. data.hisId = res.data.hisId;
  354. // 清空缓存
  355. removeCacheKs(data.operId);
  356. }
  357. }).finally(err => {
  358. // uni.hideLoading()
  359. })
  360. }
  361. function onTimeUp() {
  362. handleSubmit();
  363. }
  364. // 交卷相关功能 end
  365. // 切屏功能 start
  366. function qiepingToast(count) {
  367. messageContent.value = `已离开${count}次。${data.toggleScreenFlag}次将自动交卷!`
  368. qiepingDlRef.value.handleShow()
  369. }
  370. function forceSubmit() {
  371. // 强制交卷
  372. console.log('强制交卷')
  373. handleSubmit(true)
  374. }
  375. function qpZhuapai() {
  376. // 重新开启抓拍
  377. zhuapaiRef.value && zhuapaiRef.value.showVideoBtn();
  378. }
  379. // 切屏功能 end
  380. // 摄像头抓拍相关功能 start
  381. function zpSuccess() {}
  382. function zpError() {
  383. uni.showToast({
  384. title: '抓拍图片异常',
  385. icon: 'none',
  386. duration: 3000,
  387. mask: true // 防止触摸穿透
  388. })
  389. setTimeout(() => {
  390. handleBack()
  391. }, 3000)
  392. }
  393. // 摄像头抓拍相关功能 end
  394. // 摄像头确认相关功能 start
  395. function onProgress() {
  396. uni.showToast({
  397. icon: 'none',
  398. title: '摄像头运行环境异常,请重新进入考试',
  399. duration: 3000,
  400. mask: true // 防止触摸穿透
  401. })
  402. setTimeout(() => {
  403. handleBack();
  404. }, 3000)
  405. }
  406. function zpConfirmSuccess() {
  407. initKaoshi();
  408. }
  409. function zpConfirmError() {
  410. handleBack()
  411. }
  412. function zpConfirmCancel() {
  413. handleBack()
  414. }
  415. // 摄像头确认相关功能 end
  416. function getQaClass(qa) {
  417. if (qa.marked && qa.marked === true) {
  418. return 'paragraph-qa-block-mark';
  419. } else {
  420. if (qa.stTypeId == 1) {
  421. if (checkDanxuanReply(qa)) {
  422. return 'paragraph-qa-block-done';
  423. } else {
  424. return 'paragraph-qa-block-init';
  425. }
  426. } else if (qa.stTypeId == 2) {
  427. if (checkDuoxuanReply(qa)) {
  428. return 'paragraph-qa-block-done';
  429. } else {
  430. return 'paragraph-qa-block-init';
  431. }
  432. } else if (qa.stTypeId == 3) {
  433. if (checkPanduanReply(qa)) {
  434. return 'paragraph-qa-block-done';
  435. } else {
  436. return 'paragraph-qa-block-init';
  437. }
  438. } else if (qa.stTypeId == 4) {
  439. if (checkTiankongReply(qa)) {
  440. return 'paragraph-qa-block-done';
  441. } else {
  442. return 'paragraph-qa-block-init';
  443. }
  444. }
  445. }
  446. }
  447. function skipQuestion(dlIndex, dtIndex) {
  448. progress.dlIndex = dlIndex;
  449. progress.dtIndex = dtIndex;
  450. handlePopupBack()
  451. }
  452. function answerCardItemClick(qa) {
  453. const actQa = data.StListForSearch.find(item => item.stId == qa.stId);
  454. skipQuestion(actQa.dlIndex, actQa.dtIndex)
  455. }
  456. function handleBack() {
  457. const pages = getCurrentPages();
  458. if (pages.length > 1) {
  459. uni.navigateBack()
  460. } else {
  461. history.back();
  462. }
  463. }
  464. function showAnswerCard() {
  465. popupRef.value.open('top')
  466. }
  467. function handlePopupBack() {
  468. popupRef.value && popupRef.value.close()
  469. }
  470. function handlePrev() {
  471. const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
  472. const index = qa.onlyNum - 1;
  473. if (index > 0) {
  474. const result = data.StListForSearch[index - 1];
  475. progress.dlIndex = result.dlIndex;
  476. progress.dtIndex = result.dtIndex
  477. }
  478. }
  479. function handleNext() {
  480. const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
  481. const index = qa.onlyNum - 1;
  482. if (index < data.StListForSearch.length) {
  483. const result = data.StListForSearch[index + 1];
  484. progress.dlIndex = result.dlIndex;
  485. progress.dtIndex = result.dtIndex
  486. }
  487. }
  488. function formatDuanluoList(dlData) {
  489. let uIndex = 0; // 试题onlyNum
  490. let iDuanluo = 0; // 段落onlyNum
  491. let result = [];
  492. for (const duanluo of data.duanluo) {
  493. let paragraph = {
  494. qas: [],
  495. };
  496. paragraph.name = duanluo.name;
  497. let iQa = 0; // 当前试题序号
  498. let order = 0; // 当前题型中第几题
  499. for (const iDanxuan of duanluo.danxuan) {
  500. iDanxuan.type = 'danxuan';
  501. iDanxuan.marked = data.biaoji[iDanxuan.stId] ? true : false;
  502. iDanxuan.onlyNum = uIndex + 1;
  503. iDanxuan.order = order;
  504. iDanxuan.iQa = iQa;
  505. paragraph.qas.push(iDanxuan);
  506. uIndex++;
  507. order++;
  508. iQa++;
  509. data.StListForSearch.push({
  510. stId: iDanxuan.stId,
  511. paragraphName: paragraph.name,
  512. dlIndex: iDuanluo,
  513. dtIndex: iDanxuan.iQa,
  514. onlyNum: iDanxuan.onlyNum
  515. })
  516. }
  517. order = 0;
  518. for (const iDuoxuan of duanluo.duoxuan) {
  519. iDuoxuan.type = 'duoxuan';
  520. iDuoxuan.marked = data.biaoji[iDuoxuan.stId] ? true : false;
  521. iDuoxuan.onlyNum = uIndex + 1;
  522. iDuoxuan.order = order;
  523. paragraph.qas.push(iDuoxuan);
  524. iDuoxuan.iQa = iQa;
  525. iDuoxuan.reply = [];
  526. uIndex++;
  527. order++;
  528. iQa++;
  529. data.StListForSearch.push({
  530. stId: iDuoxuan.stId,
  531. paragraphName: paragraph.name,
  532. dlIndex: iDuanluo,
  533. dtIndex: iDuoxuan.iQa,
  534. onlyNum: iDuoxuan.onlyNum
  535. })
  536. }
  537. order = 0;
  538. for (const iPanduan of duanluo.panduan) {
  539. iPanduan.type = 'panduan';
  540. iPanduan.marked = data.biaoji[iPanduan.stId] ? true : false;
  541. iPanduan.onlyNum = uIndex + 1;
  542. iPanduan.order = order;
  543. paragraph.qas.push(iPanduan);
  544. iPanduan.iQa = iQa;
  545. uIndex++;
  546. order++;
  547. iQa++;
  548. data.StListForSearch.push({
  549. stId: iPanduan.stId,
  550. paragraphName: paragraph.name,
  551. dlIndex: iDuanluo,
  552. dtIndex: iPanduan.iQa,
  553. onlyNum: iPanduan.onlyNum
  554. })
  555. }
  556. order = 0;
  557. for (const iTiankong of duanluo.tiankong) {
  558. iTiankong.type = 'tiankong';
  559. iTiankong.marked = data.biaoji[iTiankong.stId] ? true : false;
  560. iTiankong.onlyNum = uIndex + 1;
  561. iTiankong.order = order;
  562. paragraph.qas.push(iTiankong);
  563. iTiankong.iQa = iQa;
  564. iTiankong.reply = new Array(iTiankong.count).fill('');;
  565. uIndex++;
  566. order++;
  567. iQa++;
  568. data.StListForSearch.push({
  569. stId: iTiankong.stId,
  570. paragraphName: paragraph.name,
  571. dlIndex: iDuanluo,
  572. dtIndex: iTiankong.iQa,
  573. onlyNum: iTiankong.onlyNum
  574. })
  575. }
  576. iDuanluo++;
  577. questionData.value.push(paragraph)
  578. console.log('1', questionData.value)
  579. console.log('2', data.StListForSearch)
  580. }
  581. }
  582. function handleBiaoji() {
  583. activeSt.value.marked = !activeSt.value.marked;
  584. data.biaoji[activeSt.value.stId] = activeSt.value.marked
  585. ksApi.getClientKaoshiBiaoji({
  586. operId: data.operId,
  587. biaoji: JSON.stringify(data.biaoji)
  588. }).catch(err => {
  589. console.log(22222, err)
  590. handleBack()
  591. })
  592. }
  593. function formatKaoshiData() {
  594. const historyData = getCacheKs(data.operId);
  595. if (historyData) {
  596. const {
  597. replyList,
  598. position
  599. } = historyData;
  600. if (replyList) {
  601. questionData.value.forEach(dl => {
  602. dl.qas.forEach(st => {
  603. st.reply = replyList.find(item => item.stId == st.stId).reply
  604. })
  605. })
  606. }
  607. if (position) {
  608. progress.dlIndex = position.dlIndex;
  609. progress.dtIndex = position.dtIndex;
  610. }
  611. }
  612. }
  613. // 摄像头确认初始化
  614. function initBeforKaoshi() {
  615. zhuapaiConfirmRef.value.showDialog()
  616. }
  617. function initKaoshi() {
  618. ksApi.getClientKsStart({
  619. ksId: data.ksId,
  620. userKaozhengId: data.userKaozhengId
  621. }).then(res => {
  622. const {
  623. ksId,
  624. operId,
  625. ksName,
  626. stTotal,
  627. stScore,
  628. biaoji,
  629. endSecond,
  630. pageSize,
  631. toggleScreenFlag,
  632. toggleScreenSecond,
  633. zhuapai,
  634. duanluoList
  635. } = res.data;
  636. data.ksId = ksId;
  637. data.operId = operId;
  638. data.ksName = ksName;
  639. data.stTotal = stTotal;
  640. data.stScore = stScore;
  641. data.biaoji = biaoji ? JSON.parse(biaoji) : {};
  642. data.endSecond = endSecond;
  643. data.pageSize = pageSize;
  644. data.toggleScreenFlag = toggleScreenFlag;
  645. data.toggleScreenSecond = toggleScreenSecond;
  646. data.zhuapai = zhuapai;
  647. data.duanluo = duanluoList;
  648. formatDuanluoList(data.duanluo);
  649. // 设置缓存
  650. formatKaoshiData();
  651. // 设置抓拍监听
  652. if (data.zhuapai && data.zhuapai > 0) {
  653. zhuapaiRef.value.init({
  654. zhuapai: zhuapai,
  655. operId: operId
  656. });
  657. }
  658. // 设置切屏
  659. qiepingInit({
  660. zhuapaiFlag: !!data.zhuapai,
  661. toggleScreenFlag: toggleScreenFlag,
  662. toggleScreenSecond: toggleScreenSecond,
  663. ksId: data.ksId
  664. }, {
  665. zhuapai: qpZhuapai,
  666. forceSubmit,
  667. qiepingToast
  668. })
  669. uni.setNavigationBarTitle({
  670. title: data.ksName
  671. });
  672. startCountDown.value = true;
  673. }).catch(err => {
  674. handleBack()
  675. })
  676. }
  677. </script>