questionBankContinue.vue 74 KB

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