exam.vue 18 KB

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