questionBankAllExplain.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282
  1. <template>
  2. <view class="questionBank">
  3. <nav-bar title="全部解析"></nav-bar>
  4. <swiper
  5. class="swiper"
  6. :current="current"
  7. @change="swiperChange"
  8. :interval="interval"
  9. >
  10. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  11. <view class="pageContent">
  12. <view class="pad_8 titBox">
  13. <view class="firstLetter">
  14. <view class="leftLetters">
  15. <view class="btnType">
  16. <text v-if="bank.type == 1">单选</text>
  17. <text v-if="bank.type == 2">多选</text>
  18. <text v-if="bank.type == 3">判断</text>
  19. <text v-if="bank.type == 4">案例</text>
  20. <text v-if="bank.type == 5">简答</text>
  21. </view>
  22. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  23. </view>
  24. <view style="color: #666; font-size: 28rpx"></view>
  25. <view class="leftLetters"></view>
  26. </view>
  27. <view class="titles"
  28. ><rich-text :nodes="bank.content"></rich-text
  29. ></view>
  30. </view>
  31. <template v-if="bank.type == 1">
  32. <view class="pad_8 titBox no-margin">
  33. <view v-if="!bank.ques">
  34. <view
  35. v-for="(item, index) in bank.jsonStr"
  36. :key="index"
  37. class="lisSty"
  38. >
  39. <view class="activeTI">{{ ast[index] }}</view>
  40. <view class="flex_auto">
  41. {{ item.content }}
  42. <view v-if="item.imgUrl">
  43. <image
  44. style="width: 600rpx"
  45. mode="widthFix"
  46. :src="$method.splitImgHost(item.imgUrl)"
  47. ></image>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view v-if="bank.ques">
  53. <view
  54. v-for="(item, index) in bank.jsonStr"
  55. :key="index"
  56. class="lisSty"
  57. >
  58. <text
  59. :class="{
  60. right:
  61. item.optionsId == bank.ques ||
  62. item.optionsId == bank.ans,
  63. wrong:
  64. item.optionsId == bank.ques && bank.ques != bank.ans,
  65. }"
  66. class="activeTI"
  67. >{{ ast[index] }}</text
  68. >
  69. <view class="flex_auto">
  70. {{ item.content }}
  71. <view v-if="item.imgUrl">
  72. <image
  73. style="width: 600rpx"
  74. mode="widthFix"
  75. :src="$method.splitImgHost(item.imgUrl)"
  76. ></image>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view>
  83. <view class="pad_8 answer">
  84. <view>正确答案:{{ ast[bank.ans - 1] }}</view>
  85. <view>我的答案:{{ ast[bank.ques - 1] || "" }}</view>
  86. </view>
  87. <view class="pad_8 answerInfos">
  88. <view class="answerTitle">答案解析</view>
  89. <view class="answerContent">
  90. <rich-text :nodes="bank.analysisContent"></rich-text>
  91. </view>
  92. </view>
  93. </view>
  94. </template>
  95. <template v-if="bank.type == 2">
  96. <view class="pad_8 titBox no-margin">
  97. <view v-if="!bank.ques">
  98. <view
  99. v-for="(item, index) in bank.jsonStr"
  100. :key="index"
  101. class="lisSty"
  102. >
  103. <view :class="{ checked: item.checked }" class="activeTI">{{
  104. ast[index]
  105. }}</view>
  106. <view class="flex_auto">
  107. {{ item.content }}
  108. <view v-if="item.imgUrl">
  109. <image
  110. style="width: 600rpx"
  111. mode="widthFix"
  112. :src="$method.splitImgHost(item.imgUrl)"
  113. ></image>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <view v-if="bank.ques">
  119. <view
  120. v-for="(item, index) in bank.jsonStr"
  121. :key="index"
  122. class="lisSty"
  123. >
  124. <text
  125. :class="{
  126. right:
  127. (bank.ques &&
  128. bank.ques.indexOf(item.optionsId) != -1) ||
  129. (bank.ans && bank.ans.indexOf(item.optionsId) != -1),
  130. wrong:
  131. bank.ques &&
  132. bank.ques.indexOf(item.optionsId) != -1 &&
  133. bank.ans &&
  134. bank.ans.indexOf(item.optionsId) == -1,
  135. }"
  136. class="activeTI"
  137. >{{ ast[index] }}</text
  138. >
  139. <view class="flex_auto">
  140. {{ item.content }}
  141. <view v-if="item.imgUrl">
  142. <image
  143. style="width: 600rpx"
  144. mode="widthFix"
  145. :src="$method.splitImgHost(item.imgUrl)"
  146. ></image>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. <view>
  153. <view class="pad_8 answer">
  154. <view
  155. >正确答案:
  156. <text
  157. :key="ansItemIndex"
  158. v-for="(ansItem, ansItemIndex) in bank.ans"
  159. >{{ ast[ansItem - 1] }}</text
  160. >
  161. </view>
  162. <view
  163. >我的答案:
  164. <text
  165. :key="quesItemIndex"
  166. v-for="(quesItem, quesItemIndex) in bank.ques"
  167. >{{ ast[quesItem - 1] }}</text
  168. >
  169. </view>
  170. </view>
  171. <view class="pad_8 answerInfos">
  172. <view class="answerTitle">答案解析</view>
  173. <view class="answerContent">
  174. <rich-text :nodes="bank.analysisContent"></rich-text>
  175. </view>
  176. </view>
  177. </view>
  178. </template>
  179. <template v-if="bank.type == 3">
  180. <view class="pad_8 titBox no-margin">
  181. <view v-if="!bank.ques">
  182. <view
  183. v-for="(item, index) in judge"
  184. :key="index"
  185. class="lisSty"
  186. >
  187. <view class="activeTI">{{ ast[index] }}</view>
  188. <view class="flex_auto">
  189. {{ item }}
  190. <view v-if="item.imgUrl">
  191. <image
  192. style="width: 600rpx"
  193. mode="widthFix"
  194. :src="$method.splitImgHost(item.imgUrl)"
  195. ></image>
  196. </view>
  197. </view>
  198. </view>
  199. </view>
  200. <view v-if="bank.ques">
  201. <view
  202. v-for="(item, index) in judge"
  203. :key="index"
  204. class="lisSty"
  205. >
  206. <text
  207. :class="{
  208. right: index == bank.ques || index == bank.ans,
  209. wrong: index == bank.ques && bank.ques != bank.ans,
  210. }"
  211. class="activeTI"
  212. >{{ ast[index] }}</text
  213. >
  214. <view class="flex_auto">
  215. {{ item }}
  216. <view v-if="item.imgUrl">
  217. <image
  218. style="width: 600rpx"
  219. mode="widthFix"
  220. :src="$method.splitImgHost(item.imgUrl)"
  221. ></image>
  222. </view>
  223. </view>
  224. </view>
  225. </view>
  226. </view>
  227. <view>
  228. <view class="pad_8 answer">
  229. <view>正确答案:{{ ast[bank.ans] }}</view>
  230. <view>我的答案:{{ ast[bank.ques] || "" }}</view>
  231. </view>
  232. <view class="pad_8 answerInfos">
  233. <view class="answerTitle">答案解析</view>
  234. <view class="answerContent">
  235. <rich-text :nodes="bank.analysisContent"></rich-text>
  236. </view>
  237. </view>
  238. </view>
  239. </template>
  240. <!-- 简答题 -->
  241. <template v-if="bank.type == 5">
  242. <view class="pad_8 titBox">
  243. <view class="ans">
  244. <view class="ans_submit answerInfos">
  245. <view class="answerTitle">我的答案:</view>
  246. {{ bank.ques.text || "" }}
  247. <view class="imgs">
  248. <image
  249. class="img"
  250. v-for="(ques, quesIndex) in bank.ques.imageList"
  251. :key="quesIndex"
  252. :src="$method.splitImgHost(ques, true)"
  253. ></image>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. <view>
  259. <view class="pad_8 answerInfos">
  260. <view class="answerTitle">答案解析:</view>
  261. <view class="answerContent">
  262. <rich-text :nodes="bank.analysisContent"></rich-text>
  263. </view>
  264. </view>
  265. </view>
  266. </template>
  267. <!-- 案例题 -->
  268. <template v-if="bank.type == 4">
  269. <view class="tabs">
  270. <view
  271. class="tab"
  272. :class="{ current: tabIndex == bank.current }"
  273. :key="tabIndex"
  274. v-for="(tab, tabIndex) in bank.jsonStr"
  275. @click="tabSelect(tabIndex, bankIndex)"
  276. >
  277. 问题{{ tabIndex + 1 }}
  278. </view>
  279. </view>
  280. <view
  281. v-for="(ansItem, ansIndex) in bank.jsonStr"
  282. v-if="bank.current == ansIndex"
  283. :key="ansIndex"
  284. >
  285. <template v-if="ansItem.type == 1">
  286. <view class="pad_8 titBox">
  287. <view class="leftLetters">
  288. <view class="btnType">
  289. <text>单选</text>
  290. </view>
  291. </view>
  292. <view class="titles">
  293. <rich-text :nodes="ansItem.content"></rich-text>
  294. </view>
  295. <view v-if="!bank.ques[ansIndex]">
  296. <view
  297. v-for="(option, childIndex) in ansItem.optionsList"
  298. :key="childIndex"
  299. class="lisSty"
  300. >
  301. <view class="activeTI">{{ ast[childIndex] }}</view>
  302. <view class="flex_auto">
  303. <rich-text
  304. class="textChild"
  305. :nodes="option.content"
  306. ></rich-text>
  307. <view v-if="item.imgUrl">
  308. <image
  309. style="width: 600rpx"
  310. mode="widthFix"
  311. :src="$method.splitImgHost(item.imgUrl)"
  312. ></image>
  313. </view>
  314. </view>
  315. </view>
  316. </view>
  317. <view v-if="bank.ques[ansIndex]">
  318. <view
  319. v-for="(option, childIndex) in ansItem.optionsList"
  320. :key="childIndex"
  321. class="lisSty"
  322. >
  323. <text
  324. :class="{
  325. right:
  326. option.optionsId == bank.ques[ansIndex] ||
  327. option.optionsId == bank.ans[ansIndex],
  328. wrong:
  329. option.optionsId == bank.ques[ansIndex] &&
  330. bank.ques[ansIndex] != bank.ans[ansIndex],
  331. }"
  332. class="activeTI"
  333. >{{ ast[childIndex] }}</text
  334. >
  335. <view class="flex_auto">
  336. <rich-text :nodes="option.content"></rich-text>
  337. <view v-if="item.imgUrl">
  338. <image
  339. style="width: 600rpx"
  340. mode="widthFix"
  341. :src="$method.splitImgHost(item.imgUrl)"
  342. ></image>
  343. </view>
  344. </view>
  345. </view>
  346. </view>
  347. </view>
  348. <view>
  349. <view class="pad_8 answer">
  350. <view>正确答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  351. <view
  352. >我的答案:{{ ast[bank.ques[ansIndex] - 1] || "" }}</view
  353. >
  354. </view>
  355. <view class="pad_8 answerInfos">
  356. <view class="answerTitle">答案解析</view>
  357. <view class="answerContent">
  358. <rich-text :nodes="option.analysisContent"></rich-text>
  359. </view>
  360. </view>
  361. </view>
  362. </template>
  363. <template v-if="ansItem.type == 2">
  364. <view class="pad_8 titBox">
  365. <view class="leftLetters">
  366. <view class="btnType">
  367. <text>多选</text>
  368. </view>
  369. </view>
  370. <view class="titles">
  371. <rich-text :nodes="ansItem.content"></rich-text>
  372. <view v-if="item.imgUrl">
  373. <image
  374. style="width: 600rpx"
  375. mode="widthFix"
  376. :src="$method.splitImgHost(item.imgUrl)"
  377. ></image>
  378. </view>
  379. </view>
  380. <view v-if="!bank.ques[ansIndex]">
  381. <view
  382. v-for="(option, childindex) in ansItem.optionsList"
  383. :key="childindex"
  384. class="lisSty"
  385. >
  386. <view
  387. :class="{ checked: option.checked }"
  388. class="activeTI"
  389. >{{ ast[childindex] }}</view
  390. >
  391. <view class="flex_auto">
  392. <rich-text :nodes="option.content"></rich-text>
  393. <view v-if="item.imgUrl">
  394. <image
  395. style="width: 600rpx"
  396. mode="widthFix"
  397. :src="$method.splitImgHost(item.imgUrl)"
  398. ></image>
  399. </view>
  400. </view>
  401. </view>
  402. </view>
  403. <view v-if="bank.ques && bank.ques[ansIndex]">
  404. <view
  405. v-for="(option, childindex) in ansItem.optionsList"
  406. :key="childindex"
  407. class="lisSty"
  408. >
  409. <text
  410. :class="{
  411. right: right(bankIndex, ansIndex, option),
  412. wrong: wrong(bankIndex, ansIndex, option),
  413. }"
  414. class="activeTI"
  415. >{{ ast[childindex] }}</text
  416. >
  417. <view class="flex_auto">
  418. <rich-text :nodes="option.content"></rich-text>
  419. </view>
  420. </view>
  421. </view>
  422. </view>
  423. <view>
  424. <view class="pad_8 answer">
  425. <view
  426. >正确答案:
  427. <text
  428. :key="ansItemIndex1"
  429. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  430. >{{ ast[ansItem1 - 1] }}</text
  431. >
  432. </view>
  433. <view
  434. >我的答案:
  435. <text
  436. :key="quesItemIndex"
  437. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  438. >{{ ast[quesItem - 1] }}</text
  439. >
  440. </view>
  441. </view>
  442. <view class="pad_8 answerInfos">
  443. <view class="answerTitle">答案解析</view>
  444. <view class="answerContent">
  445. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  446. </view>
  447. </view>
  448. </view>
  449. </template>
  450. <template v-if="ansItem.type == 3">
  451. <view class="pad_8 titBox">
  452. <view class="leftLetters">
  453. <view class="btnType">
  454. <text>判断</text>
  455. </view>
  456. </view>
  457. <view class="titles">
  458. <rich-text :nodes="ansItem.content"></rich-text>
  459. </view>
  460. <view v-if="!bank.ques[ansIndex]">
  461. <view
  462. v-for="(option, childindex) in judge"
  463. :key="childindex"
  464. class="lisSty"
  465. >
  466. <view class="activeTI">{{ ast[childindex] }}</view>
  467. <view class="flex_auto">
  468. {{ option }}
  469. <view v-if="item.imgUrl">
  470. <image
  471. style="width: 600rpx"
  472. mode="widthFix"
  473. :src="$method.splitImgHost(item.imgUrl)"
  474. ></image>
  475. </view>
  476. </view>
  477. </view>
  478. </view>
  479. <view v-if="bank.ques[ansIndex]">
  480. <view
  481. v-for="(option, childindex) in judge"
  482. :key="childindex"
  483. class="lisSty"
  484. >
  485. <text
  486. :class="{
  487. right:
  488. childindex == bank.ques[ansIndex] ||
  489. childindex == bank.ans[ansIndex],
  490. wrong:
  491. childindex == bank.ques[ansIndex] &&
  492. bank.ques[ansIndex] != bank.ans[ansIndex],
  493. }"
  494. class="activeTI"
  495. >{{ ast[childindex] }}</text
  496. >
  497. <view class="flex_auto">
  498. {{ option }}
  499. <view v-if="item.imgUrl">
  500. <image
  501. style="width: 600rpx"
  502. mode="widthFix"
  503. :src="$method.splitImgHost(item.imgUrl)"
  504. ></image>
  505. </view>
  506. </view>
  507. </view>
  508. </view>
  509. </view>
  510. <view>
  511. <view class="pad_8 answer">
  512. <view>正确答案:{{ ast[bank.ans[ansIndex]] }}</view>
  513. <view>我的答案:{{ ast[bank.ques[ansIndex]] || "" }}</view>
  514. </view>
  515. <view class="pad_8 answerInfos">
  516. <view class="answerTitle">答案解析</view>
  517. <view class="answerContent">
  518. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  519. </view>
  520. </view>
  521. </view>
  522. </template>
  523. <!-- 简答题 -->
  524. <template v-if="ansItem.type == 5">
  525. <view class="pad_8 titBox_title">
  526. <view class="leftLetters">
  527. <view class="btnType">
  528. <text>简答</text>
  529. </view>
  530. </view>
  531. <view class="titles">
  532. <rich-text :nodes="ansItem.content"></rich-text>
  533. </view>
  534. </view>
  535. <view class="pad_8 titBox_title">
  536. <view class="ans">
  537. <view class="ans_submit answerInfos">
  538. <view class="answerTitle">我的答案</view>
  539. {{
  540. (bank.ques[ansIndex] && bank.ques[ansIndex].text) || ""
  541. }}
  542. <view
  543. class="imgs"
  544. v-if="
  545. bank.ques[ansIndex] &&
  546. bank.ques[ansIndex].imageList.length
  547. "
  548. >
  549. <image
  550. class="img"
  551. :key="quesIndex"
  552. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  553. .imageList"
  554. :src="$method.splitImgHost(ques, true)"
  555. ></image>
  556. </view>
  557. </view>
  558. </view>
  559. </view>
  560. <view>
  561. <view class="pad_8 answerInfos">
  562. <view class="answerTitle">答案解析</view>
  563. <view class="answerContent">
  564. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  565. </view>
  566. </view>
  567. </view>
  568. </template>
  569. </view>
  570. </template>
  571. <view class="footer_btn">
  572. <view
  573. class="collect"
  574. @click="collect(collectList[bankIndex], bankIndex)"
  575. >
  576. <view>
  577. <image src="/static/icon/collect.png" mode=""></image>
  578. <view>收藏</view>
  579. </view>
  580. </view>
  581. <view class="flex_center" @click="openFooterTab">
  582. <view class="up-icon">
  583. <image src="/static/up.png"></image>
  584. </view>
  585. 答题卡
  586. </view>
  587. <view class="collect" @click="pdsubmit">
  588. <view>
  589. <image src="/static/jj.png" mode=""></image>
  590. <view>交卷</view>
  591. </view>
  592. </view>
  593. </view>
  594. </view>
  595. </swiper-item>
  596. </swiper>
  597. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  598. <view class="popupView">
  599. <view class="popupTops">
  600. <view class="topIcon"></view>
  601. 点击编号即可跳转至对应题目
  602. </view>
  603. <view class="popupContent">
  604. <scroll-view scroll-y="true" style="height: 506rpx">
  605. <view class="boxSty">
  606. <view
  607. v-for="(item, index) in questionList"
  608. :key="index"
  609. @click="changeIndex(index)"
  610. :class="{
  611. isRight: isRight(item, index),
  612. isWrong: isWrong(item, index),
  613. isPart: isPart(item, index),
  614. }"
  615. class="liListSty"
  616. >{{ index + 1 }}</view
  617. >
  618. </view>
  619. </scroll-view>
  620. </view>
  621. </view>
  622. </u-popup>
  623. <view class="dialog" v-if="showDialog">
  624. <view class="text">左右滑动切换上下题</view>
  625. <view class="btn" @click="hideDialog">我知道了</view>
  626. </view>
  627. </view>
  628. </template>
  629. <script>
  630. export default {
  631. data() {
  632. return {
  633. id: "",
  634. current: 0,
  635. questionList: [],
  636. ast: ["A", "B", "C", "D", "E", "F", "G"],
  637. judge: ["错误", "正确"],
  638. show: false,
  639. showDialog: false,
  640. bankList: [],
  641. goodsId: "",
  642. recordId: "",
  643. chapterId: "",
  644. moduleId: "",
  645. };
  646. },
  647. onLoad(option) {
  648. this.id = option.id || "";
  649. this.goodsId = option.goodsid || "";
  650. this.chapterId = option.chapterId || "";
  651. this.moduleId = option.moduleId || "";
  652. this.recordId = option.recordId || "";
  653. let showDialog = uni.getStorageSync("showDialog");
  654. if (showDialog) {
  655. this.showDialog = false;
  656. } else {
  657. this.showDialog = true;
  658. uni.setStorageSync("showDialog", "1");
  659. }
  660. this.goodsQuestionList();
  661. },
  662. onUnload() {},
  663. methods: {
  664. /**
  665. * 是否有上传图片
  666. */
  667. hasImgs(bank) {
  668. return bank.ansText.imageList.length == 0;
  669. },
  670. goodsQuestionList() {
  671. this.$api.examReport(this.recordId).then((res) => {
  672. this.questionList = JSON.parse(res.data.data.historyExamJson);
  673. });
  674. },
  675. openFooterTab() {
  676. this.show = true;
  677. },
  678. hideDialog() {
  679. this.showDialog = false;
  680. },
  681. changeIndex(index) {
  682. this.current = index;
  683. },
  684. swiperChange(e) {
  685. this.current = e.detail.current;
  686. },
  687. isRight(item, index) {
  688. //单选
  689. if (this.questionList[index].ques) {
  690. if (item.type == 1) {
  691. return this.questionList[index].ques == this.questionList[index].ans;
  692. //多选
  693. } else if (item.type == 2) {
  694. //每一项都相等
  695. return this.questionList[index].ans.every((item, i) => {
  696. return item == this.questionList[index].ques[i];
  697. });
  698. //判断
  699. } else if (item.type == 3) {
  700. return this.questionList[index].ques == this.questionList[index].ans;
  701. } else {
  702. return false;
  703. }
  704. } else {
  705. return false;
  706. }
  707. },
  708. right(bankIndex, ansIndex, option) {
  709. if (
  710. this.questionList[bankIndex].ques[ansIndex] &&
  711. this.questionList[bankIndex].ans[ansIndex]
  712. ) {
  713. if (
  714. this.questionList[bankIndex].ques[ansIndex].indexOf(
  715. option.optionsId
  716. ) != -1 ||
  717. this.questionList[bankIndex].ans[ansIndex].indexOf(
  718. option.optionsId
  719. ) != -1
  720. ) {
  721. return true;
  722. } else {
  723. return false;
  724. }
  725. } else {
  726. return false;
  727. }
  728. },
  729. wrong(bankIndex, ansIndex, option) {
  730. if (
  731. this.questionList[bankIndex].ques[ansIndex] &&
  732. this.questionList[bankIndex].ans[ansIndex]
  733. ) {
  734. if (
  735. this.questionList[bankIndex].ques[ansIndex].indexOf(
  736. option.optionsId
  737. ) != -1 &&
  738. this.questionList[bankIndex].ans[ansIndex].indexOf(
  739. option.optionsId
  740. ) == -1
  741. ) {
  742. return true;
  743. } else {
  744. return false;
  745. }
  746. } else {
  747. return false;
  748. }
  749. },
  750. isWrong(item, index) {
  751. if (this.questionList[index].ques) {
  752. //单选
  753. if (item.type == 1) {
  754. return this.questionList[index].ques != this.questionList[index].ans;
  755. //多选
  756. } else if (item.type == 2) {
  757. //每一项都相等
  758. return this.questionList[index].ques.some((item, i) => {
  759. return this.questionList[index].ans.indexOf(item) == -1;
  760. });
  761. //判断
  762. } else if (item.type == 3) {
  763. return this.questionList[index].ques != this.questionList[index].ans;
  764. } else {
  765. return false;
  766. }
  767. } else {
  768. return false;
  769. }
  770. },
  771. isPart(item, index) {
  772. if (this.questionList[index].ques) {
  773. if (item.type == 2) {
  774. let isWrong = this.questionList[index].ques.some((item, i) => {
  775. return this.questionList[index].ans.indexOf(item) == -1;
  776. });
  777. let isRight = this.questionList[index].ans.every((item, i) => {
  778. return item == this.questionList[index].ques[i];
  779. });
  780. if (!isRight && !isWrong) {
  781. return true;
  782. }
  783. }
  784. } else {
  785. return false;
  786. }
  787. },
  788. tabSelect(index, bankindex) {
  789. this.$set(this.questionList[bankindex], "current", index);
  790. },
  791. },
  792. };
  793. </script>
  794. <style lang="scss" scoped>
  795. .questionBank {
  796. width: 100%;
  797. height: 100vh;
  798. display: flex;
  799. flex-direction: column;
  800. }
  801. .swiper {
  802. width: 100%;
  803. flex: 1;
  804. }
  805. .lisSty {
  806. margin-bottom: 16rpx;
  807. display: flex;
  808. align-items: center;
  809. .flex_auto {
  810. flex: 1;
  811. }
  812. }
  813. .activeTI {
  814. vertical-align: middle;
  815. display: inline-block;
  816. border: 1rpx solid #eee;
  817. border-radius: 50rpx;
  818. height: 48rpx;
  819. line-height: 46rpx;
  820. text-align: center;
  821. width: 48rpx;
  822. margin-right: 15rpx;
  823. color: #666;
  824. font-size: 30rpx;
  825. &.right {
  826. color: #fff;
  827. background: #36c75a;
  828. }
  829. &.wrong {
  830. color: #fff;
  831. background: #ff3b30;
  832. }
  833. &.checked {
  834. color: #fff;
  835. background: #007aff;
  836. }
  837. }
  838. .submit_checkbox {
  839. position: fixed;
  840. left: 0;
  841. right: 0;
  842. bottom: 120rpx;
  843. margin: 20rpx auto;
  844. width: 526rpx;
  845. height: 80rpx;
  846. background: rgba(0, 122, 255, 1);
  847. color: #fff;
  848. text-align: center;
  849. line-height: 80rpx;
  850. font-size: 30rpx;
  851. border-radius: 40rpx;
  852. }
  853. .titles {
  854. overflow: hidden;
  855. margin-bottom: 24rpx;
  856. }
  857. .titBox {
  858. padding: 41rpx 25rpx 24rpx 25rpx;
  859. }
  860. .titBox_title {
  861. padding: 21rpx;
  862. }
  863. .tabs {
  864. margin: 10rpx;
  865. display: flex;
  866. .tab {
  867. margin: 0 4rpx;
  868. padding: 10rpx 13rpx;
  869. text-align: center;
  870. color: #007aff;
  871. font-size: 28rpx;
  872. border-radius: 16rpx;
  873. background: #fff;
  874. &.current {
  875. color: #fff;
  876. background: #007aff;
  877. }
  878. }
  879. }
  880. .ans {
  881. margin: 8rpx 8rpx 8rpx;
  882. .ans_input {
  883. border-radius: 16rpx;
  884. background: #fff;
  885. .top {
  886. border-bottom: 1rpx solid #eeeeee;
  887. padding: 16rpx;
  888. display: flex;
  889. align-items: center;
  890. .icon {
  891. margin-right: 20rpx;
  892. width: 40rpx;
  893. height: 38rpx;
  894. }
  895. .progress {
  896. flex: 1;
  897. }
  898. .submit {
  899. width: 168rpx;
  900. height: 48rpx;
  901. line-height: 48rpx;
  902. text-align: center;
  903. color: #fff;
  904. font-size: 30rpx;
  905. background: #007aff;
  906. border-radius: 24rpx;
  907. &.disabled {
  908. opacity: 0.6;
  909. }
  910. }
  911. }
  912. .textarea {
  913. textarea {
  914. width: 100%;
  915. height: 287rpx;
  916. padding: 10rpx;
  917. }
  918. }
  919. .imgs {
  920. overflow: hidden;
  921. display: flex;
  922. width: 100%;
  923. .img {
  924. width: 104rpx;
  925. height: 104rpx;
  926. border-radius: 8rpx;
  927. position: relative;
  928. margin: 20rpx;
  929. text {
  930. position: absolute;
  931. right: -15rpx;
  932. top: -15rpx;
  933. width: 30rpx;
  934. height: 30rpx;
  935. text-align: center;
  936. line-height: 30rpx;
  937. color: #fff;
  938. background: #ff3b30;
  939. border-radius: 50%;
  940. }
  941. image {
  942. width: 100%;
  943. height: 100%;
  944. }
  945. }
  946. }
  947. }
  948. .ans_submit {
  949. padding: 16rpx;
  950. border-radius: 16rpx;
  951. background: #fff;
  952. .imgs {
  953. overflow: hidden;
  954. display: flex;
  955. width: 100%;
  956. .img {
  957. width: 104rpx;
  958. height: 104rpx;
  959. border-radius: 8rpx;
  960. position: relative;
  961. margin: 20rpx;
  962. image {
  963. width: 100%;
  964. height: 100%;
  965. }
  966. }
  967. }
  968. }
  969. }
  970. .leftLetters {
  971. display: flex;
  972. align-items: center;
  973. width: 220rpx;
  974. .btnType {
  975. padding: 5rpx 10rpx;
  976. border: 1rpx solid #007aff;
  977. border-radius: 10rpx;
  978. background-color: rgba(0, 122, 255, 0.1);
  979. font-size: 28rpx;
  980. color: #007aff;
  981. margin-right: 15rpx;
  982. }
  983. }
  984. .firstLetter {
  985. display: flex;
  986. justify-content: space-between;
  987. align-items: center;
  988. margin-bottom: 30rpx;
  989. }
  990. .popupView {
  991. height: 100%;
  992. padding-bottom: 100rpx;
  993. .popupTops {
  994. height: 77rpx;
  995. border-bottom: 1rpx solid #eee;
  996. text-align: center;
  997. line-height: 77rpx;
  998. font-size: 24rpx;
  999. color: #999;
  1000. position: relative;
  1001. .topIcon {
  1002. position: absolute;
  1003. top: 10rpx;
  1004. left: 50%;
  1005. transform: translateX(-50%);
  1006. width: 80rpx;
  1007. height: 8rpx;
  1008. background-color: #999;
  1009. border-radius: 4rpx;
  1010. }
  1011. }
  1012. .popupContent {
  1013. }
  1014. }
  1015. .pageContent {
  1016. position: relative;
  1017. background-color: #eaeef1;
  1018. height: 100%;
  1019. overflow-y: scroll;
  1020. padding-top: 8rpx;
  1021. padding-bottom: 100rpx;
  1022. }
  1023. .pad_8 {
  1024. background-color: #fff;
  1025. margin: 0rpx 8rpx 8rpx;
  1026. border-radius: 16rpx;
  1027. &.no-margin {
  1028. margin-top: -16rpx;
  1029. border-radius: 0 0 16rpx 16rpx;
  1030. }
  1031. }
  1032. .answer {
  1033. height: 80rpx;
  1034. line-height: 80rpx;
  1035. padding: 0rpx 24rpx;
  1036. display: flex;
  1037. align-items: center;
  1038. justify-content: space-between;
  1039. color: #666;
  1040. font-size: 30rpx;
  1041. }
  1042. .footer_btn {
  1043. background-color: #fff;
  1044. z-index: 10078;
  1045. position: fixed;
  1046. bottom: 0rpx;
  1047. display: flex;
  1048. align-items: center;
  1049. justify-content: space-between;
  1050. width: 100%;
  1051. height: 98rpx;
  1052. padding: 0rpx 38rpx;
  1053. border-top: 1rpx solid #eee;
  1054. .flex_center {
  1055. flex: 1;
  1056. display: flex;
  1057. justify-content: center;
  1058. align-items: center;
  1059. flex-direction: column;
  1060. margin: 0 200rpx;
  1061. font-size: 24rpx;
  1062. color: #999999;
  1063. .up-icon {
  1064. margin-bottom: 18rpx;
  1065. width: 100%;
  1066. display: flex;
  1067. justify-content: center;
  1068. image {
  1069. width: 58rpx;
  1070. height: 21rpx;
  1071. }
  1072. }
  1073. }
  1074. .collect {
  1075. visibility: hidden;
  1076. width: 100rpx;
  1077. &.show {
  1078. visibility: visible;
  1079. }
  1080. > view {
  1081. display: flex;
  1082. flex-direction: column;
  1083. align-items: center;
  1084. justify-content: center;
  1085. image {
  1086. width: 32rpx;
  1087. height: 32rpx;
  1088. margin-bottom: 6rpx;
  1089. }
  1090. view {
  1091. font-size: 24rpx;
  1092. color: #999999;
  1093. }
  1094. }
  1095. }
  1096. }
  1097. .boxSty {
  1098. padding: 44rpx 41rpx 0rpx;
  1099. }
  1100. .liListSty {
  1101. border: 1rpx solid #eeeeee;
  1102. width: 88rpx;
  1103. height: 88rpx;
  1104. border-radius: 32rpx;
  1105. text-align: center;
  1106. line-height: 88rpx;
  1107. color: #333;
  1108. font-size: 32rpx;
  1109. float: left;
  1110. margin: 20rpx 23rpx;
  1111. &.isRight {
  1112. border: 1rpx solid #eeeeee;
  1113. color: #fff;
  1114. background: #36c75a;
  1115. }
  1116. &.isWrong {
  1117. border: 1rpx solid #eeeeee;
  1118. color: #fff;
  1119. background: #ff3b30;
  1120. }
  1121. &.isPart {
  1122. border: 1rpx solid #eeeeee;
  1123. color: #fff;
  1124. background: #FFC53D;
  1125. }
  1126. }
  1127. .answerInfos {
  1128. padding: 25rpx 25rpx 25rpx 23rpx;
  1129. }
  1130. .answerTitle {
  1131. margin-bottom: 28rpx;
  1132. color: #666;
  1133. font-size: 30rpx;
  1134. }
  1135. .answerContent {
  1136. font-size: 30rpx;
  1137. color: #666;
  1138. }
  1139. .textChild {
  1140. display: inline-block;
  1141. vertical-align: middle;
  1142. }
  1143. .dialog {
  1144. position: fixed;
  1145. left: 0;
  1146. top: 0;
  1147. width: 100%;
  1148. height: 100%;
  1149. background-color: rgba(0, 0, 0, 0.8);
  1150. display: flex;
  1151. flex-direction: column;
  1152. align-items: center;
  1153. justify-content: center;
  1154. z-index: 20000;
  1155. .pointer {
  1156. width: 338rpx;
  1157. height: 240rpx;
  1158. }
  1159. .text {
  1160. font-size: 32rpx;
  1161. color: #ffffff;
  1162. text-align: center;
  1163. }
  1164. .btn {
  1165. width: 242rpx;
  1166. height: 82rpx;
  1167. border: 2rpx solid #ffffff;
  1168. border-radius: 16rpx;
  1169. text-align: center;
  1170. line-height: 82rpx;
  1171. margin: 41rpx auto;
  1172. color: #fff;
  1173. font-size: 32rpx;
  1174. }
  1175. }
  1176. .popboxs {
  1177. width: 100%;
  1178. height: 100%;
  1179. display: flex;
  1180. flex-direction: column;
  1181. align-items: center;
  1182. }
  1183. .classTops {
  1184. flex-shrink: 0;
  1185. padding: 39rpx 0rpx 4rpx;
  1186. font-weight: bold;
  1187. color: #333;
  1188. font-size: 30rpx;
  1189. }
  1190. .textStys {
  1191. width: 100%;
  1192. flex: 1;
  1193. padding: 36rpx;
  1194. }
  1195. .classFootsty {
  1196. flex-shrink: 0;
  1197. display: flex;
  1198. align-items: center;
  1199. justify-content: center;
  1200. padding: 10rpx 0rpx 40rpx;
  1201. .btnsty {
  1202. width: 200rpx;
  1203. height: 80rpx;
  1204. border-radius: 40rpx;
  1205. font-weight: bold;
  1206. font-size: 30rpx;
  1207. text-align: center;
  1208. line-height: 80rpx;
  1209. }
  1210. .btns1 {
  1211. background-color: #f5f5f5;
  1212. color: #007aff;
  1213. }
  1214. .btns2 {
  1215. margin-left: 40rpx;
  1216. background-color: #007aff;
  1217. color: #ffffff;
  1218. }
  1219. }
  1220. </style>