index.vue 91 KB

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