questionBankAllExplain.vue 36 KB

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