index.vue 109 KB

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