questionBankTest.vue 54 KB

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