exam.vue 18 KB

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