index.vue 90 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584
  1. <template>
  2. <div class="course-exam">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="section__header">
  7. <!-- <el-breadcrumb separator="/">
  8. <el-breadcrumb-item
  9. v-for="(item, index) in $route.matched"
  10. :key="index"
  11. :to="{ path: item.path }"
  12. >{{ item.name }}</el-breadcrumb-item
  13. >
  14. </el-breadcrumb> -->
  15. </div>
  16. <div class="section__body">
  17. <div class="explain-record">
  18. <div class="explain-record__body">
  19. <div class="left-box">
  20. <div class="left-box__header">
  21. <el-progress
  22. class="progress"
  23. :text-inside="true"
  24. :stroke-width="26"
  25. :percentage="
  26. toFixed(
  27. (questionOverNum(true) / questionList.length) * 100
  28. ) || 0
  29. "
  30. ></el-progress>
  31. <div class="text">
  32. 已完成<span>{{ questionOverNum(true) }}</span
  33. >/{{ questionList.length }}道题
  34. </div>
  35. </div>
  36. <div class="left-box__footer">
  37. <div class="btn" @click="prevQuestion">上一题</div>
  38. <div class="btn" @click="nextQuestion">下一题</div>
  39. </div>
  40. <div class="left-box__body">
  41. <template v-for="(question, questionIndex) in questionList">
  42. <div
  43. class="question"
  44. v-if="question.type == 1 && current == questionIndex"
  45. :key="questionIndex"
  46. >
  47. <div class="question__title">
  48. {{ questionIndex + 1 }}、单选题
  49. </div>
  50. <div
  51. class="question__desc"
  52. v-html="question.content"
  53. ></div>
  54. <div class="question__content">
  55. <div class="question-list" v-if="!question.ques">
  56. <div
  57. class="radio"
  58. v-for="(item, index) in question.jsonStr"
  59. :key="index"
  60. @click="
  61. radioSelect(
  62. question,
  63. questionIndex,
  64. item.optionsId
  65. )
  66. "
  67. >
  68. <div>
  69. {{ ast[index] }}. {{ item.content }}
  70. <div v-if="item.imgUrl">
  71. <img
  72. style="max-width: 100%"
  73. :src="$tools.splitImgHost(item.imgUrl)"
  74. alt=""
  75. />
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="question-list" v-if="question.ques">
  81. <div
  82. class="radio"
  83. :class="{
  84. right:
  85. item.optionsId == question.ques ||
  86. item.optionsId == question.ans,
  87. wrong:
  88. item.optionsId == question.ques &&
  89. question.ques != question.ans,
  90. }"
  91. v-for="(item, index) in question.jsonStr"
  92. :key="index"
  93. >
  94. <div>
  95. {{ ast[index] }}. {{ item.content }}
  96. <div v-if="item.imgUrl">
  97. <img
  98. style="max-width: 100%"
  99. :src="$tools.splitImgHost(item.imgUrl)"
  100. alt=""
  101. />
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="answer-list" v-if="question.ques">
  107. <div class="answer-list__left">
  108. 正确答案:{{ ast[question.ans - 1] }}
  109. </div>
  110. <div class="answer-list__left">
  111. 我的答案:{{ ast[question.ques - 1] }}
  112. </div>
  113. </div>
  114. <div class="explain-list" v-if="question.ques">
  115. <div class="explain-list__header">答案解析:</div>
  116. <div
  117. class="explain-list__body"
  118. v-html="question.analysisContent"
  119. ></div>
  120. </div>
  121. </div>
  122. <div class="question__btns">
  123. <div
  124. class="collect"
  125. @click="
  126. collect(collectList[questionIndex], questionIndex)
  127. "
  128. >
  129. <template v-if="!collectList[questionIndex]"
  130. ><i class="el-icon-star-off"></i>收藏本题</template
  131. >
  132. <template v-if="collectList[questionIndex]"
  133. ><i class="el-icon-star-on"></i>已收藏</template
  134. >
  135. </div>
  136. </div>
  137. </div>
  138. <div
  139. class="question"
  140. v-if="question.type == 2 && current == questionIndex"
  141. :key="questionIndex"
  142. >
  143. <div class="question__title">
  144. {{ questionIndex + 1 }}、多选题
  145. </div>
  146. <div
  147. class="question__desc"
  148. v-html="question.content"
  149. ></div>
  150. <div class="question__content">
  151. <div class="question-list" v-if="!question.ques">
  152. <el-checkbox
  153. class="checkbox"
  154. v-for="(item, index) in question.jsonStr"
  155. :key="index"
  156. :label="item.optionsId"
  157. v-model="item.checked"
  158. >
  159. <div>
  160. {{ ast[index] }}. {{ item.content }}
  161. <div v-if="item.imgUrl">
  162. <img
  163. style="max-width: 100%"
  164. :src="$tools.splitImgHost(item.imgUrl)"
  165. alt=""
  166. />
  167. </div>
  168. </div>
  169. </el-checkbox>
  170. </div>
  171. <div class="question-list" v-if="question.ques">
  172. <el-checkbox
  173. disabled
  174. class="checkbox"
  175. :class="{
  176. right:
  177. question.ques.indexOf(item.optionsId) != -1 ||
  178. question.ans.indexOf(item.optionsId) != -1,
  179. wrong:
  180. question.ques.indexOf(item.optionsId) != -1 &&
  181. question.ans.indexOf(item.optionsId) == -1,
  182. }"
  183. v-for="(item, index) in question.jsonStr"
  184. :key="index"
  185. :label="item.optionsId"
  186. v-model="item.checked"
  187. >
  188. <div>
  189. {{ ast[index] }}. {{ item.content }}
  190. <div v-if="item.imgUrl">
  191. <img
  192. style="max-width: 100%"
  193. :src="$tools.splitImgHost(item.imgUrl)"
  194. alt=""
  195. />
  196. </div>
  197. </div>
  198. </el-checkbox>
  199. </div>
  200. <div class="answer-list" v-if="question.ques">
  201. <div class="answer-list__left">
  202. 正确答案:
  203. <template v-for="ansItem in question.ans">{{
  204. ast[ansItem - 1]
  205. }}</template>
  206. </div>
  207. <div class="answer-list__left">
  208. 我的答案:
  209. <template v-for="quesItem in question.ques">{{
  210. ast[quesItem - 1]
  211. }}</template>
  212. </div>
  213. </div>
  214. <div class="explain-list" v-if="question.ques">
  215. <div class="explain-list__header">答案解析:</div>
  216. <div
  217. class="explain-list__body"
  218. v-html="question.analysisContent"
  219. ></div>
  220. </div>
  221. </div>
  222. <div class="question__btns">
  223. <div
  224. v-if="!question.ques"
  225. class="submit"
  226. @click="checkboxSubmit(question, questionIndex)"
  227. >
  228. 确认答案
  229. </div>
  230. <div
  231. class="collect"
  232. @click="
  233. collect(collectList[questionIndex], questionIndex)
  234. "
  235. >
  236. <template v-if="!collectList[questionIndex]"
  237. ><i class="el-icon-star-off"></i>收藏本题</template
  238. >
  239. <template v-if="collectList[questionIndex]"
  240. ><i class="el-icon-star-on"></i>已收藏</template
  241. >
  242. </div>
  243. </div>
  244. </div>
  245. <div
  246. class="question"
  247. v-if="question.type == 3 && current == questionIndex"
  248. :key="questionIndex"
  249. >
  250. <div class="question__title">
  251. {{ questionIndex + 1 }}、判断题
  252. </div>
  253. <div
  254. class="question__desc"
  255. v-html="question.content"
  256. ></div>
  257. <div class="question__content">
  258. <div class="question-list" v-if="!question.ques">
  259. <div
  260. class="radio"
  261. v-for="(item, index) in judge"
  262. :key="index"
  263. @click="judgeSelect(question, questionIndex, index)"
  264. >
  265. <div>
  266. {{ ast[index] }}. {{ item }}
  267. <div v-if="item.imgUrl">
  268. <img
  269. style="max-width: 100%"
  270. :src="$tools.splitImgHost(item.imgUrl)"
  271. alt=""
  272. />
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. <div class="question-list" v-if="question.ques">
  278. <!-- right:
  279. index == question.ques || index == question.ans,
  280. wrong:
  281. index == question.ques &&
  282. question.ques != question.ans, -->
  283. <div
  284. class="radio"
  285. :class="{
  286. right: index == (question.ques == 1 ? 0 : 1) || index != question.ans,
  287. wrong: index == (question.ques == 1 ? 0 : 1) && question.ques != question.ans
  288. }"
  289. v-for="(item, index) in judge"
  290. :key="index"
  291. >
  292. <div>
  293. {{ ast[index] }}. {{ item }}
  294. <div v-if="item.imgUrl">
  295. <img
  296. style="max-width: 100%"
  297. :src="$tools.splitImgHost(item.imgUrl)"
  298. alt=""
  299. />
  300. </div>
  301. </div>
  302. </div>
  303. </div>
  304. <div class="answer-list" v-if="question.ques">
  305. <div class="answer-list__left">
  306. 正确答案:{{ ast[question.ans == 1 ? 0 : 1] }}
  307. </div>
  308. <div class="answer-list__left">
  309. 我的答案:{{ ast[question.ques == 1 ? 0 : 1] }}
  310. </div>
  311. </div>
  312. <div class="explain-list" v-if="question.ques">
  313. <div class="explain-list__header">答案解析:</div>
  314. <div
  315. class="explain-list__body"
  316. v-html="question.analysisContent"
  317. ></div>
  318. </div>
  319. </div>
  320. <div class="question__btns">
  321. <div
  322. class="collect"
  323. @click="
  324. collect(collectList[questionIndex], questionIndex)
  325. "
  326. >
  327. <template v-if="!collectList[questionIndex]"
  328. ><i class="el-icon-star-off"></i>收藏本题</template
  329. >
  330. <template v-if="collectList[questionIndex]"
  331. ><i class="el-icon-star-on"></i>已收藏</template
  332. >
  333. </div>
  334. </div>
  335. </div>
  336. <div
  337. class="question"
  338. v-if="question.type == 4 && current == questionIndex"
  339. :key="questionIndex"
  340. >
  341. <div class="question__title">
  342. {{ questionIndex + 1 }}、案例题
  343. </div>
  344. <div class="question__content">
  345. <el-tabs v-model="question.tabIndex">
  346. <el-tab-pane
  347. v-for="(json, jsonIndex) in question.jsonStr"
  348. :label="'问题' + (jsonIndex + 1)"
  349. :name="jsonIndex + ''"
  350. :key="jsonIndex"
  351. >
  352. <div
  353. class="question"
  354. v-if="json.type == 1"
  355. :key="questionIndex"
  356. >
  357. <div class="question__title">
  358. {{ jsonIndex + 1 }}、单选题
  359. </div>
  360. <div
  361. class="question__desc"
  362. v-html="json.content"
  363. ></div>
  364. <div class="question__content">
  365. <div
  366. class="question-list"
  367. v-if="!question.ques[jsonIndex]"
  368. >
  369. <div
  370. class="radio"
  371. v-for="(item, index) in json.optionsList"
  372. :key="index"
  373. @click="
  374. radioSelectChild(
  375. questionIndex,
  376. jsonIndex,
  377. item.optionsId
  378. )
  379. "
  380. >
  381. <div>
  382. {{ ast[index] }}. {{ item.content }}
  383. <div v-if="item.imgUrl">
  384. <img
  385. style="max-width: 100%"
  386. :src="
  387. $tools.splitImgHost(item.imgUrl)
  388. "
  389. alt=""
  390. />
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. <div
  396. class="question-list"
  397. v-if="question.ques[jsonIndex]"
  398. >
  399. <div
  400. class="radio"
  401. :class="{
  402. right:
  403. item.optionsId ==
  404. question.ques[jsonIndex] ||
  405. item.optionsId ==
  406. question.ans[jsonIndex],
  407. wrong:
  408. item.optionsId ==
  409. question.ques[jsonIndex] &&
  410. question.ques[jsonIndex] !=
  411. question.ans[jsonIndex],
  412. }"
  413. v-for="(item, index) in json.optionsList"
  414. :key="index"
  415. >
  416. <div>
  417. {{ ast[index] }}. {{ item.content }}
  418. <div v-if="item.imgUrl">
  419. <img
  420. style="max-width: 100%"
  421. :src="
  422. $tools.splitImgHost(item.imgUrl)
  423. "
  424. alt=""
  425. />
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. <div
  431. class="answer-list"
  432. v-if="question.ques[jsonIndex]"
  433. >
  434. <div class="answer-list__left">
  435. 正确答案:{{
  436. ast[question.ans[jsonIndex] - 1]
  437. }}
  438. </div>
  439. <div class="answer-list__left">
  440. 我的答案:{{
  441. ast[question.ques[jsonIndex] - 1]
  442. }}
  443. </div>
  444. </div>
  445. <div
  446. class="explain-list"
  447. v-if="question.ques[jsonIndex]"
  448. >
  449. <div class="explain-list__header">
  450. 答案解析:
  451. </div>
  452. <div
  453. class="explain-list__body"
  454. v-html="json.analysisContent"
  455. ></div>
  456. </div>
  457. </div>
  458. <div class="question__btns"></div>
  459. </div>
  460. <div
  461. class="question"
  462. v-if="json.type == 2"
  463. :key="jsonIndex"
  464. >
  465. <div class="question__title">
  466. {{ jsonIndex + 1 }}、多选题
  467. </div>
  468. <div
  469. class="question__desc"
  470. v-html="json.content"
  471. ></div>
  472. <div class="question__content">
  473. <div
  474. class="question-list"
  475. v-if="!question.ques[jsonIndex]"
  476. >
  477. <el-checkbox
  478. class="checkbox"
  479. v-for="(item, index) in json.optionsList"
  480. :key="index"
  481. :label="item.optionsId"
  482. v-model="item.checked"
  483. >
  484. <div>
  485. {{ ast[index] }}. {{ item.content }}
  486. <div v-if="item.imgUrl">
  487. <img
  488. style="max-width: 100%"
  489. :src="
  490. $tools.splitImgHost(item.imgUrl)
  491. "
  492. alt=""
  493. />
  494. </div>
  495. </div>
  496. </el-checkbox>
  497. </div>
  498. <div
  499. class="question-list"
  500. v-if="question.ques[jsonIndex]"
  501. >
  502. <el-checkbox
  503. disabled
  504. class="checkbox"
  505. :class="{
  506. right:
  507. question.ques[jsonIndex].indexOf(
  508. item.optionsId
  509. ) != -1 ||
  510. question.ans[jsonIndex].indexOf(
  511. item.optionsId
  512. ) != -1,
  513. wrong:
  514. question.ques[jsonIndex].indexOf(
  515. item.optionsId
  516. ) != -1 &&
  517. question.ans[jsonIndex].indexOf(
  518. item.optionsId
  519. ) == -1,
  520. }"
  521. v-for="(item, index) in json.optionsList"
  522. :key="index"
  523. :label="item.optionsId"
  524. v-model="item.checked"
  525. >
  526. <div>
  527. {{ ast[index] }}. {{ item.content }}
  528. <div v-if="item.imgUrl">
  529. <img
  530. style="max-width: 100%"
  531. :src="
  532. $tools.splitImgHost(item.imgUrl)
  533. "
  534. alt=""
  535. />
  536. </div>
  537. </div>
  538. </el-checkbox>
  539. </div>
  540. <div
  541. class="answer-list"
  542. v-if="question.ques[jsonIndex]"
  543. >
  544. <div class="answer-list__left">
  545. 正确答案:
  546. <template
  547. v-for="ansItem in question.ans[jsonIndex]"
  548. >{{ ast[ansItem - 1] }}</template
  549. >
  550. </div>
  551. <div class="answer-list__left">
  552. 我的答案:
  553. <template
  554. v-for="quesItem in question.ques[
  555. jsonIndex
  556. ]"
  557. >{{ ast[quesItem - 1] }}</template
  558. >
  559. </div>
  560. </div>
  561. <div
  562. class="explain-list"
  563. v-if="question.ques[jsonIndex]"
  564. >
  565. <div class="explain-list__header">
  566. 答案解析:
  567. </div>
  568. <div
  569. class="explain-list__body"
  570. v-html="json.analysisContent"
  571. ></div>
  572. </div>
  573. </div>
  574. <div class="question__btns">
  575. <div
  576. v-if="!question.ques[jsonIndex]"
  577. class="submit"
  578. @click="
  579. checkboxSubmitChild(
  580. questionIndex,
  581. jsonIndex
  582. )
  583. "
  584. >
  585. 确认答案
  586. </div>
  587. </div>
  588. </div>
  589. <div
  590. class="question"
  591. v-if="json.type == 3"
  592. :key="jsonIndex"
  593. >
  594. <div class="question__title">
  595. {{ jsonIndex + 1 }}、判断题
  596. </div>
  597. <div
  598. class="question__desc"
  599. v-html="json.content"
  600. ></div>
  601. <div class="question__content">
  602. <div
  603. class="question-list"
  604. v-if="!question.ques[jsonIndex]"
  605. >
  606. <div
  607. class="radio"
  608. v-for="(item, index) in judge"
  609. :key="index"
  610. @click="
  611. judgeSelectChild(
  612. questionIndex,
  613. jsonIndex,
  614. index
  615. )
  616. "
  617. >
  618. <div>
  619. {{ ast[index] }}. {{ item }}
  620. <div v-if="item.imgUrl">
  621. <img
  622. style="max-width: 100%"
  623. :src="
  624. $tools.splitImgHost(item.imgUrl)
  625. "
  626. alt=""
  627. />
  628. </div>
  629. </div>
  630. </div>
  631. </div>
  632. <div
  633. class="question-list"
  634. v-if="question.ques[jsonIndex]"
  635. >
  636. <div
  637. class="radio"
  638. :class="{
  639. right:
  640. index == (question.ques[jsonIndex] == 1 ? 0 : 1) ||
  641. index != question.ans[jsonIndex],
  642. wrong:
  643. index == (question.ques[jsonIndex] == 1 ? 0 : 1) &&
  644. question.ques[jsonIndex] != question.ans[jsonIndex],
  645. }"
  646. v-for="(item, index) in judge"
  647. :key="index"
  648. >
  649. <div>
  650. {{ ast[index] }}. {{ item }}
  651. <div v-if="item.imgUrl">
  652. <img
  653. style="max-width: 100%"
  654. :src="
  655. $tools.splitImgHost(item.imgUrl)
  656. "
  657. alt=""
  658. />
  659. </div>
  660. </div>
  661. </div>
  662. </div>
  663. <div
  664. class="answer-list"
  665. v-if="question.ques[jsonIndex]"
  666. >
  667. <div class="answer-list__left">
  668. 正确答案:{{ ast[question.ans[jsonIndex] == 1 ? 0 : 1] }}
  669. </div>
  670. <div class="answer-list__left">
  671. 我的答案:{{
  672. ast[question.ques[jsonIndex] == 1 ? 0 : 1]
  673. }}
  674. </div>
  675. </div>
  676. <div
  677. class="explain-list"
  678. v-if="question.ques[jsonIndex]"
  679. >
  680. <div class="explain-list__header">
  681. 答案解析:
  682. </div>
  683. <div
  684. class="explain-list__body"
  685. v-html="json.analysisContent"
  686. ></div>
  687. </div>
  688. </div>
  689. <div class="question__btns"></div>
  690. </div>
  691. <div
  692. class="question"
  693. v-if="json.type == 5"
  694. :key="jsonIndex"
  695. >
  696. <div class="question__title">
  697. {{ jsonIndex + 1 }}、简答题
  698. </div>
  699. <div
  700. class="question__desc"
  701. v-html="json.content"
  702. ></div>
  703. <div class="question__content">
  704. <div
  705. class="question-list textarea"
  706. v-if="
  707. !(
  708. question.ques[jsonIndex] &&
  709. (question.ques[jsonIndex].imageList
  710. .length ||
  711. question.ques[jsonIndex].text)
  712. )
  713. "
  714. >
  715. <el-input
  716. type="textarea"
  717. rows="5"
  718. v-model="json.ansText.text"
  719. resize="none"
  720. ></el-input>
  721. <div class="upload clearfix">
  722. <div
  723. class="upload__imgs"
  724. v-for="(img, imgIndex) in json.ansText
  725. .imageList"
  726. :key="imgIndex"
  727. >
  728. <img
  729. :src="$tools.splitImgHost(img, true)"
  730. alt=""
  731. />
  732. </div>
  733. <div class="upload__btn">
  734. <i class="el-icon-plus icon"></i>
  735. <p>上传图片</p>
  736. <input
  737. @change="
  738. uploadImgChild(
  739. $event,
  740. questionIndex,
  741. jsonIndex
  742. )
  743. "
  744. type="file"
  745. />
  746. </div>
  747. </div>
  748. </div>
  749. <div
  750. class="explain-list"
  751. v-if="
  752. question.ques[jsonIndex] &&
  753. (question.ques[jsonIndex].imageList
  754. .length ||
  755. question.ques[jsonIndex].text)
  756. "
  757. >
  758. <div class="explain-list__header">
  759. 我的答案:
  760. </div>
  761. <div class="explain-list__body">
  762. <div>
  763. {{ question.ques[jsonIndex].text }}
  764. </div>
  765. <div class="upload clearfix">
  766. <div
  767. class="upload__imgs"
  768. v-for="(img, imgIndex) in question.ques[
  769. jsonIndex
  770. ].imageList"
  771. :key="imgIndex"
  772. >
  773. <img
  774. :src="$tools.splitImgHost(img, true)"
  775. alt=""
  776. />
  777. </div>
  778. </div>
  779. </div>
  780. <div class="explain-list__header">
  781. 答案解析:
  782. </div>
  783. <div
  784. class="explain-list__body"
  785. v-html="question.analysisContent"
  786. ></div>
  787. </div>
  788. </div>
  789. <div class="question__btns">
  790. <div
  791. v-if="
  792. !(
  793. question.ques[jsonIndex] &&
  794. (question.ques[jsonIndex].imageList
  795. .length ||
  796. question.ques[jsonIndex].text)
  797. )
  798. "
  799. class="submit"
  800. @click="
  801. ansSubmitChild(
  802. question,
  803. questionIndex,
  804. jsonIndex
  805. )
  806. "
  807. >
  808. 确认答案
  809. </div>
  810. </div>
  811. </div>
  812. </el-tab-pane>
  813. </el-tabs>
  814. </div>
  815. <div class="question__btns">
  816. <div
  817. class="collect"
  818. @click="
  819. collect(collectList[questionIndex], questionIndex)
  820. "
  821. >
  822. <template v-if="!collectList[questionIndex]"
  823. ><i class="el-icon-star-off"></i>收藏本题</template
  824. >
  825. <template v-if="collectList[questionIndex]"
  826. ><i class="el-icon-star-on"></i>已收藏</template
  827. >
  828. </div>
  829. </div>
  830. </div>
  831. <div
  832. class="question"
  833. v-if="question.type == 5 && current == questionIndex"
  834. :key="questionIndex"
  835. >
  836. <div class="question__title">
  837. {{ questionIndex + 1 }}、简答题
  838. </div>
  839. <div
  840. class="question__desc"
  841. v-html="question.content"
  842. ></div>
  843. <div class="question__content">
  844. <div
  845. class="question-list textarea"
  846. v-if="
  847. !question.ques.imageList.length &&
  848. !question.ques.text
  849. "
  850. >
  851. <el-input
  852. type="textarea"
  853. rows="5"
  854. v-model="question.ansText.text"
  855. resize="none"
  856. ></el-input>
  857. <div class="upload clearfix">
  858. <div
  859. class="upload__imgs"
  860. v-for="(img, imgIndex) in question.ansText
  861. .imageList"
  862. :key="imgIndex"
  863. >
  864. <img
  865. :src="$tools.splitImgHost(img, true)"
  866. alt=""
  867. />
  868. </div>
  869. <div class="upload__btn">
  870. <i class="el-icon-plus icon"></i>
  871. <p>上传图片</p>
  872. <input
  873. @change="
  874. uploadImg($event, question, questionIndex)
  875. "
  876. type="file"
  877. />
  878. </div>
  879. </div>
  880. </div>
  881. <div
  882. class="explain-list"
  883. v-if="
  884. question.ques.imageList.length || question.ques.text
  885. "
  886. >
  887. <div class="explain-list__header">我的答案:</div>
  888. <div class="explain-list__body">
  889. <div>{{ question.ques.text }}</div>
  890. <div class="upload clearfix">
  891. <div
  892. class="upload__imgs"
  893. v-for="(img, imgIndex) in question.ques
  894. .imageList"
  895. :key="imgIndex"
  896. >
  897. <img
  898. :src="$tools.splitImgHost(img, true)"
  899. alt=""
  900. />
  901. </div>
  902. </div>
  903. </div>
  904. <div class="explain-list__header">答案解析:</div>
  905. <div
  906. class="explain-list__body"
  907. v-html="question.analysisContent"
  908. ></div>
  909. </div>
  910. </div>
  911. <div class="question__btns">
  912. <div
  913. v-if="
  914. !question.ques.imageList.length &&
  915. !question.ques.text
  916. "
  917. class="submit"
  918. @click="ansSubmit(question, questionIndex)"
  919. >
  920. 确认答案
  921. </div>
  922. <div
  923. class="collect"
  924. @click="
  925. collect(collectList[questionIndex], questionIndex)
  926. "
  927. >
  928. <template v-if="!collectList[questionIndex]"
  929. ><i class="el-icon-star-off"></i>收藏本题</template
  930. >
  931. <template v-if="collectList[questionIndex]"
  932. ><i class="el-icon-star-on"></i>已收藏</template
  933. >
  934. </div>
  935. </div>
  936. </div>
  937. </template>
  938. </div>
  939. </div>
  940. <div class="right-box">
  941. <div class="right-box__header">
  942. <el-button
  943. type="primary"
  944. round
  945. plain
  946. size="small"
  947. class="back-btn"
  948. @click="$router.back(-1)"
  949. >返回</el-button
  950. >
  951. </div>
  952. <div class="right-box__footer">
  953. <el-button
  954. type="primary"
  955. :loading="loading"
  956. class="submit"
  957. @click="submit"
  958. >交卷</el-button
  959. >
  960. </div>
  961. <div class="right-box__header">答题卡</div>
  962. <div class="right-box__body">
  963. <div class="card">
  964. <div class="card__note">
  965. <div class="item">
  966. <div class="box green"></div>
  967. 正确
  968. </div>
  969. <div class="item">
  970. <div class="box red"></div>
  971. 错误
  972. </div>
  973. <div class="item">
  974. <div class="box blue"></div>
  975. 已做未评改
  976. </div>
  977. <div class="item">
  978. <div class="box yellow"></div>
  979. 少选
  980. </div>
  981. <div class="item">
  982. <div class="box white"></div>
  983. 未做
  984. </div>
  985. </div>
  986. <div class="card__content">
  987. <ul class="list">
  988. <li
  989. class="item white"
  990. v-for="(item, index) in questionList"
  991. :key="index"
  992. :class="{
  993. green: isRight(item, index),
  994. red: isWrong(item, index),
  995. yellow: isPart(item, index),
  996. blue: isOver(item, index),
  997. }"
  998. @click="changeIndex(index)"
  999. >
  1000. {{ index + 1 }}
  1001. </li>
  1002. </ul>
  1003. </div>
  1004. </div>
  1005. </div>
  1006. </div>
  1007. </div>
  1008. </div>
  1009. </div>
  1010. </div>
  1011. </section>
  1012. <ToolBar></ToolBar>
  1013. <Footer></Footer>
  1014. </div>
  1015. </template>
  1016. <script>
  1017. import Footer from "@/components/footer/index";
  1018. import Header from "@/components/header/index";
  1019. import ToolBar from "@/components/toolbar/index";
  1020. import { mapMutations } from "vuex";
  1021. export default {
  1022. name: "BankExplain",
  1023. components: {
  1024. Footer,
  1025. Header,
  1026. ToolBar,
  1027. },
  1028. data() {
  1029. return {
  1030. recordId: 0,
  1031. questionIndex: 0,
  1032. checked: false,
  1033. activeName: "1",
  1034. questionList: [],
  1035. bankList: [],
  1036. judge: ["正确", "错误"],
  1037. ast: [
  1038. "A",
  1039. "B",
  1040. "C",
  1041. "D",
  1042. "E",
  1043. "F",
  1044. "G",
  1045. "H",
  1046. "I",
  1047. "J",
  1048. "K",
  1049. "L",
  1050. "M",
  1051. "N",
  1052. "O",
  1053. "P",
  1054. "Q",
  1055. "R",
  1056. "S",
  1057. "T",
  1058. "U",
  1059. "V",
  1060. "W",
  1061. "X",
  1062. "Y",
  1063. "Z",
  1064. ],
  1065. lastTime: 0, //剩余考试时长
  1066. allTimes: 0, //总考试时长
  1067. lastCount: 0,
  1068. examId: 0,
  1069. goodsId: 0,
  1070. moduleId: 0,
  1071. chapterId: 0,
  1072. loading: false,
  1073. current: 0,
  1074. examData: {},
  1075. orderGoodsId: "",
  1076. collectList: [],
  1077. isSubmit: false,
  1078. postTimer: null,
  1079. };
  1080. },
  1081. beforeDestroy() {
  1082. clearInterval(this.postTimer);
  1083. },
  1084. beforeRouteLeave(to, from, next) {
  1085. if (this.isSubmit) {
  1086. //交卷
  1087. next();
  1088. return;
  1089. }
  1090. let ansCount = this.questionOverNum(true); //已答题数
  1091. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1092. //所有题目答完
  1093. if (this.lastCount == 0) {
  1094. // this.testOver = true;
  1095. this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
  1096. confirmButtonText: "结束做题",
  1097. cancelButtonText: "下次继续",
  1098. type: "warning",
  1099. })
  1100. .then(() => {
  1101. this.examSubmit();
  1102. })
  1103. .catch(() => {
  1104. this.examRecordEdit();
  1105. next();
  1106. });
  1107. //未答完
  1108. } else {
  1109. this.$confirm(
  1110. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1111. "温馨提示",
  1112. {
  1113. confirmButtonText: "继续作答",
  1114. cancelButtonText: "下次继续",
  1115. type: "warning",
  1116. }
  1117. )
  1118. .then(() => {
  1119. // confirmButton回调
  1120. })
  1121. .catch(() => {
  1122. this.examRecordEdit();
  1123. next();
  1124. });
  1125. // this.isLastCount = true;
  1126. }
  1127. },
  1128. async mounted() {
  1129. this.goodsId = this.$route.params.goodsId;
  1130. this.examId = this.$route.query.examId;
  1131. this.moduleId = this.$route.query.moduleId;
  1132. this.chapterId = this.$route.query.chapterId;
  1133. this.recordId = this.$route.query.recordId;
  1134. this.orderGoodsId = this.$route.query.orderGoodsId || "";
  1135. this.goodsQuestionList();
  1136. },
  1137. methods: {
  1138. ...mapMutations(["setExamResult"]),
  1139. toFixed(num) {
  1140. if (num) {
  1141. let str = String(num).indexOf(".");
  1142. if (str != -1) {
  1143. return +num.toFixed(2);
  1144. } else {
  1145. return num;
  1146. }
  1147. } else {
  1148. return 0;
  1149. }
  1150. },
  1151. /**
  1152. * 是否做完所有题目
  1153. */
  1154. isDoOver() {
  1155. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1156. if (this.questionList.length == questionOverNum) {
  1157. //全部做完弹窗
  1158. this.$nextTick(() => {
  1159. this.$confirm("您已完成所有题目,快去交卷吧!", "提示", {
  1160. confirmButtonText: "立即交卷",
  1161. cancelButtonText: "暂不交卷",
  1162. type: "warning",
  1163. })
  1164. .then(() => {
  1165. this.examSubmit();
  1166. })
  1167. .catch(() => {});
  1168. });
  1169. }
  1170. },
  1171. /**
  1172. * 请求题目列表
  1173. */
  1174. goodsQuestionList() {
  1175. console.log("继续做题");
  1176. this.$request.examReport(this.recordId).then((res) => {
  1177. let json = JSON.parse(res.data.historyExamJson);
  1178. this.examData = res.data;
  1179. this.questionList = json;
  1180. //5秒保存一下做题记录
  1181. clearInterval(this.postTimer);
  1182. this.postTimer = setInterval(() => {
  1183. this.examRecordEdit();
  1184. }, 5000);
  1185. });
  1186. },
  1187. /**
  1188. * @param {Object}
  1189. * 单选点击确认
  1190. */
  1191. radioSelect(question, questionIndex, optionsId) {
  1192. if (this.questionList[questionIndex].ques) return;
  1193. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1194. this.isDoOver();
  1195. },
  1196. /**
  1197. * @param {Object}
  1198. * 案例单选点击
  1199. */
  1200. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1201. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1202. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1203. this.isDoOver();
  1204. },
  1205. /**
  1206. * 多选点击确认
  1207. */
  1208. checkboxSubmit(question, questionIndex) {
  1209. if (this.questionList[questionIndex].ques) return;
  1210. let arr = [];
  1211. this.questionList[questionIndex].jsonStr.forEach((item) => {
  1212. if (item.checked) {
  1213. arr.push(item.optionsId);
  1214. }
  1215. });
  1216. if (!arr.length) {
  1217. this.$message({
  1218. type: "warning",
  1219. message: "请选择答案",
  1220. });
  1221. return;
  1222. }
  1223. this.$set(this.questionList[questionIndex], "ques", arr);
  1224. this.isDoOver();
  1225. },
  1226. /**
  1227. * @param {Object}
  1228. * 案例多选确认
  1229. */
  1230. checkboxSubmitChild(questionIndex, ansIndex) {
  1231. if (this.questionList[questionIndex].ques[ansIndex]) return;
  1232. let arr = [];
  1233. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1234. (item) => {
  1235. if (item.checked) {
  1236. arr.push(item.optionsId);
  1237. }
  1238. }
  1239. );
  1240. if (!arr.length) {
  1241. this.$message({
  1242. type: "warning",
  1243. message: "请选择答案",
  1244. });
  1245. return;
  1246. }
  1247. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1248. this.isDoOver();
  1249. },
  1250. /**
  1251. * 判断点击确认
  1252. */
  1253. judgeSelect(question, questionIndex, index) {
  1254. if (question.ques) return;
  1255. this.$set(this.questionList[questionIndex], "ques", index == 0 ? '1' : '0');
  1256. this.isDoOver();
  1257. },
  1258. judgeSelectChild(questionIndex, jsonIndex, index) {
  1259. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  1260. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1261. this.$set(this.questionList[questionIndex].ques, jsonIndex, index == 0 ? '1' : '0');
  1262. this.isDoOver();
  1263. },
  1264. /**
  1265. * 上传图片
  1266. */
  1267. uploadImg(e, question, questionIndex) {
  1268. var file = e.target.files[0];
  1269. if (file.size > 2 * 1024 * 1024) {
  1270. this.$message.warn("图片不得大于2000kb");
  1271. return;
  1272. }
  1273. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1274. if (
  1275. type[0] != "jpg" &&
  1276. type[0] != "png" &&
  1277. type[0] != "jpeg" &&
  1278. type[0] != "gif"
  1279. ) {
  1280. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1281. e.target.value = "";
  1282. return;
  1283. }
  1284. this.$upload.upload(file, 0).then((res) => {
  1285. question.ansText.imageList.push(res);
  1286. });
  1287. },
  1288. /**
  1289. * 案例上传图片
  1290. */
  1291. uploadImgChild(e, questionIndex, jsonIndex) {
  1292. var file = e.target.files[0];
  1293. if (file.size > 2 * 1024 * 1024) {
  1294. this.$message.warn("图片不得大于2000kb");
  1295. return;
  1296. }
  1297. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1298. if (
  1299. type[0] != "jpg" &&
  1300. type[0] != "png" &&
  1301. type[0] != "jpeg" &&
  1302. type[0] != "gif"
  1303. ) {
  1304. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1305. e.target.value = "";
  1306. return;
  1307. }
  1308. this.$upload.upload(file, 0).then((res) => {
  1309. this.questionList[questionIndex].jsonStr[
  1310. jsonIndex
  1311. ].ansText.imageList.push(res);
  1312. });
  1313. },
  1314. /**
  1315. * @param {Object} current
  1316. * 获取收藏信息
  1317. */
  1318. getCollectInfo(current) {
  1319. this.$request
  1320. .getCollectInfo({
  1321. examId: this.examId,
  1322. questionId: this.questionList[current].questionId,
  1323. goodsId: this.goodsId,
  1324. orderGoodsId: this.orderGoodsId,
  1325. })
  1326. .then((res) => {
  1327. this.$set(this.collectList, current, res.data);
  1328. })
  1329. .catch((err) => {
  1330. this.$set(this.collectList, current, false);
  1331. });
  1332. },
  1333. isOver(item, index) {
  1334. if (this.questionList[index].ques) {
  1335. if (item.type == 4) {
  1336. //案例题
  1337. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1338. if (
  1339. jsonItem.type == 1 ||
  1340. jsonItem.type == 2 ||
  1341. jsonItem.type == 3
  1342. ) {
  1343. if (item.ques[indexs]) {
  1344. return true;
  1345. } else {
  1346. return false;
  1347. }
  1348. } else if (jsonItem.type == 5) {
  1349. if (
  1350. item.ques[indexs] &&
  1351. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1352. ) {
  1353. console.log("chil");
  1354. return true;
  1355. } else {
  1356. return false;
  1357. }
  1358. }
  1359. });
  1360. if (isOver) {
  1361. return true;
  1362. } else {
  1363. return false;
  1364. }
  1365. } else if (item.type == 5) {
  1366. //简答题
  1367. //每一项都相等
  1368. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1369. return true;
  1370. }
  1371. //判断
  1372. } else {
  1373. return false;
  1374. }
  1375. } else {
  1376. return false;
  1377. }
  1378. },
  1379. ansSubmit(question, questionIndex) {
  1380. if (!question.ansText.text && !question.ansText.imageList.length) {
  1381. this.$message({
  1382. type: "warning",
  1383. message: "请输入内容或上传图片",
  1384. });
  1385. return;
  1386. }
  1387. question.ques.imageList = question.ansText.imageList;
  1388. question.ques.text = question.ansText.text;
  1389. this.isDoOver();
  1390. console.log(question.ques);
  1391. },
  1392. ansSubmitChild(question, questionIndex, jsonIndex) {
  1393. if (
  1394. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1395. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1396. .length
  1397. ) {
  1398. this.$message({
  1399. type: "warning",
  1400. message: "请输入内容或上传图片",
  1401. });
  1402. return;
  1403. }
  1404. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1405. imageList:
  1406. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1407. .imageList || [],
  1408. text:
  1409. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  1410. "",
  1411. });
  1412. this.isDoOver();
  1413. },
  1414. changeIndex(index) {
  1415. this.current = index;
  1416. this.getCollectInfo(this.current);
  1417. },
  1418. nextQuestion() {
  1419. if (this.current >= this.questionList.length - 1) {
  1420. this.$message({
  1421. type: "warning",
  1422. message: "已经是最后一题了!",
  1423. });
  1424. return;
  1425. }
  1426. this.current++;
  1427. this.getCollectInfo(this.current);
  1428. },
  1429. prevQuestion() {
  1430. if (this.current == 0) {
  1431. this.$message({
  1432. type: "warning",
  1433. message: "已经是第一题了!",
  1434. });
  1435. return;
  1436. } else {
  1437. this.current--;
  1438. this.getCollectInfo(this.current);
  1439. }
  1440. },
  1441. isRight(item, index) {
  1442. //单选
  1443. if (this.questionList[index].ques) {
  1444. if (item.type == 1) {
  1445. console.log(
  1446. this.questionList[index].ques == this.questionList[index].ans
  1447. );
  1448. return this.questionList[index].ques == this.questionList[index].ans;
  1449. //多选
  1450. } else if (item.type == 2) {
  1451. //每一项都相等
  1452. return this.questionList[index].ans.every((item, i) => {
  1453. return item == this.questionList[index].ques[i];
  1454. });
  1455. //判断
  1456. } else if (item.type == 3) {
  1457. return this.questionList[index].ques == this.questionList[index].ans;
  1458. } else {
  1459. return false;
  1460. }
  1461. } else {
  1462. return false;
  1463. }
  1464. },
  1465. isWrong(item, index) {
  1466. if (this.questionList[index].ques) {
  1467. //单选
  1468. if (item.type == 1) {
  1469. return this.questionList[index].ques != this.questionList[index].ans;
  1470. //多选
  1471. } else if (item.type == 2) {
  1472. //每一项都相等
  1473. return this.questionList[index].ques.some((item, i) => {
  1474. return this.questionList[index].ans.indexOf(item) == -1;
  1475. });
  1476. //判断
  1477. } else if (item.type == 3) {
  1478. return this.questionList[index].ques != this.questionList[index].ans;
  1479. } else {
  1480. return false;
  1481. }
  1482. } else {
  1483. return false;
  1484. }
  1485. },
  1486. isPart(item, index) {
  1487. if (this.questionList[index].ques) {
  1488. if (item.type == 2) {
  1489. let isWrong = this.questionList[index].ques.some((item, i) => {
  1490. return this.questionList[index].ans.indexOf(item) == -1;
  1491. });
  1492. let isRight = this.questionList[index].ans.every((item, i) => {
  1493. return item == this.questionList[index].ques[i];
  1494. });
  1495. if (!isRight && !isWrong) {
  1496. return true;
  1497. }
  1498. }
  1499. } else {
  1500. return false;
  1501. }
  1502. },
  1503. right(bankIndex, ansIndex, option) {
  1504. if (
  1505. this.questionList[bankIndex].ques[ansIndex] &&
  1506. this.questionList[bankIndex].ans[ansIndex]
  1507. ) {
  1508. if (
  1509. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1510. option.optionsId
  1511. ) != -1 ||
  1512. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1513. option.optionsId
  1514. ) != -1
  1515. ) {
  1516. return true;
  1517. } else {
  1518. return false;
  1519. }
  1520. } else {
  1521. return false;
  1522. }
  1523. },
  1524. wrong(bankIndex, ansIndex, option) {
  1525. if (
  1526. this.questionList[bankIndex].ques[ansIndex] &&
  1527. this.questionList[bankIndex].ans[ansIndex]
  1528. ) {
  1529. if (
  1530. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1531. option.optionsId
  1532. ) != -1 &&
  1533. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1534. option.optionsId
  1535. ) == -1
  1536. ) {
  1537. return true;
  1538. } else {
  1539. return false;
  1540. }
  1541. } else {
  1542. return false;
  1543. }
  1544. },
  1545. /**
  1546. * 获取已经回答的题目数
  1547. * hasSpecail (是否包含简答和案例)
  1548. */
  1549. questionOverNum(hasSpecail) {
  1550. let count = 0;
  1551. this.questionList.forEach((item) => {
  1552. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1553. if (item.ques) {
  1554. count++;
  1555. }
  1556. } else if (item.type == 4) {
  1557. //案例题
  1558. if (hasSpecail) {
  1559. let isOver = item.jsonStr.every((jsonItem, index) => {
  1560. if (
  1561. jsonItem.type == 1 ||
  1562. jsonItem.type == 2 ||
  1563. jsonItem.type == 3
  1564. ) {
  1565. if (item.ques[index]) {
  1566. return true;
  1567. } else {
  1568. return false;
  1569. }
  1570. } else if (jsonItem.type == 5) {
  1571. if (
  1572. item.ques[index] &&
  1573. (item.ques[index].text || item.ques[index].imageList.length)
  1574. ) {
  1575. return true;
  1576. } else {
  1577. return false;
  1578. }
  1579. }
  1580. });
  1581. if (isOver) {
  1582. count++;
  1583. console.log(item, 444);
  1584. }
  1585. }
  1586. } else if (item.type == 5) {
  1587. //简答题
  1588. if (hasSpecail) {
  1589. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1590. console.log(5, item);
  1591. count++;
  1592. }
  1593. }
  1594. }
  1595. });
  1596. return count;
  1597. },
  1598. collect(state, index) {
  1599. if (!state) {
  1600. this.$request
  1601. .collectQuestion({
  1602. examId: this.examId,
  1603. questionId: this.questionList[index].questionId,
  1604. goodsId: this.goodsId || "",
  1605. orderGoodsId: this.orderGoodsId,
  1606. })
  1607. .then((res) => {
  1608. this.$set(this.collectList, index, true);
  1609. this.$message.success("收藏成功");
  1610. this.getCollectInfo(index);
  1611. });
  1612. } else {
  1613. this.$request
  1614. .deleteCollectQuestion(this.collectList[index].collectQuestionId)
  1615. .then((res) => {
  1616. this.$set(this.collectList, index, false);
  1617. this.$message.success("取消收藏成功");
  1618. });
  1619. }
  1620. return;
  1621. },
  1622. submit() {
  1623. let ansCount = this.questionOverNum(true); //已答题数
  1624. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1625. //没有答完
  1626. if (this.lastCount !== 0) {
  1627. this.$confirm(
  1628. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1629. "提示",
  1630. {
  1631. confirmButtonText: "立即交卷",
  1632. cancelButtonText: "继续做题",
  1633. closeOnClickModal: false,
  1634. closeOnPressEscape: false,
  1635. distinguishCancelAndClose: false,
  1636. showClose: false,
  1637. }
  1638. )
  1639. .then((_) => {
  1640. this.examSubmit();
  1641. })
  1642. .catch((_) => {});
  1643. return;
  1644. }
  1645. this.examSubmit();
  1646. },
  1647. examSubmit() {
  1648. clearInterval(this.postTimer);
  1649. this.loading = true;
  1650. let score = 0; //计算总分
  1651. let reportStatus = 0;
  1652. let number = 0; //做对的题目数量
  1653. let doQuestionNum = 0; //做过的题目数量
  1654. let allScore = 0; //总分
  1655. let passScore = 0;
  1656. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1657. let doQuestionIds = []; //做过的题目id
  1658. let rightQuestionIds = []; //做对的题目id
  1659. let lessQuestionNum = 0;
  1660. this.questionList.forEach((item, index) => {
  1661. passScore = item.passScore;
  1662. if (item.type == 1) {
  1663. //正确
  1664. if (item.ques == item.ans) {
  1665. item.scoreResult = item.score;
  1666. score += item.score;
  1667. number++;
  1668. rightQuestionIds.push(item.questionId);
  1669. } else {
  1670. //错误
  1671. item.scoreResult = 0;
  1672. if (item.ques) {
  1673. doWrongQuestionIds.push(item.questionId);
  1674. }
  1675. }
  1676. allScore += item.score;
  1677. if (item.ques) {
  1678. console.log(doQuestionNum, "单选");
  1679. doQuestionNum++;
  1680. doQuestionIds.push(item.questionId);
  1681. }
  1682. } else if (item.type == 2) {
  1683. let isRight =
  1684. item.ans &&
  1685. item.ans.every((quesItem, quesIndex) => {
  1686. if (item.ques) {
  1687. return item.ques[quesIndex] == item.ans[quesIndex];
  1688. } else {
  1689. return false;
  1690. }
  1691. });
  1692. if (isRight) {
  1693. score += item.score;
  1694. number++;
  1695. item.scoreResult = item.score;
  1696. rightQuestionIds.push(item.questionId);
  1697. } else {
  1698. let hasPart = false;
  1699. let checkboxScore = 1; //获取单题总分数
  1700. item.ques &&
  1701. item.ques.forEach((ques, quesIndex) => {
  1702. //选错一个全扣
  1703. if (item.ques) {
  1704. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1705. checkboxScore = 0;
  1706. }
  1707. } else {
  1708. checkboxScore = 0;
  1709. }
  1710. });
  1711. console.log(checkboxScore);
  1712. //没选错
  1713. if (checkboxScore) {
  1714. checkboxScore = 0;
  1715. item.ans.forEach((ans, quesIndex) => {
  1716. //漏选扣一部分,对n题给n X partScore 分
  1717. if (item.ques) {
  1718. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1719. checkboxScore += item.partScore;
  1720. hasPart = true;
  1721. }
  1722. } else {
  1723. checkboxScore = 0;
  1724. }
  1725. });
  1726. }
  1727. if (!hasPart) {
  1728. //0分
  1729. item.scoreResult = 0;
  1730. if (item.ques) {
  1731. doWrongQuestionIds.push(item.questionId);
  1732. }
  1733. } else {
  1734. //部分分
  1735. // number++;
  1736. lessQuestionNum++;
  1737. // doWrongQuestionIds.push(item.questionId);
  1738. item.scoreResult = checkboxScore;
  1739. score += checkboxScore;
  1740. // rightQuestionIds.push(item.questionId)
  1741. }
  1742. }
  1743. allScore += item.score;
  1744. if (item.ques && item.ques.length) {
  1745. console.log(doQuestionNum, "多选");
  1746. doQuestionNum++;
  1747. doQuestionIds.push(item.questionId);
  1748. }
  1749. } else if (item.type == 3) {
  1750. if (item.ques == item.ans) {
  1751. item.scoreResult = item.score;
  1752. score += item.score;
  1753. number++;
  1754. rightQuestionIds.push(item.questionId);
  1755. } else {
  1756. item.scoreResult = 0;
  1757. if (item.ques) {
  1758. doWrongQuestionIds.push(item.questionId);
  1759. }
  1760. }
  1761. allScore += item.score;
  1762. if (item.ques) {
  1763. console.log(doQuestionNum, "判断");
  1764. doQuestionNum++;
  1765. doQuestionIds.push(item.questionId);
  1766. }
  1767. } else if (item.type == 4) {
  1768. allScore += item.score;
  1769. if (item.ques && item.ques.length) {
  1770. console.log(doQuestionNum, "案例");
  1771. doQuestionNum++;
  1772. doQuestionIds.push(item.questionId);
  1773. }
  1774. } else if (item.type == 5) {
  1775. allScore += item.score;
  1776. if (
  1777. item.ques &&
  1778. (item.ques.imageList.length || item.ques.text.length)
  1779. ) {
  1780. console.log(doQuestionNum, "简答");
  1781. doQuestionNum++;
  1782. doQuestionIds.push(item.questionId);
  1783. }
  1784. }
  1785. });
  1786. //大于分及格
  1787. if (score >= passScore) {
  1788. reportStatus = 1;
  1789. } else {
  1790. reportStatus = 0;
  1791. }
  1792. //交卷
  1793. this.$request
  1794. .examRecordEdit({
  1795. orderGoodsId: this.orderGoodsId,
  1796. examId: this.examId,
  1797. goodsId: this.goodsId,
  1798. reportStatus: reportStatus,
  1799. totalScore: allScore,
  1800. recordId: this.recordId,
  1801. lessQuestionNum: lessQuestionNum,
  1802. rightQuestionNum: number,
  1803. status: 1,
  1804. moduleExamId: this.moduleId || 0,
  1805. chapterExamId: this.chapterId || 0,
  1806. doQuestionIds: doQuestionIds.join(","),
  1807. rightQuestionIds: rightQuestionIds.join(","),
  1808. doQuestionNum: doQuestionNum,
  1809. performance: score,
  1810. historyExamJson: JSON.stringify(this.questionList),
  1811. })
  1812. .then((res) => {
  1813. this.isSubmit = true;
  1814. this.loading = false;
  1815. this.$message({
  1816. type: "success",
  1817. message: "交卷成功",
  1818. });
  1819. setTimeout(() => {
  1820. let result = {
  1821. orderGoodsId: this.orderGoodsId,
  1822. chapterId: this.chapterId,
  1823. moduleId: this.moduleId,
  1824. examId: this.examId,
  1825. recordId: this.recordId,
  1826. };
  1827. console.log(result);
  1828. this.setExamResult(result);
  1829. this.$router.replace({
  1830. path: "/bank-report/" + this.goodsId,
  1831. query: {
  1832. orderGoodsId: this.orderGoodsId,
  1833. chapterId: this.chapterId,
  1834. moduleId: this.moduleId,
  1835. examId: this.examId,
  1836. recordId: this.recordId,
  1837. },
  1838. });
  1839. }, 1000);
  1840. })
  1841. .catch((err) => {
  1842. this.loading = false;
  1843. console.log(err, "err");
  1844. });
  1845. //错题集id提交(客观题)
  1846. this.$request
  1847. .examWrongRecord({
  1848. orderGoodsId: this.orderGoodsId,
  1849. examId: this.examId,
  1850. goodsId: this.goodsId,
  1851. questionIds: doWrongQuestionIds,
  1852. recordId: this.recordId,
  1853. })
  1854. .then((res) => {})
  1855. .catch((err) => {});
  1856. },
  1857. /**
  1858. * 离开页面统计回答正确题数
  1859. */
  1860. examRecordEdit() {
  1861. let number = 0;
  1862. let score = 0;
  1863. let doQuestionNum = 0;
  1864. let doQuestionIds = []; //做过的题目id
  1865. let lessQuestionNum = 0;
  1866. this.questionList.forEach((item, index) => {
  1867. if (item.type == 1) {
  1868. if (item.ques == item.ans) {
  1869. score += item.score;
  1870. number++;
  1871. }
  1872. if (item.ques) {
  1873. doQuestionNum++;
  1874. doQuestionIds.push(item.questionId);
  1875. }
  1876. } else if (item.type == 2) {
  1877. let isRight =
  1878. item.ans &&
  1879. item.ans.every((quesItem, quesIndex) => {
  1880. if (item.ques) {
  1881. return item.ques[quesIndex] == item.ans[quesIndex];
  1882. } else {
  1883. return false;
  1884. }
  1885. });
  1886. if (isRight) {
  1887. score += item.score;
  1888. number++;
  1889. } else {
  1890. let hasPart = false;
  1891. let checkboxScore = 1; //获取单题总分数
  1892. item.ques &&
  1893. item.ques.forEach((ques, quesIndex) => {
  1894. //选错一个全扣
  1895. if (item.ques) {
  1896. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1897. checkboxScore = 0;
  1898. }
  1899. } else {
  1900. checkboxScore = 0;
  1901. }
  1902. });
  1903. console.log(checkboxScore);
  1904. //没选错
  1905. if (checkboxScore) {
  1906. checkboxScore = 0;
  1907. item.ans.forEach((ans, quesIndex) => {
  1908. //漏选扣一部分,对n题给n X partScore 分
  1909. if (item.ques) {
  1910. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1911. checkboxScore += item.partScore;
  1912. hasPart = true;
  1913. }
  1914. } else {
  1915. checkboxScore = 0;
  1916. }
  1917. });
  1918. }
  1919. if (!hasPart) {
  1920. //0分
  1921. } else {
  1922. //部分分
  1923. // number++;
  1924. lessQuestionNum++;
  1925. score += checkboxScore;
  1926. }
  1927. }
  1928. if (item.ques && item.ques.length) {
  1929. doQuestionNum++;
  1930. doQuestionIds.push(item.questionId);
  1931. }
  1932. } else if (item.type == 3) {
  1933. if (item.ques == item.ans) {
  1934. score += item.score;
  1935. number++;
  1936. }
  1937. if (item.ques) {
  1938. doQuestionNum++;
  1939. doQuestionIds.push(item.questionId);
  1940. }
  1941. } else if (item == 4) {
  1942. if (item.ques.length) {
  1943. doQuestionNum++;
  1944. doQuestionIds.push(item.questionId);
  1945. }
  1946. } else if (item.type == 5) {
  1947. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1948. doQuestionNum++;
  1949. doQuestionIds.push(item.questionId);
  1950. }
  1951. }
  1952. });
  1953. this.$request
  1954. .examRecordEdit({
  1955. examId: this.examId,
  1956. goodsId: this.goodsId,
  1957. recordId: this.recordId,
  1958. orderGoodsId: this.orderGoodsId,
  1959. doQuestionIds: doQuestionIds.join(","),
  1960. rightQuestionNum: number,
  1961. lessQuestionNum: lessQuestionNum,
  1962. moduleExamId: this.moduleId || 0,
  1963. chapterExamId: this.chapterId || 0,
  1964. status: 0,
  1965. doQuestionNum: doQuestionNum,
  1966. historyExamJson: JSON.stringify(this.questionList),
  1967. })
  1968. .then((res) => {});
  1969. },
  1970. },
  1971. };
  1972. </script>
  1973. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1974. <style scoped lang="scss">
  1975. .course-exam {
  1976. .section {
  1977. overflow: hidden;
  1978. &__header {
  1979. height: 20px;
  1980. margin-top: 20px;
  1981. }
  1982. &__body {
  1983. .explain-record {
  1984. &__header {
  1985. }
  1986. &__body {
  1987. margin-bottom: 20px;
  1988. border: 1px solid #eee;
  1989. .left-box {
  1990. float: left;
  1991. width: 970px;
  1992. min-height: 630px;
  1993. border: 1px solid #eee;
  1994. &__header {
  1995. height: 40px;
  1996. padding-left: 12px;
  1997. border-bottom: 1px solid #eeeeee;
  1998. display: flex;
  1999. align-items: center;
  2000. .progress {
  2001. width: 636px;
  2002. }
  2003. .text {
  2004. margin-left: 15px;
  2005. font-size: 16px;
  2006. span {
  2007. font-family: Microsoft YaHei;
  2008. font-weight: bold;
  2009. color: #3f8dfd;
  2010. line-height: 24px;
  2011. }
  2012. }
  2013. }
  2014. &__body {
  2015. .question {
  2016. padding: 12px 0 0 12px;
  2017. display: flex;
  2018. flex-direction: column;
  2019. height: 100%;
  2020. &__title {
  2021. padding-left: 12px;
  2022. font-size: 16px;
  2023. font-family: Microsoft YaHei;
  2024. font-weight: bold;
  2025. color: #333333;
  2026. line-height: 24px;
  2027. }
  2028. &__desc {
  2029. padding-left: 12px;
  2030. margin-top: 20px;
  2031. font-size: 16px;
  2032. font-family: Microsoft YaHei;
  2033. font-weight: 400;
  2034. color: #666666;
  2035. line-height: 24px;
  2036. /deep/ img {
  2037. max-width: 100% !important;
  2038. }
  2039. }
  2040. &__content {
  2041. /deep/ .el-tabs__item {
  2042. height: 40px;
  2043. line-height: 40px;
  2044. }
  2045. .question__content {
  2046. height: auto;
  2047. overflow: auto;
  2048. }
  2049. .question-list {
  2050. padding: 24px 0 0 24px;
  2051. .checkbox,
  2052. .radio {
  2053. cursor: pointer;
  2054. margin-right: 24px;
  2055. padding: 0 24px;
  2056. display: flex;
  2057. align-items: center;
  2058. margin-top: 2px;
  2059. min-height: 40px;
  2060. padding-top: 10px;
  2061. padding-bottom: 10px;
  2062. background: #f5f9ff;
  2063. border-radius: 8px;
  2064. box-sizing: border-box;
  2065. &.right {
  2066. background: #37c65b;
  2067. }
  2068. &.wrong {
  2069. background: #ff3a30;
  2070. }
  2071. }
  2072. &.textarea {
  2073. margin-right: 12px;
  2074. .upload {
  2075. margin-top: 10px;
  2076. &__imgs {
  2077. margin-right: 10px;
  2078. width: 80px;
  2079. height: 80px;
  2080. background: #ffffff;
  2081. border: 1px solid #eeeeee;
  2082. border-radius: 4px;
  2083. position: relative;
  2084. display: flex;
  2085. float: left;
  2086. align-items: center;
  2087. justify-content: center;
  2088. img {
  2089. max-width: 100%;
  2090. max-height: 100%;
  2091. }
  2092. }
  2093. &__btn {
  2094. margin-right: 10px;
  2095. width: 80px;
  2096. height: 80px;
  2097. background: #ffffff;
  2098. border: 1px solid #eeeeee;
  2099. border-radius: 4px;
  2100. position: relative;
  2101. display: flex;
  2102. float: left;
  2103. align-items: center;
  2104. justify-content: center;
  2105. flex-direction: column;
  2106. .icon {
  2107. font-size: 20px;
  2108. color: #3f8dfd;
  2109. }
  2110. p {
  2111. font-size: 12px;
  2112. font-family: Microsoft YaHei;
  2113. font-weight: 400;
  2114. color: #999999;
  2115. line-height: 24px;
  2116. }
  2117. input {
  2118. position: absolute;
  2119. left: 0;
  2120. top: 0;
  2121. display: block;
  2122. width: 100%;
  2123. height: 100%;
  2124. opacity: 0;
  2125. }
  2126. }
  2127. }
  2128. }
  2129. /deep/ .el-checkbox {
  2130. white-space: normal;
  2131. }
  2132. }
  2133. .answer-list {
  2134. height: 40px;
  2135. border-top: 1px solid #eee;
  2136. border-bottom: 1px solid #eee;
  2137. margin-top: 24px;
  2138. display: flex;
  2139. align-items: center;
  2140. justify-content: space-between;
  2141. padding: 0 24px;
  2142. &__left {
  2143. font-size: 16px;
  2144. font-family: Microsoft YaHei;
  2145. font-weight: 400;
  2146. color: #333333;
  2147. line-height: 24px;
  2148. }
  2149. &__right {
  2150. font-size: 16px;
  2151. font-family: Microsoft YaHei;
  2152. font-weight: 400;
  2153. color: #333333;
  2154. line-height: 24px;
  2155. }
  2156. }
  2157. .explain-list {
  2158. padding: 12px 24px;
  2159. &__header {
  2160. font-size: 16px;
  2161. font-family: Microsoft YaHei;
  2162. font-weight: bold;
  2163. color: #666666;
  2164. line-height: 24px;
  2165. }
  2166. &__body {
  2167. margin-top: 12px;
  2168. font-size: 16px;
  2169. font-family: Microsoft YaHei;
  2170. font-weight: 400;
  2171. color: #666666;
  2172. line-height: 24px;
  2173. }
  2174. .upload {
  2175. margin-top: 10px;
  2176. &__imgs {
  2177. margin-right: 10px;
  2178. width: 80px;
  2179. height: 80px;
  2180. background: #ffffff;
  2181. border: 1px solid #eeeeee;
  2182. border-radius: 4px;
  2183. position: relative;
  2184. display: flex;
  2185. float: left;
  2186. align-items: center;
  2187. justify-content: center;
  2188. img {
  2189. max-width: 100%;
  2190. max-height: 100%;
  2191. }
  2192. }
  2193. }
  2194. }
  2195. }
  2196. &__btns {
  2197. position: relative;
  2198. height: 32px;
  2199. .submit {
  2200. cursor: pointer;
  2201. margin: 0 auto;
  2202. width: 140px;
  2203. height: 32px;
  2204. color: #fff;
  2205. background: #3f8dfd;
  2206. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2207. border-radius: 16px;
  2208. text-align: center;
  2209. line-height: 32px;
  2210. font-size: 16px;
  2211. }
  2212. .collect {
  2213. width: 100px;
  2214. cursor: pointer;
  2215. position: absolute;
  2216. right: 0;
  2217. top: 5px;
  2218. font-size: 12px;
  2219. font-family: Microsoft YaHei;
  2220. font-weight: 400;
  2221. color: #3f8dfd;
  2222. line-height: 24px;
  2223. i {
  2224. font-size: 20px;
  2225. }
  2226. }
  2227. }
  2228. }
  2229. }
  2230. &__footer {
  2231. height: 40px;
  2232. display: flex;
  2233. justify-content: space-around;
  2234. align-items: center;
  2235. .btn {
  2236. cursor: pointer;
  2237. width: 140px;
  2238. height: 32px;
  2239. background: #ffffff;
  2240. border: 1px solid #3f8dfd;
  2241. border-radius: 16px;
  2242. line-height: 32px;
  2243. text-align: center;
  2244. color: #3f8dfd;
  2245. }
  2246. }
  2247. }
  2248. .right-box {
  2249. float: right;
  2250. width: 299px;
  2251. border-right: 1px solid #eee;
  2252. &__header {
  2253. height: 40px;
  2254. line-height: 40px;
  2255. font-size: 16px;
  2256. font-family: Microsoft YaHei;
  2257. font-weight: bold;
  2258. color: #333333;
  2259. text-align: center;
  2260. border-bottom: 1px solid #eeeeee;
  2261. .back-btn {
  2262. display: block;
  2263. margin: 0 auto;
  2264. width: 160px;
  2265. }
  2266. }
  2267. &__body {
  2268. height: 510px;
  2269. border-bottom: 1px solid #eee;
  2270. .card {
  2271. &__note {
  2272. display: flex;
  2273. height: 64px;
  2274. align-items: center;
  2275. border-bottom: 1px solid #eee;
  2276. flex-wrap: wrap;
  2277. .item {
  2278. display: flex;
  2279. align-items: center;
  2280. margin-left: 10px;
  2281. width: 84px;
  2282. font-size: 12px;
  2283. .box {
  2284. margin-right: 5px;
  2285. width: 16px;
  2286. height: 16px;
  2287. border-radius: 4px;
  2288. &.white {
  2289. background: #ffffff;
  2290. border: 1px solid #eeeeee;
  2291. }
  2292. &.green {
  2293. background: #37c65b;
  2294. }
  2295. &.red {
  2296. background: #ff3a30;
  2297. }
  2298. &.yellow {
  2299. background: #ffc53d;
  2300. }
  2301. &.blue {
  2302. background: #3f8dfd;
  2303. }
  2304. }
  2305. }
  2306. }
  2307. &__content {
  2308. height: 440px;
  2309. overflow-y: scroll;
  2310. &::-webkit-scrollbar {
  2311. width: 6px;
  2312. }
  2313. &::-webkit-scrollbar-track {
  2314. background-color: #fff;
  2315. -webkit-border-radius: 2em;
  2316. -moz-border-radius: 2em;
  2317. border-radius: 2em;
  2318. }
  2319. &::-webkit-scrollbar-thumb {
  2320. background-color: #eeeeee;
  2321. -webkit-border-radius: 2em;
  2322. -moz-border-radius: 2em;
  2323. border-radius: 2em;
  2324. }
  2325. .list {
  2326. display: flex;
  2327. flex-wrap: wrap;
  2328. .item {
  2329. width: 40px;
  2330. height: 40px;
  2331. border-radius: 10px;
  2332. text-align: center;
  2333. line-height: 40px;
  2334. margin-left: 16px;
  2335. margin-top: 16px;
  2336. cursor: pointer;
  2337. &.white {
  2338. line-height: 38px;
  2339. color: #333333;
  2340. background: #ffffff;
  2341. border: 1px solid #eeeeee;
  2342. }
  2343. &.green {
  2344. color: #fff;
  2345. background: #37c65b;
  2346. }
  2347. &.red {
  2348. color: #fff;
  2349. background: #ff3a30;
  2350. }
  2351. &.blue {
  2352. border: 1rpx solid #eeeeee;
  2353. color: #fff;
  2354. background: #3f8dfd;
  2355. }
  2356. &.yellow {
  2357. background: #ffc53d;
  2358. }
  2359. &.disabled {
  2360. cursor: not-allowed;
  2361. line-height: 38px;
  2362. color: #eeeeee;
  2363. background: #ffffff;
  2364. border: 1px solid #eeeeee;
  2365. }
  2366. }
  2367. }
  2368. }
  2369. }
  2370. }
  2371. &__footer {
  2372. border-bottom: 1px solid #eee;
  2373. height: 40px;
  2374. display: flex;
  2375. align-items: center;
  2376. justify-content: center;
  2377. .submit {
  2378. cursor: pointer;
  2379. width: 140px;
  2380. height: 32px;
  2381. padding: 0;
  2382. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2383. border-radius: 16px;
  2384. line-height: 32px;
  2385. text-align: center;
  2386. font-size: 16px;
  2387. }
  2388. }
  2389. }
  2390. }
  2391. }
  2392. }
  2393. }
  2394. .take-photo {
  2395. /deep/ .el-dialog__header {
  2396. display: none;
  2397. }
  2398. /deep/ .el-dialog__body {
  2399. padding: 0;
  2400. overflow: unset;
  2401. }
  2402. &__close {
  2403. cursor: pointer;
  2404. position: absolute;
  2405. right: 0;
  2406. top: -28px;
  2407. width: 24px;
  2408. height: 24px;
  2409. line-height: 24px;
  2410. text-align: center;
  2411. color: #eee;
  2412. border: 1px solid #eee;
  2413. border-radius: 50%;
  2414. }
  2415. &__header {
  2416. height: 40px;
  2417. border-bottom: 1px solid #eee;
  2418. line-height: 40px;
  2419. font-size: 16px;
  2420. font-family: Microsoft YaHei;
  2421. font-weight: bold;
  2422. color: #333333;
  2423. padding-left: 24px;
  2424. }
  2425. &__body {
  2426. height: 400px;
  2427. padding: 40px 24px;
  2428. .left-box {
  2429. width: 336px;
  2430. float: left;
  2431. .title {
  2432. font-size: 16px;
  2433. font-family: Microsoft YaHei;
  2434. font-weight: bold;
  2435. color: #ff3b30;
  2436. line-height: 24px;
  2437. }
  2438. .content {
  2439. font-size: 14px;
  2440. font-family: Microsoft YaHei;
  2441. font-weight: 400;
  2442. color: #333333;
  2443. line-height: 28px;
  2444. margin-top: 32px;
  2445. }
  2446. }
  2447. .right-box {
  2448. float: right;
  2449. width: 400px;
  2450. height: 300px;
  2451. video {
  2452. width: 100%;
  2453. height: 100%;
  2454. }
  2455. }
  2456. }
  2457. &__footer {
  2458. height: 90px;
  2459. border-top: 1px solid #eee;
  2460. text-align: center;
  2461. .take {
  2462. display: inline-block;
  2463. width: 200px;
  2464. height: 40px;
  2465. padding: 0;
  2466. border-radius: 20px;
  2467. text-align: center;
  2468. line-height: 40px;
  2469. margin: 24px auto;
  2470. }
  2471. }
  2472. }
  2473. }
  2474. </style>