collectBank.vue 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819
  1. <template>
  2. <view id="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. @click="radioSelect(item.optionsId, bankIndex)"
  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 v-if="bank.ques">
  83. <view class="pad_8 answer">
  84. <view>题目答案:{{ ast[bank.ans - 1] }}</view>
  85. <view v-if="!explain">我的答案:{{ 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. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  103. >
  104. <view :class="{ checked: item.checked }" class="activeTI">{{
  105. ast[index]
  106. }}</view>
  107. <view class="flex_auto">
  108. {{ item.content }}
  109. <view v-if="item.imgUrl">
  110. <image
  111. style="width: 600rpx"
  112. mode="widthFix"
  113. :src="$method.splitImgHost(item.imgUrl)"
  114. ></image>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <view
  120. v-if="!bank.ques"
  121. class="submit_checkbox"
  122. :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
  123. @click="checkboxSubmit(bankIndex)"
  124. >
  125. 确认答案
  126. </view>
  127. <view v-if="bank.ques">
  128. <view
  129. v-for="(item, index) in bank.jsonStr"
  130. :key="index"
  131. class="lisSty"
  132. >
  133. <text
  134. :class="{
  135. right:
  136. bank.ques.indexOf(item.optionsId) != -1 ||
  137. bank.ans.indexOf(item.optionsId) != -1,
  138. wrong:
  139. bank.ques.indexOf(item.optionsId) != -1 &&
  140. bank.ans.indexOf(item.optionsId) == -1,
  141. }"
  142. class="activeTI"
  143. >{{ ast[index] }}</text
  144. >
  145. <view class="flex_auto">
  146. {{ item.content }}
  147. <view v-if="item.imgUrl">
  148. <image
  149. style="width: 600rpx"
  150. mode="widthFix"
  151. :src="$method.splitImgHost(item.imgUrl)"
  152. ></image>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. <view v-if="bank.ques">
  159. <view class="pad_8 answer">
  160. <view
  161. >题目答案:
  162. <text
  163. v-for="(ansItem, ansItemIndex) in bank.ans"
  164. :key="ansItemIndex"
  165. >{{ ast[ansItem - 1] }}</text
  166. >
  167. </view>
  168. <view v-if="!explain"
  169. >我的答案:
  170. <text
  171. v-for="(quesItem, quesItemIndex) in bank.ques"
  172. :key="quesItemIndex"
  173. >{{ ast[quesItem - 1] }}</text
  174. >
  175. </view>
  176. </view>
  177. <view class="pad_8 answerInfos">
  178. <view class="answerTitle">答案解析</view>
  179. <view class="answerContent">
  180. <rich-text :nodes="bank.analysisContent"></rich-text>
  181. </view>
  182. </view>
  183. </view>
  184. </template>
  185. <template v-if="bank.type == 3">
  186. <view class="pad_8 titBox no-margin">
  187. <view v-if="!bank.ques">
  188. <view
  189. v-for="(item, index) in judge"
  190. :key="index"
  191. class="lisSty"
  192. @click="judgeSelect(index, bankIndex)"
  193. >
  194. <view class="activeTI">{{ ast[index] }}</view>
  195. <view class="flex_auto">
  196. {{ item }}
  197. <view v-if="item.imgUrl">
  198. <image
  199. style="width: 600rpx"
  200. mode="widthFix"
  201. :src="$method.splitImgHost(item.imgUrl)"
  202. ></image>
  203. </view>
  204. </view>
  205. </view>
  206. </view>
  207. <view v-if="bank.ques">
  208. <view
  209. v-for="(item, index) in judge"
  210. :key="index"
  211. class="lisSty"
  212. >
  213. <text
  214. :class="{
  215. right: index == (bank.ques == 1 ? 0 : 1) || index != bank.ans,
  216. wrong: index == (bank.ques == 1 ? 0 : 1) && bank.ques != bank.ans,
  217. }"
  218. class="activeTI"
  219. >{{ ast[index] }}</text
  220. >
  221. <view class="flex_auto">
  222. {{ item }}
  223. <view v-if="item.imgUrl">
  224. <image
  225. style="width: 600rpx"
  226. mode="widthFix"
  227. :src="$method.splitImgHost(item.imgUrl)"
  228. ></image>
  229. </view>
  230. </view>
  231. </view>
  232. </view>
  233. </view>
  234. <view v-if="bank.ques">
  235. <view class="pad_8 answer">
  236. <view>题目答案:{{ ast[bank.ans == 1 ? 0 : 1] }}</view>
  237. <view v-if="!explain">我的答案:{{ ast[bank.ques == 1 ? 0 : 1] }}</view>
  238. </view>
  239. <view class="pad_8 answerInfos">
  240. <view class="answerTitle">答案解析</view>
  241. <view class="answerContent">
  242. <rich-text :nodes="bank.analysisContent"></rich-text>
  243. </view>
  244. </view>
  245. </view>
  246. </template>
  247. <!-- 简答题 -->
  248. <template v-if="bank.type == 5">
  249. <view class="pad_8 titBox">
  250. <view class="ans">
  251. <view class="ans_input" v-if="!bank.ques">
  252. <view class="top flex">
  253. <image
  254. :data-index="bankIndex"
  255. class="icon"
  256. @click="chooseImg(bankIndex)"
  257. src="/static/08-10_032.jpg"
  258. mode=""
  259. ></image>
  260. <view class="progress"
  261. >{{ bank.ansText.imageList.length || "0" }}/4</view
  262. >
  263. <view
  264. class="submit"
  265. :class="{ disabled: !bank.ansText.text && hasImgs(bank) }"
  266. @click="submitAns(bankIndex)"
  267. >确认答案</view
  268. >
  269. </view>
  270. <view class="textarea">
  271. <textarea
  272. v-model="bank.ansText.text"
  273. placeholder="在此输入答案"
  274. ></textarea>
  275. </view>
  276. <view class="imgs">
  277. <view
  278. class="img"
  279. v-for="(img, imgIndex) in bank.ansText.imageList"
  280. :key="imgIndex"
  281. >
  282. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  283. <image :src="$method.splitImgHost(img, true)"></image>
  284. </view>
  285. </view>
  286. </view>
  287. <view
  288. class="ans_submit answerInfos"
  289. v-if="bank.ques && !explain"
  290. >
  291. <view class="answerTitle">我的答案:</view>
  292. {{ bank.ques.text }}
  293. <view class="imgs">
  294. <image
  295. class="img"
  296. :key="quesIndex"
  297. v-for="(ques, quesIndex) in bank.ques.imageList"
  298. :src="$method.splitImgHost(ques, true)"
  299. ></image>
  300. </view>
  301. </view>
  302. </view>
  303. </view>
  304. <view v-if="bank.ques">
  305. <view class="pad_8 answerInfos">
  306. <view class="answerTitle">答案解析:</view>
  307. <view class="answerContent">
  308. <rich-text :nodes="bank.analysisContent"></rich-text>
  309. </view>
  310. </view>
  311. </view>
  312. </template>
  313. <!-- 案例题 -->
  314. <template v-if="bank.type == 4">
  315. <view class="tabs">
  316. <view
  317. class="tab"
  318. :class="{ current: tabIndex == bank.current }"
  319. :key="tabIndex"
  320. v-for="(tab, tabIndex) in bank.jsonStr"
  321. @click="tabSelect(tabIndex, bankIndex)"
  322. >问题{{ tabIndex + 1 }}</view
  323. >
  324. </view>
  325. <view
  326. v-for="(ansItem, ansIndex) in bank.jsonStr"
  327. v-if="bank.current == ansIndex"
  328. :key="ansIndex"
  329. >
  330. <template v-if="ansItem.type == 1">
  331. <view class="pad_8 titBox">
  332. <view class="titles">
  333. <rich-text :nodes="ansItem.content"></rich-text>
  334. </view>
  335. <view v-if="!bank.ques[ansIndex]">
  336. <view
  337. v-for="(option, childIndex) in ansItem.optionsList"
  338. :key="childIndex"
  339. class="lisSty"
  340. @click="
  341. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  342. "
  343. >
  344. <view class="activeTI">{{ ast[childIndex] }}</view>
  345. <view class="flex_auto">
  346. <rich-text
  347. class="textChild"
  348. :nodes="option.content"
  349. ></rich-text>
  350. <view v-if="option.imgUrl">
  351. <image
  352. style="width: 600rpx"
  353. mode="widthFix"
  354. :src="$method.splitImgHost(option.imgUrl)"
  355. ></image>
  356. </view>
  357. </view>
  358. </view>
  359. </view>
  360. <view v-if="bank.ques[ansIndex]">
  361. <view
  362. v-for="(option, childIndex) in ansItem.optionsList"
  363. :key="childIndex"
  364. class="lisSty"
  365. >
  366. <text
  367. :class="{
  368. right:
  369. option.optionsId == bank.ques[ansIndex] ||
  370. option.optionsId == bank.ans[ansIndex],
  371. wrong:
  372. option.optionsId == bank.ques[ansIndex] &&
  373. bank.ques[ansIndex] != bank.ans[ansIndex],
  374. }"
  375. class="activeTI"
  376. >{{ ast[childIndex] }}</text
  377. >
  378. <view class="flex_auto">
  379. <rich-text :nodes="option.content"></rich-text>
  380. <view v-if="option.imgUrl">
  381. <image
  382. style="width: 600rpx"
  383. mode="widthFix"
  384. :src="$method.splitImgHost(option.imgUrl)"
  385. ></image>
  386. </view>
  387. </view>
  388. </view>
  389. </view>
  390. </view>
  391. <view v-if="bank.ques[ansIndex]">
  392. <view class="pad_8 answer">
  393. <view>题目答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  394. <view v-if="!explain"
  395. >我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view
  396. >
  397. </view>
  398. <view class="pad_8 answerInfos">
  399. <view class="answerTitle">答案解析</view>
  400. <view class="answerContent">
  401. <rich-text :nodes="option.analysisContent"></rich-text>
  402. </view>
  403. </view>
  404. </view>
  405. </template>
  406. <template v-if="ansItem.type == 2">
  407. <view class="pad_8 titBox">
  408. <view class="titles">
  409. <rich-text :nodes="ansItem.content"></rich-text>
  410. </view>
  411. <view v-if="!bank.ques[ansIndex]">
  412. <view
  413. v-for="(option, childindex) in ansItem.optionsList"
  414. :key="childindex"
  415. class="lisSty"
  416. @click="
  417. checkboxSelectChild(bankIndex, ansIndex, childindex)
  418. "
  419. >
  420. <view
  421. :class="{ checked: option.checked }"
  422. class="activeTI"
  423. >{{ ast[childindex] }}</view
  424. >
  425. <view class="flex_auto">
  426. <rich-text :nodes="option.content"></rich-text>
  427. <view v-if="option.imgUrl">
  428. <image
  429. style="width: 600rpx"
  430. mode="widthFix"
  431. :src="$method.splitImgHost(option.imgUrl)"
  432. ></image>
  433. </view>
  434. </view>
  435. </view>
  436. </view>
  437. <view
  438. v-if="!bank.ques[ansIndex]"
  439. class="submit_checkbox"
  440. :class="{
  441. disabled: !isCheckboxChecked(ansItem.optionsList),
  442. }"
  443. @click="checkboxSubmitChild(bankIndex, ansIndex)"
  444. >
  445. 确认答案
  446. </view>
  447. <view v-if="bank.ques && bank.ques[ansIndex]">
  448. <view
  449. v-for="(option, childindex) in ansItem.optionsList"
  450. :key="childindex"
  451. class="lisSty"
  452. >
  453. <text
  454. :class="{
  455. right: right(bankIndex, ansIndex, option),
  456. wrong: wrong(bankIndex, ansIndex, option),
  457. }"
  458. class="activeTI"
  459. >{{ ast[childindex] }}</text
  460. >
  461. <view class="flex_auto">
  462. <rich-text :nodes="option.content"></rich-text>
  463. <view v-if="option.imgUrl">
  464. <image
  465. style="width: 600rpx"
  466. mode="widthFix"
  467. :src="$method.splitImgHost(option.imgUrl)"
  468. ></image>
  469. </view>
  470. </view>
  471. </view>
  472. </view>
  473. </view>
  474. <view v-if="bank.ques[ansIndex]">
  475. <view class="pad_8 answer">
  476. <view
  477. >题目答案:
  478. <text
  479. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  480. :key="ansItemIndex1"
  481. >{{ ast[ansItem1 - 1] }}</text
  482. >
  483. </view>
  484. <view v-if="!explain"
  485. >我的答案:
  486. <text
  487. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  488. :key="quesItemIndex"
  489. >{{ ast[quesItem - 1] }}</text
  490. >
  491. </view>
  492. </view>
  493. <view class="pad_8 answerInfos">
  494. <view class="answerTitle">答案解析</view>
  495. <view class="answerContent">
  496. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  497. </view>
  498. </view>
  499. </view>
  500. </template>
  501. <template v-if="ansItem.type == 3">
  502. <view class="pad_8 titBox">
  503. <view class="titles">
  504. <rich-text :nodes="ansItem.content"></rich-text>
  505. </view>
  506. <view v-if="!bank.ques[ansIndex]">
  507. <view
  508. v-for="(option, childindex) in judge"
  509. :key="childindex"
  510. class="lisSty"
  511. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  512. >
  513. <view class="activeTI">{{ ast[childindex] }}</view>
  514. <view class="flex_auto">
  515. {{ option }}
  516. <view v-if="option.imgUrl">
  517. <image
  518. style="width: 600rpx"
  519. mode="widthFix"
  520. :src="$method.splitImgHost(option.imgUrl)"
  521. ></image>
  522. </view>
  523. </view>
  524. </view>
  525. </view>
  526. <view v-if="bank.ques[ansIndex]">
  527. <view
  528. v-for="(option, childindex) in judge"
  529. :key="childindex"
  530. class="lisSty"
  531. >
  532. <text
  533. :class="{
  534. right:
  535. childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) ||
  536. childindex != bank.ans[ansIndex],
  537. wrong:
  538. childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) &&
  539. bank.ques[ansIndex] != bank.ans[ansIndex],
  540. }"
  541. class="activeTI"
  542. >{{ ast[childindex] }}</text
  543. >
  544. <view class="flex_auto">
  545. {{ option }}
  546. <view v-if="option.imgUrl">
  547. <image
  548. style="width: 600rpx"
  549. mode="widthFix"
  550. :src="$method.splitImgHost(option.imgUrl)"
  551. ></image>
  552. </view>
  553. </view>
  554. </view>
  555. </view>
  556. </view>
  557. <view v-if="bank.ques[ansIndex]">
  558. <view class="pad_8 answer">
  559. <view>题目答案:{{ ast[bank.ans[ansIndex] == 1 ? 0 : 1] }}</view>
  560. <view v-if="!explain"
  561. >我的答案:{{ ast[bank.ques[ansIndex] == 1 ? 0 : 1] }}</view
  562. >
  563. </view>
  564. <view class="pad_8 answerInfos">
  565. <view class="answerTitle">答案解析</view>
  566. <view class="answerContent">
  567. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  568. </view>
  569. </view>
  570. </view>
  571. </template>
  572. <!-- 简答题 -->
  573. <template v-if="ansItem.type == 5">
  574. <view class="pad_8 titBox_title">
  575. <view class="titles">
  576. <rich-text :nodes="ansItem.content"></rich-text>
  577. </view>
  578. </view>
  579. <view class="pad_8 titBox_title">
  580. <view class="ans">
  581. <view class="ans_input" v-if="!bank.ques[ansIndex]">
  582. <view class="top flex">
  583. <image
  584. class="icon"
  585. @click="chooseImgChild(bankIndex, ansIndex)"
  586. src="/static/08-10_032.jpg"
  587. mode=""
  588. ></image>
  589. <view class="progress"
  590. >{{ ansItem.ansText.imageList.length || "0" }}/4</view
  591. >
  592. <view
  593. class="submit"
  594. :class="{
  595. disabled: !ansItem.ansText.text && hasImgs(ansItem),
  596. }"
  597. @click="submitAnsChild(bankIndex, ansIndex)"
  598. >确认答案</view
  599. >
  600. </view>
  601. <view class="textarea">
  602. <textarea
  603. v-model="ansItem.ansText.text"
  604. placeholder="在此输入答案"
  605. ></textarea>
  606. </view>
  607. <view class="imgs">
  608. <view
  609. class="img"
  610. v-for="(img, imgIndex) in ansItem.ansText.imageList"
  611. :key="imgIndex"
  612. >
  613. <text
  614. @click="
  615. deleteImgChild(imgIndex, bankIndex, ansIndex)
  616. "
  617. >x</text
  618. >
  619. <image :src="$method.splitImgHost(img, true)"></image>
  620. </view>
  621. </view>
  622. </view>
  623. <view
  624. class="ans_submit answerInfos"
  625. v-if="bank.ques[ansIndex] && !explain"
  626. >
  627. <view class="answerTitle">我的答案</view>
  628. {{ bank.ques[ansIndex].text }}
  629. <view class="imgs">
  630. <image
  631. class="img"
  632. :key="quesIndex"
  633. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  634. .imageList"
  635. :src="$method.splitImgHost(ques, true)"
  636. ></image>
  637. </view>
  638. </view>
  639. </view>
  640. </view>
  641. <view v-if="bank.ques[ansIndex]">
  642. <view class="pad_8 answerInfos">
  643. <view class="answerTitle">答案解析</view>
  644. <view class="answerContent">
  645. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  646. </view>
  647. </view>
  648. </view>
  649. </template>
  650. </view>
  651. </template>
  652. <view class="footer_btn">
  653. <view
  654. class="collect show"
  655. @click="collect(collectList[bankIndex], bankIndex, bank)"
  656. >
  657. <view v-if="collectList[bankIndex]">
  658. <image src="/static/icon/collected.png" mode=""></image>
  659. <view>取消收藏</view>
  660. </view>
  661. <view v-if="!collectList[bankIndex]">
  662. <image src="/static/icon/collect.png" mode=""></image>
  663. <view>收藏</view>
  664. </view>
  665. </view>
  666. <view class="flex_center" @click="openFooterTab">
  667. <view class="up-icon">
  668. <image src="/static/up.png"></image>
  669. </view>
  670. 答题卡
  671. </view>
  672. </view>
  673. </view>
  674. </swiper-item>
  675. </swiper>
  676. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  677. <view class="popupView">
  678. <view class="popupTops">
  679. <view class="topIcon"></view>
  680. 点击编号即可跳转至对应题目
  681. </view>
  682. <view class="popupContent">
  683. <scroll-view scroll-y="true" style="height: 506rpx">
  684. <view class="boxSty">
  685. <view
  686. v-for="(item, index) in questionList"
  687. :key="index"
  688. @click="changeIndex(index)"
  689. :class="{
  690. isRight: isRight(item, index),
  691. isWrong: isWrong(item, index),
  692. isPart: isPart(item, index),
  693. }"
  694. class="liListSty"
  695. >{{ index + 1 }}</view
  696. >
  697. </view>
  698. </scroll-view>
  699. </view>
  700. </view>
  701. </u-popup>
  702. <view class="dialog" v-if="showDialog">
  703. <image src="/static/pointer.png" class="pointer" mode=""></image>
  704. <view class="text">左右滑动切换上下题</view>
  705. <view class="btn" @click="hideDialog">我知道了</view>
  706. </view>
  707. </view>
  708. </template>
  709. <script>
  710. export default {
  711. data() {
  712. return {
  713. examId: "",
  714. current: 0,
  715. questionList: [],
  716. ast: ["A", "B", "C", "D", "E", "F", "G"],
  717. judge: ["正确", "错误"],
  718. show: false,
  719. showDialog: false,
  720. bankList: [],
  721. collectList: [],
  722. goodsId: "",
  723. explain: "",
  724. orderGoodsId: "",
  725. distinction: 1, // 1试卷归类,2题型归类
  726. subjectType: 0, // 题目类型
  727. doMode: 1,
  728. };
  729. },
  730. onLoad(option) {
  731. this.orderGoodsId = option.orderGoodsId || "";
  732. const { examId, explain, type, distinction, doMode} = option
  733. this.examId = examId
  734. this.explain = explain
  735. this.distinction = distinction
  736. this.subjectType = type
  737. this.doMode = doMode || 1
  738. // console.log('--doMode-', this.doMode);
  739. let showDialog = uni.getStorageSync("showDialog");
  740. if (showDialog) {
  741. this.showDialog = false;
  742. } else {
  743. this.showDialog = true;
  744. uni.setStorageSync("showDialog", "1");
  745. }
  746. if (this.distinction == 1) {
  747. this.collectQuestionExamQuestionList();
  748. } else {
  749. this.goodsCollectList()
  750. }
  751. },
  752. onUnload() {},
  753. methods: {
  754. /**
  755. * 是否有上传图片
  756. */
  757. hasImgs(bank) {
  758. return bank.ansText.imageList.length == 0;
  759. },
  760. collectQuestionExamQuestionList() {
  761. this.$api
  762. .collectQuestionExamQuestionList({
  763. examId: this.examId,
  764. })
  765. .then((res) => {
  766. this.analysteData(res.data.rows)
  767. });
  768. },
  769. goodsCollectList() {
  770. this.$api.goodsCollectList({
  771. type: this.subjectType,
  772. })
  773. .then((res) => {
  774. this.analysteData(res.data.rows)
  775. })
  776. },
  777. analysteData(rows) {
  778. rows.forEach((item, index) => {
  779. if (typeof item.jsonStr == "string") {
  780. item.jsonStr = JSON.parse(item.jsonStr);
  781. if (item.type == 2) {
  782. //多选
  783. item.jsonStr.forEach((str) => {
  784. str.optionsId = "" + str.optionsId;
  785. });
  786. let arr = item.answerQuestion.split(",");
  787. arr.forEach((a, i) => {
  788. arr[i] = "" + a;
  789. });
  790. item.ans = arr;
  791. item.analysisContent &&
  792. (item.analysisContent = item.analysisContent.replace(
  793. /<img/gi,
  794. '<img style="max-width:100%;"'
  795. ));
  796. item.content &&
  797. (item.content = item.content.replace(
  798. /<img/gi,
  799. '<img style="max-width:100%;"'
  800. ));
  801. if (this.explain) {
  802. item.ques = item.ans;
  803. }
  804. return;
  805. } else if (item.type == 5) {
  806. item.ansText = {
  807. text: "",
  808. imageList: [],
  809. };
  810. item.analysisContent &&
  811. (item.analysisContent = item.analysisContent.replace(
  812. /<img/gi,
  813. '<img style="max-width:100%;"'
  814. ));
  815. item.content &&
  816. (item.content = item.content.replace(
  817. /<img/gi,
  818. '<img style="max-width:100%;"'
  819. ));
  820. if (this.explain) {
  821. item.ques = {
  822. text: item.analysisContent,
  823. };
  824. return;
  825. }
  826. } else if (item.type == 4) {
  827. console.log(item.jsonStr);
  828. item.ques = [];
  829. item.current = 0;
  830. let ansArr = [];
  831. item.jsonStr.forEach((json, index) => {
  832. if (json.type == 1) {
  833. ansArr[index] = json.answerQuestion;
  834. json.content &&
  835. (json.content = json.content.replace(
  836. /<img/gi,
  837. '<img style="max-width:100%;"'
  838. ));
  839. } else if (json.type == 2) {
  840. json.optionsList.forEach((str) => {
  841. str.optionsId = "" + str.optionsId;
  842. });
  843. let arr = json.answerQuestion.split(",");
  844. arr.forEach((a, i) => {
  845. arr[i] = "" + a;
  846. });
  847. ansArr[index] = arr;
  848. json.content &&
  849. (json.content = json.content.replace(
  850. /<img/gi,
  851. '<img style="max-width:100%;"'
  852. ));
  853. } else if (json.type == 3) {
  854. ansArr[index] = json.answerQuestion;
  855. json.content &&
  856. (json.content = json.content.replace(
  857. /<img/gi,
  858. '<img style="max-width:100%;"'
  859. ));
  860. } else if (json.type == 5) {
  861. ansArr[index] = {
  862. text: "",
  863. imageList: [],
  864. };
  865. json.ansText = {
  866. text: "",
  867. imageList: [],
  868. };
  869. json.content &&
  870. (json.content = json.content.replace(
  871. /<img/gi,
  872. '<img style="max-width:100%;"'
  873. ));
  874. }
  875. });
  876. item.ans = ansArr;
  877. item.analysisContent &&
  878. (item.analysisContent = item.analysisContent.replace(
  879. /<img/gi,
  880. '<img style="max-width:100%;"'
  881. ));
  882. if (this.distinction == 2) {
  883. item.content && (item.content = item.content.replace(
  884. /<img/gi,
  885. '<img style="max-width:100%;"'
  886. ));
  887. }
  888. if (this.explain) {
  889. item.ques = item.ans;
  890. }
  891. return;
  892. }
  893. item.analysisContent &&
  894. (item.analysisContent = item.analysisContent.replace(
  895. /<img/gi,
  896. '<img style="max-width:100%;"'
  897. ));
  898. item.content &&
  899. (item.content = item.content.replace(
  900. /<img/gi,
  901. '<img style="max-width:100%;"'
  902. ));
  903. item.ans = item.answerQuestion;
  904. if (this.explain) {
  905. item.ques = item.ans;
  906. }
  907. } else {
  908. if (this.explain) {
  909. item.ques = item.ans;
  910. }
  911. }
  912. });
  913. this.questionList = rows;
  914. // new Array(12).fill(true)
  915. this.collectList = new Array(this.questionList.length).fill(true)
  916. console.log('this.collectList', this.collectList)
  917. },
  918. /**
  919. * @param {Object} state
  920. * @param {Object} index
  921. * 收藏
  922. */
  923. collect(state, index, bank) {
  924. if (!state) {
  925. this.$api.collectQuestion({
  926. examId: this.examId || bank.examId,
  927. questionId: bank.questionId,
  928. goodsId: bank.goodsId || "",
  929. orderGoodsId: bank.orderGoodsId,
  930. doMode: this.doMode, //做题模式 1章卷 2随机练习
  931. })
  932. .then((res) => {
  933. if (res.data.code == 200) {
  934. this.$set(this.collectList, index, true);
  935. uni.showToast({
  936. title: "收藏成功",
  937. duration: 2000,
  938. icon: "none",
  939. });
  940. } else {
  941. uni.showToast({
  942. title: "收藏失败",
  943. duration: 2000,
  944. icon: "none",
  945. });
  946. }
  947. });
  948. } else {
  949. this.$api.deleteCollectQuestion(bank.collectQuestionId).then((res) => {
  950. if (res.data.code == 200) {
  951. this.$set(this.collectList, index, false)
  952. uni.showToast({
  953. title: "取消收藏成功",
  954. duration: 2000,
  955. icon: "none",
  956. });
  957. } else {
  958. uni.showToast({
  959. title: "取消收藏失败",
  960. duration: 2000,
  961. icon: "none",
  962. });
  963. }
  964. });
  965. }
  966. },
  967. /**
  968. * @param {Object} e单选点击
  969. */
  970. radioSelect(optionsId, bindex) {
  971. if (this.questionList[bindex].ques) return;
  972. this.$set(this.questionList[bindex], "ques", optionsId);
  973. },
  974. /**
  975. * @param {Object} e单选点击
  976. */
  977. radioSelectChild(optionsId, ansIndex, bindex) {
  978. if (this.questionList[bindex].ques[ansIndex]) return;
  979. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  980. },
  981. /**
  982. * @param {Object} 多选点击
  983. */
  984. checkboxSelect(optionsId, bindex, index) {
  985. this.$set(
  986. this.questionList[bindex].jsonStr[index],
  987. "checked",
  988. !this.questionList[bindex].jsonStr[index].checked
  989. );
  990. },
  991. /**
  992. * @param {Object} 多选点击
  993. */
  994. checkboxSelectChild(bindex, ansIndex, childIndex) {
  995. this.$set(
  996. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  997. "checked",
  998. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  999. .checked
  1000. );
  1001. },
  1002. isCheckboxChecked(arr) {
  1003. return arr.some((item) => {
  1004. if (item.checked) {
  1005. return true;
  1006. }
  1007. });
  1008. },
  1009. /**
  1010. * @param {Object} 多选确认
  1011. */
  1012. checkboxSubmit(bindex) {
  1013. if (this.questionList[bindex].ques) return;
  1014. let arr = [];
  1015. this.questionList[bindex].jsonStr.forEach((item) => {
  1016. if (item.checked) {
  1017. arr.push(item.optionsId);
  1018. }
  1019. });
  1020. if (!arr.length) {
  1021. uni.showToast({
  1022. title: "请选择答案",
  1023. icon: "none",
  1024. });
  1025. return;
  1026. }
  1027. this.$set(this.questionList[bindex], "ques", arr);
  1028. },
  1029. /**
  1030. * @param {Object} 多选确认
  1031. */
  1032. checkboxSubmitChild(bindex, ansIndex) {
  1033. if (this.questionList[bindex].ques[ansIndex]) return;
  1034. let arr = [];
  1035. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1036. (item) => {
  1037. if (item.checked) {
  1038. arr.push(item.optionsId);
  1039. }
  1040. }
  1041. );
  1042. if (!arr.length) {
  1043. uni.showToast({
  1044. title: "请选择答案",
  1045. icon: "none",
  1046. });
  1047. return;
  1048. }
  1049. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1050. },
  1051. judgeSelect(index, bindex) {
  1052. if (this.questionList[bindex].ques) return;
  1053. this.$set(this.questionList[bindex], "ques", index == 0 ? '1' : '0');
  1054. },
  1055. judgeSelectChild(ansindex, childindex, bindex) {
  1056. if (this.questionList[bindex].ques[ansindex]) return;
  1057. this.$set(this.questionList[bindex].ques, ansindex, childindex == 0 ? '1' : '0');
  1058. },
  1059. openFooterTab() {
  1060. this.show = true;
  1061. },
  1062. hideDialog() {
  1063. this.showDialog = false;
  1064. },
  1065. changeIndex(index) {
  1066. this.current = index;
  1067. },
  1068. swiperChange(e) {
  1069. this.current = e.detail.current;
  1070. },
  1071. deleteImg(imgIndex, bankIndex) {
  1072. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1073. },
  1074. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1075. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1076. imgIndex,
  1077. 1
  1078. );
  1079. },
  1080. chooseImg(bankindex) {
  1081. uni.chooseImage({
  1082. count: 1, //默认9
  1083. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1084. sourceType: ["album", "camera"], //从相册选择
  1085. success: (res) => {
  1086. let self = this;
  1087. // console.log(JSON.stringify(res.tempFilePaths));
  1088. let img = res.tempFilePaths[0];
  1089. uni.getImageInfo({
  1090. src: img,
  1091. success: async (res) => {
  1092. let canvasWidth = res.width; //图片原始长宽
  1093. let canvasHeight = res.height;
  1094. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1095. uni.compressImage({
  1096. src: img,
  1097. quality: 75,
  1098. width: "50%",
  1099. height: "50%",
  1100. success: async (rest) => {
  1101. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1102. this.questionList[bankindex].ansText.imageList.push(dir);
  1103. },
  1104. });
  1105. } else {
  1106. const dir = await self.uploadFile(img, 0);
  1107. this.questionList[bankindex].ansText.imageList.push(dir);
  1108. }
  1109. },
  1110. });
  1111. },
  1112. });
  1113. },
  1114. chooseImgChild(bankindex, ansindex) {
  1115. uni.chooseImage({
  1116. count: 1, //默认9
  1117. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1118. sourceType: ["album", "camera"], //从相册选择
  1119. success: (res) => {
  1120. let self = this;
  1121. // console.log(JSON.stringify(res.tempFilePaths));
  1122. let img = res.tempFilePaths[0];
  1123. uni.getImageInfo({
  1124. src: img,
  1125. success: async (res) => {
  1126. let canvasWidth = res.width; //图片原始长宽
  1127. let canvasHeight = res.height;
  1128. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1129. uni.compressImage({
  1130. src: img,
  1131. quality: 75,
  1132. width: "50%",
  1133. height: "50%",
  1134. success: async (rest) => {
  1135. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1136. this.questionList[bankindex].jsonStr[
  1137. ansindex
  1138. ].ansText.imageList.push(dir);
  1139. },
  1140. });
  1141. } else {
  1142. const dir = await self.uploadFile(img, 0);
  1143. this.questionList[bankindex].jsonStr[
  1144. ansindex
  1145. ].ansText.imageList.push(dir);
  1146. }
  1147. },
  1148. });
  1149. },
  1150. });
  1151. },
  1152. uploadFile(options, int) {
  1153. var self = this;
  1154. return new Promise((resolve, reject) => {
  1155. var data = {
  1156. imageStatus: int,
  1157. };
  1158. self.$api.aliyunpolicy(data).then((res) => {
  1159. console.log(res.data, 6);
  1160. if (res.data.code != 200) {
  1161. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1162. return;
  1163. }
  1164. var ossToken = res.data.data.resultContent;
  1165. if (ossToken.host == null || ossToken.host == undefined) {
  1166. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1167. return;
  1168. }
  1169. uni.uploadFile({
  1170. url: ossToken.host,
  1171. name: "file",
  1172. filePath: options,
  1173. fileType: "image",
  1174. header: {
  1175. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1176. },
  1177. formData: {
  1178. key: ossToken.dir,
  1179. OSSAccessKeyId: ossToken.accessid,
  1180. policy: ossToken.policy,
  1181. Signature: ossToken.signature,
  1182. callback: ossToken.callback,
  1183. success_action_status: 200,
  1184. },
  1185. success: (result) => {
  1186. // if (result.statusCode === 200) {
  1187. resolve(ossToken.dir);
  1188. // } else {
  1189. // uni.showToast({
  1190. // title: "上传失败",
  1191. // icon: "none",
  1192. // });
  1193. // return;
  1194. // }
  1195. },
  1196. fail: (error) => {
  1197. uni.showToast({
  1198. title: "上传接口报错" + error,
  1199. icon: "none",
  1200. });
  1201. return;
  1202. },
  1203. });
  1204. });
  1205. });
  1206. },
  1207. submitAns(bankindex) {
  1208. console.log(this.questionList[bankindex]);
  1209. if (
  1210. !this.questionList[bankindex].ansText.text &&
  1211. !this.questionList[bankindex].ansText.imageList.length
  1212. ) {
  1213. uni.showToast({
  1214. title: "请输入内容或上传图片",
  1215. duration: 2000,
  1216. icon: "none",
  1217. });
  1218. return;
  1219. }
  1220. this.$set(this.questionList[bankindex], "ques", {
  1221. imageList: this.questionList[bankindex].ansText.imageList,
  1222. text: this.questionList[bankindex].ansText.text,
  1223. });
  1224. },
  1225. submitAnsChild(bankindex, ansindex) {
  1226. if (
  1227. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  1228. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  1229. ) {
  1230. uni.showToast({
  1231. title: "请输入内容或上传图片",
  1232. duration: 2000,
  1233. icon: "none",
  1234. });
  1235. return;
  1236. }
  1237. this.$set(this.questionList[bankindex].ques, ansindex, {
  1238. imageList:
  1239. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  1240. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  1241. });
  1242. },
  1243. isRight(item, index) {
  1244. //单选
  1245. if (this.questionList[index].ques) {
  1246. if (item.type == 1) {
  1247. return this.questionList[index].ques == this.questionList[index].ans;
  1248. //多选
  1249. } else if (item.type == 2) {
  1250. //每一项都相等
  1251. return this.questionList[index].ans.every((item, i) => {
  1252. return item == this.questionList[index].ques[i];
  1253. });
  1254. //判断
  1255. } else if (item.type == 3) {
  1256. return this.questionList[index].ques == this.questionList[index].ans;
  1257. } else {
  1258. return false;
  1259. }
  1260. } else {
  1261. return false;
  1262. }
  1263. },
  1264. right(bankIndex, ansIndex, option) {
  1265. if (
  1266. this.questionList[bankIndex].ques[ansIndex] &&
  1267. this.questionList[bankIndex].ans[ansIndex]
  1268. ) {
  1269. if (
  1270. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1271. option.optionsId
  1272. ) != -1 ||
  1273. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1274. option.optionsId
  1275. ) != -1
  1276. ) {
  1277. return true;
  1278. } else {
  1279. return false;
  1280. }
  1281. } else {
  1282. return false;
  1283. }
  1284. },
  1285. wrong(bankIndex, ansIndex, option) {
  1286. if (
  1287. this.questionList[bankIndex].ques[ansIndex] &&
  1288. this.questionList[bankIndex].ans[ansIndex]
  1289. ) {
  1290. if (
  1291. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1292. option.optionsId
  1293. ) != -1 &&
  1294. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1295. option.optionsId
  1296. ) == -1
  1297. ) {
  1298. return true;
  1299. } else {
  1300. return false;
  1301. }
  1302. } else {
  1303. return false;
  1304. }
  1305. },
  1306. isWrong(item, index) {
  1307. if (this.questionList[index].ques) {
  1308. //单选
  1309. if (item.type == 1) {
  1310. return this.questionList[index].ques != this.questionList[index].ans;
  1311. //多选
  1312. } else if (item.type == 2) {
  1313. //每一项都相等
  1314. return this.questionList[index].ques.some((item, i) => {
  1315. return this.questionList[index].ans.indexOf(item) == -1;
  1316. });
  1317. //判断
  1318. } else if (item.type == 3) {
  1319. return this.questionList[index].ques != this.questionList[index].ans;
  1320. } else {
  1321. return false;
  1322. }
  1323. } else {
  1324. return false;
  1325. }
  1326. },
  1327. isPart(item, index) {
  1328. if (this.questionList[index].ques) {
  1329. if (item.type == 2) {
  1330. let isWrong = this.questionList[index].ques.some((item, i) => {
  1331. return this.questionList[index].ans.indexOf(item) == -1;
  1332. });
  1333. let isRight = this.questionList[index].ans.every((item, i) => {
  1334. return item == this.questionList[index].ques[i];
  1335. });
  1336. if (!isRight && !isWrong) {
  1337. return true;
  1338. }
  1339. }
  1340. } else {
  1341. return false;
  1342. }
  1343. },
  1344. tabSelect(index, bankindex) {
  1345. this.$set(this.questionList[bankindex], "current", index);
  1346. },
  1347. },
  1348. };
  1349. </script>
  1350. <style lang="scss" scoped>
  1351. #questionBank {
  1352. width: 100%;
  1353. height: 100vh;
  1354. display: flex;
  1355. flex-direction: column;
  1356. }
  1357. .swiper {
  1358. width: 100%;
  1359. flex: 1;
  1360. }
  1361. .lisSty {
  1362. margin-bottom: 16rpx;
  1363. display: flex;
  1364. align-items: center;
  1365. .flex_auto {
  1366. flex: 1;
  1367. }
  1368. }
  1369. .activeTI {
  1370. vertical-align: middle;
  1371. display: inline-block;
  1372. border: 1rpx solid #eee;
  1373. border-radius: 50rpx;
  1374. height: 48rpx;
  1375. line-height: 46rpx;
  1376. text-align: center;
  1377. width: 48rpx;
  1378. margin-right: 15rpx;
  1379. color: #666;
  1380. font-size: 30rpx;
  1381. &.right {
  1382. color: #fff;
  1383. background: #36c75a;
  1384. }
  1385. &.wrong {
  1386. color: #fff;
  1387. background: #ff3b30;
  1388. }
  1389. &.checked {
  1390. color: #fff;
  1391. background: #007aff;
  1392. }
  1393. }
  1394. .submit_checkbox {
  1395. position: fixed;
  1396. left: 0;
  1397. right: 0;
  1398. bottom: 120rpx;
  1399. margin: 20rpx auto;
  1400. width: 526rpx;
  1401. height: 80rpx;
  1402. background: rgba(0, 122, 255, 1);
  1403. color: #fff;
  1404. text-align: center;
  1405. line-height: 80rpx;
  1406. font-size: 30rpx;
  1407. border-radius: 40rpx;
  1408. &.disabled {
  1409. opacity: 0.6;
  1410. }
  1411. }
  1412. .titles {
  1413. overflow: hidden;
  1414. margin-bottom: 24rpx;
  1415. }
  1416. .titBox {
  1417. padding: 41rpx 25rpx 24rpx 25rpx;
  1418. }
  1419. .titBox_title {
  1420. padding: 21rpx;
  1421. }
  1422. .tabs {
  1423. margin: 10rpx;
  1424. display: flex;
  1425. .tab {
  1426. margin: 0 4rpx;
  1427. padding: 10rpx 13rpx;
  1428. text-align: center;
  1429. color: #007aff;
  1430. font-size: 28rpx;
  1431. border-radius: 16rpx;
  1432. background: #fff;
  1433. &.current {
  1434. color: #fff;
  1435. background: #007aff;
  1436. }
  1437. }
  1438. }
  1439. .ans {
  1440. margin: 8rpx 8rpx 8rpx;
  1441. .ans_input {
  1442. border-radius: 16rpx;
  1443. background: #fff;
  1444. .top {
  1445. border-bottom: 1rpx solid #eeeeee;
  1446. padding: 16rpx;
  1447. display: flex;
  1448. align-items: center;
  1449. .icon {
  1450. margin-right: 20rpx;
  1451. width: 40rpx;
  1452. height: 38rpx;
  1453. }
  1454. .progress {
  1455. flex: 1;
  1456. }
  1457. .submit {
  1458. width: 168rpx;
  1459. height: 48rpx;
  1460. line-height: 48rpx;
  1461. text-align: center;
  1462. color: #fff;
  1463. font-size: 30rpx;
  1464. background: #007aff;
  1465. border-radius: 24rpx;
  1466. &.disabled {
  1467. opacity: 0.6;
  1468. }
  1469. }
  1470. }
  1471. .textarea {
  1472. textarea {
  1473. width: 100%;
  1474. height: 287rpx;
  1475. padding: 10rpx;
  1476. }
  1477. }
  1478. .imgs {
  1479. overflow: hidden;
  1480. display: flex;
  1481. width: 100%;
  1482. .img {
  1483. width: 104rpx;
  1484. height: 104rpx;
  1485. border-radius: 8rpx;
  1486. position: relative;
  1487. margin: 20rpx;
  1488. text {
  1489. position: absolute;
  1490. right: -15rpx;
  1491. top: -15rpx;
  1492. width: 30rpx;
  1493. height: 30rpx;
  1494. text-align: center;
  1495. line-height: 30rpx;
  1496. color: #fff;
  1497. background: #ff3b30;
  1498. border-radius: 50%;
  1499. }
  1500. image {
  1501. width: 100%;
  1502. height: 100%;
  1503. }
  1504. }
  1505. }
  1506. }
  1507. .ans_submit {
  1508. padding: 16rpx;
  1509. border-radius: 16rpx;
  1510. background: #fff;
  1511. .imgs {
  1512. overflow: hidden;
  1513. display: flex;
  1514. width: 100%;
  1515. .img {
  1516. width: 104rpx;
  1517. height: 104rpx;
  1518. border-radius: 8rpx;
  1519. position: relative;
  1520. margin: 20rpx;
  1521. image {
  1522. width: 100%;
  1523. height: 100%;
  1524. }
  1525. }
  1526. }
  1527. }
  1528. }
  1529. .firstLetter {
  1530. display: flex;
  1531. justify-content: space-between;
  1532. align-items: center;
  1533. margin-bottom: 30rpx;
  1534. .leftLetters {
  1535. display: flex;
  1536. align-items: center;
  1537. width: 220rpx;
  1538. .btnType {
  1539. padding: 5rpx 10rpx;
  1540. border: 1rpx solid #007aff;
  1541. border-radius: 10rpx;
  1542. background-color: rgba(0, 122, 255, 0.1);
  1543. font-size: 28rpx;
  1544. color: #007aff;
  1545. margin-right: 15rpx;
  1546. }
  1547. }
  1548. }
  1549. .popupView {
  1550. height: 100%;
  1551. padding-bottom: 100rpx;
  1552. .popupTops {
  1553. height: 77rpx;
  1554. border-bottom: 1rpx solid #eee;
  1555. text-align: center;
  1556. line-height: 77rpx;
  1557. font-size: 24rpx;
  1558. color: #999;
  1559. position: relative;
  1560. .topIcon {
  1561. position: absolute;
  1562. top: 10rpx;
  1563. left: 50%;
  1564. transform: translateX(-50%);
  1565. width: 80rpx;
  1566. height: 8rpx;
  1567. background-color: #999;
  1568. border-radius: 4rpx;
  1569. }
  1570. }
  1571. .popupContent {
  1572. }
  1573. }
  1574. .pageContent {
  1575. position: relative;
  1576. background-color: #eaeef1;
  1577. height: 100%;
  1578. overflow-y: scroll;
  1579. padding-top: 8rpx;
  1580. padding-bottom: 100rpx;
  1581. }
  1582. .pad_8 {
  1583. background-color: #fff;
  1584. margin: 0rpx 8rpx 8rpx;
  1585. border-radius: 16rpx;
  1586. &.no-margin {
  1587. margin-top: -16rpx;
  1588. border-radius: 0 0 16rpx 16rpx;
  1589. }
  1590. }
  1591. .answer {
  1592. height: 80rpx;
  1593. line-height: 80rpx;
  1594. padding: 0rpx 24rpx;
  1595. display: flex;
  1596. align-items: center;
  1597. justify-content: space-between;
  1598. color: #666;
  1599. font-size: 30rpx;
  1600. }
  1601. .footer_btn {
  1602. background-color: #fff;
  1603. z-index: 10078;
  1604. position: fixed;
  1605. bottom: 0rpx;
  1606. display: flex;
  1607. align-items: center;
  1608. justify-content: space-between;
  1609. width: 100%;
  1610. height: 98rpx;
  1611. padding: 0rpx 38rpx;
  1612. border-top: 1rpx solid #eee;
  1613. .flex_center {
  1614. flex: 1;
  1615. display: flex;
  1616. justify-content: center;
  1617. align-items: center;
  1618. flex-direction: column;
  1619. margin: 0 200rpx;
  1620. font-size: 24rpx;
  1621. color: #999999;
  1622. .up-icon {
  1623. margin-bottom: 18rpx;
  1624. width: 100%;
  1625. display: flex;
  1626. justify-content: center;
  1627. image {
  1628. width: 58rpx;
  1629. height: 21rpx;
  1630. }
  1631. }
  1632. }
  1633. .collect {
  1634. visibility: hidden;
  1635. &.show {
  1636. visibility: visible;
  1637. }
  1638. > view {
  1639. display: flex;
  1640. flex-direction: column;
  1641. align-items: center;
  1642. justify-content: center;
  1643. image {
  1644. width: 32rpx;
  1645. height: 32rpx;
  1646. margin-bottom: 6rpx;
  1647. }
  1648. view {
  1649. font-size: 24rpx;
  1650. color: #999999;
  1651. }
  1652. }
  1653. }
  1654. }
  1655. .boxSty {
  1656. padding: 44rpx 41rpx 0rpx;
  1657. }
  1658. .liListSty {
  1659. border: 1rpx solid #eeeeee;
  1660. width: 88rpx;
  1661. height: 88rpx;
  1662. border-radius: 32rpx;
  1663. text-align: center;
  1664. line-height: 88rpx;
  1665. color: #333;
  1666. font-size: 32rpx;
  1667. float: left;
  1668. margin: 20rpx 23rpx;
  1669. &.isRight {
  1670. border: 1rpx solid #eeeeee;
  1671. color: #fff;
  1672. background: #36c75a;
  1673. }
  1674. &.isWrong {
  1675. border: 1rpx solid #eeeeee;
  1676. color: #fff;
  1677. background: #ff3b30;
  1678. }
  1679. &.isPart {
  1680. border: 1rpx solid #eeeeee;
  1681. color: #fff;
  1682. background: #ffc53d;
  1683. }
  1684. }
  1685. .answerInfos {
  1686. padding: 25rpx 25rpx 25rpx 23rpx;
  1687. }
  1688. .answerTitle {
  1689. margin-bottom: 28rpx;
  1690. color: #666;
  1691. font-size: 30rpx;
  1692. }
  1693. .answerContent {
  1694. font-size: 30rpx;
  1695. color: #666;
  1696. }
  1697. .textChild {
  1698. display: inline-block;
  1699. vertical-align: middle;
  1700. }
  1701. .dialog {
  1702. position: fixed;
  1703. left: 0;
  1704. top: 0;
  1705. width: 100%;
  1706. height: 100%;
  1707. background-color: rgba(0, 0, 0, 0.8);
  1708. display: flex;
  1709. flex-direction: column;
  1710. align-items: center;
  1711. justify-content: center;
  1712. z-index: 20000;
  1713. .pointer {
  1714. width: 338rpx;
  1715. height: 240rpx;
  1716. }
  1717. .text {
  1718. font-size: 32rpx;
  1719. color: #ffffff;
  1720. text-align: center;
  1721. }
  1722. .btn {
  1723. width: 242rpx;
  1724. height: 82rpx;
  1725. border: 2rpx solid #ffffff;
  1726. border-radius: 16rpx;
  1727. text-align: center;
  1728. line-height: 82rpx;
  1729. margin: 41rpx auto;
  1730. color: #fff;
  1731. font-size: 32rpx;
  1732. }
  1733. }
  1734. </style>