collectBank.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820
  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. word-break: break-all;
  1368. }
  1369. }
  1370. .activeTI {
  1371. vertical-align: middle;
  1372. display: inline-block;
  1373. border: 1rpx solid #eee;
  1374. border-radius: 50rpx;
  1375. height: 48rpx;
  1376. line-height: 46rpx;
  1377. text-align: center;
  1378. width: 48rpx;
  1379. margin-right: 15rpx;
  1380. color: #666;
  1381. font-size: 30rpx;
  1382. &.right {
  1383. color: #fff;
  1384. background: #36c75a;
  1385. }
  1386. &.wrong {
  1387. color: #fff;
  1388. background: #ff3b30;
  1389. }
  1390. &.checked {
  1391. color: #fff;
  1392. background: #007aff;
  1393. }
  1394. }
  1395. .submit_checkbox {
  1396. position: fixed;
  1397. left: 0;
  1398. right: 0;
  1399. bottom: 120rpx;
  1400. margin: 20rpx auto;
  1401. width: 526rpx;
  1402. height: 80rpx;
  1403. background: rgba(0, 122, 255, 1);
  1404. color: #fff;
  1405. text-align: center;
  1406. line-height: 80rpx;
  1407. font-size: 30rpx;
  1408. border-radius: 40rpx;
  1409. &.disabled {
  1410. opacity: 0.6;
  1411. }
  1412. }
  1413. .titles {
  1414. overflow: hidden;
  1415. margin-bottom: 24rpx;
  1416. }
  1417. .titBox {
  1418. padding: 41rpx 25rpx 24rpx 25rpx;
  1419. }
  1420. .titBox_title {
  1421. padding: 21rpx;
  1422. }
  1423. .tabs {
  1424. margin: 10rpx;
  1425. display: flex;
  1426. .tab {
  1427. margin: 0 4rpx;
  1428. padding: 10rpx 13rpx;
  1429. text-align: center;
  1430. color: #007aff;
  1431. font-size: 28rpx;
  1432. border-radius: 16rpx;
  1433. background: #fff;
  1434. &.current {
  1435. color: #fff;
  1436. background: #007aff;
  1437. }
  1438. }
  1439. }
  1440. .ans {
  1441. margin: 8rpx 8rpx 8rpx;
  1442. .ans_input {
  1443. border-radius: 16rpx;
  1444. background: #fff;
  1445. .top {
  1446. border-bottom: 1rpx solid #eeeeee;
  1447. padding: 16rpx;
  1448. display: flex;
  1449. align-items: center;
  1450. .icon {
  1451. margin-right: 20rpx;
  1452. width: 40rpx;
  1453. height: 38rpx;
  1454. }
  1455. .progress {
  1456. flex: 1;
  1457. }
  1458. .submit {
  1459. width: 168rpx;
  1460. height: 48rpx;
  1461. line-height: 48rpx;
  1462. text-align: center;
  1463. color: #fff;
  1464. font-size: 30rpx;
  1465. background: #007aff;
  1466. border-radius: 24rpx;
  1467. &.disabled {
  1468. opacity: 0.6;
  1469. }
  1470. }
  1471. }
  1472. .textarea {
  1473. textarea {
  1474. width: 100%;
  1475. height: 287rpx;
  1476. padding: 10rpx;
  1477. }
  1478. }
  1479. .imgs {
  1480. overflow: hidden;
  1481. display: flex;
  1482. width: 100%;
  1483. .img {
  1484. width: 104rpx;
  1485. height: 104rpx;
  1486. border-radius: 8rpx;
  1487. position: relative;
  1488. margin: 20rpx;
  1489. text {
  1490. position: absolute;
  1491. right: -15rpx;
  1492. top: -15rpx;
  1493. width: 30rpx;
  1494. height: 30rpx;
  1495. text-align: center;
  1496. line-height: 30rpx;
  1497. color: #fff;
  1498. background: #ff3b30;
  1499. border-radius: 50%;
  1500. }
  1501. image {
  1502. width: 100%;
  1503. height: 100%;
  1504. }
  1505. }
  1506. }
  1507. }
  1508. .ans_submit {
  1509. padding: 16rpx;
  1510. border-radius: 16rpx;
  1511. background: #fff;
  1512. .imgs {
  1513. overflow: hidden;
  1514. display: flex;
  1515. width: 100%;
  1516. .img {
  1517. width: 104rpx;
  1518. height: 104rpx;
  1519. border-radius: 8rpx;
  1520. position: relative;
  1521. margin: 20rpx;
  1522. image {
  1523. width: 100%;
  1524. height: 100%;
  1525. }
  1526. }
  1527. }
  1528. }
  1529. }
  1530. .firstLetter {
  1531. display: flex;
  1532. justify-content: space-between;
  1533. align-items: center;
  1534. margin-bottom: 30rpx;
  1535. .leftLetters {
  1536. display: flex;
  1537. align-items: center;
  1538. width: 220rpx;
  1539. .btnType {
  1540. padding: 5rpx 10rpx;
  1541. border: 1rpx solid #007aff;
  1542. border-radius: 10rpx;
  1543. background-color: rgba(0, 122, 255, 0.1);
  1544. font-size: 28rpx;
  1545. color: #007aff;
  1546. margin-right: 15rpx;
  1547. }
  1548. }
  1549. }
  1550. .popupView {
  1551. height: 100%;
  1552. padding-bottom: 100rpx;
  1553. .popupTops {
  1554. height: 77rpx;
  1555. border-bottom: 1rpx solid #eee;
  1556. text-align: center;
  1557. line-height: 77rpx;
  1558. font-size: 24rpx;
  1559. color: #999;
  1560. position: relative;
  1561. .topIcon {
  1562. position: absolute;
  1563. top: 10rpx;
  1564. left: 50%;
  1565. transform: translateX(-50%);
  1566. width: 80rpx;
  1567. height: 8rpx;
  1568. background-color: #999;
  1569. border-radius: 4rpx;
  1570. }
  1571. }
  1572. .popupContent {
  1573. }
  1574. }
  1575. .pageContent {
  1576. position: relative;
  1577. background-color: #eaeef1;
  1578. height: 100%;
  1579. overflow-y: scroll;
  1580. padding-top: 8rpx;
  1581. padding-bottom: 100rpx;
  1582. }
  1583. .pad_8 {
  1584. background-color: #fff;
  1585. margin: 0rpx 8rpx 8rpx;
  1586. border-radius: 16rpx;
  1587. &.no-margin {
  1588. margin-top: -16rpx;
  1589. border-radius: 0 0 16rpx 16rpx;
  1590. }
  1591. }
  1592. .answer {
  1593. height: 80rpx;
  1594. line-height: 80rpx;
  1595. padding: 0rpx 24rpx;
  1596. display: flex;
  1597. align-items: center;
  1598. justify-content: space-between;
  1599. color: #666;
  1600. font-size: 30rpx;
  1601. }
  1602. .footer_btn {
  1603. background-color: #fff;
  1604. z-index: 10078;
  1605. position: fixed;
  1606. bottom: 0rpx;
  1607. display: flex;
  1608. align-items: center;
  1609. justify-content: space-between;
  1610. width: 100%;
  1611. height: 98rpx;
  1612. padding: 0rpx 38rpx;
  1613. border-top: 1rpx solid #eee;
  1614. .flex_center {
  1615. flex: 1;
  1616. display: flex;
  1617. justify-content: center;
  1618. align-items: center;
  1619. flex-direction: column;
  1620. margin: 0 200rpx;
  1621. font-size: 24rpx;
  1622. color: #999999;
  1623. .up-icon {
  1624. margin-bottom: 18rpx;
  1625. width: 100%;
  1626. display: flex;
  1627. justify-content: center;
  1628. image {
  1629. width: 58rpx;
  1630. height: 21rpx;
  1631. }
  1632. }
  1633. }
  1634. .collect {
  1635. visibility: hidden;
  1636. &.show {
  1637. visibility: visible;
  1638. }
  1639. > view {
  1640. display: flex;
  1641. flex-direction: column;
  1642. align-items: center;
  1643. justify-content: center;
  1644. image {
  1645. width: 32rpx;
  1646. height: 32rpx;
  1647. margin-bottom: 6rpx;
  1648. }
  1649. view {
  1650. font-size: 24rpx;
  1651. color: #999999;
  1652. }
  1653. }
  1654. }
  1655. }
  1656. .boxSty {
  1657. padding: 44rpx 41rpx 0rpx;
  1658. }
  1659. .liListSty {
  1660. border: 1rpx solid #eeeeee;
  1661. width: 88rpx;
  1662. height: 88rpx;
  1663. border-radius: 32rpx;
  1664. text-align: center;
  1665. line-height: 88rpx;
  1666. color: #333;
  1667. font-size: 32rpx;
  1668. float: left;
  1669. margin: 20rpx 23rpx;
  1670. &.isRight {
  1671. border: 1rpx solid #eeeeee;
  1672. color: #fff;
  1673. background: #36c75a;
  1674. }
  1675. &.isWrong {
  1676. border: 1rpx solid #eeeeee;
  1677. color: #fff;
  1678. background: #ff3b30;
  1679. }
  1680. &.isPart {
  1681. border: 1rpx solid #eeeeee;
  1682. color: #fff;
  1683. background: #ffc53d;
  1684. }
  1685. }
  1686. .answerInfos {
  1687. padding: 25rpx 25rpx 25rpx 23rpx;
  1688. }
  1689. .answerTitle {
  1690. margin-bottom: 28rpx;
  1691. color: #666;
  1692. font-size: 30rpx;
  1693. }
  1694. .answerContent {
  1695. font-size: 30rpx;
  1696. color: #666;
  1697. }
  1698. .textChild {
  1699. display: inline-block;
  1700. vertical-align: middle;
  1701. }
  1702. .dialog {
  1703. position: fixed;
  1704. left: 0;
  1705. top: 0;
  1706. width: 100%;
  1707. height: 100%;
  1708. background-color: rgba(0, 0, 0, 0.8);
  1709. display: flex;
  1710. flex-direction: column;
  1711. align-items: center;
  1712. justify-content: center;
  1713. z-index: 20000;
  1714. .pointer {
  1715. width: 338rpx;
  1716. height: 240rpx;
  1717. }
  1718. .text {
  1719. font-size: 32rpx;
  1720. color: #ffffff;
  1721. text-align: center;
  1722. }
  1723. .btn {
  1724. width: 242rpx;
  1725. height: 82rpx;
  1726. border: 2rpx solid #ffffff;
  1727. border-radius: 16rpx;
  1728. text-align: center;
  1729. line-height: 82rpx;
  1730. margin: 41rpx auto;
  1731. color: #fff;
  1732. font-size: 32rpx;
  1733. }
  1734. }
  1735. </style>