questionBankAllExplain.vue 36 KB

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