questionBankContinue.vue 74 KB

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