index.vue 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525
  1. <template>
  2. <view class="questionBank">
  3. <uni-nav-bar
  4. @clickLeft="clickLeft"
  5. left-icon="back"
  6. ref="navbar"
  7. :statusBar="true"
  8. :title="examData.examName"
  9. ></uni-nav-bar>
  10. <swiper class="swiper" :current="current" @change="swiperChange">
  11. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  12. <view class="pageContent">
  13. <view class="pad_8 titBox">
  14. <view class="firstLetter">
  15. <view class="leftLetters">
  16. <view class="btnType">
  17. <text v-if="bank.type == 1">单选</text>
  18. <text v-if="bank.type == 2">多选</text>
  19. <text v-if="bank.type == 3">判断</text>
  20. <text v-if="bank.type == 4">案例</text>
  21. <text v-if="bank.type == 5">简答</text>
  22. </view>
  23. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  24. </view>
  25. <view style="color: #666; font-size: 28rpx">{{
  26. countdown(lastTime)
  27. }}</view>
  28. </view>
  29. <view class="titles" @click="showPhoto(bank.content)"
  30. ><rich-text :nodes="bank.content"></rich-text
  31. ></view>
  32. </view>
  33. <template v-if="bank.type == 1">
  34. <view class="pad_8 titBox no-margin">
  35. <view v-if="!bank.ques">
  36. <view
  37. v-for="(item, index) in bank.jsonStr"
  38. :key="index"
  39. class="lisSty"
  40. @click="radioSelect(item.optionsId, bankIndex)"
  41. >
  42. <view class="activeTI">{{ ast[index] }}</view>
  43. <view class="flex_auto"
  44. >{{ item.content }}
  45. <view v-if="item.imgUrl">
  46. <image
  47. style="width: 600rpx"
  48. mode="widthFix"
  49. :src="$method.splitImgHost(item.imgUrl)"
  50. ></image>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view v-if="bank.ques">
  56. <view
  57. v-for="(item, index) in bank.jsonStr"
  58. :key="index"
  59. class="lisSty"
  60. @click="radioSelect(item.optionsId, bankIndex)"
  61. >
  62. <text
  63. :class="{
  64. right:
  65. bankType == 1 &&
  66. (item.optionsId == bank.ques ||
  67. item.optionsId == bank.ans),
  68. wrong:
  69. bankType == 1 &&
  70. item.optionsId == bank.ques &&
  71. bank.ques != bank.ans,
  72. user_choose: bankType == 2 && item.optionsId == bank.ques,
  73. }"
  74. class="activeTI"
  75. >
  76. {{ ast[index] }}
  77. </text>
  78. <view class="flex_auto">
  79. {{ item.content }}
  80. <view v-if="item.imgUrl">
  81. <image
  82. style="width: 600rpx"
  83. mode="widthFix"
  84. :src="$method.splitImgHost(item.imgUrl)"
  85. ></image>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view v-if="bankType == 1 && bank.ques">
  92. <view class="pad_8 answer">
  93. <view>题目答案:{{ ast[bank.ans - 1] }} </view>
  94. <view>我的答案:{{ ast[bank.ques - 1] }}</view>
  95. </view>
  96. <view class="pad_8 answerInfos">
  97. <view class="answerTitle">答案解析</view>
  98. <view class="answerContent"
  99. ><rich-text :nodes="bank.analysisContent"></rich-text
  100. ></view>
  101. </view>
  102. </view>
  103. </template>
  104. <template v-if="bank.type == 2">
  105. <view class="pad_8 titBox no-margin">
  106. <view v-if="!bank.ques">
  107. <view
  108. v-for="(item, index) in bank.jsonStr"
  109. :key="index"
  110. class="lisSty"
  111. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  112. >
  113. <view :class="{ checked: item.checked }" class="activeTI">{{
  114. ast[index]
  115. }}</view>
  116. <view class="flex_auto">
  117. {{ item.content }}
  118. <view v-if="item.imgUrl">
  119. <image
  120. style="width: 600rpx"
  121. mode="widthFix"
  122. :src="$method.splitImgHost(item.imgUrl)"
  123. ></image>
  124. </view>
  125. </view>
  126. </view>
  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. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  134. >
  135. <text
  136. :class="{
  137. right:
  138. bankType == 1 &&
  139. (bank.ques.indexOf(item.optionsId) != -1 ||
  140. bank.ans.indexOf(item.optionsId) != -1),
  141. wrong:
  142. bankType == 1 &&
  143. bank.ques.indexOf(item.optionsId) != -1 &&
  144. bank.ans.indexOf(item.optionsId) == -1,
  145. user_choose: bankType == 2 && item.checked,
  146. }"
  147. class="activeTI"
  148. >
  149. {{ ast[index] }}
  150. </text>
  151. <view class="flex_auto">
  152. {{ item.content }}
  153. <view v-if="item.imgUrl">
  154. <image
  155. style="width: 600rpx"
  156. mode="widthFix"
  157. :src="$method.splitImgHost(item.imgUrl)"
  158. ></image>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <view
  164. v-if="bankType == 2 || (bankType == 1 && !bank.ques)"
  165. class="submit_checkbox"
  166. :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
  167. @click="checkboxSubmit(bankIndex)"
  168. >确认答案</view
  169. >
  170. </view>
  171. <view v-if="bankType == 1 && bank.ques">
  172. <view class="pad_8 answer">
  173. <view>
  174. 题目答案:
  175. <text
  176. v-for="(ansItem, ansIndex) in bank.ans"
  177. :key="ansIndex"
  178. >{{ ast[ansItem - 1] }}</text
  179. >
  180. </view>
  181. <view>
  182. 我的答案:
  183. <text
  184. v-for="(quesItem, quesIndex) in bank.ques"
  185. :key="quesIndex"
  186. >{{ ast[quesItem - 1] }}</text
  187. >
  188. </view>
  189. </view>
  190. <view class="pad_8 answerInfos">
  191. <view class="answerTitle">答案解析</view>
  192. <view class="answerContent"
  193. ><rich-text :nodes="bank.analysisContent"></rich-text
  194. ></view>
  195. </view>
  196. </view>
  197. </template>
  198. <template v-if="bank.type == 3">
  199. <view class="pad_8 titBox no-margin">
  200. <view v-if="!bank.ques">
  201. <view
  202. v-for="(item, index) in judge"
  203. :key="index"
  204. class="lisSty"
  205. @click="judgeSelect(index, bankIndex)"
  206. >
  207. <view class="activeTI">{{ ast[index] }}</view>
  208. <view class="flex_auto">
  209. {{ item }}
  210. <view v-if="item.imgUrl">
  211. <image
  212. style="width: 600rpx"
  213. mode="widthFix"
  214. :src="$method.splitImgHost(item.imgUrl)"
  215. ></image>
  216. </view>
  217. </view>
  218. </view>
  219. </view>
  220. <view v-if="bank.ques">
  221. <view
  222. v-for="(item, index) in judge"
  223. :key="index"
  224. class="lisSty"
  225. @click="judgeSelect(index, bankIndex)"
  226. >
  227. <text
  228. :class="{
  229. right:
  230. bankType == 1 &&
  231. (index == (bank.ques == 1 ? 0 : 1) ||
  232. index != bank.ans),
  233. wrong:
  234. bankType == 1 &&
  235. index == (bank.ques == 1 ? 0 : 1) &&
  236. bank.ques != bank.ans,
  237. user_choose:
  238. bankType == 2 && index == (bank.ques == 1 ? 0 : 1),
  239. }"
  240. class="activeTI"
  241. >
  242. {{ ast[index] }}
  243. </text>
  244. <view class="flex_auto">
  245. {{ item }}
  246. <view v-if="item.imgUrl">
  247. <image
  248. style="width: 600rpx"
  249. mode="widthFix"
  250. :src="$method.splitImgHost(item.imgUrl)"
  251. ></image>
  252. </view>
  253. </view>
  254. </view>
  255. </view>
  256. </view>
  257. <view v-if="bankType == 1 && bank.ques">
  258. <view class="pad_8 answer">
  259. <view>题目答案:{{ ast[bank.ans == 1 ? 0 : 1] }}</view>
  260. <view>我的答案:{{ ast[bank.ques == 1 ? 0 : 1] }}</view>
  261. </view>
  262. <view class="pad_8 answerInfos">
  263. <view class="answerTitle">答案解析</view>
  264. <view class="answerContent"
  265. ><rich-text :nodes="bank.analysisContent"></rich-text
  266. ></view>
  267. </view>
  268. </view>
  269. </template>
  270. <!-- 简答题 -->
  271. <template v-if="bank.type == 5">
  272. <view class="pad_8 titBox">
  273. <view class="ans">
  274. <view
  275. class="ans_input"
  276. v-if="
  277. bankType == 2 ||
  278. (bankType == 1 &&
  279. (!bank.ques ||
  280. (!bank.ques.imageList.length && !bank.ques.text)))
  281. "
  282. >
  283. <view class="top flex">
  284. <image
  285. :data-index="bankIndex"
  286. class="icon"
  287. @click="chooseImg(bankIndex)"
  288. src="/static/camera.png"
  289. mode=""
  290. ></image>
  291. <view class="progress"
  292. >{{ bank.ansText.imageList.length || "0" }}/4</view
  293. >
  294. <view
  295. class="submit"
  296. :class="{ disabled: !bank.ansText.text && hasImgs(bank) }"
  297. @click="submitAns(bankIndex)"
  298. >确认答案</view
  299. >
  300. </view>
  301. <view class="textarea">
  302. <textarea
  303. v-model="bank.ansText.text"
  304. placeholder="在此输入答案"
  305. ></textarea>
  306. </view>
  307. <view class="imgs">
  308. <view
  309. class="img"
  310. v-for="(img, imgIndex) in bank.ansText.imageList"
  311. :key="imgIndex"
  312. >
  313. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  314. <image :src="$method.splitImgHost(img, true)"></image>
  315. </view>
  316. </view>
  317. </view>
  318. <view
  319. class="ans_submit answerInfos"
  320. v-if="
  321. bankType == 1 &&
  322. bank.ques &&
  323. (bank.ques.imageList.length || bank.ques.text)
  324. "
  325. >
  326. <view class="answerTitle">我的答案:</view>
  327. {{ bank.ques.text }}
  328. <view class="imgs"
  329. ><image
  330. class="img"
  331. :key="quesIndex"
  332. v-for="(ques, quesIndex) in bank.ques.imageList"
  333. :src="$method.splitImgHost(ques, true)"
  334. ></image
  335. ></view>
  336. </view>
  337. </view>
  338. </view>
  339. <view
  340. v-if="
  341. bankType == 1 &&
  342. bank.ques &&
  343. (bank.ques.imageList.length || bank.ques.text)
  344. "
  345. >
  346. <view class="pad_8 answerInfos">
  347. <view class="answerTitle">答案解析:</view>
  348. <view class="answerContent"
  349. ><rich-text :nodes="bank.analysisContent"></rich-text
  350. ></view>
  351. </view>
  352. </view>
  353. </template>
  354. <!-- 案例题 -->
  355. <template v-if="bank.type == 4">
  356. <view class="tabs">
  357. <view
  358. class="tab"
  359. :class="{ current: tabIndex == bank.current }"
  360. :key="tabIndex"
  361. v-for="(tab, tabIndex) in bank.jsonStr"
  362. @click="tabSelect(tabIndex, bankIndex)"
  363. >
  364. 问题{{ tabIndex + 1 }}
  365. </view>
  366. </view>
  367. <view
  368. v-for="(ansItem, ansIndex) in bank.jsonStr"
  369. v-if="bank.current == ansIndex"
  370. :key="ansIndex"
  371. >
  372. <template v-if="ansItem.type == 1">
  373. <view class="pad_8 titBox">
  374. <view class="leftLetters">
  375. <view class="btnType">
  376. <text>单选</text>
  377. </view>
  378. </view>
  379. <view class="titles"
  380. ><rich-text :nodes="ansItem.content"></rich-text
  381. ></view>
  382. <view v-if="!bank.ques[ansIndex]">
  383. <view
  384. v-for="(option, childIndex) in ansItem.optionsList"
  385. :key="childIndex"
  386. class="lisSty"
  387. @click="
  388. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  389. "
  390. >
  391. <view class="activeTI">{{ ast[childIndex] }}</view>
  392. <view class="flex_auto">
  393. <rich-text
  394. class="textChild"
  395. :nodes="option.content"
  396. ></rich-text>
  397. <view v-if="option.imgUrl">
  398. <image
  399. style="width: 600rpx"
  400. mode="widthFix"
  401. :src="$method.splitImgHost(option.imgUrl)"
  402. ></image>
  403. </view>
  404. </view>
  405. </view>
  406. </view>
  407. <view v-if="bank.ques[ansIndex]">
  408. <view
  409. v-for="(option, childIndex) in ansItem.optionsList"
  410. :key="childIndex"
  411. class="lisSty"
  412. @click="
  413. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  414. "
  415. >
  416. <text
  417. :class="{
  418. right:
  419. bankType == 1 &&
  420. (option.optionsId == bank.ques[ansIndex] ||
  421. option.optionsId == bank.ans[ansIndex]),
  422. wrong:
  423. bankType == 1 &&
  424. option.optionsId == bank.ques[ansIndex] &&
  425. bank.ques[ansIndex] != bank.ans[ansIndex],
  426. user_choose:
  427. bankType == 2 &&
  428. option.optionsId == bank.ques[ansIndex],
  429. }"
  430. class="activeTI"
  431. >
  432. {{ ast[childIndex] }}
  433. </text>
  434. <view class="flex_auto">
  435. <rich-text :nodes="option.content"></rich-text>
  436. <view v-if="option.imgUrl">
  437. <image
  438. style="width: 600rpx"
  439. mode="widthFix"
  440. :src="$method.splitImgHost(option.imgUrl)"
  441. ></image>
  442. </view>
  443. </view>
  444. </view>
  445. </view>
  446. </view>
  447. <view v-if="bankType == 1 && bank.ques[ansIndex]">
  448. <view class="pad_8 answer">
  449. <view>题目答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  450. <view>我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view>
  451. </view>
  452. <view class="pad_8 answerInfos">
  453. <view class="answerTitle">答案解析</view>
  454. <view class="answerContent"
  455. ><rich-text :nodes="option.analysisContent"></rich-text
  456. ></view>
  457. </view>
  458. </view>
  459. </template>
  460. <template v-if="ansItem.type == 2">
  461. <view class="pad_8 titBox">
  462. <view class="leftLetters">
  463. <view class="btnType">
  464. <text>多选</text>
  465. </view>
  466. </view>
  467. <view class="titles"
  468. ><rich-text :nodes="ansItem.content"></rich-text
  469. ></view>
  470. <view v-if="!bank.ques[ansIndex]">
  471. <view
  472. v-for="(option, childindex) in ansItem.optionsList"
  473. :key="childindex"
  474. class="lisSty"
  475. @click="
  476. checkboxSelectChild(bankIndex, ansIndex, childindex)
  477. "
  478. >
  479. <view
  480. :class="{ checked: option.checked }"
  481. class="activeTI"
  482. >{{ ast[childindex] }}</view
  483. >
  484. <view class="flex_auto">
  485. <rich-text :nodes="option.content"></rich-text>
  486. <view v-if="option.imgUrl">
  487. <image
  488. style="width: 600rpx"
  489. mode="widthFix"
  490. :src="$method.splitImgHost(option.imgUrl)"
  491. ></image>
  492. </view>
  493. </view>
  494. </view>
  495. </view>
  496. <view
  497. v-if="
  498. bankType == 2 || (bankType == 1 && !bank.ques[ansIndex])
  499. "
  500. class="submit_checkbox"
  501. :class="{
  502. disabled: !isCheckboxChecked(ansItem.optionsList),
  503. }"
  504. @click="checkboxSubmitChild(bankIndex, ansIndex)"
  505. >确认答案</view
  506. >
  507. <view v-if="bank.ques && bank.ques[ansIndex]">
  508. <view
  509. v-for="(option, childindex) in ansItem.optionsList"
  510. :key="childindex"
  511. class="lisSty"
  512. @click="
  513. checkboxSelectChild(bankIndex, ansIndex, childindex)
  514. "
  515. >
  516. <text
  517. :class="{
  518. right:
  519. bankType == 1 && right(bankIndex, ansIndex, option),
  520. wrong:
  521. bankType == 1 && wrong(bankIndex, ansIndex, option),
  522. user_choose: bankType == 2 && option.checked,
  523. }"
  524. class="activeTI"
  525. >
  526. {{ ast[childindex] }}
  527. </text>
  528. <view class="flex_auto">
  529. <rich-text :nodes="option.content"></rich-text>
  530. <view v-if="option.imgUrl">
  531. <image
  532. style="width: 600rpx"
  533. mode="widthFix"
  534. :src="$method.splitImgHost(option.imgUrl)"
  535. ></image>
  536. </view>
  537. </view>
  538. </view>
  539. </view>
  540. </view>
  541. <view v-if="bankType == 1 && bank.ques[ansIndex]">
  542. <view class="pad_8 answer">
  543. <view>
  544. 题目答案:
  545. <text
  546. :key="ansItemIndex1"
  547. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  548. >{{ ast[ansItem1 - 1] }}</text
  549. >
  550. </view>
  551. <view>
  552. 我的答案:
  553. <text
  554. :key="quesItemIndex"
  555. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  556. >{{ ast[quesItem - 1] }}</text
  557. >
  558. </view>
  559. </view>
  560. <view class="pad_8 answerInfos">
  561. <view class="answerTitle">答案解析</view>
  562. <view class="answerContent"
  563. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  564. ></view>
  565. </view>
  566. </view>
  567. </template>
  568. <template v-if="ansItem.type == 3">
  569. <view class="pad_8 titBox">
  570. <view class="leftLetters">
  571. <view class="btnType">
  572. <text>判断</text>
  573. </view>
  574. </view>
  575. <view class="titles"
  576. ><rich-text :nodes="ansItem.content"></rich-text
  577. ></view>
  578. <view v-if="!bank.ques[ansIndex]">
  579. <view
  580. v-for="(option, childindex) in judge"
  581. :key="childindex"
  582. class="lisSty"
  583. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  584. >
  585. <view class="activeTI">{{ ast[childindex] }}</view>
  586. <view class="flex_auto">
  587. {{ option }}
  588. <view v-if="option.imgUrl">
  589. <image
  590. style="width: 600rpx"
  591. mode="widthFix"
  592. :src="$method.splitImgHost(option.imgUrl)"
  593. ></image>
  594. </view>
  595. </view>
  596. </view>
  597. </view>
  598. <view v-if="bank.ques[ansIndex]">
  599. <view
  600. v-for="(option, childindex) in judge"
  601. :key="childindex"
  602. class="lisSty"
  603. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  604. >
  605. <text
  606. :class="{
  607. right:
  608. bankType == 1 &&
  609. (childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) ||
  610. childindex != bank.ans[ansIndex]),
  611. wrong:
  612. bankType == 1 &&
  613. childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) &&
  614. bank.ques[ansIndex] != bank.ans[ansIndex],
  615. user_choose:
  616. bankType == 2 &&
  617. childindex == (bank.ques[ansIndex] == 1 ? 0 : 1),
  618. }"
  619. class="activeTI"
  620. >
  621. {{ ast[childindex] }}
  622. </text>
  623. <view class="flex_auto">
  624. {{ option }}
  625. <view v-if="option.imgUrl">
  626. <image
  627. style="width: 600rpx"
  628. mode="widthFix"
  629. :src="$method.splitImgHost(option.imgUrl)"
  630. ></image>
  631. </view>
  632. </view>
  633. </view>
  634. </view>
  635. </view>
  636. <view v-if="bankType == 1 && bank.ques[ansIndex]">
  637. <view class="pad_8 answer">
  638. <view
  639. >题目答案:{{
  640. ast[bank.ans[ansIndex] == 1 ? 0 : 1]
  641. }}</view
  642. >
  643. <view
  644. >我的答案:{{
  645. ast[bank.ques[ansIndex] == 1 ? 0 : 1]
  646. }}</view
  647. >
  648. </view>
  649. <view class="pad_8 answerInfos">
  650. <view class="answerTitle">答案解析</view>
  651. <view class="answerContent"
  652. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  653. ></view>
  654. </view>
  655. </view>
  656. </template>
  657. <!-- 简答题 -->
  658. <template v-if="ansItem.type == 5">
  659. <view class="pad_8 titBox_title">
  660. <view class="leftLetters">
  661. <view class="btnType">
  662. <text>简答</text>
  663. </view>
  664. </view>
  665. <view><rich-text :nodes="ansItem.content"></rich-text></view>
  666. </view>
  667. <view class="pad_8 titBox_title">
  668. <view class="ans">
  669. <view
  670. class="ans_input"
  671. v-if="
  672. bankType == 2 ||
  673. (bankType == 1 &&
  674. (!bank.ques[ansIndex] ||
  675. (!bank.ques[ansIndex].text &&
  676. !bank.ques[ansIndex].imageList.length)))
  677. "
  678. >
  679. <view class="top flex">
  680. <image
  681. class="icon"
  682. @click="chooseImgChild(bankIndex, ansIndex)"
  683. src="/static/camera.png"
  684. mode=""
  685. ></image>
  686. <view class="progress"
  687. >{{ ansItem.ansText.imageList.length || "0" }}/4</view
  688. >
  689. <view
  690. class="submit"
  691. :class="{
  692. disabled: !ansItem.ansText.text && hasImgs(ansItem),
  693. }"
  694. @click="submitAnsChild(bankIndex, ansIndex)"
  695. >确认答案</view
  696. >
  697. </view>
  698. <view class="textarea">
  699. <textarea
  700. v-model="ansItem.ansText.text"
  701. placeholder="在此输入答案"
  702. ></textarea>
  703. </view>
  704. <view class="imgs">
  705. <view
  706. class="img"
  707. v-for="(img, imgIndex) in ansItem.ansText.imageList"
  708. :key="imgIndex"
  709. >
  710. <text
  711. @click="
  712. deleteImgChild(imgIndex, bankIndex, ansIndex)
  713. "
  714. >x</text
  715. >
  716. <image :src="$method.splitImgHost(img, true)"></image>
  717. </view>
  718. </view>
  719. </view>
  720. <view
  721. class="ans_submit answerInfos"
  722. v-if="
  723. bankType == 1 &&
  724. bank.ques[ansIndex] &&
  725. (bank.ques[ansIndex].imageList.length ||
  726. bank.ques[ansIndex].text)
  727. "
  728. >
  729. <view class="answerTitle">我的答案</view>
  730. {{ bank.ques[ansIndex].text || "" }}
  731. <view class="imgs">
  732. <image
  733. class="img"
  734. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  735. .imageList"
  736. :key="quesIndex"
  737. :src="$method.splitImgHost(ques, true)"
  738. ></image>
  739. </view>
  740. </view>
  741. </view>
  742. </view>
  743. <view
  744. v-if="
  745. bankType == 1 &&
  746. (bank.ques[ansIndex].imageList.length ||
  747. bank.ques[ansIndex].text)
  748. "
  749. >
  750. <view class="pad_8 answerInfos">
  751. <view class="answerTitle">答案解析</view>
  752. <view class="answerContent"
  753. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  754. ></view>
  755. </view>
  756. </view>
  757. </template>
  758. </view>
  759. </template>
  760. </view>
  761. </swiper-item>
  762. </swiper>
  763. <bank-bom
  764. :isShowCollect="false"
  765. :questionList="questionList"
  766. :bankType="bankType"
  767. :current.sync="current"
  768. @submit="pdsubmit"
  769. ></bank-bom>
  770. <view class="dialog" v-if="showDialog">
  771. <image class="pointer" src="/static/pointer.png" mode=""></image>
  772. <view class="text">左右滑动切换上下题</view>
  773. <view class="btn" @click="showDialog = false">我知道了</view>
  774. </view>
  775. <view class="dialog-arrow" v-if="showArrow">
  776. <image class="pointer" src="/static/arrow-left.png" mode=""></image>
  777. <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
  778. <view class="btn" @click="showArrow = false">我知道了</view>
  779. </view>
  780. <view class="dialog_wrap" v-if="testOver">
  781. <view class="bg"></view>
  782. <view class="dialog">
  783. <view class="title">温馨提示</view>
  784. <view class="content">
  785. <view>您已完成所有题目,</view>
  786. <view>快去交卷吧!</view>
  787. </view>
  788. <view class="btns">
  789. <view class="btn" @click="noSubmit()">暂不交卷</view>
  790. <view class="btn active" @click="submitNow()">立即交卷</view>
  791. </view>
  792. </view>
  793. </view>
  794. <view class="dialog_wrap" v-if="isLastCount">
  795. <view class="bg"></view>
  796. <view class="dialog">
  797. <view class="title">温馨提示</view>
  798. <view class="content">
  799. <view
  800. >您当前正在测试,还剩{{ lastCount }}道题未完成,离开视为交卷</view
  801. >
  802. </view>
  803. <view class="btns">
  804. <view class="btn" @click="noLeave()">暂不离开</view>
  805. <view class="btn active" @click="leaveNow()">继续离开</view>
  806. </view>
  807. </view>
  808. </view>
  809. <u-popup
  810. v-model="showpopups"
  811. mode="center"
  812. border-radius="24"
  813. height="439rpx"
  814. width="640rpx"
  815. :mask-close-able="false"
  816. >
  817. <view class="popboxs">
  818. <view class="classTops">温馨提示</view>
  819. <view class="textStys">
  820. {{
  821. cgType === 7
  822. ? "您还未交卷,确定结束做题吗?"
  823. : cgType === 8
  824. ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
  825. : cgType === 6
  826. ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
  827. : cgType == 9
  828. ? `您已完成所有题目,快去交卷吧!`
  829. : ""
  830. }}
  831. </view>
  832. <view class="classFootsty" v-if="cgType === 6">
  833. <view class="btnsty btns1" @click="submit">立即交卷</view>
  834. <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
  835. </view>
  836. <view class="classFootsty" v-if="cgType === 7">
  837. <view class="btnsty btns1" @click="backPages">下次继续</view>
  838. <view class="btnsty btns2" @click="submit">结束做题</view>
  839. </view>
  840. <view class="classFootsty" v-if="cgType === 8">
  841. <view class="btnsty btns1" @click="backPages()">下次继续</view>
  842. <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
  843. </view>
  844. <view class="classFootsty" v-if="cgType === 9">
  845. <view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
  846. <view class="btnsty btns2" @click="submit">立即交卷</view>
  847. </view>
  848. </view>
  849. </u-popup>
  850. </view>
  851. </template>
  852. <script>
  853. import { mapGetters, mapActions } from "vuex";
  854. import BankBom from "../../components/common/BankBom.vue";
  855. export default {
  856. data() {
  857. return {
  858. subscribeId: 0,
  859. showpopups: false,
  860. examId: "",
  861. current: 0,
  862. questionList: [],
  863. ast: ["A", "B", "C", "D", "E", "F", "G"],
  864. judge: ["正确", "错误"],
  865. ans: [],
  866. ques: [],
  867. showDialog: false,
  868. bankList: [],
  869. collectList: [],
  870. recordId: "",
  871. isSubmit: false,
  872. lastTime: 0, //剩余考试时长
  873. allTimes: 0, //总考试时长
  874. timer: null,
  875. wrongList: [],
  876. bankType: 2, //试卷类型
  877. needBack: false, //是否是考试
  878. testOver: false,
  879. isLastCount: false, //是否有未答题目
  880. lastCount: 0, //剩余没有回答的题目数
  881. showArrow: false, //退出提示
  882. gradeId: "",
  883. examData: {},
  884. eachExamId: 0,
  885. normal: "",
  886. isAutoSubmit: false,
  887. cgType: 0, //对应设计稿弹窗编码
  888. examStartTime: 0,
  889. examEndTime: 0,
  890. simulateExamId: undefined,
  891. goodsId: undefined,
  892. orderGoodsId: undefined,
  893. };
  894. },
  895. async onLoad(option) {
  896. this.examStartTime = option.examStartTime;
  897. this.examEndTime = option.examEndTime;
  898. this.subscribeId = option.subscribeId || "";
  899. this.current = +option.current || 0;
  900. this.eachExamId = option.eachExamId;
  901. this.examId = option.examId;
  902. this.allTimes = this.examEndTime - this.examStartTime || "";
  903. this.goodsId = option.goodsId;
  904. this.orderGoodsId = option.orderGoodsId;
  905. let isBack = option.isback;
  906. let showDialog = uni.getStorageSync("showDialog");
  907. if (showDialog) {
  908. this.showDialog = false;
  909. } else {
  910. this.showDialog = true;
  911. uni.setStorageSync("showDialog", "1");
  912. }
  913. //考试被迫返回
  914. if (isBack) {
  915. let app = getApp();
  916. let globalData = app.globalData;
  917. for (var k in globalData.bankData) {
  918. this[k] = globalData.bankData[k];
  919. }
  920. this.showArrow = true;
  921. this.timer = setInterval(() => {
  922. if (this.lastTime <= 0) {
  923. clearInterval(this.timer);
  924. uni.showToast({
  925. icon: "none",
  926. mask: true,
  927. title: "考试时间已到,系统将自动交卷",
  928. duration: 10000,
  929. });
  930. this.isAutoSubmit = true;
  931. this.submit();
  932. return;
  933. }
  934. this.lastTime--;
  935. }, 1000);
  936. } else {
  937. //进入页面
  938. await this.bankExam();
  939. await this.setSystemTime();
  940. this.goodsQuestionList();
  941. }
  942. },
  943. onUnload() {
  944. if (this.isSubmit) {
  945. clearInterval(this.timer);
  946. return;
  947. }
  948. //考试试卷 阻止ios手势返回,自动跳回答题页
  949. if (this.needBack) {
  950. let app = getApp();
  951. app.globalData.bankData = this.$data;
  952. clearInterval(this.timer);
  953. uni.navigateTo({
  954. url:
  955. "/pages2/bank/questionBank?examId=" +
  956. this.examId +
  957. "&eachExamId=" +
  958. this.eachExamId +
  959. "&isback=true" +
  960. "&subscribeId=" +
  961. this.subscribeId +
  962. "&examStartTime=" +
  963. this.examStartTime +
  964. "&examEndTime=" +
  965. this.examEndTime,
  966. });
  967. } else {
  968. //点击返回按钮确认允许退出,记录答题记录
  969. clearInterval(this.timer);
  970. this.mockRecordEdit();
  971. }
  972. },
  973. methods: {
  974. ...mapActions(["setSystemTime"]),
  975. /**
  976. * 是否有上传图片
  977. */
  978. hasImgs(bank) {
  979. return bank.ansText.imageList.length == 0;
  980. },
  981. /**
  982. * 获取试卷类型2考试,1练习
  983. */
  984. bankExam() {
  985. return new Promise((resolve, reject) => {
  986. this.$api.bankExam(this.examId).then((res) => {
  987. const { examLimitClient, doType } = res.data.data;
  988. if (!this.$method.examClientCanLearn(examLimitClient)) {
  989. reject();
  990. }
  991. this.bankType = doType;
  992. this.examData = res.data.data;
  993. if (this.bankType == 2) {
  994. this.needBack = true;
  995. }
  996. resolve();
  997. });
  998. });
  999. },
  1000. /**
  1001. * 点击后退按钮
  1002. */
  1003. clickLeft() {
  1004. if (this.bankType == 1) {
  1005. let ansCount = this.questionOverNum(true); //已答题数
  1006. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1007. //所有题目答完
  1008. if (this.lastCount == 0) {
  1009. // this.testOver = true;
  1010. this.cgType = 7;
  1011. //未答完
  1012. } else {
  1013. this.cgType = 8;
  1014. // this.isLastCount = true;
  1015. }
  1016. this.showpopups = true;
  1017. } else if (this.bankType == 2) {
  1018. let ansCount = this.questionOverNum(true); //已答题数
  1019. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1020. //所有题目答完
  1021. if (this.lastCount == 0) {
  1022. this.testOver = true;
  1023. //未答完
  1024. } else {
  1025. this.isLastCount = true;
  1026. }
  1027. }
  1028. },
  1029. /**
  1030. * 返回上一页
  1031. */
  1032. backPages() {
  1033. this.needBack = false;
  1034. uni.navigateBack({
  1035. delta: 1,
  1036. });
  1037. },
  1038. /**
  1039. * 获取已经回答的题目数
  1040. * hasSpecail (是否包含简答和案例)
  1041. */
  1042. questionOverNum(hasSpecail) {
  1043. let count = 0;
  1044. this.questionList.forEach((item) => {
  1045. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1046. if (item.ques) {
  1047. count++;
  1048. }
  1049. } else if (item.type == 4) {
  1050. //案例题
  1051. if (hasSpecail) {
  1052. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1053. if (
  1054. jsonItem.type == 1 ||
  1055. jsonItem.type == 2 ||
  1056. jsonItem.type == 3
  1057. ) {
  1058. if (item.ques[indexs]) {
  1059. return true;
  1060. } else {
  1061. return false;
  1062. }
  1063. } else if (jsonItem.type == 5) {
  1064. if (
  1065. item.ques[indexs] &&
  1066. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1067. ) {
  1068. console.log("chil");
  1069. return true;
  1070. } else {
  1071. return false;
  1072. }
  1073. }
  1074. });
  1075. if (isOver) {
  1076. count++;
  1077. console.log(item, 444);
  1078. }
  1079. }
  1080. } else if (item.type == 5) {
  1081. //简答题
  1082. if (hasSpecail) {
  1083. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1084. console.log(5, item);
  1085. count++;
  1086. }
  1087. }
  1088. }
  1089. });
  1090. return count;
  1091. },
  1092. mockSubscribeEdit() {
  1093. this.$api
  1094. .mockSubscribeEdit({
  1095. subscribeId: this.subscribeId,
  1096. handStatus: this.isAutoSubmit ? 2 : 1,
  1097. })
  1098. .then((res) => {});
  1099. },
  1100. /**
  1101. * 是否做完所有题目
  1102. */
  1103. isDoOver() {
  1104. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1105. if (this.questionList.length == questionOverNum) {
  1106. //全部做完弹窗
  1107. this.cgType = 9;
  1108. this.showpopups = true;
  1109. }
  1110. },
  1111. /**
  1112. * 暂不交卷
  1113. */
  1114. noSubmit() {
  1115. //设为允许退出页面
  1116. this.needBack = false;
  1117. uni.navigateBack({
  1118. delta: 1,
  1119. });
  1120. },
  1121. /**
  1122. * 不离开
  1123. */
  1124. noLeave() {
  1125. this.isLastCount = false;
  1126. },
  1127. /**
  1128. * 立即离开并交卷
  1129. */
  1130. leaveNow() {
  1131. this.needBack = false;
  1132. this.isSubmit = true;
  1133. this.submit(false);
  1134. uni.navigateBack({
  1135. delta: 1,
  1136. });
  1137. },
  1138. /**
  1139. * 立即交卷
  1140. */
  1141. submitNow() {
  1142. console.log("sds");
  1143. this.showpopups = false;
  1144. this.needBack = false;
  1145. this.submit();
  1146. },
  1147. /**
  1148. * 离开页面统计回答正确题数
  1149. */
  1150. mockRecordEdit() {
  1151. if (!this.isSubmit) {
  1152. if (this.subscribeId) {
  1153. this.mockSubscribeEdit();
  1154. }
  1155. let {
  1156. doQuestionNum,
  1157. doQuestionIds,
  1158. rightQuestionNum,
  1159. historyExamJson,
  1160. } = this.$method.calculateScore(this.questionList);
  1161. this.$api
  1162. .mockRecordEdit({
  1163. examId: this.examId,
  1164. eachExamId: this.eachExamId,
  1165. goodsId: this.goodsId,
  1166. recordId: this.recordId,
  1167. doQuestionIds,
  1168. rightQuestionNum,
  1169. status: 1,
  1170. doQuestionNum,
  1171. historyExamJson,
  1172. })
  1173. .then((res) => {});
  1174. }
  1175. },
  1176. /**
  1177. * 记录总题数
  1178. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1179. */
  1180. mockRecord(hasSpecial) {
  1181. let questionList = 0;
  1182. // if(!hasSpecial) {
  1183. this.questionList.forEach((item, index) => {
  1184. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1185. questionList++;
  1186. }
  1187. });
  1188. // } else {
  1189. // questionList = this.questionList.length;
  1190. // }
  1191. this.$api
  1192. .mockRecord({
  1193. examId: this.examId,
  1194. eachExamId: this.eachExamId,
  1195. totalQuestionNum: questionList,
  1196. allQuestionNum: this.questionList.length,
  1197. doMode: this.doMode,
  1198. simulateExamId: this.simulateExamId,
  1199. })
  1200. .then((res) => {
  1201. this.recordId = res.data.data;
  1202. //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
  1203. });
  1204. },
  1205. /**
  1206. * @param {Object} second倒计时过滤器
  1207. */
  1208. countdown(second) {
  1209. if (second) {
  1210. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  1211. let m = parseInt((second / 60) % 60); // 计算分数
  1212. let s = parseInt(second % 60); // 计算当前秒数
  1213. if (h < 10) h = "0" + h;
  1214. if (m < 10) m = "0" + m;
  1215. if (s < 10) s = "0" + s;
  1216. return h + ":" + m + ":" + s;
  1217. } else {
  1218. return "";
  1219. }
  1220. },
  1221. hideDialog() {
  1222. this.showDialog = false;
  1223. },
  1224. noListTip(content = "该试卷暂无题目") {
  1225. this.hideDialog();
  1226. uni.showModal({
  1227. showCancel: false,
  1228. content,
  1229. success: (k) => {
  1230. if (k.confirm) {
  1231. this.isSubmit = true;
  1232. uni.navigateBack();
  1233. }
  1234. },
  1235. });
  1236. },
  1237. /**
  1238. * 请求题目列表
  1239. */
  1240. goodsQuestionList() {
  1241. // app/common/bank/question/list
  1242. this.$api[
  1243. this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
  1244. ]({
  1245. examId: this.examId,
  1246. goodsId: this.goodsId,
  1247. orderGoodsId: this.orderGoodsId,
  1248. from: 3,
  1249. }).then((res) => {
  1250. if (res.data.code == 500) {
  1251. return this.noListTip("你已完成所有题目");
  1252. }
  1253. let data = res.data.data;
  1254. if (this.doMode == 3) {
  1255. this.simulateExamId = data.simulateExamId;
  1256. data = data.questionList;
  1257. }
  1258. if (!data.length) {
  1259. return this.noListTip();
  1260. }
  1261. if (this.subscribeId) {
  1262. this.lastTime = this.examEndTime - this.sysTime;
  1263. //考试时间到了自动交卷
  1264. if (this.lastTime) {
  1265. this.timer = setInterval(() => {
  1266. if (this.lastTime <= 0) {
  1267. clearInterval(this.timer);
  1268. uni.showToast({
  1269. icon: "none",
  1270. mask: true,
  1271. title: "考试时间已到,系统将自动交卷",
  1272. duration: 5000,
  1273. });
  1274. this.isAutoSubmit = true;
  1275. this.submit();
  1276. return;
  1277. }
  1278. this.lastTime--;
  1279. }, 1000);
  1280. } else {
  1281. }
  1282. }
  1283. data.forEach((item, index) => {
  1284. // if (typeof item.jsonStr == 'string') {
  1285. item.jsonStr = JSON.parse(item.jsonStr);
  1286. if (item.type == 2) {
  1287. //多选
  1288. item.jsonStr.forEach((str) => {
  1289. str.optionsId = "" + str.optionsId;
  1290. });
  1291. let arr = item.answerQuestion.split(",");
  1292. arr.forEach((a, i) => {
  1293. arr[i] = "" + a;
  1294. });
  1295. item.ans = arr;
  1296. item.analysisContent &&
  1297. (item.analysisContent = item.analysisContent.replace(
  1298. /<img/gi,
  1299. '<img style="max-width:100%;"'
  1300. ));
  1301. item.content &&
  1302. (item.content = item.content.replace(
  1303. /<img/gi,
  1304. '<img style="max-width:100%;"'
  1305. ));
  1306. return;
  1307. } else if (item.type == 5) {
  1308. //简答题
  1309. item.ansText = {
  1310. text: "",
  1311. imageList: [],
  1312. };
  1313. item.ques = {
  1314. text: "",
  1315. imageList: [],
  1316. };
  1317. item.analysisContent &&
  1318. (item.analysisContent = item.analysisContent.replace(
  1319. /<img/gi,
  1320. '<img style="max-width:100%;"'
  1321. ));
  1322. item.content &&
  1323. (item.content = item.content.replace(
  1324. /<img/gi,
  1325. '<img style="max-width:100%;"'
  1326. ));
  1327. } else if (item.type == 4) {
  1328. //案例题
  1329. item.ques = [];
  1330. item.current = 0;
  1331. let ansArr = [];
  1332. item.jsonStr.forEach((json, index) => {
  1333. if (json.type == 1) {
  1334. ansArr[index] = json.answerQuestion;
  1335. json.content &&
  1336. (json.content = json.content.replace(
  1337. /<img/gi,
  1338. '<img style="max-width:100%;"'
  1339. ));
  1340. } else if (json.type == 2) {
  1341. json.optionsList.forEach((str) => {
  1342. str.optionsId = "" + str.optionsId;
  1343. });
  1344. let arr = json.answerQuestion.split(",");
  1345. arr.forEach((a, i) => {
  1346. arr[i] = "" + a;
  1347. });
  1348. ansArr[index] = arr;
  1349. json.content &&
  1350. (json.content = json.content.replace(
  1351. /<img/gi,
  1352. '<img style="max-width:100%;"'
  1353. ));
  1354. } else if (json.type == 3) {
  1355. ansArr[index] = json.answerQuestion;
  1356. json.content &&
  1357. (json.content = json.content.replace(
  1358. /<img/gi,
  1359. '<img style="max-width:100%;"'
  1360. ));
  1361. } else if (json.type == 5) {
  1362. ansArr[index] = {
  1363. text: json.answerQuestion,
  1364. imageList: [],
  1365. };
  1366. json.ansText = {
  1367. text: "",
  1368. imageList: [],
  1369. };
  1370. json.content &&
  1371. (json.content = json.content.replace(
  1372. /<img/gi,
  1373. '<img style="max-width:100%;"'
  1374. ));
  1375. }
  1376. });
  1377. item.analysisContent &&
  1378. (item.analysisContent = item.analysisContent.replace(
  1379. /<img/gi,
  1380. '<img style="max-width:100%;"'
  1381. ));
  1382. item.content &&
  1383. (item.content = item.content.replace(
  1384. /<img/gi,
  1385. '<img style="max-width:100%;"'
  1386. ));
  1387. item.ans = ansArr;
  1388. return;
  1389. }
  1390. item.analysisContent &&
  1391. (item.analysisContent = item.analysisContent.replace(
  1392. /<img/gi,
  1393. '<img style="max-width:100%;"'
  1394. ));
  1395. item.content &&
  1396. (item.content = item.content.replace(
  1397. /<img/gi,
  1398. '<img style="max-width:100%;"'
  1399. ));
  1400. item.ans = item.answerQuestion;
  1401. // }
  1402. });
  1403. this.questionList = data;
  1404. this.lastCount = this.questionList.length;
  1405. this.mockRecord();
  1406. });
  1407. },
  1408. /**
  1409. * @param {Object} e单选点击
  1410. */
  1411. radioSelect(optionsId, bindex) {
  1412. // if (this.questionList[bindex].ques) return;
  1413. // 类型为考试的可以重新在选择答案
  1414. if (this.questionList[bindex].ques && this.bankType == 1) {
  1415. return;
  1416. }
  1417. this.$set(this.questionList[bindex], "ques", optionsId);
  1418. // if ((bindex + 1) < this.questionList.length) {
  1419. // this.current = bindex + 1
  1420. // }
  1421. console.log("改变后:", this.questionList[bindex].ques);
  1422. this.isDoOver();
  1423. },
  1424. /**
  1425. * @param {Object} e案例单选点击
  1426. */
  1427. radioSelectChild(optionsId, ansIndex, bindex) {
  1428. // if (this.questionList[bindex].ques[ansIndex]) return;
  1429. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1430. return;
  1431. }
  1432. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1433. this.isDoOver();
  1434. },
  1435. /**
  1436. * @param {Object} 多选点击
  1437. */
  1438. checkboxSelect(optionsId, bindex, index) {
  1439. if (this.questionList[bindex].ques && this.bankType == 1) {
  1440. return;
  1441. }
  1442. this.$set(
  1443. this.questionList[bindex].jsonStr[index],
  1444. "checked",
  1445. !this.questionList[bindex].jsonStr[index].checked
  1446. );
  1447. },
  1448. /**
  1449. * @param {Object} 案例多选点击
  1450. */
  1451. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1452. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1453. return;
  1454. }
  1455. this.$set(
  1456. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  1457. "checked",
  1458. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1459. .checked
  1460. );
  1461. },
  1462. isCheckboxChecked(arr) {
  1463. return arr.some((item) => {
  1464. if (item.checked) {
  1465. return true;
  1466. }
  1467. });
  1468. },
  1469. /**
  1470. * @param {Object} 多选确认
  1471. */
  1472. checkboxSubmit(bindex) {
  1473. // if (this.questionList[bindex].ques) return;
  1474. if (this.questionList[bindex].ques && this.bankType == 1) {
  1475. return;
  1476. }
  1477. let arr = [];
  1478. this.questionList[bindex].jsonStr.forEach((item) => {
  1479. if (item.checked) {
  1480. arr.push(item.optionsId);
  1481. }
  1482. });
  1483. if (!arr.length) {
  1484. delete this.questionList[bindex].ques;
  1485. uni.showToast({
  1486. title: "请选择答案",
  1487. icon: "none",
  1488. });
  1489. return;
  1490. }
  1491. this.$set(this.questionList[bindex], "ques", arr);
  1492. this.$u.toast("已确认答案");
  1493. this.isDoOver();
  1494. // 切换下一题
  1495. if (
  1496. this.bankType != 1 &&
  1497. this.cgType != 9 &&
  1498. bindex != this.questionList.length - 1
  1499. ) {
  1500. this.current = bindex + 1;
  1501. this.getCollectInfo(this.current);
  1502. }
  1503. },
  1504. /**
  1505. * @param {Object} 案例多选确认
  1506. */
  1507. checkboxSubmitChild(bindex, ansIndex) {
  1508. // if (this.questionList[bindex].ques[ansIndex]) return;
  1509. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1510. return;
  1511. }
  1512. let arr = [];
  1513. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1514. (item) => {
  1515. if (item.checked) {
  1516. arr.push(item.optionsId);
  1517. }
  1518. }
  1519. );
  1520. if (!arr.length) {
  1521. delete this.questionList[bindex].ques[ansIndex];
  1522. uni.showToast({
  1523. title: "请选择答案",
  1524. icon: "none",
  1525. });
  1526. return;
  1527. }
  1528. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1529. this.$u.toast("已确认答案");
  1530. this.isDoOver();
  1531. // 切换下一题
  1532. if (
  1533. this.bankType != 1 &&
  1534. this.cgType != 9 &&
  1535. ansIndex != this.questionList[bindex].ques.length - 1
  1536. ) {
  1537. this.questionList[bindex].current += 1;
  1538. }
  1539. },
  1540. /**
  1541. * @param {Object} index
  1542. * @param {Object} bindex
  1543. * 判断题
  1544. */
  1545. judgeSelect(index, bindex) {
  1546. // if (this.questionList[bindex].ques) return;
  1547. if (this.questionList[bindex].ques && this.bankType == 1) {
  1548. return;
  1549. }
  1550. // 答案: 判断题1正确 0错误
  1551. let value = index == 0 ? "1" : "0";
  1552. // this.$set(this.questionList[bindex], "ques", index + "");
  1553. this.$set(this.questionList[bindex], "ques", value);
  1554. this.isDoOver();
  1555. },
  1556. /**
  1557. * @param {Object} ansindex
  1558. * @param {Object} childindex
  1559. * @param {Object} bindex
  1560. * 案例判断题
  1561. */
  1562. judgeSelectChild(ansindex, childindex, bindex) {
  1563. // if (this.questionList[bindex].ques[ansindex]) return;
  1564. if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
  1565. return;
  1566. }
  1567. this.$set(
  1568. this.questionList[bindex].ques,
  1569. ansindex,
  1570. childindex == 0 ? "1" : "0"
  1571. );
  1572. this.isDoOver();
  1573. },
  1574. openFooterTab() {
  1575. this.show = true;
  1576. },
  1577. changeIndex(index) {
  1578. this.current = index;
  1579. },
  1580. swiperChange(e) {
  1581. this.current = e.detail.current;
  1582. },
  1583. pdsubmit() {
  1584. // if (this.bankType == 1) {
  1585. let ansCount = this.questionOverNum(true); //已答题数
  1586. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1587. //没有答完
  1588. if (this.lastCount !== 0) {
  1589. this.cgType = 6;
  1590. this.showpopups = true;
  1591. return;
  1592. }
  1593. // }
  1594. if (this.bankType == 2) {
  1595. if (this.lastTime > 0) {
  1596. let lastTime = this.countdown(this.lastTime);
  1597. uni.showModal({
  1598. title: "提示",
  1599. content: `时间还剩余${lastTime},确定交卷吗?`,
  1600. confirmText: "交卷",
  1601. cancelText: "继续答题",
  1602. success: (res) => {
  1603. if (res.confirm) {
  1604. //确定
  1605. this.submit();
  1606. } else {
  1607. //取消
  1608. }
  1609. },
  1610. });
  1611. return;
  1612. }
  1613. }
  1614. this.submit();
  1615. },
  1616. /**
  1617. * 交卷
  1618. */
  1619. submit(isShowTip = true) {
  1620. let form = this.$method.calculateScore(this.questionList);
  1621. if (this.subscribeId) {
  1622. this.mockSubscribeEdit();
  1623. }
  1624. //交卷
  1625. this.$api
  1626. .mockRecordEdit({
  1627. examId: this.examId,
  1628. eachExamId: this.eachExamId,
  1629. recordId: this.recordId,
  1630. status: 1,
  1631. examTime: parseInt(this.allTimes),
  1632. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1633. ...form,
  1634. })
  1635. .then((res) => {
  1636. this.isSubmit = true;
  1637. if (res.data.code == 200) {
  1638. if (!isShowTip) {
  1639. return;
  1640. }
  1641. uni.showToast({
  1642. title: "交卷成功",
  1643. duration: 1000,
  1644. icon: "none",
  1645. });
  1646. setTimeout(() => {
  1647. uni.redirectTo({
  1648. url:
  1649. "/pages5/examReport/index?&examId=" +
  1650. this.examId +
  1651. "&id=" +
  1652. this.recordId +
  1653. "&eachExamId=" +
  1654. this.eachExamId +
  1655. "&subscribeId=" +
  1656. this.subscribeId +
  1657. "&doMode=" +
  1658. this.doMode,
  1659. });
  1660. }, 1000);
  1661. }
  1662. });
  1663. //错题集id提交(客观题)
  1664. this.$api
  1665. .mockWrongRecord({
  1666. eachExamId: this.eachExamId,
  1667. examId: this.examId,
  1668. questionIds: form.questionIds,
  1669. recordId: this.recordId,
  1670. doMode: this.doMode,
  1671. })
  1672. .then((res) => {});
  1673. },
  1674. /**
  1675. * @param {Object} imgIndex
  1676. * @param {Object} bankIndex
  1677. * 删除简答图片
  1678. */
  1679. deleteImg(imgIndex, bankIndex) {
  1680. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1681. },
  1682. /**
  1683. * @param {Object} imgIndex
  1684. * @param {Object} bankIndex
  1685. * @param {Object} ansIndex
  1686. * 删除案例题简答图片
  1687. */
  1688. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1689. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1690. imgIndex,
  1691. 1
  1692. );
  1693. },
  1694. /**
  1695. * @param {Object} bankindex
  1696. * 选择上传图片
  1697. */
  1698. chooseImg(bankindex) {
  1699. if (
  1700. this.questionList[bankindex] &&
  1701. this.questionList[bankindex].ansText &&
  1702. this.questionList[bankindex].ansText.imageList.length >= 4
  1703. ) {
  1704. uni.showToast({
  1705. icon: "none",
  1706. title: "最多选择4张",
  1707. });
  1708. return;
  1709. }
  1710. uni.chooseImage({
  1711. count: 1, //默认9
  1712. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1713. sourceType: ["album", "camera"], //从相册选择
  1714. success: (res) => {
  1715. let self = this;
  1716. // console.log(JSON.stringify(res.tempFilePaths));
  1717. let img = res.tempFilePaths[0];
  1718. uni.getImageInfo({
  1719. src: img,
  1720. success: async (res) => {
  1721. let canvasWidth = res.width; //图片原始长宽
  1722. let canvasHeight = res.height;
  1723. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1724. uni.compressImage({
  1725. src: img,
  1726. quality: 75,
  1727. width: "50%",
  1728. height: "50%",
  1729. success: async (rest) => {
  1730. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1731. this.questionList[bankindex].ansText.imageList.push(dir);
  1732. },
  1733. });
  1734. } else {
  1735. const dir = await self.uploadFile(img, 0);
  1736. this.questionList[bankindex].ansText.imageList.push(dir);
  1737. }
  1738. },
  1739. });
  1740. },
  1741. });
  1742. },
  1743. /**
  1744. * @param {Object} bankindex
  1745. * @param {Object} ansindex
  1746. * 案例题选择上传图片
  1747. */
  1748. chooseImgChild(bankindex, ansindex) {
  1749. if (
  1750. this.questionList[bankindex].jsonStr[ansindex] &&
  1751. this.questionList[bankindex].jsonStr[ansindex].ansText &&
  1752. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList
  1753. .length >= 4
  1754. ) {
  1755. uni.showToast({
  1756. icon: "none",
  1757. title: "最多选择4张",
  1758. });
  1759. return;
  1760. }
  1761. uni.chooseImage({
  1762. count: 1, //默认9
  1763. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1764. sourceType: ["album", "camera"], //从相册选择
  1765. success: (res) => {
  1766. let self = this;
  1767. // console.log(JSON.stringify(res.tempFilePaths));
  1768. let img = res.tempFilePaths[0];
  1769. uni.getImageInfo({
  1770. src: img,
  1771. success: async (res) => {
  1772. let canvasWidth = res.width; //图片原始长宽
  1773. let canvasHeight = res.height;
  1774. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1775. uni.compressImage({
  1776. src: img,
  1777. quality: 75,
  1778. width: "50%",
  1779. height: "50%",
  1780. success: async (rest) => {
  1781. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1782. this.questionList[bankindex].jsonStr[
  1783. ansindex
  1784. ].ansText.imageList.push(dir);
  1785. },
  1786. });
  1787. } else {
  1788. const dir = await self.uploadFile(img, 0);
  1789. this.questionList[bankindex].jsonStr[
  1790. ansindex
  1791. ].ansText.imageList.push(dir);
  1792. }
  1793. },
  1794. });
  1795. },
  1796. });
  1797. },
  1798. uploadFile(options, int) {
  1799. var self = this;
  1800. return new Promise((resolve, reject) => {
  1801. var data = {
  1802. orderGoodsId: this.orderGoodsId,
  1803. imageStatus: int,
  1804. };
  1805. self.$api.aliyunpolicy(data).then((res) => {
  1806. console.log(res.data, 6);
  1807. if (res.data.code != 200) {
  1808. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1809. return;
  1810. }
  1811. var ossToken = res.data.data.resultContent;
  1812. if (ossToken.host == null || ossToken.host == undefined) {
  1813. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1814. return;
  1815. }
  1816. uni.uploadFile({
  1817. url: ossToken.host,
  1818. name: "file",
  1819. filePath: options,
  1820. fileType: "image",
  1821. header: {
  1822. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1823. },
  1824. formData: {
  1825. key: ossToken.dir,
  1826. OSSAccessKeyId: ossToken.accessid,
  1827. policy: ossToken.policy,
  1828. Signature: ossToken.signature,
  1829. callback: ossToken.callback,
  1830. success_action_status: 200,
  1831. },
  1832. success: (result) => {
  1833. // if (result.statusCode === 200) {
  1834. resolve(ossToken.dir);
  1835. // } else {
  1836. // uni.showToast({
  1837. // title: "上传失败",
  1838. // icon: "none",
  1839. // });
  1840. // return;
  1841. // }
  1842. },
  1843. fail: (error) => {
  1844. uni.showToast({
  1845. title: "上传接口报错" + error,
  1846. icon: "none",
  1847. });
  1848. return;
  1849. },
  1850. });
  1851. });
  1852. });
  1853. },
  1854. /**
  1855. * @param {Object} type
  1856. * @param {Object} bankindex
  1857. * 简答题答案确认
  1858. */
  1859. submitAns(bankindex) {
  1860. console.log(this.questionList[bankindex]);
  1861. if (
  1862. !this.questionList[bankindex].ansText.text &&
  1863. !this.questionList[bankindex].ansText.imageList.length
  1864. ) {
  1865. uni.showToast({
  1866. title: "请输入内容或上传图片",
  1867. duration: 2000,
  1868. icon: "none",
  1869. });
  1870. return;
  1871. }
  1872. this.$set(this.questionList[bankindex], "ques", {
  1873. imageList: this.questionList[bankindex].ansText.imageList || [],
  1874. text: this.questionList[bankindex].ansText.text || "",
  1875. });
  1876. this.$u.toast("已确认答案");
  1877. this.isDoOver();
  1878. },
  1879. /**
  1880. * @param {Object} bankindex
  1881. * @param {Object} ansindex
  1882. * 案例题简答答案确认
  1883. */
  1884. submitAnsChild(bankindex, ansindex) {
  1885. if (
  1886. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  1887. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  1888. ) {
  1889. uni.showToast({
  1890. title: "请输入内容或上传图片",
  1891. duration: 2000,
  1892. icon: "none",
  1893. });
  1894. return;
  1895. }
  1896. this.$set(this.questionList[bankindex].ques, ansindex, {
  1897. imageList:
  1898. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList ||
  1899. [],
  1900. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || "",
  1901. });
  1902. this.$u.toast("已确认答案");
  1903. this.isDoOver();
  1904. },
  1905. right(bankIndex, ansIndex, option) {
  1906. if (
  1907. this.questionList[bankIndex].ques[ansIndex] &&
  1908. this.questionList[bankIndex].ans[ansIndex]
  1909. ) {
  1910. if (
  1911. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1912. option.optionsId
  1913. ) != -1 ||
  1914. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1915. option.optionsId
  1916. ) != -1
  1917. ) {
  1918. return true;
  1919. } else {
  1920. return false;
  1921. }
  1922. } else {
  1923. return false;
  1924. }
  1925. },
  1926. wrong(bankIndex, ansIndex, option) {
  1927. if (
  1928. this.questionList[bankIndex].ques[ansIndex] &&
  1929. this.questionList[bankIndex].ans[ansIndex]
  1930. ) {
  1931. if (
  1932. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1933. option.optionsId
  1934. ) != -1 &&
  1935. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1936. option.optionsId
  1937. ) == -1
  1938. ) {
  1939. return true;
  1940. } else {
  1941. return false;
  1942. }
  1943. } else {
  1944. return false;
  1945. }
  1946. },
  1947. tabSelect(index, bankindex) {
  1948. this.$set(this.questionList[bankindex], "current", index);
  1949. },
  1950. showPhoto(contentStr) {
  1951. // #ifdef H5
  1952. return;
  1953. // #endif
  1954. if (contentStr && typeof contentStr == "string") {
  1955. let reg = /<img[^>]*src[=\'\"\s]+([^\'\"]*)[\'\"]?[^>]*>/gi;
  1956. let strArr = contentStr.match(reg);
  1957. strArr.forEach((str, index) => {
  1958. strArr[index] = str.replace(reg, "$1");
  1959. });
  1960. // 预览图片
  1961. uni.previewImage({
  1962. urls: strArr,
  1963. longPressActions: {
  1964. itemList: ["发送给朋友", "保存图片", "收藏"],
  1965. success: function (data) {
  1966. console.log(
  1967. "选中了第" +
  1968. (data.tapIndex + 1) +
  1969. "个按钮,第" +
  1970. (data.index + 1) +
  1971. "张图片"
  1972. );
  1973. },
  1974. fail: function (err) {
  1975. console.log(err.errMsg);
  1976. },
  1977. },
  1978. });
  1979. }
  1980. },
  1981. },
  1982. computed: {
  1983. ...mapGetters(["sysTime"]),
  1984. doMode() {
  1985. // 做题模式 1章卷 2随机练习 3模拟组卷
  1986. return this.examData.simulateStatus ? 3 : undefined;
  1987. },
  1988. },
  1989. components: {
  1990. BankBom,
  1991. },
  1992. };
  1993. </script>
  1994. <style lang="scss" scoped>
  1995. .questionBank {
  1996. width: 100%;
  1997. height: 100vh;
  1998. display: flex;
  1999. flex-direction: column;
  2000. }
  2001. .swiper {
  2002. width: 100%;
  2003. flex: 1;
  2004. }
  2005. .lisSty {
  2006. margin-bottom: 16rpx;
  2007. display: flex;
  2008. align-items: center;
  2009. .flex_auto {
  2010. flex: 1;
  2011. word-break: break-all;
  2012. }
  2013. }
  2014. .activeTI {
  2015. vertical-align: middle;
  2016. display: inline-block;
  2017. border: 1rpx solid #eee;
  2018. border-radius: 50rpx;
  2019. height: 48rpx;
  2020. line-height: 46rpx;
  2021. text-align: center;
  2022. width: 48rpx;
  2023. margin-right: 15rpx;
  2024. color: #666;
  2025. font-size: 30rpx;
  2026. &.right {
  2027. color: #fff;
  2028. background: #36c75a;
  2029. }
  2030. &.wrong {
  2031. color: #fff;
  2032. background: #ff3b30;
  2033. }
  2034. &.checked,
  2035. &.user_choose {
  2036. color: #fff;
  2037. background: #007aff;
  2038. }
  2039. }
  2040. .submit_checkbox {
  2041. position: fixed;
  2042. left: 0;
  2043. right: 0;
  2044. bottom: 120rpx;
  2045. margin: 20rpx auto;
  2046. width: 526rpx;
  2047. height: 80rpx;
  2048. background: rgba(0, 122, 255, 1);
  2049. color: #fff;
  2050. text-align: center;
  2051. line-height: 80rpx;
  2052. font-size: 30rpx;
  2053. border-radius: 40rpx;
  2054. &.disabled {
  2055. opacity: 0.6;
  2056. }
  2057. }
  2058. .titles {
  2059. overflow: hidden;
  2060. margin-bottom: 24rpx;
  2061. }
  2062. .titBox {
  2063. padding: 41rpx 25rpx 24rpx 25rpx;
  2064. }
  2065. .titBox_title {
  2066. padding: 21rpx;
  2067. }
  2068. .tabs {
  2069. margin: 10rpx;
  2070. display: flex;
  2071. .tab {
  2072. margin: 0 4rpx;
  2073. padding: 10rpx 13rpx;
  2074. text-align: center;
  2075. color: #007aff;
  2076. font-size: 28rpx;
  2077. border-radius: 16rpx;
  2078. background: #fff;
  2079. &.current {
  2080. color: #fff;
  2081. background: #007aff;
  2082. }
  2083. }
  2084. }
  2085. .ans {
  2086. margin: 8rpx 8rpx 8rpx;
  2087. .ans_input {
  2088. border-radius: 16rpx;
  2089. background: #fff;
  2090. .top {
  2091. border-bottom: 1rpx solid #eeeeee;
  2092. padding: 16rpx;
  2093. display: flex;
  2094. align-items: center;
  2095. .icon {
  2096. margin-right: 20rpx;
  2097. width: 40rpx;
  2098. height: 38rpx;
  2099. }
  2100. .progress {
  2101. flex: 1;
  2102. }
  2103. .submit {
  2104. width: 168rpx;
  2105. height: 48rpx;
  2106. line-height: 48rpx;
  2107. text-align: center;
  2108. color: #fff;
  2109. font-size: 30rpx;
  2110. background: #007aff;
  2111. border-radius: 24rpx;
  2112. &.disabled {
  2113. opacity: 0.6;
  2114. }
  2115. }
  2116. }
  2117. .textarea {
  2118. textarea {
  2119. width: 100%;
  2120. height: 287rpx;
  2121. padding: 10rpx;
  2122. }
  2123. }
  2124. .imgs {
  2125. overflow: hidden;
  2126. display: flex;
  2127. width: 100%;
  2128. .img {
  2129. width: 104rpx;
  2130. height: 104rpx;
  2131. border-radius: 8rpx;
  2132. position: relative;
  2133. margin: 20rpx;
  2134. text {
  2135. position: absolute;
  2136. right: -15rpx;
  2137. top: -15rpx;
  2138. width: 30rpx;
  2139. height: 30rpx;
  2140. text-align: center;
  2141. line-height: 30rpx;
  2142. color: #fff;
  2143. background: #ff3b30;
  2144. border-radius: 50%;
  2145. }
  2146. image {
  2147. width: 100%;
  2148. height: 100%;
  2149. }
  2150. }
  2151. }
  2152. }
  2153. .ans_submit {
  2154. padding: 16rpx;
  2155. border-radius: 16rpx;
  2156. background: #fff;
  2157. .imgs {
  2158. overflow: hidden;
  2159. display: flex;
  2160. width: 100%;
  2161. .img {
  2162. width: 104rpx;
  2163. height: 104rpx;
  2164. border-radius: 8rpx;
  2165. position: relative;
  2166. margin: 20rpx;
  2167. image {
  2168. width: 100%;
  2169. height: 100%;
  2170. }
  2171. }
  2172. }
  2173. }
  2174. }
  2175. .leftLetters {
  2176. display: flex;
  2177. align-items: center;
  2178. width: 220rpx;
  2179. .btnType {
  2180. padding: 5rpx 10rpx;
  2181. border: 1rpx solid #007aff;
  2182. border-radius: 10rpx;
  2183. background-color: rgba(0, 122, 255, 0.1);
  2184. font-size: 28rpx;
  2185. color: #007aff;
  2186. margin-right: 15rpx;
  2187. }
  2188. }
  2189. .firstLetter {
  2190. display: flex;
  2191. justify-content: space-between;
  2192. align-items: center;
  2193. margin-bottom: 30rpx;
  2194. }
  2195. .pageContent {
  2196. position: relative;
  2197. background-color: #eaeef1;
  2198. height: 100%;
  2199. padding-top: 8rpx;
  2200. padding-bottom: 100rpx;
  2201. overflow-y: scroll;
  2202. }
  2203. .pad_8 {
  2204. background-color: #fff;
  2205. margin: 0rpx 8rpx 8rpx;
  2206. border-radius: 16rpx;
  2207. &.no-margin {
  2208. margin-top: -16rpx;
  2209. border-radius: 0 0 16rpx 16rpx;
  2210. }
  2211. }
  2212. .answer {
  2213. height: 80rpx;
  2214. line-height: 80rpx;
  2215. padding: 0rpx 24rpx;
  2216. display: flex;
  2217. align-items: center;
  2218. justify-content: space-between;
  2219. color: #666;
  2220. font-size: 30rpx;
  2221. }
  2222. .answerInfos {
  2223. padding: 25rpx 25rpx 25rpx 23rpx;
  2224. }
  2225. .answerTitle {
  2226. margin-bottom: 28rpx;
  2227. color: #666;
  2228. font-size: 30rpx;
  2229. }
  2230. .answerContent {
  2231. font-size: 30rpx;
  2232. color: #666;
  2233. }
  2234. .textChild {
  2235. display: inline-block;
  2236. vertical-align: middle;
  2237. }
  2238. .dialog {
  2239. position: fixed;
  2240. left: 0;
  2241. top: 0;
  2242. width: 100%;
  2243. height: 100%;
  2244. background-color: rgba(0, 0, 0, 0.8);
  2245. display: flex;
  2246. flex-direction: column;
  2247. align-items: center;
  2248. justify-content: center;
  2249. z-index: 20000;
  2250. .pointer {
  2251. width: 338rpx;
  2252. height: 240rpx;
  2253. }
  2254. .text {
  2255. font-size: 32rpx;
  2256. color: #ffffff;
  2257. text-align: center;
  2258. }
  2259. .btn {
  2260. width: 242rpx;
  2261. height: 82rpx;
  2262. border: 2rpx solid #ffffff;
  2263. border-radius: 16rpx;
  2264. text-align: center;
  2265. line-height: 82rpx;
  2266. margin: 41rpx auto;
  2267. color: #fff;
  2268. font-size: 32rpx;
  2269. }
  2270. }
  2271. .dialog-arrow {
  2272. padding-top: 124rpx;
  2273. position: fixed;
  2274. left: 0;
  2275. top: 0;
  2276. width: 100%;
  2277. height: 100%;
  2278. background-color: rgba(0, 0, 0, 0.8);
  2279. z-index: 20000;
  2280. .pointer {
  2281. margin-left: 87rpx;
  2282. display: block;
  2283. width: 95rpx;
  2284. height: 98rpx;
  2285. }
  2286. .text {
  2287. padding-left: 177rpx;
  2288. font-size: 32rpx;
  2289. color: #ffffff;
  2290. }
  2291. .btn {
  2292. width: 242rpx;
  2293. height: 82rpx;
  2294. border: 2rpx solid #ffffff;
  2295. border-radius: 16rpx;
  2296. text-align: center;
  2297. line-height: 82rpx;
  2298. margin: 500rpx auto 0;
  2299. color: #fff;
  2300. font-size: 32rpx;
  2301. }
  2302. }
  2303. .dialog_wrap {
  2304. position: fixed;
  2305. left: 0;
  2306. top: 0;
  2307. width: 100%;
  2308. height: 100%;
  2309. z-index: 9999999999;
  2310. .bg {
  2311. background: rgba(0, 0, 0, 0.3);
  2312. position: absolute;
  2313. left: 0;
  2314. top: 0;
  2315. width: 100%;
  2316. height: 100%;
  2317. }
  2318. .dialog {
  2319. position: absolute;
  2320. left: 50%;
  2321. top: 50%;
  2322. transform: translate3D(-50%, -50%, 0);
  2323. width: 640rpx;
  2324. height: 439rpx;
  2325. background: #ffffff;
  2326. border-radius: 24rpx;
  2327. .title {
  2328. font-size: 30rpx;
  2329. font-weight: bold;
  2330. color: #333333;
  2331. line-height: 48rpx;
  2332. text-align: center;
  2333. margin-top: 40rpx;
  2334. }
  2335. .content {
  2336. margin: 35rpx 35rpx 0;
  2337. font-size: 30rpx;
  2338. color: #666666;
  2339. line-height: 48rpx;
  2340. }
  2341. .btns {
  2342. margin-top: 35rpx;
  2343. display: flex;
  2344. align-items: center;
  2345. justify-content: center;
  2346. .btn {
  2347. width: 200rpx;
  2348. height: 80rpx;
  2349. line-height: 80rpx;
  2350. text-align: center;
  2351. background: #f5f5f5;
  2352. border-radius: 40rpx;
  2353. font-size: 30rpx;
  2354. color: rgba(0, 122, 255, 1);
  2355. background: #f5f5f5;
  2356. margin: 0 20rpx;
  2357. &.active {
  2358. color: #f5f5f5;
  2359. background: rgba(0, 122, 255, 1);
  2360. }
  2361. }
  2362. }
  2363. }
  2364. }
  2365. .popboxs {
  2366. width: 100%;
  2367. height: 100%;
  2368. display: flex;
  2369. flex-direction: column;
  2370. align-items: center;
  2371. }
  2372. .classTops {
  2373. flex-shrink: 0;
  2374. padding: 39rpx 0rpx 4rpx;
  2375. font-weight: bold;
  2376. color: #333;
  2377. font-size: 30rpx;
  2378. }
  2379. .textStys {
  2380. width: 100%;
  2381. flex: 1;
  2382. padding: 36rpx;
  2383. }
  2384. .classFootsty {
  2385. flex-shrink: 0;
  2386. display: flex;
  2387. align-items: center;
  2388. justify-content: center;
  2389. padding: 10rpx 0rpx 40rpx;
  2390. .btnsty {
  2391. width: 200rpx;
  2392. height: 80rpx;
  2393. border-radius: 40rpx;
  2394. font-weight: bold;
  2395. font-size: 30rpx;
  2396. text-align: center;
  2397. line-height: 80rpx;
  2398. }
  2399. .btns1 {
  2400. background-color: #f5f5f5;
  2401. color: #007aff;
  2402. }
  2403. .btns2 {
  2404. margin-left: 40rpx;
  2405. background-color: #007aff;
  2406. color: #ffffff;
  2407. }
  2408. }
  2409. </style>