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. :interval="interval"
  9. >
  10. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  11. <view class="pageContent">
  12. <view class="pad_8 titBox">
  13. <view class="firstLetter">
  14. <view class="leftLetters">
  15. <view class="btnType">
  16. <text v-if="bank.type == 1">单选</text>
  17. <text v-if="bank.type == 2">多选</text>
  18. <text v-if="bank.type == 3">判断</text>
  19. <text v-if="bank.type == 4">案例题</text>
  20. <text v-if="bank.type == 5">简答题</text>
  21. </view>
  22. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  23. </view>
  24. <view style="color: #666; font-size: 28rpx"></view>
  25. <view class="leftLetters"></view>
  26. </view>
  27. <view class="titles">
  28. <rich-text :nodes="bank.content"></rich-text>
  29. </view>
  30. </view>
  31. <template v-if="bank.type == 1">
  32. <view class="pad_8 titBox no-margin">
  33. <view v-if="!bank.ques">
  34. <view
  35. v-for="(item, index) in bank.jsonStr"
  36. :key="index"
  37. class="lisSty"
  38. @click="radioSelect(item.optionsId, bankIndex)"
  39. >
  40. <view class="activeTI">{{ ast[index] }}</view>
  41. <view class="flex_auto">
  42. {{ item.content }}
  43. <view v-if="item.imgUrl">
  44. <image
  45. style="width: 600rpx"
  46. mode="widthFix"
  47. :src="$method.splitImgHost(item.imgUrl)"
  48. ></image>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view v-if="bank.ques">
  54. <view
  55. v-for="(item, index) in bank.jsonStr"
  56. :key="index"
  57. class="lisSty"
  58. >
  59. <text
  60. :class="{
  61. right:
  62. item.optionsId == bank.ques ||
  63. item.optionsId == bank.ans,
  64. wrong:
  65. item.optionsId == bank.ques && bank.ques != bank.ans,
  66. }"
  67. class="activeTI"
  68. >{{ ast[index] }}</text
  69. >
  70. <view class="flex_auto">
  71. {{ item.content }}
  72. <view v-if="item.imgUrl">
  73. <image
  74. style="width: 600rpx"
  75. mode="widthFix"
  76. :src="$method.splitImgHost(item.imgUrl)"
  77. ></image>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view v-if="bank.ques">
  84. <view class="pad_8 answer">
  85. <view>题目答案:{{ ast[bank.ans - 1] }}</view>
  86. <view v-if="!explain">我的答案:{{ ast[bank.ques - 1] }}</view>
  87. </view>
  88. <view class="pad_8 answerInfos">
  89. <view class="answerTitle">答案解析</view>
  90. <view class="answerContent">
  91. <rich-text :nodes="bank.analysisContent"></rich-text>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <template v-if="bank.type == 2">
  97. <view class="pad_8 titBox no-margin">
  98. <view v-if="!bank.ques">
  99. <view
  100. v-for="(item, index) in bank.jsonStr"
  101. :key="index"
  102. class="lisSty"
  103. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  104. >
  105. <view :class="{ checked: item.checked }" class="activeTI">{{
  106. ast[index]
  107. }}</view>
  108. <view class="flex_auto">
  109. {{ item.content }}
  110. <view v-if="item.imgUrl">
  111. <image
  112. style="width: 600rpx"
  113. mode="widthFix"
  114. :src="$method.splitImgHost(item.imgUrl)"
  115. ></image>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <view
  121. v-if="!bank.ques"
  122. class="submit_checkbox"
  123. :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
  124. @click="checkboxSubmit(bankIndex)"
  125. >
  126. 确认答案
  127. </view>
  128. <view v-if="bank.ques">
  129. <view
  130. v-for="(item, index) in bank.jsonStr"
  131. :key="index"
  132. class="lisSty"
  133. >
  134. <text
  135. :class="{
  136. right:
  137. bank.ques.indexOf(item.optionsId) != -1 ||
  138. bank.ans.indexOf(item.optionsId) != -1,
  139. wrong:
  140. bank.ques.indexOf(item.optionsId) != -1 &&
  141. bank.ans.indexOf(item.optionsId) == -1,
  142. }"
  143. class="activeTI"
  144. >{{ ast[index] }}</text
  145. >
  146. <view class="flex_auto">
  147. {{ item.content }}
  148. <view v-if="item.imgUrl">
  149. <image
  150. style="width: 600rpx"
  151. mode="widthFix"
  152. :src="$method.splitImgHost(item.imgUrl)"
  153. ></image>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <view v-if="bank.ques">
  160. <view class="pad_8 answer">
  161. <view
  162. >题目答案:
  163. <text
  164. v-for="(ansItem, ansItemIndex) in bank.ans"
  165. :key="ansItemIndex"
  166. >{{ ast[ansItem - 1] }}</text
  167. >
  168. </view>
  169. <view v-if="!explain"
  170. >我的答案:
  171. <text
  172. v-for="(quesItem, quesItemIndex) in bank.ques"
  173. :key="quesItemIndex"
  174. >{{ ast[quesItem - 1] }}</text
  175. >
  176. </view>
  177. </view>
  178. <view class="pad_8 answerInfos">
  179. <view class="answerTitle">答案解析</view>
  180. <view class="answerContent">
  181. <rich-text :nodes="bank.analysisContent"></rich-text>
  182. </view>
  183. </view>
  184. </view>
  185. </template>
  186. <template v-if="bank.type == 3">
  187. <view class="pad_8 titBox no-margin">
  188. <view v-if="!bank.ques">
  189. <view
  190. v-for="(item, index) in judge"
  191. :key="index"
  192. class="lisSty"
  193. @click="judgeSelect(index, bankIndex)"
  194. >
  195. <view class="activeTI">{{ ast[index] }}</view>
  196. <view class="flex_auto">
  197. {{ item }}
  198. <view v-if="item.imgUrl">
  199. <image
  200. style="width: 600rpx"
  201. mode="widthFix"
  202. :src="$method.splitImgHost(item.imgUrl)"
  203. ></image>
  204. </view>
  205. </view>
  206. </view>
  207. </view>
  208. <view v-if="bank.ques">
  209. <view
  210. v-for="(item, index) in judge"
  211. :key="index"
  212. class="lisSty"
  213. >
  214. <text
  215. :class="{
  216. right: index == (bank.ques == 1 ? 0 : 1) || index != bank.ans,
  217. wrong: index == (bank.ques == 1 ? 0 : 1) && bank.ques != bank.ans,
  218. }"
  219. class="activeTI"
  220. >{{ ast[index] }}</text
  221. >
  222. <view class="flex_auto">
  223. {{ item }}
  224. <view v-if="item.imgUrl">
  225. <image
  226. style="width: 600rpx"
  227. mode="widthFix"
  228. :src="$method.splitImgHost(item.imgUrl)"
  229. ></image>
  230. </view>
  231. </view>
  232. </view>
  233. </view>
  234. </view>
  235. <view v-if="bank.ques">
  236. <view class="pad_8 answer">
  237. <view>题目答案:{{ ast[bank.ans == 1 ? 0 : 1] }}</view>
  238. <view v-if="!explain">我的答案:{{ ast[bank.ques == 1 ? 0 : 1] }}</view>
  239. </view>
  240. <view class="pad_8 answerInfos">
  241. <view class="answerTitle">答案解析</view>
  242. <view class="answerContent">
  243. <rich-text :nodes="bank.analysisContent"></rich-text>
  244. </view>
  245. </view>
  246. </view>
  247. </template>
  248. <!-- 简答题 -->
  249. <template v-if="bank.type == 5">
  250. <view class="pad_8 titBox">
  251. <view class="ans">
  252. <view class="ans_input" v-if="!bank.ques">
  253. <view class="top flex">
  254. <image
  255. :data-index="bankIndex"
  256. class="icon"
  257. @click="chooseImg(bankIndex)"
  258. src="/static/08-10_032.jpg"
  259. mode=""
  260. ></image>
  261. <view class="progress"
  262. >{{ bank.ansText.imageList.length || "0" }}/4</view
  263. >
  264. <view
  265. class="submit"
  266. :class="{ disabled: !bank.ansText.text && hasImgs(bank) }"
  267. @click="submitAns(bankIndex)"
  268. >确认答案</view
  269. >
  270. </view>
  271. <view class="textarea">
  272. <textarea
  273. v-model="bank.ansText.text"
  274. placeholder="在此输入答案"
  275. ></textarea>
  276. </view>
  277. <view class="imgs">
  278. <view
  279. class="img"
  280. v-for="(img, imgIndex) in bank.ansText.imageList"
  281. :key="imgIndex"
  282. >
  283. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  284. <image :src="$method.splitImgHost(img, true)"></image>
  285. </view>
  286. </view>
  287. </view>
  288. <view
  289. class="ans_submit answerInfos"
  290. v-if="bank.ques && !explain"
  291. >
  292. <view class="answerTitle">我的答案:</view>
  293. {{ bank.ques.text }}
  294. <view class="imgs">
  295. <image
  296. class="img"
  297. :key="quesIndex"
  298. v-for="(ques, quesIndex) in bank.ques.imageList"
  299. :src="$method.splitImgHost(ques, true)"
  300. ></image>
  301. </view>
  302. </view>
  303. </view>
  304. </view>
  305. <view v-if="bank.ques">
  306. <view class="pad_8 answerInfos">
  307. <view class="answerTitle">答案解析:</view>
  308. <view class="answerContent">
  309. <rich-text :nodes="bank.analysisContent"></rich-text>
  310. </view>
  311. </view>
  312. </view>
  313. </template>
  314. <!-- 案例题 -->
  315. <template v-if="bank.type == 4">
  316. <view class="tabs">
  317. <view
  318. class="tab"
  319. :class="{ current: tabIndex == bank.current }"
  320. :key="tabIndex"
  321. v-for="(tab, tabIndex) in bank.jsonStr"
  322. @click="tabSelect(tabIndex, bankIndex)"
  323. >问题{{ tabIndex + 1 }}</view
  324. >
  325. </view>
  326. <view
  327. v-for="(ansItem, ansIndex) in bank.jsonStr"
  328. v-if="bank.current == ansIndex"
  329. :key="ansIndex"
  330. >
  331. <template v-if="ansItem.type == 1">
  332. <view class="pad_8 titBox">
  333. <view class="titles">
  334. <rich-text :nodes="ansItem.content"></rich-text>
  335. </view>
  336. <view v-if="!bank.ques[ansIndex]">
  337. <view
  338. v-for="(option, childIndex) in ansItem.optionsList"
  339. :key="childIndex"
  340. class="lisSty"
  341. @click="
  342. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  343. "
  344. >
  345. <view class="activeTI">{{ ast[childIndex] }}</view>
  346. <view class="flex_auto">
  347. <rich-text
  348. class="textChild"
  349. :nodes="option.content"
  350. ></rich-text>
  351. <view v-if="option.imgUrl">
  352. <image
  353. style="width: 600rpx"
  354. mode="widthFix"
  355. :src="$method.splitImgHost(option.imgUrl)"
  356. ></image>
  357. </view>
  358. </view>
  359. </view>
  360. </view>
  361. <view v-if="bank.ques[ansIndex]">
  362. <view
  363. v-for="(option, childIndex) in ansItem.optionsList"
  364. :key="childIndex"
  365. class="lisSty"
  366. >
  367. <text
  368. :class="{
  369. right:
  370. option.optionsId == bank.ques[ansIndex] ||
  371. option.optionsId == bank.ans[ansIndex],
  372. wrong:
  373. option.optionsId == bank.ques[ansIndex] &&
  374. bank.ques[ansIndex] != bank.ans[ansIndex],
  375. }"
  376. class="activeTI"
  377. >{{ ast[childIndex] }}</text
  378. >
  379. <view class="flex_auto">
  380. <rich-text :nodes="option.content"></rich-text>
  381. <view v-if="option.imgUrl">
  382. <image
  383. style="width: 600rpx"
  384. mode="widthFix"
  385. :src="$method.splitImgHost(option.imgUrl)"
  386. ></image>
  387. </view>
  388. </view>
  389. </view>
  390. </view>
  391. </view>
  392. <view v-if="bank.ques[ansIndex]">
  393. <view class="pad_8 answer">
  394. <view>题目答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  395. <view v-if="!explain"
  396. >我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view
  397. >
  398. </view>
  399. <view class="pad_8 answerInfos">
  400. <view class="answerTitle">答案解析</view>
  401. <view class="answerContent">
  402. <rich-text :nodes="option.analysisContent"></rich-text>
  403. </view>
  404. </view>
  405. </view>
  406. </template>
  407. <template v-if="ansItem.type == 2">
  408. <view class="pad_8 titBox">
  409. <view class="titles">
  410. <rich-text :nodes="ansItem.content"></rich-text>
  411. </view>
  412. <view v-if="!bank.ques[ansIndex]">
  413. <view
  414. v-for="(option, childindex) in ansItem.optionsList"
  415. :key="childindex"
  416. class="lisSty"
  417. @click="
  418. checkboxSelectChild(bankIndex, ansIndex, childindex)
  419. "
  420. >
  421. <view
  422. :class="{ checked: option.checked }"
  423. class="activeTI"
  424. >{{ ast[childindex] }}</view
  425. >
  426. <view class="flex_auto">
  427. <rich-text :nodes="option.content"></rich-text>
  428. <view v-if="option.imgUrl">
  429. <image
  430. style="width: 600rpx"
  431. mode="widthFix"
  432. :src="$method.splitImgHost(option.imgUrl)"
  433. ></image>
  434. </view>
  435. </view>
  436. </view>
  437. </view>
  438. <view
  439. v-if="!bank.ques[ansIndex]"
  440. class="submit_checkbox"
  441. :class="{
  442. disabled: !isCheckboxChecked(ansItem.optionsList),
  443. }"
  444. @click="checkboxSubmitChild(bankIndex, ansIndex)"
  445. >
  446. 确认答案
  447. </view>
  448. <view v-if="bank.ques && bank.ques[ansIndex]">
  449. <view
  450. v-for="(option, childindex) in ansItem.optionsList"
  451. :key="childindex"
  452. class="lisSty"
  453. >
  454. <text
  455. :class="{
  456. right: right(bankIndex, ansIndex, option),
  457. wrong: wrong(bankIndex, ansIndex, option),
  458. }"
  459. class="activeTI"
  460. >{{ ast[childindex] }}</text
  461. >
  462. <view class="flex_auto">
  463. <rich-text :nodes="option.content"></rich-text>
  464. <view v-if="option.imgUrl">
  465. <image
  466. style="width: 600rpx"
  467. mode="widthFix"
  468. :src="$method.splitImgHost(option.imgUrl)"
  469. ></image>
  470. </view>
  471. </view>
  472. </view>
  473. </view>
  474. </view>
  475. <view v-if="bank.ques[ansIndex]">
  476. <view class="pad_8 answer">
  477. <view
  478. >题目答案:
  479. <text
  480. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  481. :key="ansItemIndex1"
  482. >{{ ast[ansItem1 - 1] }}</text
  483. >
  484. </view>
  485. <view v-if="!explain"
  486. >我的答案:
  487. <text
  488. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  489. :key="quesItemIndex"
  490. >{{ ast[quesItem - 1] }}</text
  491. >
  492. </view>
  493. </view>
  494. <view class="pad_8 answerInfos">
  495. <view class="answerTitle">答案解析</view>
  496. <view class="answerContent">
  497. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  498. </view>
  499. </view>
  500. </view>
  501. </template>
  502. <template v-if="ansItem.type == 3">
  503. <view class="pad_8 titBox">
  504. <view class="titles">
  505. <rich-text :nodes="ansItem.content"></rich-text>
  506. </view>
  507. <view v-if="!bank.ques[ansIndex]">
  508. <view
  509. v-for="(option, childindex) in judge"
  510. :key="childindex"
  511. class="lisSty"
  512. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  513. >
  514. <view class="activeTI">{{ ast[childindex] }}</view>
  515. <view class="flex_auto">
  516. {{ option }}
  517. <view v-if="option.imgUrl">
  518. <image
  519. style="width: 600rpx"
  520. mode="widthFix"
  521. :src="$method.splitImgHost(option.imgUrl)"
  522. ></image>
  523. </view>
  524. </view>
  525. </view>
  526. </view>
  527. <view v-if="bank.ques[ansIndex]">
  528. <view
  529. v-for="(option, childindex) in judge"
  530. :key="childindex"
  531. class="lisSty"
  532. >
  533. <text
  534. :class="{
  535. right:
  536. childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) ||
  537. childindex != bank.ans[ansIndex],
  538. wrong:
  539. childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) &&
  540. bank.ques[ansIndex] != bank.ans[ansIndex],
  541. }"
  542. class="activeTI"
  543. >{{ ast[childindex] }}</text
  544. >
  545. <view class="flex_auto">
  546. {{ option }}
  547. <view v-if="option.imgUrl">
  548. <image
  549. style="width: 600rpx"
  550. mode="widthFix"
  551. :src="$method.splitImgHost(option.imgUrl)"
  552. ></image>
  553. </view>
  554. </view>
  555. </view>
  556. </view>
  557. </view>
  558. <view v-if="bank.ques[ansIndex]">
  559. <view class="pad_8 answer">
  560. <view>题目答案:{{ ast[bank.ans[ansIndex] == 1 ? 0 : 1] }}</view>
  561. <view v-if="!explain"
  562. >我的答案:{{ ast[bank.ques[ansIndex] == 1 ? 0 : 1] }}</view
  563. >
  564. </view>
  565. <view class="pad_8 answerInfos">
  566. <view class="answerTitle">答案解析</view>
  567. <view class="answerContent">
  568. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  569. </view>
  570. </view>
  571. </view>
  572. </template>
  573. <!-- 简答题 -->
  574. <template v-if="ansItem.type == 5">
  575. <view class="pad_8 titBox_title">
  576. <view class="titles">
  577. <rich-text :nodes="ansItem.content"></rich-text>
  578. </view>
  579. </view>
  580. <view class="pad_8 titBox_title">
  581. <view class="ans">
  582. <view class="ans_input" v-if="!bank.ques[ansIndex]">
  583. <view class="top flex">
  584. <image
  585. class="icon"
  586. @click="chooseImgChild(bankIndex, ansIndex)"
  587. src="/static/08-10_032.jpg"
  588. mode=""
  589. ></image>
  590. <view class="progress"
  591. >{{ ansItem.ansText.imageList.length || "0" }}/4</view
  592. >
  593. <view
  594. class="submit"
  595. :class="{
  596. disabled: !ansItem.ansText.text && hasImgs(ansItem),
  597. }"
  598. @click="submitAnsChild(bankIndex, ansIndex)"
  599. >确认答案</view
  600. >
  601. </view>
  602. <view class="textarea">
  603. <textarea
  604. v-model="ansItem.ansText.text"
  605. placeholder="在此输入答案"
  606. ></textarea>
  607. </view>
  608. <view class="imgs">
  609. <view
  610. class="img"
  611. v-for="(img, imgIndex) in ansItem.ansText.imageList"
  612. :key="imgIndex"
  613. >
  614. <text
  615. @click="
  616. deleteImgChild(imgIndex, bankIndex, ansIndex)
  617. "
  618. >x</text
  619. >
  620. <image :src="$method.splitImgHost(img, true)"></image>
  621. </view>
  622. </view>
  623. </view>
  624. <view
  625. class="ans_submit answerInfos"
  626. v-if="bank.ques[ansIndex] && !explain"
  627. >
  628. <view class="answerTitle">我的答案</view>
  629. {{ bank.ques[ansIndex].text }}
  630. <view class="imgs">
  631. <image
  632. class="img"
  633. :key="quesIndex"
  634. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  635. .imageList"
  636. :src="$method.splitImgHost(ques, true)"
  637. ></image>
  638. </view>
  639. </view>
  640. </view>
  641. </view>
  642. <view v-if="bank.ques[ansIndex]">
  643. <view class="pad_8 answerInfos">
  644. <view class="answerTitle">答案解析</view>
  645. <view class="answerContent">
  646. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  647. </view>
  648. </view>
  649. </view>
  650. </template>
  651. </view>
  652. </template>
  653. <view class="footer_btn">
  654. <view
  655. class="collect show"
  656. @click="collect(collectList[bankIndex], bankIndex, bank)"
  657. >
  658. <view v-if="collectList[bankIndex]">
  659. <image src="/static/icon/collected.png" mode=""></image>
  660. <view>取消收藏</view>
  661. </view>
  662. <view v-if="!collectList[bankIndex]">
  663. <image src="/static/icon/collect.png" mode=""></image>
  664. <view>收藏</view>
  665. </view>
  666. </view>
  667. <view class="flex_center" @click="openFooterTab">
  668. <view class="up-icon">
  669. <image src="/static/up.png"></image>
  670. </view>
  671. 答题卡
  672. </view>
  673. </view>
  674. </view>
  675. </swiper-item>
  676. </swiper>
  677. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  678. <view class="popupView">
  679. <view class="popupTops">
  680. <view class="topIcon"></view>
  681. 点击编号即可跳转至对应题目
  682. </view>
  683. <view class="popupContent">
  684. <scroll-view scroll-y="true" style="height: 506rpx">
  685. <view class="boxSty">
  686. <view
  687. v-for="(item, index) in questionList"
  688. :key="index"
  689. @click="changeIndex(index)"
  690. :class="{
  691. isRight: isRight(item, index),
  692. isWrong: isWrong(item, index),
  693. isPart: isPart(item, index),
  694. }"
  695. class="liListSty"
  696. >{{ index + 1 }}</view
  697. >
  698. </view>
  699. </scroll-view>
  700. </view>
  701. </view>
  702. </u-popup>
  703. <view class="dialog" v-if="showDialog">
  704. <image src="/static/pointer.png" class="pointer" mode=""></image>
  705. <view class="text">左右滑动切换上下题</view>
  706. <view class="btn" @click="hideDialog">我知道了</view>
  707. </view>
  708. </view>
  709. </template>
  710. <script>
  711. export default {
  712. data() {
  713. return {
  714. examId: "",
  715. current: 0,
  716. questionList: [],
  717. ast: ["A", "B", "C", "D", "E", "F", "G"],
  718. judge: ["正确", "错误"],
  719. show: false,
  720. showDialog: false,
  721. bankList: [],
  722. collectList: [],
  723. goodsId: "",
  724. explain: "",
  725. orderGoodsId: "",
  726. distinction: 1, // 1试卷归类,2题型归类
  727. subjectType: 0, // 题目类型
  728. doMode: 1,
  729. };
  730. },
  731. onLoad(option) {
  732. this.orderGoodsId = option.orderGoodsId || "";
  733. const { examId, explain, type, distinction, doMode} = option
  734. this.examId = examId
  735. this.explain = explain
  736. this.distinction = distinction
  737. this.subjectType = type
  738. this.doMode = doMode || 1
  739. // console.log('--doMode-', this.doMode);
  740. let showDialog = uni.getStorageSync("showDialog");
  741. if (showDialog) {
  742. this.showDialog = false;
  743. } else {
  744. this.showDialog = true;
  745. uni.setStorageSync("showDialog", "1");
  746. }
  747. if (this.distinction == 1) {
  748. this.collectQuestionExamQuestionList();
  749. } else {
  750. this.goodsCollectList()
  751. }
  752. },
  753. onUnload() {},
  754. methods: {
  755. /**
  756. * 是否有上传图片
  757. */
  758. hasImgs(bank) {
  759. return bank.ansText.imageList.length == 0;
  760. },
  761. collectQuestionExamQuestionList() {
  762. this.$api
  763. .collectQuestionExamQuestionList({
  764. examId: this.examId,
  765. })
  766. .then((res) => {
  767. this.analysteData(res.data.rows)
  768. });
  769. },
  770. goodsCollectList() {
  771. this.$api.goodsCollectList({
  772. type: this.subjectType,
  773. })
  774. .then((res) => {
  775. this.analysteData(res.data.rows)
  776. })
  777. },
  778. analysteData(rows) {
  779. rows.forEach((item, index) => {
  780. if (typeof item.jsonStr == "string") {
  781. item.jsonStr = JSON.parse(item.jsonStr);
  782. if (item.type == 2) {
  783. //多选
  784. item.jsonStr.forEach((str) => {
  785. str.optionsId = "" + str.optionsId;
  786. });
  787. let arr = item.answerQuestion.split(",");
  788. arr.forEach((a, i) => {
  789. arr[i] = "" + a;
  790. });
  791. item.ans = arr;
  792. item.analysisContent &&
  793. (item.analysisContent = item.analysisContent.replace(
  794. /<img/gi,
  795. '<img style="max-width:100%;"'
  796. ));
  797. item.content &&
  798. (item.content = item.content.replace(
  799. /<img/gi,
  800. '<img style="max-width:100%;"'
  801. ));
  802. if (this.explain) {
  803. item.ques = item.ans;
  804. }
  805. return;
  806. } else if (item.type == 5) {
  807. item.ansText = {
  808. text: "",
  809. imageList: [],
  810. };
  811. item.analysisContent &&
  812. (item.analysisContent = item.analysisContent.replace(
  813. /<img/gi,
  814. '<img style="max-width:100%;"'
  815. ));
  816. item.content &&
  817. (item.content = item.content.replace(
  818. /<img/gi,
  819. '<img style="max-width:100%;"'
  820. ));
  821. if (this.explain) {
  822. item.ques = {
  823. text: item.analysisContent,
  824. };
  825. return;
  826. }
  827. } else if (item.type == 4) {
  828. console.log(item.jsonStr);
  829. item.ques = [];
  830. item.current = 0;
  831. let ansArr = [];
  832. item.jsonStr.forEach((json, index) => {
  833. if (json.type == 1) {
  834. ansArr[index] = json.answerQuestion;
  835. json.content &&
  836. (json.content = json.content.replace(
  837. /<img/gi,
  838. '<img style="max-width:100%;"'
  839. ));
  840. } else if (json.type == 2) {
  841. json.optionsList.forEach((str) => {
  842. str.optionsId = "" + str.optionsId;
  843. });
  844. let arr = json.answerQuestion.split(",");
  845. arr.forEach((a, i) => {
  846. arr[i] = "" + a;
  847. });
  848. ansArr[index] = arr;
  849. json.content &&
  850. (json.content = json.content.replace(
  851. /<img/gi,
  852. '<img style="max-width:100%;"'
  853. ));
  854. } else if (json.type == 3) {
  855. ansArr[index] = json.answerQuestion;
  856. json.content &&
  857. (json.content = json.content.replace(
  858. /<img/gi,
  859. '<img style="max-width:100%;"'
  860. ));
  861. } else if (json.type == 5) {
  862. ansArr[index] = {
  863. text: "",
  864. imageList: [],
  865. };
  866. json.ansText = {
  867. text: "",
  868. imageList: [],
  869. };
  870. json.content &&
  871. (json.content = json.content.replace(
  872. /<img/gi,
  873. '<img style="max-width:100%;"'
  874. ));
  875. }
  876. });
  877. item.ans = ansArr;
  878. item.analysisContent &&
  879. (item.analysisContent = item.analysisContent.replace(
  880. /<img/gi,
  881. '<img style="max-width:100%;"'
  882. ));
  883. if (this.distinction == 2) {
  884. item.content && (item.content = item.content.replace(
  885. /<img/gi,
  886. '<img style="max-width:100%;"'
  887. ));
  888. }
  889. if (this.explain) {
  890. item.ques = item.ans;
  891. }
  892. return;
  893. }
  894. item.analysisContent &&
  895. (item.analysisContent = item.analysisContent.replace(
  896. /<img/gi,
  897. '<img style="max-width:100%;"'
  898. ));
  899. item.content &&
  900. (item.content = item.content.replace(
  901. /<img/gi,
  902. '<img style="max-width:100%;"'
  903. ));
  904. item.ans = item.answerQuestion;
  905. if (this.explain) {
  906. item.ques = item.ans;
  907. }
  908. } else {
  909. if (this.explain) {
  910. item.ques = item.ans;
  911. }
  912. }
  913. });
  914. this.questionList = rows;
  915. // new Array(12).fill(true)
  916. this.collectList = new Array(this.questionList.length).fill(true)
  917. console.log('this.collectList', this.collectList)
  918. },
  919. /**
  920. * @param {Object} state
  921. * @param {Object} index
  922. * 收藏
  923. */
  924. collect(state, index, bank) {
  925. if (!state) {
  926. this.$api.collectQuestion({
  927. examId: this.examId || bank.examId,
  928. questionId: bank.questionId,
  929. goodsId: bank.goodsId || "",
  930. orderGoodsId: bank.orderGoodsId,
  931. doMode: this.doMode, //做题模式 1章卷 2随机练习
  932. })
  933. .then((res) => {
  934. if (res.data.code == 200) {
  935. this.$set(this.collectList, index, true);
  936. uni.showToast({
  937. title: "收藏成功",
  938. duration: 2000,
  939. icon: "none",
  940. });
  941. } else {
  942. uni.showToast({
  943. title: "收藏失败",
  944. duration: 2000,
  945. icon: "none",
  946. });
  947. }
  948. });
  949. } else {
  950. this.$api.deleteCollectQuestion(bank.collectQuestionId).then((res) => {
  951. if (res.data.code == 200) {
  952. this.$set(this.collectList, index, false)
  953. uni.showToast({
  954. title: "取消收藏成功",
  955. duration: 2000,
  956. icon: "none",
  957. });
  958. } else {
  959. uni.showToast({
  960. title: "取消收藏失败",
  961. duration: 2000,
  962. icon: "none",
  963. });
  964. }
  965. });
  966. }
  967. },
  968. /**
  969. * @param {Object} e单选点击
  970. */
  971. radioSelect(optionsId, bindex) {
  972. if (this.questionList[bindex].ques) return;
  973. this.$set(this.questionList[bindex], "ques", optionsId);
  974. },
  975. /**
  976. * @param {Object} e单选点击
  977. */
  978. radioSelectChild(optionsId, ansIndex, bindex) {
  979. if (this.questionList[bindex].ques[ansIndex]) return;
  980. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  981. },
  982. /**
  983. * @param {Object} 多选点击
  984. */
  985. checkboxSelect(optionsId, bindex, index) {
  986. this.$set(
  987. this.questionList[bindex].jsonStr[index],
  988. "checked",
  989. !this.questionList[bindex].jsonStr[index].checked
  990. );
  991. },
  992. /**
  993. * @param {Object} 多选点击
  994. */
  995. checkboxSelectChild(bindex, ansIndex, childIndex) {
  996. this.$set(
  997. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  998. "checked",
  999. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1000. .checked
  1001. );
  1002. },
  1003. isCheckboxChecked(arr) {
  1004. return arr.some((item) => {
  1005. if (item.checked) {
  1006. return true;
  1007. }
  1008. });
  1009. },
  1010. /**
  1011. * @param {Object} 多选确认
  1012. */
  1013. checkboxSubmit(bindex) {
  1014. if (this.questionList[bindex].ques) return;
  1015. let arr = [];
  1016. this.questionList[bindex].jsonStr.forEach((item) => {
  1017. if (item.checked) {
  1018. arr.push(item.optionsId);
  1019. }
  1020. });
  1021. if (!arr.length) {
  1022. uni.showToast({
  1023. title: "请选择答案",
  1024. icon: "none",
  1025. });
  1026. return;
  1027. }
  1028. this.$set(this.questionList[bindex], "ques", arr);
  1029. },
  1030. /**
  1031. * @param {Object} 多选确认
  1032. */
  1033. checkboxSubmitChild(bindex, ansIndex) {
  1034. if (this.questionList[bindex].ques[ansIndex]) return;
  1035. let arr = [];
  1036. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1037. (item) => {
  1038. if (item.checked) {
  1039. arr.push(item.optionsId);
  1040. }
  1041. }
  1042. );
  1043. if (!arr.length) {
  1044. uni.showToast({
  1045. title: "请选择答案",
  1046. icon: "none",
  1047. });
  1048. return;
  1049. }
  1050. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1051. },
  1052. judgeSelect(index, bindex) {
  1053. if (this.questionList[bindex].ques) return;
  1054. this.$set(this.questionList[bindex], "ques", index == 0 ? '1' : '0');
  1055. },
  1056. judgeSelectChild(ansindex, childindex, bindex) {
  1057. if (this.questionList[bindex].ques[ansindex]) return;
  1058. this.$set(this.questionList[bindex].ques, ansindex, childindex == 0 ? '1' : '0');
  1059. },
  1060. openFooterTab() {
  1061. this.show = true;
  1062. },
  1063. hideDialog() {
  1064. this.showDialog = false;
  1065. },
  1066. changeIndex(index) {
  1067. this.current = index;
  1068. },
  1069. swiperChange(e) {
  1070. this.current = e.detail.current;
  1071. },
  1072. deleteImg(imgIndex, bankIndex) {
  1073. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1074. },
  1075. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1076. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1077. imgIndex,
  1078. 1
  1079. );
  1080. },
  1081. chooseImg(bankindex) {
  1082. uni.chooseImage({
  1083. count: 1, //默认9
  1084. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1085. sourceType: ["album", "camera"], //从相册选择
  1086. success: (res) => {
  1087. let self = this;
  1088. // console.log(JSON.stringify(res.tempFilePaths));
  1089. let img = res.tempFilePaths[0];
  1090. uni.getImageInfo({
  1091. src: img,
  1092. success: async (res) => {
  1093. let canvasWidth = res.width; //图片原始长宽
  1094. let canvasHeight = res.height;
  1095. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1096. uni.compressImage({
  1097. src: img,
  1098. quality: 75,
  1099. width: "50%",
  1100. height: "50%",
  1101. success: async (rest) => {
  1102. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1103. this.questionList[bankindex].ansText.imageList.push(dir);
  1104. },
  1105. });
  1106. } else {
  1107. const dir = await self.uploadFile(img, 0);
  1108. this.questionList[bankindex].ansText.imageList.push(dir);
  1109. }
  1110. },
  1111. });
  1112. },
  1113. });
  1114. },
  1115. chooseImgChild(bankindex, ansindex) {
  1116. uni.chooseImage({
  1117. count: 1, //默认9
  1118. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1119. sourceType: ["album", "camera"], //从相册选择
  1120. success: (res) => {
  1121. let self = this;
  1122. // console.log(JSON.stringify(res.tempFilePaths));
  1123. let img = res.tempFilePaths[0];
  1124. uni.getImageInfo({
  1125. src: img,
  1126. success: async (res) => {
  1127. let canvasWidth = res.width; //图片原始长宽
  1128. let canvasHeight = res.height;
  1129. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1130. uni.compressImage({
  1131. src: img,
  1132. quality: 75,
  1133. width: "50%",
  1134. height: "50%",
  1135. success: async (rest) => {
  1136. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1137. this.questionList[bankindex].jsonStr[
  1138. ansindex
  1139. ].ansText.imageList.push(dir);
  1140. },
  1141. });
  1142. } else {
  1143. const dir = await self.uploadFile(img, 0);
  1144. this.questionList[bankindex].jsonStr[
  1145. ansindex
  1146. ].ansText.imageList.push(dir);
  1147. }
  1148. },
  1149. });
  1150. },
  1151. });
  1152. },
  1153. uploadFile(options, int) {
  1154. var self = this;
  1155. return new Promise((resolve, reject) => {
  1156. var data = {
  1157. imageStatus: int,
  1158. };
  1159. self.$api.aliyunpolicy(data).then((res) => {
  1160. console.log(res.data, 6);
  1161. if (res.data.code != 200) {
  1162. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1163. return;
  1164. }
  1165. var ossToken = res.data.data.resultContent;
  1166. if (ossToken.host == null || ossToken.host == undefined) {
  1167. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1168. return;
  1169. }
  1170. uni.uploadFile({
  1171. url: ossToken.host,
  1172. name: "file",
  1173. filePath: options,
  1174. fileType: "image",
  1175. header: {
  1176. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1177. },
  1178. formData: {
  1179. key: ossToken.dir,
  1180. OSSAccessKeyId: ossToken.accessid,
  1181. policy: ossToken.policy,
  1182. Signature: ossToken.signature,
  1183. callback: ossToken.callback,
  1184. success_action_status: 200,
  1185. },
  1186. success: (result) => {
  1187. // if (result.statusCode === 200) {
  1188. resolve(ossToken.dir);
  1189. // } else {
  1190. // uni.showToast({
  1191. // title: "上传失败",
  1192. // icon: "none",
  1193. // });
  1194. // return;
  1195. // }
  1196. },
  1197. fail: (error) => {
  1198. uni.showToast({
  1199. title: "上传接口报错" + error,
  1200. icon: "none",
  1201. });
  1202. return;
  1203. },
  1204. });
  1205. });
  1206. });
  1207. },
  1208. submitAns(bankindex) {
  1209. console.log(this.questionList[bankindex]);
  1210. if (
  1211. !this.questionList[bankindex].ansText.text &&
  1212. !this.questionList[bankindex].ansText.imageList.length
  1213. ) {
  1214. uni.showToast({
  1215. title: "请输入内容或上传图片",
  1216. duration: 2000,
  1217. icon: "none",
  1218. });
  1219. return;
  1220. }
  1221. this.$set(this.questionList[bankindex], "ques", {
  1222. imageList: this.questionList[bankindex].ansText.imageList,
  1223. text: this.questionList[bankindex].ansText.text,
  1224. });
  1225. },
  1226. submitAnsChild(bankindex, ansindex) {
  1227. if (
  1228. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  1229. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  1230. ) {
  1231. uni.showToast({
  1232. title: "请输入内容或上传图片",
  1233. duration: 2000,
  1234. icon: "none",
  1235. });
  1236. return;
  1237. }
  1238. this.$set(this.questionList[bankindex].ques, ansindex, {
  1239. imageList:
  1240. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  1241. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  1242. });
  1243. },
  1244. isRight(item, index) {
  1245. //单选
  1246. if (this.questionList[index].ques) {
  1247. if (item.type == 1) {
  1248. return this.questionList[index].ques == this.questionList[index].ans;
  1249. //多选
  1250. } else if (item.type == 2) {
  1251. //每一项都相等
  1252. return this.questionList[index].ans.every((item, i) => {
  1253. return item == this.questionList[index].ques[i];
  1254. });
  1255. //判断
  1256. } else if (item.type == 3) {
  1257. return this.questionList[index].ques == this.questionList[index].ans;
  1258. } else {
  1259. return false;
  1260. }
  1261. } else {
  1262. return false;
  1263. }
  1264. },
  1265. right(bankIndex, ansIndex, option) {
  1266. if (
  1267. this.questionList[bankIndex].ques[ansIndex] &&
  1268. this.questionList[bankIndex].ans[ansIndex]
  1269. ) {
  1270. if (
  1271. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1272. option.optionsId
  1273. ) != -1 ||
  1274. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1275. option.optionsId
  1276. ) != -1
  1277. ) {
  1278. return true;
  1279. } else {
  1280. return false;
  1281. }
  1282. } else {
  1283. return false;
  1284. }
  1285. },
  1286. wrong(bankIndex, ansIndex, option) {
  1287. if (
  1288. this.questionList[bankIndex].ques[ansIndex] &&
  1289. this.questionList[bankIndex].ans[ansIndex]
  1290. ) {
  1291. if (
  1292. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1293. option.optionsId
  1294. ) != -1 &&
  1295. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1296. option.optionsId
  1297. ) == -1
  1298. ) {
  1299. return true;
  1300. } else {
  1301. return false;
  1302. }
  1303. } else {
  1304. return false;
  1305. }
  1306. },
  1307. isWrong(item, index) {
  1308. if (this.questionList[index].ques) {
  1309. //单选
  1310. if (item.type == 1) {
  1311. return this.questionList[index].ques != this.questionList[index].ans;
  1312. //多选
  1313. } else if (item.type == 2) {
  1314. //每一项都相等
  1315. return this.questionList[index].ques.some((item, i) => {
  1316. return this.questionList[index].ans.indexOf(item) == -1;
  1317. });
  1318. //判断
  1319. } else if (item.type == 3) {
  1320. return this.questionList[index].ques != this.questionList[index].ans;
  1321. } else {
  1322. return false;
  1323. }
  1324. } else {
  1325. return false;
  1326. }
  1327. },
  1328. isPart(item, index) {
  1329. if (this.questionList[index].ques) {
  1330. if (item.type == 2) {
  1331. let isWrong = this.questionList[index].ques.some((item, i) => {
  1332. return this.questionList[index].ans.indexOf(item) == -1;
  1333. });
  1334. let isRight = this.questionList[index].ans.every((item, i) => {
  1335. return item == this.questionList[index].ques[i];
  1336. });
  1337. if (!isRight && !isWrong) {
  1338. return true;
  1339. }
  1340. }
  1341. } else {
  1342. return false;
  1343. }
  1344. },
  1345. tabSelect(index, bankindex) {
  1346. this.$set(this.questionList[bankindex], "current", index);
  1347. },
  1348. },
  1349. };
  1350. </script>
  1351. <style lang="scss" scoped>
  1352. #questionBank {
  1353. width: 100%;
  1354. height: 100vh;
  1355. display: flex;
  1356. flex-direction: column;
  1357. }
  1358. .swiper {
  1359. width: 100%;
  1360. flex: 1;
  1361. }
  1362. .lisSty {
  1363. margin-bottom: 16rpx;
  1364. display: flex;
  1365. align-items: center;
  1366. .flex_auto {
  1367. flex: 1;
  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>