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. this.getCollectInfo(this.current)
  1198. //5秒保存一下做题记录
  1199. clearInterval(this.postTimer);
  1200. this.postTimer = setInterval(() => {
  1201. this.examRecordEdit();
  1202. }, 5000);
  1203. });
  1204. },
  1205. /**
  1206. * @param {Object}
  1207. * 单选点击确认
  1208. */
  1209. radioSelect(question, questionIndex, optionsId) {
  1210. if (this.questionList[questionIndex].ques) return;
  1211. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1212. this.isDoOver();
  1213. },
  1214. /**
  1215. * @param {Object}
  1216. * 案例单选点击
  1217. */
  1218. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1219. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1220. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1221. this.isDoOver();
  1222. },
  1223. /**
  1224. * 多选点击确认
  1225. */
  1226. checkboxSubmit(question, questionIndex) {
  1227. if (this.questionList[questionIndex].ques) return;
  1228. let arr = [];
  1229. this.questionList[questionIndex].jsonStr.forEach((item) => {
  1230. if (item.checked) {
  1231. arr.push(item.optionsId);
  1232. }
  1233. });
  1234. if (!arr.length) {
  1235. this.$message({
  1236. type: "warning",
  1237. message: "请选择答案",
  1238. });
  1239. return;
  1240. }
  1241. this.$set(this.questionList[questionIndex], "ques", arr);
  1242. this.isDoOver();
  1243. },
  1244. /**
  1245. * @param {Object}
  1246. * 案例多选确认
  1247. */
  1248. checkboxSubmitChild(questionIndex, ansIndex) {
  1249. if (this.questionList[questionIndex].ques[ansIndex]) return;
  1250. let arr = [];
  1251. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1252. (item) => {
  1253. if (item.checked) {
  1254. arr.push(item.optionsId);
  1255. }
  1256. }
  1257. );
  1258. if (!arr.length) {
  1259. this.$message({
  1260. type: "warning",
  1261. message: "请选择答案",
  1262. });
  1263. return;
  1264. }
  1265. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1266. this.isDoOver();
  1267. },
  1268. /**
  1269. * 判断点击确认
  1270. */
  1271. judgeSelect(question, questionIndex, index) {
  1272. if (question.ques) return;
  1273. this.$set(
  1274. this.questionList[questionIndex],
  1275. "ques",
  1276. index == 0 ? "1" : "0"
  1277. );
  1278. this.isDoOver();
  1279. },
  1280. judgeSelectChild(questionIndex, jsonIndex, index) {
  1281. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  1282. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1283. this.$set(
  1284. this.questionList[questionIndex].ques,
  1285. jsonIndex,
  1286. index == 0 ? "1" : "0"
  1287. );
  1288. this.isDoOver();
  1289. },
  1290. /**
  1291. * 上传图片
  1292. */
  1293. uploadImg(e, question, questionIndex) {
  1294. var file = e.target.files[0];
  1295. if (file.size > 2 * 1024 * 1024) {
  1296. this.$message.warn("图片不得大于2000kb");
  1297. return;
  1298. }
  1299. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1300. if (
  1301. type[0] != "jpg" &&
  1302. type[0] != "png" &&
  1303. type[0] != "jpeg" &&
  1304. type[0] != "gif"
  1305. ) {
  1306. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1307. e.target.value = "";
  1308. return;
  1309. }
  1310. this.$upload.upload(file, 0).then((res) => {
  1311. question.ansText.imageList.push(res);
  1312. });
  1313. },
  1314. /**
  1315. * 案例上传图片
  1316. */
  1317. uploadImgChild(e, questionIndex, jsonIndex) {
  1318. var file = e.target.files[0];
  1319. if (file.size > 2 * 1024 * 1024) {
  1320. this.$message.warn("图片不得大于2000kb");
  1321. return;
  1322. }
  1323. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1324. if (
  1325. type[0] != "jpg" &&
  1326. type[0] != "png" &&
  1327. type[0] != "jpeg" &&
  1328. type[0] != "gif"
  1329. ) {
  1330. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1331. e.target.value = "";
  1332. return;
  1333. }
  1334. this.$upload.upload(file, 0).then((res) => {
  1335. this.questionList[questionIndex].jsonStr[
  1336. jsonIndex
  1337. ].ansText.imageList.push(res);
  1338. });
  1339. },
  1340. /**
  1341. * @param {Object} current
  1342. * 获取收藏信息
  1343. */
  1344. getCollectInfo(current) {
  1345. this.$request
  1346. .getCollectInfo({
  1347. examId: this.examId,
  1348. questionId: this.questionList[current].questionId,
  1349. goodsId: this.goodsId,
  1350. orderGoodsId: this.orderGoodsId,
  1351. })
  1352. .then((res) => {
  1353. this.$set(this.collectList, current, res.data);
  1354. })
  1355. .catch((err) => {
  1356. this.$set(this.collectList, current, false);
  1357. });
  1358. },
  1359. isOver(item, index) {
  1360. if (this.questionList[index].ques) {
  1361. if (item.type == 4) {
  1362. //案例题
  1363. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1364. if (
  1365. jsonItem.type == 1 ||
  1366. jsonItem.type == 2 ||
  1367. jsonItem.type == 3
  1368. ) {
  1369. if (item.ques[indexs]) {
  1370. return true;
  1371. } else {
  1372. return false;
  1373. }
  1374. } else if (jsonItem.type == 5) {
  1375. if (
  1376. item.ques[indexs] &&
  1377. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1378. ) {
  1379. console.log("chil");
  1380. return true;
  1381. } else {
  1382. return false;
  1383. }
  1384. }
  1385. });
  1386. if (isOver) {
  1387. return true;
  1388. } else {
  1389. return false;
  1390. }
  1391. } else if (item.type == 5) {
  1392. //简答题
  1393. //每一项都相等
  1394. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1395. return true;
  1396. }
  1397. //判断
  1398. } else {
  1399. return false;
  1400. }
  1401. } else {
  1402. return false;
  1403. }
  1404. },
  1405. ansSubmit(question, questionIndex) {
  1406. if (!question.ansText.text && !question.ansText.imageList.length) {
  1407. this.$message({
  1408. type: "warning",
  1409. message: "请输入内容或上传图片",
  1410. });
  1411. return;
  1412. }
  1413. question.ques.imageList = question.ansText.imageList;
  1414. question.ques.text = question.ansText.text;
  1415. this.isDoOver();
  1416. console.log(question.ques);
  1417. },
  1418. ansSubmitChild(question, questionIndex, jsonIndex) {
  1419. if (
  1420. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1421. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1422. .length
  1423. ) {
  1424. this.$message({
  1425. type: "warning",
  1426. message: "请输入内容或上传图片",
  1427. });
  1428. return;
  1429. }
  1430. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1431. imageList:
  1432. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1433. .imageList || [],
  1434. text:
  1435. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  1436. "",
  1437. });
  1438. this.isDoOver();
  1439. },
  1440. changeIndex(index) {
  1441. this.current = index;
  1442. this.getCollectInfo(this.current);
  1443. },
  1444. nextQuestion() {
  1445. if (this.current >= this.questionList.length - 1) {
  1446. this.$message({
  1447. type: "warning",
  1448. message: "已经是最后一题了!",
  1449. });
  1450. return;
  1451. }
  1452. this.current++;
  1453. this.getCollectInfo(this.current);
  1454. },
  1455. prevQuestion() {
  1456. if (this.current == 0) {
  1457. this.$message({
  1458. type: "warning",
  1459. message: "已经是第一题了!",
  1460. });
  1461. return;
  1462. } else {
  1463. this.current--;
  1464. this.getCollectInfo(this.current);
  1465. }
  1466. },
  1467. isRight(item, index) {
  1468. //单选
  1469. if (this.questionList[index].ques) {
  1470. if (item.type == 1) {
  1471. console.log(
  1472. this.questionList[index].ques == this.questionList[index].ans
  1473. );
  1474. return this.questionList[index].ques == this.questionList[index].ans;
  1475. //多选
  1476. } else if (item.type == 2) {
  1477. //每一项都相等
  1478. return this.questionList[index].ans.every((item, i) => {
  1479. return item == this.questionList[index].ques[i];
  1480. });
  1481. //判断
  1482. } else if (item.type == 3) {
  1483. return this.questionList[index].ques == this.questionList[index].ans;
  1484. } else {
  1485. return false;
  1486. }
  1487. } else {
  1488. return false;
  1489. }
  1490. },
  1491. isWrong(item, index) {
  1492. if (this.questionList[index].ques) {
  1493. //单选
  1494. if (item.type == 1) {
  1495. return this.questionList[index].ques != this.questionList[index].ans;
  1496. //多选
  1497. } else if (item.type == 2) {
  1498. //每一项都相等
  1499. return this.questionList[index].ques.some((item, i) => {
  1500. return this.questionList[index].ans.indexOf(item) == -1;
  1501. });
  1502. //判断
  1503. } else if (item.type == 3) {
  1504. return this.questionList[index].ques != this.questionList[index].ans;
  1505. } else {
  1506. return false;
  1507. }
  1508. } else {
  1509. return false;
  1510. }
  1511. },
  1512. isPart(item, index) {
  1513. if (this.questionList[index].ques) {
  1514. if (item.type == 2) {
  1515. let isWrong = this.questionList[index].ques.some((item, i) => {
  1516. return this.questionList[index].ans.indexOf(item) == -1;
  1517. });
  1518. let isRight = this.questionList[index].ans.every((item, i) => {
  1519. return item == this.questionList[index].ques[i];
  1520. });
  1521. if (!isRight && !isWrong) {
  1522. return true;
  1523. }
  1524. }
  1525. } else {
  1526. return false;
  1527. }
  1528. },
  1529. right(bankIndex, ansIndex, option) {
  1530. if (
  1531. this.questionList[bankIndex].ques[ansIndex] &&
  1532. this.questionList[bankIndex].ans[ansIndex]
  1533. ) {
  1534. if (
  1535. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1536. option.optionsId
  1537. ) != -1 ||
  1538. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1539. option.optionsId
  1540. ) != -1
  1541. ) {
  1542. return true;
  1543. } else {
  1544. return false;
  1545. }
  1546. } else {
  1547. return false;
  1548. }
  1549. },
  1550. wrong(bankIndex, ansIndex, option) {
  1551. if (
  1552. this.questionList[bankIndex].ques[ansIndex] &&
  1553. this.questionList[bankIndex].ans[ansIndex]
  1554. ) {
  1555. if (
  1556. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1557. option.optionsId
  1558. ) != -1 &&
  1559. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1560. option.optionsId
  1561. ) == -1
  1562. ) {
  1563. return true;
  1564. } else {
  1565. return false;
  1566. }
  1567. } else {
  1568. return false;
  1569. }
  1570. },
  1571. /**
  1572. * 获取已经回答的题目数
  1573. * hasSpecail (是否包含简答和案例)
  1574. */
  1575. questionOverNum(hasSpecail) {
  1576. let count = 0;
  1577. this.questionList.forEach((item) => {
  1578. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1579. if (item.ques) {
  1580. count++;
  1581. }
  1582. } else if (item.type == 4) {
  1583. //案例题
  1584. if (hasSpecail) {
  1585. let isOver = item.jsonStr.every((jsonItem, index) => {
  1586. if (
  1587. jsonItem.type == 1 ||
  1588. jsonItem.type == 2 ||
  1589. jsonItem.type == 3
  1590. ) {
  1591. if (item.ques[index]) {
  1592. return true;
  1593. } else {
  1594. return false;
  1595. }
  1596. } else if (jsonItem.type == 5) {
  1597. if (
  1598. item.ques[index] &&
  1599. (item.ques[index].text || item.ques[index].imageList.length)
  1600. ) {
  1601. return true;
  1602. } else {
  1603. return false;
  1604. }
  1605. }
  1606. });
  1607. if (isOver) {
  1608. count++;
  1609. console.log(item, 444);
  1610. }
  1611. }
  1612. } else if (item.type == 5) {
  1613. //简答题
  1614. if (hasSpecail) {
  1615. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1616. console.log(5, item);
  1617. count++;
  1618. }
  1619. }
  1620. }
  1621. });
  1622. return count;
  1623. },
  1624. collect(state, index) {
  1625. if (!state) {
  1626. this.$request
  1627. .collectQuestion({
  1628. examId: this.examId,
  1629. questionId: this.questionList[index].questionId,
  1630. goodsId: this.goodsId || "",
  1631. orderGoodsId: this.orderGoodsId,
  1632. })
  1633. .then((res) => {
  1634. this.$set(this.collectList, index, true);
  1635. this.$message.success("收藏成功");
  1636. this.getCollectInfo(index);
  1637. });
  1638. } else {
  1639. this.$request
  1640. .deleteCollectQuestion(this.collectList[index].collectQuestionId)
  1641. .then((res) => {
  1642. this.$set(this.collectList, index, false);
  1643. this.$message.success("取消收藏成功");
  1644. });
  1645. }
  1646. return;
  1647. },
  1648. submit() {
  1649. let ansCount = this.questionOverNum(true); //已答题数
  1650. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1651. //没有答完
  1652. if (this.lastCount !== 0) {
  1653. this.$confirm(
  1654. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1655. "提示",
  1656. {
  1657. confirmButtonText: "立即交卷",
  1658. cancelButtonText: "继续做题",
  1659. closeOnClickModal: false,
  1660. closeOnPressEscape: false,
  1661. distinguishCancelAndClose: false,
  1662. showClose: false,
  1663. }
  1664. )
  1665. .then((_) => {
  1666. this.examSubmit();
  1667. })
  1668. .catch((_) => {});
  1669. return;
  1670. }
  1671. this.examSubmit();
  1672. },
  1673. examSubmit() {
  1674. clearInterval(this.postTimer);
  1675. this.loading = true;
  1676. let score = 0; //计算总分
  1677. let reportStatus = 0;
  1678. let number = 0; //做对的题目数量
  1679. let doQuestionNum = 0; //做过的题目数量
  1680. let allScore = 0; //总分
  1681. let passScore = 0;
  1682. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1683. let doQuestionIds = []; //做过的题目id
  1684. let rightQuestionIds = []; //做对的题目id
  1685. let lessQuestionNum = 0;
  1686. this.questionList.forEach((item, index) => {
  1687. passScore = item.passScore;
  1688. if (item.type == 1) {
  1689. //正确
  1690. if (item.ques == item.ans) {
  1691. item.scoreResult = item.score;
  1692. score += item.score;
  1693. number++;
  1694. rightQuestionIds.push(item.questionId);
  1695. } else {
  1696. //错误
  1697. item.scoreResult = 0;
  1698. if (item.ques) {
  1699. doWrongQuestionIds.push(item.questionId);
  1700. }
  1701. }
  1702. allScore += item.score;
  1703. if (item.ques) {
  1704. console.log(doQuestionNum, "单选");
  1705. doQuestionNum++;
  1706. doQuestionIds.push(item.questionId);
  1707. }
  1708. } else if (item.type == 2) {
  1709. let isRight =
  1710. item.ans &&
  1711. item.ans.every((quesItem, quesIndex) => {
  1712. if (item.ques) {
  1713. return item.ques[quesIndex] == item.ans[quesIndex];
  1714. } else {
  1715. return false;
  1716. }
  1717. });
  1718. if (isRight) {
  1719. score += item.score;
  1720. number++;
  1721. item.scoreResult = item.score;
  1722. rightQuestionIds.push(item.questionId);
  1723. } else {
  1724. let hasPart = false;
  1725. let checkboxScore = 1; //获取单题总分数
  1726. item.ques &&
  1727. item.ques.forEach((ques, quesIndex) => {
  1728. //选错一个全扣
  1729. if (item.ques) {
  1730. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1731. checkboxScore = 0;
  1732. }
  1733. } else {
  1734. checkboxScore = 0;
  1735. }
  1736. });
  1737. console.log(checkboxScore);
  1738. //没选错
  1739. if (checkboxScore) {
  1740. checkboxScore = 0;
  1741. item.ans.forEach((ans, quesIndex) => {
  1742. //漏选扣一部分,对n题给n X partScore 分
  1743. if (item.ques) {
  1744. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1745. checkboxScore += item.partScore;
  1746. hasPart = true;
  1747. }
  1748. } else {
  1749. checkboxScore = 0;
  1750. }
  1751. });
  1752. }
  1753. if (!hasPart) {
  1754. //0分
  1755. item.scoreResult = 0;
  1756. if (item.ques) {
  1757. doWrongQuestionIds.push(item.questionId);
  1758. }
  1759. } else {
  1760. //部分分
  1761. // number++;
  1762. lessQuestionNum++;
  1763. // doWrongQuestionIds.push(item.questionId);
  1764. item.scoreResult = checkboxScore;
  1765. score += checkboxScore;
  1766. // rightQuestionIds.push(item.questionId)
  1767. }
  1768. }
  1769. allScore += item.score;
  1770. if (item.ques && item.ques.length) {
  1771. console.log(doQuestionNum, "多选");
  1772. doQuestionNum++;
  1773. doQuestionIds.push(item.questionId);
  1774. }
  1775. } else if (item.type == 3) {
  1776. if (item.ques == item.ans) {
  1777. item.scoreResult = item.score;
  1778. score += item.score;
  1779. number++;
  1780. rightQuestionIds.push(item.questionId);
  1781. } else {
  1782. item.scoreResult = 0;
  1783. if (item.ques) {
  1784. doWrongQuestionIds.push(item.questionId);
  1785. }
  1786. }
  1787. allScore += item.score;
  1788. if (item.ques) {
  1789. console.log(doQuestionNum, "判断");
  1790. doQuestionNum++;
  1791. doQuestionIds.push(item.questionId);
  1792. }
  1793. } else if (item.type == 4) {
  1794. allScore += item.score;
  1795. if (item.ques && item.ques.length) {
  1796. console.log(doQuestionNum, "案例");
  1797. doQuestionNum++;
  1798. doQuestionIds.push(item.questionId);
  1799. }
  1800. } else if (item.type == 5) {
  1801. allScore += item.score;
  1802. if (
  1803. item.ques &&
  1804. (item.ques.imageList.length || item.ques.text.length)
  1805. ) {
  1806. console.log(doQuestionNum, "简答");
  1807. doQuestionNum++;
  1808. doQuestionIds.push(item.questionId);
  1809. }
  1810. }
  1811. });
  1812. //大于分及格
  1813. if (score >= passScore) {
  1814. reportStatus = 1;
  1815. } else {
  1816. reportStatus = 0;
  1817. }
  1818. //交卷
  1819. this.$request
  1820. .examRecordEdit({
  1821. orderGoodsId: this.orderGoodsId,
  1822. examId: this.examId,
  1823. goodsId: this.goodsId,
  1824. reportStatus: reportStatus,
  1825. totalScore: allScore,
  1826. recordId: this.recordId,
  1827. lessQuestionNum: lessQuestionNum,
  1828. rightQuestionNum: number,
  1829. status: 1,
  1830. moduleExamId: this.moduleId || 0,
  1831. chapterExamId: this.chapterId || 0,
  1832. doQuestionIds: doQuestionIds.join(","),
  1833. rightQuestionIds: rightQuestionIds.join(","),
  1834. doQuestionNum: doQuestionNum,
  1835. performance: score,
  1836. historyExamJson: JSON.stringify(this.questionList),
  1837. })
  1838. .then((res) => {
  1839. this.isSubmit = true;
  1840. this.loading = false;
  1841. this.$message({
  1842. type: "success",
  1843. message: "交卷成功",
  1844. });
  1845. setTimeout(() => {
  1846. let result = {
  1847. orderGoodsId: this.orderGoodsId,
  1848. chapterId: this.chapterId,
  1849. moduleId: this.moduleId,
  1850. examId: this.examId,
  1851. recordId: this.recordId,
  1852. };
  1853. console.log(result);
  1854. this.setExamResult(result);
  1855. this.$router.replace({
  1856. path: "/bank-report/" + this.goodsId,
  1857. query: {
  1858. orderGoodsId: this.orderGoodsId,
  1859. chapterId: this.chapterId,
  1860. moduleId: this.moduleId,
  1861. examId: this.examId,
  1862. recordId: this.recordId,
  1863. },
  1864. });
  1865. }, 1000);
  1866. })
  1867. .catch((err) => {
  1868. this.loading = false;
  1869. console.log(err, "err");
  1870. });
  1871. //错题集id提交(客观题)
  1872. this.$request
  1873. .examWrongRecord({
  1874. orderGoodsId: this.orderGoodsId,
  1875. examId: this.examId,
  1876. goodsId: this.goodsId,
  1877. questionIds: doWrongQuestionIds,
  1878. recordId: this.recordId,
  1879. type: 1,
  1880. })
  1881. .then((res) => {})
  1882. .catch((err) => {});
  1883. },
  1884. /**
  1885. * 离开页面统计回答正确题数
  1886. */
  1887. examRecordEdit() {
  1888. let number = 0;
  1889. let score = 0;
  1890. let doQuestionNum = 0;
  1891. let doQuestionIds = []; //做过的题目id
  1892. let lessQuestionNum = 0;
  1893. this.questionList.forEach((item, index) => {
  1894. if (item.type == 1) {
  1895. if (item.ques == item.ans) {
  1896. score += item.score;
  1897. number++;
  1898. }
  1899. if (item.ques) {
  1900. doQuestionNum++;
  1901. doQuestionIds.push(item.questionId);
  1902. }
  1903. } else if (item.type == 2) {
  1904. let isRight =
  1905. item.ans &&
  1906. item.ans.every((quesItem, quesIndex) => {
  1907. if (item.ques) {
  1908. return item.ques[quesIndex] == item.ans[quesIndex];
  1909. } else {
  1910. return false;
  1911. }
  1912. });
  1913. if (isRight) {
  1914. score += item.score;
  1915. number++;
  1916. } else {
  1917. let hasPart = false;
  1918. let checkboxScore = 1; //获取单题总分数
  1919. item.ques &&
  1920. item.ques.forEach((ques, quesIndex) => {
  1921. //选错一个全扣
  1922. if (item.ques) {
  1923. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1924. checkboxScore = 0;
  1925. }
  1926. } else {
  1927. checkboxScore = 0;
  1928. }
  1929. });
  1930. console.log(checkboxScore);
  1931. //没选错
  1932. if (checkboxScore) {
  1933. checkboxScore = 0;
  1934. item.ans.forEach((ans, quesIndex) => {
  1935. //漏选扣一部分,对n题给n X partScore 分
  1936. if (item.ques) {
  1937. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1938. checkboxScore += item.partScore;
  1939. hasPart = true;
  1940. }
  1941. } else {
  1942. checkboxScore = 0;
  1943. }
  1944. });
  1945. }
  1946. if (!hasPart) {
  1947. //0分
  1948. } else {
  1949. //部分分
  1950. // number++;
  1951. lessQuestionNum++;
  1952. score += checkboxScore;
  1953. }
  1954. }
  1955. if (item.ques && item.ques.length) {
  1956. doQuestionNum++;
  1957. doQuestionIds.push(item.questionId);
  1958. }
  1959. } else if (item.type == 3) {
  1960. if (item.ques == item.ans) {
  1961. score += item.score;
  1962. number++;
  1963. }
  1964. if (item.ques) {
  1965. doQuestionNum++;
  1966. doQuestionIds.push(item.questionId);
  1967. }
  1968. } else if (item == 4) {
  1969. if (item.ques.length) {
  1970. doQuestionNum++;
  1971. doQuestionIds.push(item.questionId);
  1972. }
  1973. } else if (item.type == 5) {
  1974. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1975. doQuestionNum++;
  1976. doQuestionIds.push(item.questionId);
  1977. }
  1978. }
  1979. });
  1980. this.$request
  1981. .examRecordEdit({
  1982. examId: this.examId,
  1983. goodsId: this.goodsId,
  1984. recordId: this.recordId,
  1985. orderGoodsId: this.orderGoodsId,
  1986. doQuestionIds: doQuestionIds.join(","),
  1987. rightQuestionNum: number,
  1988. lessQuestionNum: lessQuestionNum,
  1989. moduleExamId: this.moduleId || 0,
  1990. chapterExamId: this.chapterId || 0,
  1991. status: 0,
  1992. doQuestionNum: doQuestionNum,
  1993. historyExamJson: JSON.stringify(this.questionList),
  1994. })
  1995. .then((res) => {});
  1996. },
  1997. },
  1998. };
  1999. </script>
  2000. <!-- Add "scoped" attribute to limit CSS to this component only -->
  2001. <style scoped lang="scss">
  2002. .course-exam {
  2003. .section {
  2004. overflow: hidden;
  2005. &__header {
  2006. height: 20px;
  2007. margin-top: 20px;
  2008. }
  2009. &__body {
  2010. .explain-record {
  2011. &__header {
  2012. }
  2013. &__body {
  2014. margin-bottom: 20px;
  2015. border: 1px solid #eee;
  2016. .left-box {
  2017. float: left;
  2018. width: 970px;
  2019. min-height: 630px;
  2020. border: 1px solid #eee;
  2021. &__header {
  2022. height: 40px;
  2023. padding-left: 12px;
  2024. border-bottom: 1px solid #eeeeee;
  2025. display: flex;
  2026. align-items: center;
  2027. .progress {
  2028. width: 636px;
  2029. }
  2030. .text {
  2031. margin-left: 15px;
  2032. font-size: 16px;
  2033. span {
  2034. font-family: Microsoft YaHei;
  2035. font-weight: bold;
  2036. color: #3f8dfd;
  2037. line-height: 24px;
  2038. }
  2039. }
  2040. }
  2041. &__body {
  2042. .question {
  2043. padding: 12px 0 0 12px;
  2044. display: flex;
  2045. flex-direction: column;
  2046. height: 100%;
  2047. &__title {
  2048. padding-left: 12px;
  2049. font-size: 16px;
  2050. font-family: Microsoft YaHei;
  2051. font-weight: bold;
  2052. color: #333333;
  2053. line-height: 24px;
  2054. }
  2055. &__desc {
  2056. padding-left: 12px;
  2057. margin-top: 20px;
  2058. font-size: 16px;
  2059. font-family: Microsoft YaHei;
  2060. font-weight: 400;
  2061. color: #666666;
  2062. line-height: 24px;
  2063. /deep/ img {
  2064. max-width: 100% !important;
  2065. }
  2066. }
  2067. &__content {
  2068. /deep/ .el-tabs__item {
  2069. height: 40px;
  2070. line-height: 40px;
  2071. }
  2072. .question__content {
  2073. height: auto;
  2074. overflow: auto;
  2075. }
  2076. .question-list {
  2077. padding: 24px 0 0 24px;
  2078. .checkbox,
  2079. .radio {
  2080. cursor: pointer;
  2081. margin-right: 24px;
  2082. padding: 0 24px;
  2083. display: flex;
  2084. align-items: center;
  2085. margin-top: 2px;
  2086. min-height: 40px;
  2087. padding-top: 10px;
  2088. padding-bottom: 10px;
  2089. background: #f5f9ff;
  2090. border-radius: 8px;
  2091. box-sizing: border-box;
  2092. &.right {
  2093. background: #37c65b;
  2094. }
  2095. &.wrong {
  2096. background: #ff3a30;
  2097. }
  2098. }
  2099. &.textarea {
  2100. margin-right: 12px;
  2101. .upload {
  2102. margin-top: 10px;
  2103. &__imgs {
  2104. margin-right: 10px;
  2105. width: 80px;
  2106. height: 80px;
  2107. background: #ffffff;
  2108. border: 1px solid #eeeeee;
  2109. border-radius: 4px;
  2110. position: relative;
  2111. display: flex;
  2112. float: left;
  2113. align-items: center;
  2114. justify-content: center;
  2115. img {
  2116. max-width: 100%;
  2117. max-height: 100%;
  2118. }
  2119. }
  2120. &__btn {
  2121. margin-right: 10px;
  2122. width: 80px;
  2123. height: 80px;
  2124. background: #ffffff;
  2125. border: 1px solid #eeeeee;
  2126. border-radius: 4px;
  2127. position: relative;
  2128. display: flex;
  2129. float: left;
  2130. align-items: center;
  2131. justify-content: center;
  2132. flex-direction: column;
  2133. .icon {
  2134. font-size: 20px;
  2135. color: #3f8dfd;
  2136. }
  2137. p {
  2138. font-size: 12px;
  2139. font-family: Microsoft YaHei;
  2140. font-weight: 400;
  2141. color: #999999;
  2142. line-height: 24px;
  2143. }
  2144. input {
  2145. position: absolute;
  2146. left: 0;
  2147. top: 0;
  2148. display: block;
  2149. width: 100%;
  2150. height: 100%;
  2151. opacity: 0;
  2152. }
  2153. }
  2154. }
  2155. }
  2156. /deep/
  2157. .el-checkbox__input.is-checked
  2158. + .el-checkbox__label {
  2159. color: #000 !important;
  2160. }
  2161. /deep/
  2162. .el-checkbox__input.is-disabled
  2163. + span.el-checkbox__label {
  2164. color: #000;
  2165. }
  2166. /deep/ .el-checkbox {
  2167. white-space: normal;
  2168. }
  2169. }
  2170. .answer-list {
  2171. height: 40px;
  2172. border-top: 1px solid #eee;
  2173. border-bottom: 1px solid #eee;
  2174. margin-top: 24px;
  2175. display: flex;
  2176. align-items: center;
  2177. justify-content: space-between;
  2178. padding: 0 24px;
  2179. &__left {
  2180. font-size: 16px;
  2181. font-family: Microsoft YaHei;
  2182. font-weight: 400;
  2183. color: #333333;
  2184. line-height: 24px;
  2185. }
  2186. &__right {
  2187. font-size: 16px;
  2188. font-family: Microsoft YaHei;
  2189. font-weight: 400;
  2190. color: #333333;
  2191. line-height: 24px;
  2192. }
  2193. }
  2194. .explain-list {
  2195. padding: 12px 24px;
  2196. &__header {
  2197. font-size: 16px;
  2198. font-family: Microsoft YaHei;
  2199. font-weight: bold;
  2200. color: #666666;
  2201. line-height: 24px;
  2202. }
  2203. &__body {
  2204. margin-top: 12px;
  2205. font-size: 16px;
  2206. font-family: Microsoft YaHei;
  2207. font-weight: 400;
  2208. color: #666666;
  2209. line-height: 24px;
  2210. }
  2211. .upload {
  2212. margin-top: 10px;
  2213. &__imgs {
  2214. margin-right: 10px;
  2215. width: 80px;
  2216. height: 80px;
  2217. background: #ffffff;
  2218. border: 1px solid #eeeeee;
  2219. border-radius: 4px;
  2220. position: relative;
  2221. display: flex;
  2222. float: left;
  2223. align-items: center;
  2224. justify-content: center;
  2225. img {
  2226. max-width: 100%;
  2227. max-height: 100%;
  2228. }
  2229. }
  2230. }
  2231. }
  2232. }
  2233. &__btns {
  2234. position: relative;
  2235. height: 32px;
  2236. .submit {
  2237. cursor: pointer;
  2238. margin: 0 auto;
  2239. width: 140px;
  2240. height: 32px;
  2241. color: #fff;
  2242. background: #3f8dfd;
  2243. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2244. border-radius: 16px;
  2245. text-align: center;
  2246. line-height: 32px;
  2247. font-size: 16px;
  2248. }
  2249. .collect {
  2250. width: 100px;
  2251. cursor: pointer;
  2252. position: absolute;
  2253. right: 0;
  2254. top: 5px;
  2255. font-size: 12px;
  2256. font-family: Microsoft YaHei;
  2257. font-weight: 400;
  2258. color: #3f8dfd;
  2259. line-height: 24px;
  2260. i {
  2261. font-size: 20px;
  2262. }
  2263. }
  2264. }
  2265. }
  2266. }
  2267. &__footer {
  2268. height: 40px;
  2269. display: flex;
  2270. justify-content: space-around;
  2271. align-items: center;
  2272. .btn {
  2273. cursor: pointer;
  2274. width: 140px;
  2275. height: 32px;
  2276. background: #ffffff;
  2277. border: 1px solid #3f8dfd;
  2278. border-radius: 16px;
  2279. line-height: 32px;
  2280. text-align: center;
  2281. color: #3f8dfd;
  2282. }
  2283. }
  2284. }
  2285. .right-box {
  2286. float: right;
  2287. width: 299px;
  2288. border-right: 1px solid #eee;
  2289. &__header {
  2290. height: 40px;
  2291. line-height: 40px;
  2292. font-size: 16px;
  2293. font-family: Microsoft YaHei;
  2294. font-weight: bold;
  2295. color: #333333;
  2296. text-align: center;
  2297. border-bottom: 1px solid #eeeeee;
  2298. .back-btn {
  2299. display: block;
  2300. margin: 0 auto;
  2301. width: 160px;
  2302. }
  2303. }
  2304. &__body {
  2305. height: 510px;
  2306. border-bottom: 1px solid #eee;
  2307. .card {
  2308. &__note {
  2309. display: flex;
  2310. height: 64px;
  2311. align-items: center;
  2312. border-bottom: 1px solid #eee;
  2313. flex-wrap: wrap;
  2314. .item {
  2315. display: flex;
  2316. align-items: center;
  2317. margin-left: 10px;
  2318. width: 84px;
  2319. font-size: 12px;
  2320. .box {
  2321. margin-right: 5px;
  2322. width: 16px;
  2323. height: 16px;
  2324. border-radius: 4px;
  2325. &.white {
  2326. background: #ffffff;
  2327. border: 1px solid #eeeeee;
  2328. }
  2329. &.green {
  2330. background: #37c65b;
  2331. }
  2332. &.red {
  2333. background: #ff3a30;
  2334. }
  2335. &.yellow {
  2336. background: #ffc53d;
  2337. }
  2338. &.blue {
  2339. background: #3f8dfd;
  2340. }
  2341. }
  2342. }
  2343. }
  2344. &__content {
  2345. height: 440px;
  2346. overflow-y: scroll;
  2347. &::-webkit-scrollbar {
  2348. width: 6px;
  2349. }
  2350. &::-webkit-scrollbar-track {
  2351. background-color: #fff;
  2352. -webkit-border-radius: 2em;
  2353. -moz-border-radius: 2em;
  2354. border-radius: 2em;
  2355. }
  2356. &::-webkit-scrollbar-thumb {
  2357. background-color: #eeeeee;
  2358. -webkit-border-radius: 2em;
  2359. -moz-border-radius: 2em;
  2360. border-radius: 2em;
  2361. }
  2362. .list {
  2363. display: flex;
  2364. flex-wrap: wrap;
  2365. .item {
  2366. width: 40px;
  2367. height: 40px;
  2368. border-radius: 10px;
  2369. text-align: center;
  2370. line-height: 40px;
  2371. margin-left: 16px;
  2372. margin-top: 16px;
  2373. cursor: pointer;
  2374. &.white {
  2375. line-height: 38px;
  2376. color: #333333;
  2377. background: #ffffff;
  2378. border: 1px solid #eeeeee;
  2379. }
  2380. &.green {
  2381. color: #fff;
  2382. background: #37c65b;
  2383. }
  2384. &.red {
  2385. color: #fff;
  2386. background: #ff3a30;
  2387. }
  2388. &.blue {
  2389. border: 1rpx solid #eeeeee;
  2390. color: #fff;
  2391. background: #3f8dfd;
  2392. }
  2393. &.yellow {
  2394. background: #ffc53d;
  2395. }
  2396. &.disabled {
  2397. cursor: not-allowed;
  2398. line-height: 38px;
  2399. color: #eeeeee;
  2400. background: #ffffff;
  2401. border: 1px solid #eeeeee;
  2402. }
  2403. }
  2404. }
  2405. }
  2406. }
  2407. }
  2408. &__footer {
  2409. border-bottom: 1px solid #eee;
  2410. height: 40px;
  2411. display: flex;
  2412. align-items: center;
  2413. justify-content: center;
  2414. .submit {
  2415. cursor: pointer;
  2416. width: 140px;
  2417. height: 32px;
  2418. padding: 0;
  2419. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2420. border-radius: 16px;
  2421. line-height: 32px;
  2422. text-align: center;
  2423. font-size: 16px;
  2424. }
  2425. }
  2426. }
  2427. }
  2428. }
  2429. }
  2430. }
  2431. .take-photo {
  2432. /deep/ .el-dialog__header {
  2433. display: none;
  2434. }
  2435. /deep/ .el-dialog__body {
  2436. padding: 0;
  2437. overflow: unset;
  2438. }
  2439. &__close {
  2440. cursor: pointer;
  2441. position: absolute;
  2442. right: 0;
  2443. top: -28px;
  2444. width: 24px;
  2445. height: 24px;
  2446. line-height: 24px;
  2447. text-align: center;
  2448. color: #eee;
  2449. border: 1px solid #eee;
  2450. border-radius: 50%;
  2451. }
  2452. &__header {
  2453. height: 40px;
  2454. border-bottom: 1px solid #eee;
  2455. line-height: 40px;
  2456. font-size: 16px;
  2457. font-family: Microsoft YaHei;
  2458. font-weight: bold;
  2459. color: #333333;
  2460. padding-left: 24px;
  2461. }
  2462. &__body {
  2463. height: 400px;
  2464. padding: 40px 24px;
  2465. .left-box {
  2466. width: 336px;
  2467. float: left;
  2468. .title {
  2469. font-size: 16px;
  2470. font-family: Microsoft YaHei;
  2471. font-weight: bold;
  2472. color: #ff3b30;
  2473. line-height: 24px;
  2474. }
  2475. .content {
  2476. font-size: 14px;
  2477. font-family: Microsoft YaHei;
  2478. font-weight: 400;
  2479. color: #333333;
  2480. line-height: 28px;
  2481. margin-top: 32px;
  2482. }
  2483. }
  2484. .right-box {
  2485. float: right;
  2486. width: 400px;
  2487. height: 300px;
  2488. video {
  2489. width: 100%;
  2490. height: 100%;
  2491. }
  2492. }
  2493. }
  2494. &__footer {
  2495. height: 90px;
  2496. border-top: 1px solid #eee;
  2497. text-align: center;
  2498. .take {
  2499. display: inline-block;
  2500. width: 200px;
  2501. height: 40px;
  2502. padding: 0;
  2503. border-radius: 20px;
  2504. text-align: center;
  2505. line-height: 40px;
  2506. margin: 24px auto;
  2507. }
  2508. }
  2509. }
  2510. }
  2511. </style>