index.vue 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522
  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) => {
  986. this.$api.bankExam(this.examId).then((res) => {
  987. this.bankType = res.data.data.doType;
  988. this.examData = res.data.data;
  989. if (this.bankType == 2) {
  990. this.needBack = true;
  991. }
  992. resolve();
  993. });
  994. });
  995. },
  996. /**
  997. * 点击后退按钮
  998. */
  999. clickLeft() {
  1000. if (this.bankType == 1) {
  1001. let ansCount = this.questionOverNum(true); //已答题数
  1002. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1003. //所有题目答完
  1004. if (this.lastCount == 0) {
  1005. // this.testOver = true;
  1006. this.cgType = 7;
  1007. //未答完
  1008. } else {
  1009. this.cgType = 8;
  1010. // this.isLastCount = true;
  1011. }
  1012. this.showpopups = true;
  1013. } else if (this.bankType == 2) {
  1014. let ansCount = this.questionOverNum(true); //已答题数
  1015. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1016. //所有题目答完
  1017. if (this.lastCount == 0) {
  1018. this.testOver = true;
  1019. //未答完
  1020. } else {
  1021. this.isLastCount = true;
  1022. }
  1023. }
  1024. },
  1025. /**
  1026. * 返回上一页
  1027. */
  1028. backPages() {
  1029. this.needBack = false;
  1030. uni.navigateBack({
  1031. delta: 1,
  1032. });
  1033. },
  1034. /**
  1035. * 获取已经回答的题目数
  1036. * hasSpecail (是否包含简答和案例)
  1037. */
  1038. questionOverNum(hasSpecail) {
  1039. let count = 0;
  1040. this.questionList.forEach((item) => {
  1041. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1042. if (item.ques) {
  1043. count++;
  1044. }
  1045. } else if (item.type == 4) {
  1046. //案例题
  1047. if (hasSpecail) {
  1048. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1049. if (
  1050. jsonItem.type == 1 ||
  1051. jsonItem.type == 2 ||
  1052. jsonItem.type == 3
  1053. ) {
  1054. if (item.ques[indexs]) {
  1055. return true;
  1056. } else {
  1057. return false;
  1058. }
  1059. } else if (jsonItem.type == 5) {
  1060. if (
  1061. item.ques[indexs] &&
  1062. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1063. ) {
  1064. console.log("chil");
  1065. return true;
  1066. } else {
  1067. return false;
  1068. }
  1069. }
  1070. });
  1071. if (isOver) {
  1072. count++;
  1073. console.log(item, 444);
  1074. }
  1075. }
  1076. } else if (item.type == 5) {
  1077. //简答题
  1078. if (hasSpecail) {
  1079. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1080. console.log(5, item);
  1081. count++;
  1082. }
  1083. }
  1084. }
  1085. });
  1086. return count;
  1087. },
  1088. mockSubscribeEdit() {
  1089. this.$api
  1090. .mockSubscribeEdit({
  1091. subscribeId: this.subscribeId,
  1092. handStatus: this.isAutoSubmit ? 2 : 1,
  1093. })
  1094. .then((res) => {});
  1095. },
  1096. /**
  1097. * 是否做完所有题目
  1098. */
  1099. isDoOver() {
  1100. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1101. if (this.questionList.length == questionOverNum) {
  1102. //全部做完弹窗
  1103. this.cgType = 9;
  1104. this.showpopups = true;
  1105. }
  1106. },
  1107. /**
  1108. * 暂不交卷
  1109. */
  1110. noSubmit() {
  1111. //设为允许退出页面
  1112. this.needBack = false;
  1113. uni.navigateBack({
  1114. delta: 1,
  1115. });
  1116. },
  1117. /**
  1118. * 不离开
  1119. */
  1120. noLeave() {
  1121. this.isLastCount = false;
  1122. },
  1123. /**
  1124. * 立即离开并交卷
  1125. */
  1126. leaveNow() {
  1127. this.needBack = false;
  1128. this.isSubmit = true;
  1129. this.submit(false);
  1130. uni.navigateBack({
  1131. delta: 1,
  1132. });
  1133. },
  1134. /**
  1135. * 立即交卷
  1136. */
  1137. submitNow() {
  1138. console.log("sds");
  1139. this.showpopups = false;
  1140. this.needBack = false;
  1141. this.submit();
  1142. },
  1143. /**
  1144. * 离开页面统计回答正确题数
  1145. */
  1146. mockRecordEdit() {
  1147. if (!this.isSubmit) {
  1148. if (this.subscribeId) {
  1149. this.mockSubscribeEdit();
  1150. }
  1151. let {
  1152. doQuestionNum,
  1153. doQuestionIds,
  1154. rightQuestionNum,
  1155. historyExamJson,
  1156. } = this.$method.calculateScore(this.questionList);
  1157. this.$api
  1158. .mockRecordEdit({
  1159. examId: this.examId,
  1160. eachExamId: this.eachExamId,
  1161. goodsId: this.goodsId,
  1162. recordId: this.recordId,
  1163. doQuestionIds,
  1164. rightQuestionNum,
  1165. status: 1,
  1166. doQuestionNum,
  1167. historyExamJson,
  1168. })
  1169. .then((res) => {});
  1170. }
  1171. },
  1172. /**
  1173. * 记录总题数
  1174. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1175. */
  1176. mockRecord(hasSpecial) {
  1177. let questionList = 0;
  1178. // if(!hasSpecial) {
  1179. this.questionList.forEach((item, index) => {
  1180. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1181. questionList++;
  1182. }
  1183. });
  1184. // } else {
  1185. // questionList = this.questionList.length;
  1186. // }
  1187. this.$api
  1188. .mockRecord({
  1189. examId: this.examId,
  1190. eachExamId: this.eachExamId,
  1191. totalQuestionNum: questionList,
  1192. allQuestionNum: this.questionList.length,
  1193. doMode: this.doMode,
  1194. simulateExamId: this.simulateExamId,
  1195. })
  1196. .then((res) => {
  1197. this.recordId = res.data.data;
  1198. //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
  1199. });
  1200. },
  1201. /**
  1202. * @param {Object} second倒计时过滤器
  1203. */
  1204. countdown(second) {
  1205. if (second) {
  1206. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  1207. let m = parseInt((second / 60) % 60); // 计算分数
  1208. let s = parseInt(second % 60); // 计算当前秒数
  1209. if (h < 10) h = "0" + h;
  1210. if (m < 10) m = "0" + m;
  1211. if (s < 10) s = "0" + s;
  1212. return h + ":" + m + ":" + s;
  1213. } else {
  1214. return "";
  1215. }
  1216. },
  1217. hideDialog() {
  1218. this.showDialog = false;
  1219. },
  1220. noListTip(content = "该试卷暂无题目") {
  1221. this.hideDialog();
  1222. uni.showModal({
  1223. showCancel: false,
  1224. content,
  1225. success: (k) => {
  1226. if (k.confirm) {
  1227. this.isSubmit = true;
  1228. uni.navigateBack();
  1229. }
  1230. },
  1231. });
  1232. },
  1233. /**
  1234. * 请求题目列表
  1235. */
  1236. goodsQuestionList() {
  1237. // app/common/bank/question/list
  1238. this.$api[
  1239. this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
  1240. ]({
  1241. examId: this.examId,
  1242. goodsId: this.goodsId,
  1243. orderGoodsId: this.orderGoodsId,
  1244. from: 3,
  1245. }).then((res) => {
  1246. if (res.data.code == 500) {
  1247. return this.noListTip("你已完成所有题目");
  1248. }
  1249. let data = res.data.data;
  1250. if (this.doMode == 3) {
  1251. this.simulateExamId = data.simulateExamId;
  1252. data = data.questionList;
  1253. }
  1254. if (!data.length) {
  1255. return this.noListTip();
  1256. }
  1257. if (this.subscribeId) {
  1258. this.lastTime = this.examEndTime - this.sysTime;
  1259. //考试时间到了自动交卷
  1260. if (this.lastTime) {
  1261. this.timer = setInterval(() => {
  1262. if (this.lastTime <= 0) {
  1263. clearInterval(this.timer);
  1264. uni.showToast({
  1265. icon: "none",
  1266. mask: true,
  1267. title: "考试时间已到,系统将自动交卷",
  1268. duration: 5000,
  1269. });
  1270. this.isAutoSubmit = true;
  1271. this.submit();
  1272. return;
  1273. }
  1274. this.lastTime--;
  1275. }, 1000);
  1276. } else {
  1277. }
  1278. }
  1279. data.forEach((item, index) => {
  1280. // if (typeof item.jsonStr == 'string') {
  1281. item.jsonStr = JSON.parse(item.jsonStr);
  1282. if (item.type == 2) {
  1283. //多选
  1284. item.jsonStr.forEach((str) => {
  1285. str.optionsId = "" + str.optionsId;
  1286. });
  1287. let arr = item.answerQuestion.split(",");
  1288. arr.forEach((a, i) => {
  1289. arr[i] = "" + a;
  1290. });
  1291. item.ans = arr;
  1292. item.analysisContent &&
  1293. (item.analysisContent = item.analysisContent.replace(
  1294. /<img/gi,
  1295. '<img style="max-width:100%;"'
  1296. ));
  1297. item.content &&
  1298. (item.content = item.content.replace(
  1299. /<img/gi,
  1300. '<img style="max-width:100%;"'
  1301. ));
  1302. return;
  1303. } else if (item.type == 5) {
  1304. //简答题
  1305. item.ansText = {
  1306. text: "",
  1307. imageList: [],
  1308. };
  1309. item.ques = {
  1310. text: "",
  1311. imageList: [],
  1312. };
  1313. item.analysisContent &&
  1314. (item.analysisContent = item.analysisContent.replace(
  1315. /<img/gi,
  1316. '<img style="max-width:100%;"'
  1317. ));
  1318. item.content &&
  1319. (item.content = item.content.replace(
  1320. /<img/gi,
  1321. '<img style="max-width:100%;"'
  1322. ));
  1323. } else if (item.type == 4) {
  1324. //案例题
  1325. item.ques = [];
  1326. item.current = 0;
  1327. let ansArr = [];
  1328. item.jsonStr.forEach((json, index) => {
  1329. if (json.type == 1) {
  1330. ansArr[index] = json.answerQuestion;
  1331. json.content &&
  1332. (json.content = json.content.replace(
  1333. /<img/gi,
  1334. '<img style="max-width:100%;"'
  1335. ));
  1336. } else if (json.type == 2) {
  1337. json.optionsList.forEach((str) => {
  1338. str.optionsId = "" + str.optionsId;
  1339. });
  1340. let arr = json.answerQuestion.split(",");
  1341. arr.forEach((a, i) => {
  1342. arr[i] = "" + a;
  1343. });
  1344. ansArr[index] = arr;
  1345. json.content &&
  1346. (json.content = json.content.replace(
  1347. /<img/gi,
  1348. '<img style="max-width:100%;"'
  1349. ));
  1350. } else if (json.type == 3) {
  1351. ansArr[index] = json.answerQuestion;
  1352. json.content &&
  1353. (json.content = json.content.replace(
  1354. /<img/gi,
  1355. '<img style="max-width:100%;"'
  1356. ));
  1357. } else if (json.type == 5) {
  1358. ansArr[index] = {
  1359. text: json.answerQuestion,
  1360. imageList: [],
  1361. };
  1362. json.ansText = {
  1363. text: "",
  1364. imageList: [],
  1365. };
  1366. json.content &&
  1367. (json.content = json.content.replace(
  1368. /<img/gi,
  1369. '<img style="max-width:100%;"'
  1370. ));
  1371. }
  1372. });
  1373. item.analysisContent &&
  1374. (item.analysisContent = item.analysisContent.replace(
  1375. /<img/gi,
  1376. '<img style="max-width:100%;"'
  1377. ));
  1378. item.content &&
  1379. (item.content = item.content.replace(
  1380. /<img/gi,
  1381. '<img style="max-width:100%;"'
  1382. ));
  1383. item.ans = ansArr;
  1384. return;
  1385. }
  1386. item.analysisContent &&
  1387. (item.analysisContent = item.analysisContent.replace(
  1388. /<img/gi,
  1389. '<img style="max-width:100%;"'
  1390. ));
  1391. item.content &&
  1392. (item.content = item.content.replace(
  1393. /<img/gi,
  1394. '<img style="max-width:100%;"'
  1395. ));
  1396. item.ans = item.answerQuestion;
  1397. // }
  1398. });
  1399. this.questionList = data;
  1400. this.lastCount = this.questionList.length;
  1401. this.mockRecord();
  1402. });
  1403. },
  1404. /**
  1405. * @param {Object} e单选点击
  1406. */
  1407. radioSelect(optionsId, bindex) {
  1408. // if (this.questionList[bindex].ques) return;
  1409. // 类型为考试的可以重新在选择答案
  1410. if (this.questionList[bindex].ques && this.bankType == 1) {
  1411. return;
  1412. }
  1413. this.$set(this.questionList[bindex], "ques", optionsId);
  1414. // if ((bindex + 1) < this.questionList.length) {
  1415. // this.current = bindex + 1
  1416. // }
  1417. console.log("改变后:", this.questionList[bindex].ques);
  1418. this.isDoOver();
  1419. },
  1420. /**
  1421. * @param {Object} e案例单选点击
  1422. */
  1423. radioSelectChild(optionsId, ansIndex, bindex) {
  1424. // if (this.questionList[bindex].ques[ansIndex]) return;
  1425. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1426. return;
  1427. }
  1428. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1429. this.isDoOver();
  1430. },
  1431. /**
  1432. * @param {Object} 多选点击
  1433. */
  1434. checkboxSelect(optionsId, bindex, index) {
  1435. if (this.questionList[bindex].ques && this.bankType == 1) {
  1436. return;
  1437. }
  1438. this.$set(
  1439. this.questionList[bindex].jsonStr[index],
  1440. "checked",
  1441. !this.questionList[bindex].jsonStr[index].checked
  1442. );
  1443. },
  1444. /**
  1445. * @param {Object} 案例多选点击
  1446. */
  1447. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1448. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1449. return;
  1450. }
  1451. this.$set(
  1452. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  1453. "checked",
  1454. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1455. .checked
  1456. );
  1457. },
  1458. isCheckboxChecked(arr) {
  1459. return arr.some((item) => {
  1460. if (item.checked) {
  1461. return true;
  1462. }
  1463. });
  1464. },
  1465. /**
  1466. * @param {Object} 多选确认
  1467. */
  1468. checkboxSubmit(bindex) {
  1469. // if (this.questionList[bindex].ques) return;
  1470. if (this.questionList[bindex].ques && this.bankType == 1) {
  1471. return;
  1472. }
  1473. let arr = [];
  1474. this.questionList[bindex].jsonStr.forEach((item) => {
  1475. if (item.checked) {
  1476. arr.push(item.optionsId);
  1477. }
  1478. });
  1479. if (!arr.length) {
  1480. delete this.questionList[bindex].ques;
  1481. uni.showToast({
  1482. title: "请选择答案",
  1483. icon: "none",
  1484. });
  1485. return;
  1486. }
  1487. this.$set(this.questionList[bindex], "ques", arr);
  1488. this.$u.toast("已确认答案");
  1489. this.isDoOver();
  1490. // 切换下一题
  1491. if (
  1492. this.bankType != 1 &&
  1493. this.cgType != 9 &&
  1494. bindex != this.questionList.length - 1
  1495. ) {
  1496. this.current = bindex + 1;
  1497. this.getCollectInfo(this.current);
  1498. }
  1499. },
  1500. /**
  1501. * @param {Object} 案例多选确认
  1502. */
  1503. checkboxSubmitChild(bindex, ansIndex) {
  1504. // if (this.questionList[bindex].ques[ansIndex]) return;
  1505. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1506. return;
  1507. }
  1508. let arr = [];
  1509. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1510. (item) => {
  1511. if (item.checked) {
  1512. arr.push(item.optionsId);
  1513. }
  1514. }
  1515. );
  1516. if (!arr.length) {
  1517. delete this.questionList[bindex].ques[ansIndex];
  1518. uni.showToast({
  1519. title: "请选择答案",
  1520. icon: "none",
  1521. });
  1522. return;
  1523. }
  1524. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1525. this.$u.toast("已确认答案");
  1526. this.isDoOver();
  1527. // 切换下一题
  1528. if (
  1529. this.bankType != 1 &&
  1530. this.cgType != 9 &&
  1531. ansIndex != this.questionList[bindex].ques.length - 1
  1532. ) {
  1533. this.questionList[bindex].current += 1;
  1534. }
  1535. },
  1536. /**
  1537. * @param {Object} index
  1538. * @param {Object} bindex
  1539. * 判断题
  1540. */
  1541. judgeSelect(index, bindex) {
  1542. // if (this.questionList[bindex].ques) return;
  1543. if (this.questionList[bindex].ques && this.bankType == 1) {
  1544. return;
  1545. }
  1546. // 答案: 判断题1正确 0错误
  1547. let value = index == 0 ? "1" : "0";
  1548. // this.$set(this.questionList[bindex], "ques", index + "");
  1549. this.$set(this.questionList[bindex], "ques", value);
  1550. this.isDoOver();
  1551. },
  1552. /**
  1553. * @param {Object} ansindex
  1554. * @param {Object} childindex
  1555. * @param {Object} bindex
  1556. * 案例判断题
  1557. */
  1558. judgeSelectChild(ansindex, childindex, bindex) {
  1559. // if (this.questionList[bindex].ques[ansindex]) return;
  1560. if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
  1561. return;
  1562. }
  1563. this.$set(
  1564. this.questionList[bindex].ques,
  1565. ansindex,
  1566. childindex == 0 ? "1" : "0"
  1567. );
  1568. this.isDoOver();
  1569. },
  1570. openFooterTab() {
  1571. this.show = true;
  1572. },
  1573. changeIndex(index) {
  1574. this.current = index;
  1575. },
  1576. swiperChange(e) {
  1577. this.current = e.detail.current;
  1578. },
  1579. pdsubmit() {
  1580. // if (this.bankType == 1) {
  1581. let ansCount = this.questionOverNum(true); //已答题数
  1582. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1583. //没有答完
  1584. if (this.lastCount !== 0) {
  1585. this.cgType = 6;
  1586. this.showpopups = true;
  1587. return;
  1588. }
  1589. // }
  1590. if (this.bankType == 2) {
  1591. if (this.lastTime > 0) {
  1592. let lastTime = this.countdown(this.lastTime);
  1593. uni.showModal({
  1594. title: "提示",
  1595. content: `时间还剩余${lastTime},确定交卷吗?`,
  1596. confirmText: "交卷",
  1597. cancelText: "继续答题",
  1598. success: (res) => {
  1599. if (res.confirm) {
  1600. //确定
  1601. this.submit();
  1602. } else {
  1603. //取消
  1604. }
  1605. },
  1606. });
  1607. return;
  1608. }
  1609. }
  1610. this.submit();
  1611. },
  1612. /**
  1613. * 交卷
  1614. */
  1615. submit(isShowTip = true) {
  1616. let form = this.$method.calculateScore(this.questionList);
  1617. if (this.subscribeId) {
  1618. this.mockSubscribeEdit();
  1619. }
  1620. //交卷
  1621. this.$api
  1622. .mockRecordEdit({
  1623. examId: this.examId,
  1624. eachExamId: this.eachExamId,
  1625. recordId: this.recordId,
  1626. status: 1,
  1627. examTime: parseInt(this.allTimes),
  1628. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1629. ...form,
  1630. })
  1631. .then((res) => {
  1632. this.isSubmit = true;
  1633. if (res.data.code == 200) {
  1634. if (!isShowTip) {
  1635. return;
  1636. }
  1637. uni.showToast({
  1638. title: "交卷成功",
  1639. duration: 1000,
  1640. icon: "none",
  1641. });
  1642. setTimeout(() => {
  1643. uni.redirectTo({
  1644. url:
  1645. "/pages5/examReport/index?&examId=" +
  1646. this.examId +
  1647. "&id=" +
  1648. this.recordId +
  1649. "&eachExamId=" +
  1650. this.eachExamId +
  1651. "&subscribeId=" +
  1652. this.subscribeId +
  1653. "&doMode=" +
  1654. this.doMode,
  1655. });
  1656. }, 1000);
  1657. }
  1658. });
  1659. //错题集id提交(客观题)
  1660. this.$api
  1661. .mockWrongRecord({
  1662. eachExamId: this.eachExamId,
  1663. examId: this.examId,
  1664. questionIds: form.questionIds,
  1665. recordId: this.recordId,
  1666. doMode: this.doMode,
  1667. })
  1668. .then((res) => {});
  1669. },
  1670. /**
  1671. * @param {Object} imgIndex
  1672. * @param {Object} bankIndex
  1673. * 删除简答图片
  1674. */
  1675. deleteImg(imgIndex, bankIndex) {
  1676. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1677. },
  1678. /**
  1679. * @param {Object} imgIndex
  1680. * @param {Object} bankIndex
  1681. * @param {Object} ansIndex
  1682. * 删除案例题简答图片
  1683. */
  1684. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1685. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1686. imgIndex,
  1687. 1
  1688. );
  1689. },
  1690. /**
  1691. * @param {Object} bankindex
  1692. * 选择上传图片
  1693. */
  1694. chooseImg(bankindex) {
  1695. if (
  1696. this.questionList[bankindex] &&
  1697. this.questionList[bankindex].ansText &&
  1698. this.questionList[bankindex].ansText.imageList.length >= 4
  1699. ) {
  1700. uni.showToast({
  1701. icon: "none",
  1702. title: "最多选择4张",
  1703. });
  1704. return;
  1705. }
  1706. uni.chooseImage({
  1707. count: 1, //默认9
  1708. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1709. sourceType: ["album", "camera"], //从相册选择
  1710. success: (res) => {
  1711. let self = this;
  1712. // console.log(JSON.stringify(res.tempFilePaths));
  1713. let img = res.tempFilePaths[0];
  1714. uni.getImageInfo({
  1715. src: img,
  1716. success: async (res) => {
  1717. let canvasWidth = res.width; //图片原始长宽
  1718. let canvasHeight = res.height;
  1719. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1720. uni.compressImage({
  1721. src: img,
  1722. quality: 75,
  1723. width: "50%",
  1724. height: "50%",
  1725. success: async (rest) => {
  1726. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1727. this.questionList[bankindex].ansText.imageList.push(dir);
  1728. },
  1729. });
  1730. } else {
  1731. const dir = await self.uploadFile(img, 0);
  1732. this.questionList[bankindex].ansText.imageList.push(dir);
  1733. }
  1734. },
  1735. });
  1736. },
  1737. });
  1738. },
  1739. /**
  1740. * @param {Object} bankindex
  1741. * @param {Object} ansindex
  1742. * 案例题选择上传图片
  1743. */
  1744. chooseImgChild(bankindex, ansindex) {
  1745. if (
  1746. this.questionList[bankindex].jsonStr[ansindex] &&
  1747. this.questionList[bankindex].jsonStr[ansindex].ansText &&
  1748. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList
  1749. .length >= 4
  1750. ) {
  1751. uni.showToast({
  1752. icon: "none",
  1753. title: "最多选择4张",
  1754. });
  1755. return;
  1756. }
  1757. uni.chooseImage({
  1758. count: 1, //默认9
  1759. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1760. sourceType: ["album", "camera"], //从相册选择
  1761. success: (res) => {
  1762. let self = this;
  1763. // console.log(JSON.stringify(res.tempFilePaths));
  1764. let img = res.tempFilePaths[0];
  1765. uni.getImageInfo({
  1766. src: img,
  1767. success: async (res) => {
  1768. let canvasWidth = res.width; //图片原始长宽
  1769. let canvasHeight = res.height;
  1770. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1771. uni.compressImage({
  1772. src: img,
  1773. quality: 75,
  1774. width: "50%",
  1775. height: "50%",
  1776. success: async (rest) => {
  1777. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1778. this.questionList[bankindex].jsonStr[
  1779. ansindex
  1780. ].ansText.imageList.push(dir);
  1781. },
  1782. });
  1783. } else {
  1784. const dir = await self.uploadFile(img, 0);
  1785. this.questionList[bankindex].jsonStr[
  1786. ansindex
  1787. ].ansText.imageList.push(dir);
  1788. }
  1789. },
  1790. });
  1791. },
  1792. });
  1793. },
  1794. uploadFile(options, int) {
  1795. var self = this;
  1796. return new Promise((resolve, reject) => {
  1797. var data = {
  1798. orderGoodsId: this.orderGoodsId,
  1799. imageStatus: int,
  1800. };
  1801. self.$api.aliyunpolicy(data).then((res) => {
  1802. console.log(res.data, 6);
  1803. if (res.data.code != 200) {
  1804. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1805. return;
  1806. }
  1807. var ossToken = res.data.data.resultContent;
  1808. if (ossToken.host == null || ossToken.host == undefined) {
  1809. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1810. return;
  1811. }
  1812. uni.uploadFile({
  1813. url: ossToken.host,
  1814. name: "file",
  1815. filePath: options,
  1816. fileType: "image",
  1817. header: {
  1818. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1819. },
  1820. formData: {
  1821. key: ossToken.dir,
  1822. OSSAccessKeyId: ossToken.accessid,
  1823. policy: ossToken.policy,
  1824. Signature: ossToken.signature,
  1825. callback: ossToken.callback,
  1826. success_action_status: 200,
  1827. },
  1828. success: (result) => {
  1829. // if (result.statusCode === 200) {
  1830. resolve(ossToken.dir);
  1831. // } else {
  1832. // uni.showToast({
  1833. // title: "上传失败",
  1834. // icon: "none",
  1835. // });
  1836. // return;
  1837. // }
  1838. },
  1839. fail: (error) => {
  1840. uni.showToast({
  1841. title: "上传接口报错" + error,
  1842. icon: "none",
  1843. });
  1844. return;
  1845. },
  1846. });
  1847. });
  1848. });
  1849. },
  1850. /**
  1851. * @param {Object} type
  1852. * @param {Object} bankindex
  1853. * 简答题答案确认
  1854. */
  1855. submitAns(bankindex) {
  1856. console.log(this.questionList[bankindex]);
  1857. if (
  1858. !this.questionList[bankindex].ansText.text &&
  1859. !this.questionList[bankindex].ansText.imageList.length
  1860. ) {
  1861. uni.showToast({
  1862. title: "请输入内容或上传图片",
  1863. duration: 2000,
  1864. icon: "none",
  1865. });
  1866. return;
  1867. }
  1868. this.$set(this.questionList[bankindex], "ques", {
  1869. imageList: this.questionList[bankindex].ansText.imageList || [],
  1870. text: this.questionList[bankindex].ansText.text || "",
  1871. });
  1872. this.$u.toast("已确认答案");
  1873. this.isDoOver();
  1874. },
  1875. /**
  1876. * @param {Object} bankindex
  1877. * @param {Object} ansindex
  1878. * 案例题简答答案确认
  1879. */
  1880. submitAnsChild(bankindex, ansindex) {
  1881. if (
  1882. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  1883. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  1884. ) {
  1885. uni.showToast({
  1886. title: "请输入内容或上传图片",
  1887. duration: 2000,
  1888. icon: "none",
  1889. });
  1890. return;
  1891. }
  1892. this.$set(this.questionList[bankindex].ques, ansindex, {
  1893. imageList:
  1894. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList ||
  1895. [],
  1896. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || "",
  1897. });
  1898. this.$u.toast("已确认答案");
  1899. this.isDoOver();
  1900. },
  1901. right(bankIndex, ansIndex, option) {
  1902. if (
  1903. this.questionList[bankIndex].ques[ansIndex] &&
  1904. this.questionList[bankIndex].ans[ansIndex]
  1905. ) {
  1906. if (
  1907. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1908. option.optionsId
  1909. ) != -1 ||
  1910. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1911. option.optionsId
  1912. ) != -1
  1913. ) {
  1914. return true;
  1915. } else {
  1916. return false;
  1917. }
  1918. } else {
  1919. return false;
  1920. }
  1921. },
  1922. wrong(bankIndex, ansIndex, option) {
  1923. if (
  1924. this.questionList[bankIndex].ques[ansIndex] &&
  1925. this.questionList[bankIndex].ans[ansIndex]
  1926. ) {
  1927. if (
  1928. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1929. option.optionsId
  1930. ) != -1 &&
  1931. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1932. option.optionsId
  1933. ) == -1
  1934. ) {
  1935. return true;
  1936. } else {
  1937. return false;
  1938. }
  1939. } else {
  1940. return false;
  1941. }
  1942. },
  1943. tabSelect(index, bankindex) {
  1944. this.$set(this.questionList[bankindex], "current", index);
  1945. },
  1946. showPhoto(contentStr) {
  1947. // #ifdef H5
  1948. return;
  1949. // #endif
  1950. if (contentStr && typeof contentStr == "string") {
  1951. let reg = /<img[^>]*src[=\'\"\s]+([^\'\"]*)[\'\"]?[^>]*>/gi;
  1952. let strArr = contentStr.match(reg);
  1953. strArr.forEach((str, index) => {
  1954. strArr[index] = str.replace(reg, "$1");
  1955. });
  1956. // 预览图片
  1957. uni.previewImage({
  1958. urls: strArr,
  1959. longPressActions: {
  1960. itemList: ["发送给朋友", "保存图片", "收藏"],
  1961. success: function (data) {
  1962. console.log(
  1963. "选中了第" +
  1964. (data.tapIndex + 1) +
  1965. "个按钮,第" +
  1966. (data.index + 1) +
  1967. "张图片"
  1968. );
  1969. },
  1970. fail: function (err) {
  1971. console.log(err.errMsg);
  1972. },
  1973. },
  1974. });
  1975. }
  1976. },
  1977. },
  1978. computed: {
  1979. ...mapGetters(["sysTime"]),
  1980. doMode() {
  1981. // 做题模式 1章卷 2随机练习 3模拟组卷
  1982. return this.examData.simulateStatus ? 3 : undefined;
  1983. },
  1984. },
  1985. components: {
  1986. BankBom,
  1987. },
  1988. };
  1989. </script>
  1990. <style lang="scss" scoped>
  1991. .questionBank {
  1992. width: 100%;
  1993. height: 100vh;
  1994. display: flex;
  1995. flex-direction: column;
  1996. }
  1997. .swiper {
  1998. width: 100%;
  1999. flex: 1;
  2000. }
  2001. .lisSty {
  2002. margin-bottom: 16rpx;
  2003. display: flex;
  2004. align-items: center;
  2005. .flex_auto {
  2006. flex: 1;
  2007. word-break: break-all;
  2008. }
  2009. }
  2010. .activeTI {
  2011. vertical-align: middle;
  2012. display: inline-block;
  2013. border: 1rpx solid #eee;
  2014. border-radius: 50rpx;
  2015. height: 48rpx;
  2016. line-height: 46rpx;
  2017. text-align: center;
  2018. width: 48rpx;
  2019. margin-right: 15rpx;
  2020. color: #666;
  2021. font-size: 30rpx;
  2022. &.right {
  2023. color: #fff;
  2024. background: #36c75a;
  2025. }
  2026. &.wrong {
  2027. color: #fff;
  2028. background: #ff3b30;
  2029. }
  2030. &.checked,
  2031. &.user_choose {
  2032. color: #fff;
  2033. background: #007aff;
  2034. }
  2035. }
  2036. .submit_checkbox {
  2037. position: fixed;
  2038. left: 0;
  2039. right: 0;
  2040. bottom: 120rpx;
  2041. margin: 20rpx auto;
  2042. width: 526rpx;
  2043. height: 80rpx;
  2044. background: rgba(0, 122, 255, 1);
  2045. color: #fff;
  2046. text-align: center;
  2047. line-height: 80rpx;
  2048. font-size: 30rpx;
  2049. border-radius: 40rpx;
  2050. &.disabled {
  2051. opacity: 0.6;
  2052. }
  2053. }
  2054. .titles {
  2055. overflow: hidden;
  2056. margin-bottom: 24rpx;
  2057. }
  2058. .titBox {
  2059. padding: 41rpx 25rpx 24rpx 25rpx;
  2060. }
  2061. .titBox_title {
  2062. padding: 21rpx;
  2063. }
  2064. .tabs {
  2065. margin: 10rpx;
  2066. display: flex;
  2067. .tab {
  2068. margin: 0 4rpx;
  2069. padding: 10rpx 13rpx;
  2070. text-align: center;
  2071. color: #007aff;
  2072. font-size: 28rpx;
  2073. border-radius: 16rpx;
  2074. background: #fff;
  2075. &.current {
  2076. color: #fff;
  2077. background: #007aff;
  2078. }
  2079. }
  2080. }
  2081. .ans {
  2082. margin: 8rpx 8rpx 8rpx;
  2083. .ans_input {
  2084. border-radius: 16rpx;
  2085. background: #fff;
  2086. .top {
  2087. border-bottom: 1rpx solid #eeeeee;
  2088. padding: 16rpx;
  2089. display: flex;
  2090. align-items: center;
  2091. .icon {
  2092. margin-right: 20rpx;
  2093. width: 40rpx;
  2094. height: 38rpx;
  2095. }
  2096. .progress {
  2097. flex: 1;
  2098. }
  2099. .submit {
  2100. width: 168rpx;
  2101. height: 48rpx;
  2102. line-height: 48rpx;
  2103. text-align: center;
  2104. color: #fff;
  2105. font-size: 30rpx;
  2106. background: #007aff;
  2107. border-radius: 24rpx;
  2108. &.disabled {
  2109. opacity: 0.6;
  2110. }
  2111. }
  2112. }
  2113. .textarea {
  2114. textarea {
  2115. width: 100%;
  2116. height: 287rpx;
  2117. padding: 10rpx;
  2118. }
  2119. }
  2120. .imgs {
  2121. overflow: hidden;
  2122. display: flex;
  2123. width: 100%;
  2124. .img {
  2125. width: 104rpx;
  2126. height: 104rpx;
  2127. border-radius: 8rpx;
  2128. position: relative;
  2129. margin: 20rpx;
  2130. text {
  2131. position: absolute;
  2132. right: -15rpx;
  2133. top: -15rpx;
  2134. width: 30rpx;
  2135. height: 30rpx;
  2136. text-align: center;
  2137. line-height: 30rpx;
  2138. color: #fff;
  2139. background: #ff3b30;
  2140. border-radius: 50%;
  2141. }
  2142. image {
  2143. width: 100%;
  2144. height: 100%;
  2145. }
  2146. }
  2147. }
  2148. }
  2149. .ans_submit {
  2150. padding: 16rpx;
  2151. border-radius: 16rpx;
  2152. background: #fff;
  2153. .imgs {
  2154. overflow: hidden;
  2155. display: flex;
  2156. width: 100%;
  2157. .img {
  2158. width: 104rpx;
  2159. height: 104rpx;
  2160. border-radius: 8rpx;
  2161. position: relative;
  2162. margin: 20rpx;
  2163. image {
  2164. width: 100%;
  2165. height: 100%;
  2166. }
  2167. }
  2168. }
  2169. }
  2170. }
  2171. .leftLetters {
  2172. display: flex;
  2173. align-items: center;
  2174. width: 220rpx;
  2175. .btnType {
  2176. padding: 5rpx 10rpx;
  2177. border: 1rpx solid #007aff;
  2178. border-radius: 10rpx;
  2179. background-color: rgba(0, 122, 255, 0.1);
  2180. font-size: 28rpx;
  2181. color: #007aff;
  2182. margin-right: 15rpx;
  2183. }
  2184. }
  2185. .firstLetter {
  2186. display: flex;
  2187. justify-content: space-between;
  2188. align-items: center;
  2189. margin-bottom: 30rpx;
  2190. }
  2191. .pageContent {
  2192. position: relative;
  2193. background-color: #eaeef1;
  2194. height: 100%;
  2195. padding-top: 8rpx;
  2196. padding-bottom: 100rpx;
  2197. overflow-y: scroll;
  2198. }
  2199. .pad_8 {
  2200. background-color: #fff;
  2201. margin: 0rpx 8rpx 8rpx;
  2202. border-radius: 16rpx;
  2203. &.no-margin {
  2204. margin-top: -16rpx;
  2205. border-radius: 0 0 16rpx 16rpx;
  2206. }
  2207. }
  2208. .answer {
  2209. height: 80rpx;
  2210. line-height: 80rpx;
  2211. padding: 0rpx 24rpx;
  2212. display: flex;
  2213. align-items: center;
  2214. justify-content: space-between;
  2215. color: #666;
  2216. font-size: 30rpx;
  2217. }
  2218. .answerInfos {
  2219. padding: 25rpx 25rpx 25rpx 23rpx;
  2220. }
  2221. .answerTitle {
  2222. margin-bottom: 28rpx;
  2223. color: #666;
  2224. font-size: 30rpx;
  2225. }
  2226. .answerContent {
  2227. font-size: 30rpx;
  2228. color: #666;
  2229. }
  2230. .textChild {
  2231. display: inline-block;
  2232. vertical-align: middle;
  2233. }
  2234. .dialog {
  2235. position: fixed;
  2236. left: 0;
  2237. top: 0;
  2238. width: 100%;
  2239. height: 100%;
  2240. background-color: rgba(0, 0, 0, 0.8);
  2241. display: flex;
  2242. flex-direction: column;
  2243. align-items: center;
  2244. justify-content: center;
  2245. z-index: 20000;
  2246. .pointer {
  2247. width: 338rpx;
  2248. height: 240rpx;
  2249. }
  2250. .text {
  2251. font-size: 32rpx;
  2252. color: #ffffff;
  2253. text-align: center;
  2254. }
  2255. .btn {
  2256. width: 242rpx;
  2257. height: 82rpx;
  2258. border: 2rpx solid #ffffff;
  2259. border-radius: 16rpx;
  2260. text-align: center;
  2261. line-height: 82rpx;
  2262. margin: 41rpx auto;
  2263. color: #fff;
  2264. font-size: 32rpx;
  2265. }
  2266. }
  2267. .dialog-arrow {
  2268. padding-top: 124rpx;
  2269. position: fixed;
  2270. left: 0;
  2271. top: 0;
  2272. width: 100%;
  2273. height: 100%;
  2274. background-color: rgba(0, 0, 0, 0.8);
  2275. z-index: 20000;
  2276. .pointer {
  2277. margin-left: 87rpx;
  2278. display: block;
  2279. width: 95rpx;
  2280. height: 98rpx;
  2281. }
  2282. .text {
  2283. padding-left: 177rpx;
  2284. font-size: 32rpx;
  2285. color: #ffffff;
  2286. }
  2287. .btn {
  2288. width: 242rpx;
  2289. height: 82rpx;
  2290. border: 2rpx solid #ffffff;
  2291. border-radius: 16rpx;
  2292. text-align: center;
  2293. line-height: 82rpx;
  2294. margin: 500rpx auto 0;
  2295. color: #fff;
  2296. font-size: 32rpx;
  2297. }
  2298. }
  2299. .dialog_wrap {
  2300. position: fixed;
  2301. left: 0;
  2302. top: 0;
  2303. width: 100%;
  2304. height: 100%;
  2305. z-index: 9999999999;
  2306. .bg {
  2307. background: rgba(0, 0, 0, 0.3);
  2308. position: absolute;
  2309. left: 0;
  2310. top: 0;
  2311. width: 100%;
  2312. height: 100%;
  2313. }
  2314. .dialog {
  2315. position: absolute;
  2316. left: 50%;
  2317. top: 50%;
  2318. transform: translate3D(-50%, -50%, 0);
  2319. width: 640rpx;
  2320. height: 439rpx;
  2321. background: #ffffff;
  2322. border-radius: 24rpx;
  2323. .title {
  2324. font-size: 30rpx;
  2325. font-weight: bold;
  2326. color: #333333;
  2327. line-height: 48rpx;
  2328. text-align: center;
  2329. margin-top: 40rpx;
  2330. }
  2331. .content {
  2332. margin: 35rpx 35rpx 0;
  2333. font-size: 30rpx;
  2334. color: #666666;
  2335. line-height: 48rpx;
  2336. }
  2337. .btns {
  2338. margin-top: 35rpx;
  2339. display: flex;
  2340. align-items: center;
  2341. justify-content: center;
  2342. .btn {
  2343. width: 200rpx;
  2344. height: 80rpx;
  2345. line-height: 80rpx;
  2346. text-align: center;
  2347. background: #f5f5f5;
  2348. border-radius: 40rpx;
  2349. font-size: 30rpx;
  2350. color: rgba(0, 122, 255, 1);
  2351. background: #f5f5f5;
  2352. margin: 0 20rpx;
  2353. &.active {
  2354. color: #f5f5f5;
  2355. background: rgba(0, 122, 255, 1);
  2356. }
  2357. }
  2358. }
  2359. }
  2360. }
  2361. .popboxs {
  2362. width: 100%;
  2363. height: 100%;
  2364. display: flex;
  2365. flex-direction: column;
  2366. align-items: center;
  2367. }
  2368. .classTops {
  2369. flex-shrink: 0;
  2370. padding: 39rpx 0rpx 4rpx;
  2371. font-weight: bold;
  2372. color: #333;
  2373. font-size: 30rpx;
  2374. }
  2375. .textStys {
  2376. width: 100%;
  2377. flex: 1;
  2378. padding: 36rpx;
  2379. }
  2380. .classFootsty {
  2381. flex-shrink: 0;
  2382. display: flex;
  2383. align-items: center;
  2384. justify-content: center;
  2385. padding: 10rpx 0rpx 40rpx;
  2386. .btnsty {
  2387. width: 200rpx;
  2388. height: 80rpx;
  2389. border-radius: 40rpx;
  2390. font-weight: bold;
  2391. font-size: 30rpx;
  2392. text-align: center;
  2393. line-height: 80rpx;
  2394. }
  2395. .btns1 {
  2396. background-color: #f5f5f5;
  2397. color: #007aff;
  2398. }
  2399. .btns2 {
  2400. margin-left: 40rpx;
  2401. background-color: #007aff;
  2402. color: #ffffff;
  2403. }
  2404. }
  2405. </style>