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. >
  14. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  15. <view class="pageContent">
  16. <view class="pad_8 titBox">
  17. <view class="firstLetter">
  18. <view class="leftLetters">
  19. <view class="btnType">
  20. <text v-if="bank.type == 1">单选</text>
  21. <text v-if="bank.type == 2">多选</text>
  22. <text v-if="bank.type == 3">判断</text>
  23. <text v-if="bank.type == 4">案例</text>
  24. <text v-if="bank.type == 5">简答</text>
  25. </view>
  26. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  27. </view>
  28. <view style="color: #666; font-size: 28rpx"></view>
  29. <view class="leftLetters"></view>
  30. </view>
  31. <view class="titles" @click="showPhoto(bank.content)">
  32. <rich-text :nodes="bank.content"></rich-text>
  33. </view>
  34. </view>
  35. <template v-if="bank.type == 1">
  36. <view class="pad_8 titBox no-margin">
  37. <view v-if="!bank.ques">
  38. <view
  39. v-for="(item, index) in bank.jsonStr"
  40. :key="index"
  41. class="lisSty"
  42. @click="radioSelect(item.optionsId, bankIndex)"
  43. >
  44. <view class="activeTI">{{ ast[index] }}</view>
  45. <view class="flex_auto">
  46. {{ item.content }}
  47. <view v-if="item.imgUrl">
  48. <image
  49. style="width: 600rpx"
  50. mode="widthFix"
  51. :src="$method.splitImgHost(item.imgUrl)"
  52. ></image>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view v-if="bank.ques">
  58. <view
  59. v-for="(item, index) in bank.jsonStr"
  60. :key="index"
  61. class="lisSty"
  62. >
  63. <text
  64. :class="{
  65. right:
  66. item.optionsId == bank.ques ||
  67. item.optionsId == bank.ans,
  68. wrong:
  69. item.optionsId == bank.ques && bank.ques != bank.ans,
  70. }"
  71. class="activeTI"
  72. >{{ ast[index] }}</text
  73. >
  74. <view class="flex_auto">
  75. {{ item.content }}
  76. <view v-if="item.imgUrl">
  77. <image
  78. style="width: 600rpx"
  79. mode="widthFix"
  80. :src="$method.splitImgHost(item.imgUrl)"
  81. ></image>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view v-if="bank.ques">
  88. <view class="pad_8 answer">
  89. <view>题目答案:{{ ast[bank.ans - 1] }}</view>
  90. <view>我的答案:{{ ast[bank.ques - 1] || "" }}</view>
  91. </view>
  92. <view class="pad_8 answerInfos">
  93. <view class="answerTitle">答案解析</view>
  94. <view class="answerContent">
  95. <rich-text :nodes="bank.analysisContent"></rich-text>
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <template v-if="bank.type == 2">
  101. <view class="pad_8 titBox no-margin">
  102. <view v-if="!bank.ques">
  103. <view
  104. v-for="(item, index) in bank.jsonStr"
  105. :key="index"
  106. class="lisSty"
  107. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  108. >
  109. <view :class="{ checked: item.checked }" class="activeTI">{{
  110. ast[index]
  111. }}</view>
  112. <view class="flex_auto">
  113. {{ item.content }}
  114. <view v-if="item.imgUrl">
  115. <image
  116. style="width: 600rpx"
  117. mode="widthFix"
  118. :src="$method.splitImgHost(item.imgUrl)"
  119. ></image>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <view
  125. v-if="!bank.ques"
  126. class="submit_checkbox"
  127. :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
  128. @click="checkboxSubmit(bankIndex)"
  129. >
  130. 确认答案
  131. </view>
  132. <view v-if="bank.ques">
  133. <view
  134. v-for="(item, index) in bank.jsonStr"
  135. :key="index"
  136. class="lisSty"
  137. >
  138. <text
  139. :class="{
  140. right:
  141. bank.ques.indexOf(item.optionsId) != -1 ||
  142. bank.ans.indexOf(item.optionsId) != -1,
  143. wrong:
  144. bank.ques.indexOf(item.optionsId) != -1 &&
  145. bank.ans.indexOf(item.optionsId) == -1,
  146. }"
  147. class="activeTI"
  148. >{{ ast[index] }}</text
  149. >
  150. <view class="flex_auto">
  151. {{ item.content }}
  152. <view v-if="item.imgUrl">
  153. <image
  154. style="width: 600rpx"
  155. mode="widthFix"
  156. :src="$method.splitImgHost(item.imgUrl)"
  157. ></image>
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <view v-if="bank.ques">
  164. <view class="pad_8 answer">
  165. <view
  166. >题目答案:
  167. <text
  168. :key="ansItemIndex"
  169. v-for="(ansItem, ansItemIndex) in bank.ans"
  170. >{{ ast[ansItem - 1] }}</text
  171. >
  172. </view>
  173. <view
  174. >我的答案:
  175. <text
  176. :key="quesItemIndex"
  177. v-for="(quesItem, quesItemIndex) in bank.ques"
  178. >{{ ast[quesItem - 1] }}</text
  179. >
  180. </view>
  181. </view>
  182. <view class="pad_8 answerInfos">
  183. <view class="answerTitle">答案解析</view>
  184. <view class="answerContent">
  185. <rich-text :nodes="bank.analysisContent"></rich-text>
  186. </view>
  187. </view>
  188. </view>
  189. </template>
  190. <template v-if="bank.type == 3">
  191. <view class="pad_8 titBox no-margin">
  192. <view v-if="!bank.ques">
  193. <view
  194. v-for="(item, index) in judge"
  195. :key="index"
  196. class="lisSty"
  197. @click="judgeSelect(index, bankIndex)"
  198. >
  199. <view class="activeTI">{{ ast[index] }}</view>
  200. <view class="flex_auto">
  201. {{ item }}
  202. <view v-if="item.imgUrl">
  203. <image
  204. style="width: 600rpx"
  205. mode="widthFix"
  206. :src="$method.splitImgHost(item.imgUrl)"
  207. ></image>
  208. </view>
  209. </view>
  210. </view>
  211. </view>
  212. <view v-if="bank.ques">
  213. <view
  214. v-for="(item, index) in judge"
  215. :key="index"
  216. class="lisSty"
  217. >
  218. <!-- right: index == bank.ques || index == bank.ans,
  219. wrong: index == bank.ques && bank.ques != bank.ans, -->
  220. <text
  221. :class="{
  222. right: index == (bank.ques == 1 ? 0 : 1) || index != bank.ans,
  223. wrong: index == (bank.ques == 1 ? 0 : 1) && bank.ques != bank.ans,
  224. }"
  225. class="activeTI"
  226. >{{ ast[index] }}</text
  227. >
  228. {{ item }}
  229. <view v-if="item.imgUrl">
  230. <image
  231. style="width: 600rpx"
  232. mode="widthFix"
  233. :src="$method.splitImgHost(item.imgUrl)"
  234. ></image>
  235. </view>
  236. </view>
  237. </view>
  238. </view>
  239. <view v-if="bank.ques">
  240. <view class="pad_8 answer">
  241. <view>题目答案:{{ ast[bank.ans == 1 ? 0 : 1] }}</view>
  242. <view>我的答案:{{ ast[bank.ques == 1 ? 0 : 1] || "" }}</view>
  243. </view>
  244. <view class="pad_8 answerInfos">
  245. <view class="answerTitle">答案解析</view>
  246. <view class="answerContent">
  247. <rich-text :nodes="bank.analysisContent"></rich-text>
  248. </view>
  249. </view>
  250. </view>
  251. </template>
  252. <!-- 简答题 -->
  253. <template v-if="bank.type == 5">
  254. <view class="pad_8 titBox">
  255. <view class="ans">
  256. <view
  257. class="ans_input"
  258. v-if="
  259. !bank.ques ||
  260. (!bank.ques.text && !bank.ques.imageList.length)
  261. "
  262. >
  263. <view class="top flex">
  264. <image
  265. :data-index="bankIndex"
  266. class="icon"
  267. @click="chooseImg(bankIndex)"
  268. src="/static/camera.png"
  269. mode=""
  270. ></image>
  271. <view class="progress"
  272. >{{ bank.ansText.imageList.length || "0" }}/4</view
  273. >
  274. <view
  275. class="submit"
  276. :class="{ disabled: !bank.ansText.text && hasImgs(bank) }"
  277. @click="submitAns(bankIndex)"
  278. >确认答案</view
  279. >
  280. </view>
  281. <view class="textarea">
  282. <textarea
  283. v-model="bank.ansText.text"
  284. placeholder="在此输入答案"
  285. ></textarea>
  286. </view>
  287. <view class="imgs">
  288. <view
  289. class="img"
  290. v-for="(img, imgIndex) in bank.ansText.imageList"
  291. :key="imgIndex"
  292. >
  293. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  294. <image :src="$method.splitImgHost(img, true)"></image>
  295. </view>
  296. </view>
  297. </view>
  298. <view
  299. class="ans_submit answerInfos"
  300. v-if="
  301. bank.ques && (bank.ques.text || bank.ques.imageList.length)
  302. "
  303. >
  304. <view class="answerTitle">我的答案:</view>
  305. {{ bank.ques.text || "" }}
  306. <view class="imgs">
  307. <image
  308. class="img"
  309. v-for="(ques, quesIndex) in bank.ques.imageList"
  310. :key="quesIndex"
  311. :src="$method.splitImgHost(ques, true)"
  312. ></image>
  313. </view>
  314. </view>
  315. </view>
  316. </view>
  317. <view v-if="bank.ques.text || bank.ques.imageList.length">
  318. <view class="pad_8 answerInfos">
  319. <view class="answerTitle">答案解析:</view>
  320. <view class="answerContent">
  321. <rich-text :nodes="bank.analysisContent"></rich-text>
  322. </view>
  323. </view>
  324. </view>
  325. </template>
  326. <!-- 案例题 -->
  327. <template v-if="bank.type == 4">
  328. <view class="tabs">
  329. <view
  330. class="tab"
  331. :class="{ current: tabIndex == bank.current }"
  332. :key="tabIndex"
  333. v-for="(tab, tabIndex) in bank.jsonStr"
  334. @click="tabSelect(tabIndex, bankIndex)"
  335. >
  336. 问题{{ tabIndex + 1 }}
  337. </view>
  338. </view>
  339. <view
  340. v-for="(ansItem, ansIndex) in bank.jsonStr"
  341. v-if="bank.current == ansIndex"
  342. :key="ansIndex"
  343. >
  344. <template v-if="ansItem.type == 1">
  345. <view class="pad_8 titBox">
  346. <view class="leftLetters">
  347. <view class="btnType">
  348. <text>单选</text>
  349. </view>
  350. </view>
  351. <view class="titles">
  352. <rich-text :nodes="ansItem.content"></rich-text>
  353. </view>
  354. <view v-if="!bank.ques[ansIndex]">
  355. <view
  356. v-for="(option, childIndex) in ansItem.optionsList"
  357. :key="childIndex"
  358. class="lisSty"
  359. @click="
  360. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  361. "
  362. >
  363. <view class="activeTI">{{ ast[childIndex] }}</view>
  364. <view class="flex_auto">
  365. <rich-text
  366. class="textChild"
  367. :nodes="option.content"
  368. ></rich-text>
  369. <view v-if="option.imgUrl">
  370. <image
  371. style="width: 600rpx"
  372. mode="widthFix"
  373. :src="$method.splitImgHost(option.imgUrl)"
  374. ></image>
  375. </view>
  376. </view>
  377. </view>
  378. </view>
  379. <view v-if="bank.ques[ansIndex]">
  380. <view
  381. v-for="(option, childIndex) in ansItem.optionsList"
  382. :key="childIndex"
  383. class="lisSty"
  384. >
  385. <text
  386. :class="{
  387. right:
  388. option.optionsId == bank.ques[ansIndex] ||
  389. option.optionsId == bank.ans[ansIndex],
  390. wrong:
  391. option.optionsId == bank.ques[ansIndex] &&
  392. bank.ques[ansIndex] != bank.ans[ansIndex],
  393. }"
  394. class="activeTI"
  395. >{{ ast[childIndex] }}</text
  396. >
  397. <view class="flex_auto">
  398. <rich-text :nodes="option.content"></rich-text>
  399. <view v-if="option.imgUrl">
  400. <image
  401. style="width: 600rpx"
  402. mode="widthFix"
  403. :src="$method.splitImgHost(option.imgUrl)"
  404. ></image>
  405. </view>
  406. </view>
  407. </view>
  408. </view>
  409. </view>
  410. <view v-if="bank.ques[ansIndex]">
  411. <view class="pad_8 answer">
  412. <view>题目答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  413. <view
  414. >我的答案:{{ ast[bank.ques[ansIndex] - 1] || "" }}</view
  415. >
  416. </view>
  417. <view class="pad_8 answerInfos">
  418. <view class="answerTitle">答案解析</view>
  419. <view class="answerContent">
  420. <rich-text :nodes="option.analysisContent"></rich-text>
  421. </view>
  422. </view>
  423. </view>
  424. </template>
  425. <template v-if="ansItem.type == 2">
  426. <view class="pad_8 titBox">
  427. <view class="leftLetters">
  428. <view class="btnType">
  429. <text>多选</text>
  430. </view>
  431. </view>
  432. <view class="titles">
  433. <rich-text :nodes="ansItem.content"></rich-text>
  434. </view>
  435. <view v-if="!bank.ques[ansIndex]">
  436. <view
  437. v-for="(option, childindex) in ansItem.optionsList"
  438. :key="childindex"
  439. class="lisSty"
  440. @click="
  441. checkboxSelectChild(bankIndex, ansIndex, childindex)
  442. "
  443. >
  444. <view
  445. :class="{ checked: option.checked }"
  446. class="activeTI"
  447. >{{ ast[childindex] }}</view
  448. >
  449. <view class="flex_auto">
  450. <rich-text :nodes="option.content"></rich-text>
  451. <view v-if="option.imgUrl">
  452. <image
  453. style="width: 600rpx"
  454. mode="widthFix"
  455. :src="$method.splitImgHost(option.imgUrl)"
  456. ></image>
  457. </view>
  458. </view>
  459. </view>
  460. </view>
  461. <view
  462. v-if="!bank.ques[ansIndex]"
  463. class="submit_checkbox"
  464. :class="{
  465. disabled: !isCheckboxChecked(ansItem.optionsList),
  466. }"
  467. @click="checkboxSubmitChild(bankIndex, ansIndex)"
  468. >
  469. 确认答案
  470. </view>
  471. <view v-if="bank.ques && bank.ques[ansIndex]">
  472. <view
  473. v-for="(option, childindex) in ansItem.optionsList"
  474. :key="childindex"
  475. class="lisSty"
  476. >
  477. <text
  478. :class="{
  479. right: right(bankIndex, ansIndex, option),
  480. wrong: wrong(bankIndex, ansIndex, option),
  481. }"
  482. class="activeTI"
  483. >{{ ast[childindex] }}</text
  484. >
  485. <view class="flex_auto">
  486. <rich-text :nodes="option.content"></rich-text>
  487. <view v-if="option.imgUrl">
  488. <image
  489. style="width: 600rpx"
  490. mode="widthFix"
  491. :src="$method.splitImgHost(option.imgUrl)"
  492. ></image>
  493. </view>
  494. </view>
  495. </view>
  496. </view>
  497. </view>
  498. <view v-if="bank.ques[ansIndex]">
  499. <view class="pad_8 answer">
  500. <view
  501. >题目答案:
  502. <text
  503. :key="ansItemIndex1"
  504. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  505. >{{ ast[ansItem1 - 1] }}</text
  506. >
  507. </view>
  508. <view
  509. >我的答案:
  510. <text
  511. :key="quesItemIndex"
  512. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  513. >{{ ast[quesItem - 1] }}</text
  514. >
  515. </view>
  516. </view>
  517. <view class="pad_8 answerInfos">
  518. <view class="answerTitle">答案解析</view>
  519. <view class="answerContent">
  520. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  521. </view>
  522. </view>
  523. </view>
  524. </template>
  525. <template v-if="ansItem.type == 3">
  526. <view class="pad_8 titBox">
  527. <view class="leftLetters">
  528. <view class="btnType">
  529. <text>判断</text>
  530. </view>
  531. </view>
  532. <view class="titles">
  533. <rich-text :nodes="ansItem.content"></rich-text>
  534. </view>
  535. <view v-if="!bank.ques[ansIndex]">
  536. <view
  537. v-for="(option, childindex) in judge"
  538. :key="childindex"
  539. class="lisSty"
  540. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  541. >
  542. <view class="activeTI">{{ ast[childindex] }}</view>
  543. <view class="flex_auto">
  544. {{ option }}
  545. <view v-if="option.imgUrl">
  546. <image
  547. style="width: 600rpx"
  548. mode="widthFix"
  549. :src="$method.splitImgHost(option.imgUrl)"
  550. ></image>
  551. </view>
  552. </view>
  553. </view>
  554. </view>
  555. <view v-if="bank.ques[ansIndex]">
  556. <view
  557. v-for="(option, childindex) in judge"
  558. :key="childindex"
  559. class="lisSty"
  560. >
  561. <!-- right:
  562. childindex == bank.ques[ansIndex] ||
  563. childindex == bank.ans[ansIndex],
  564. wrong:
  565. childindex == bank.ques[ansIndex] &&
  566. bank.ques[ansIndex] != bank.ans[ansIndex], -->
  567. <text
  568. :class="{
  569. right:
  570. bankType == 1 && (childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) ||
  571. childindex != bank.ans[ansIndex]),
  572. wrong:
  573. bankType == 1 && (childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) &&
  574. bank.ques[ansIndex] != bank.ans[ansIndex]),
  575. }"
  576. class="activeTI"
  577. >{{ ast[childindex] }}</text
  578. >
  579. <view class="flex_auto">
  580. {{ option }}
  581. <view v-if="option.imgUrl">
  582. <image
  583. style="width: 600rpx"
  584. mode="widthFix"
  585. :src="$method.splitImgHost(option.imgUrl)"
  586. ></image>
  587. </view>
  588. </view>
  589. </view>
  590. </view>
  591. </view>
  592. <view v-if="bank.ques[ansIndex]">
  593. <view class="pad_8 answer">
  594. <view>题目答案:{{ ast[bank.ans[ansIndex] == 1 ? 0 : 1] }}</view>
  595. <view>我的答案:{{ ast[bank.ques[ansIndex] == 1 ? 0 : 1] || "" }}</view>
  596. </view>
  597. <view class="pad_8 answerInfos">
  598. <view class="answerTitle">答案解析</view>
  599. <view class="answerContent">
  600. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  601. </view>
  602. </view>
  603. </view>
  604. </template>
  605. <!-- 简答题 -->
  606. <template v-if="ansItem.type == 5">
  607. <view class="pad_8 titBox_title">
  608. <view class="leftLetters">
  609. <view class="btnType">
  610. <text>简答</text>
  611. </view>
  612. </view>
  613. <view class="titles">
  614. <rich-text :nodes="ansItem.content"></rich-text>
  615. </view>
  616. </view>
  617. <view class="pad_8 titBox_title">
  618. <view class="ans">
  619. <view
  620. class="ans_input"
  621. v-if="
  622. !bank.ques[ansIndex] ||
  623. (!bank.ques[ansIndex].text &&
  624. !bank.ques[ansIndex].imageList.length)
  625. "
  626. >
  627. <view class="top flex">
  628. <image
  629. class="icon"
  630. @click="chooseImgChild(bankIndex, ansIndex)"
  631. src="/static/08-10_032.jpg"
  632. mode=""
  633. ></image>
  634. <view class="progress"
  635. >{{ ansItem.ansText.imageList.length || "0" }}/4</view
  636. >
  637. <view
  638. class="submit"
  639. :class="{
  640. disabled: !ansItem.ansText.text && hasImgs(ansItem),
  641. }"
  642. @click="submitAnsChild(bankIndex, ansIndex)"
  643. >确认答案</view
  644. >
  645. </view>
  646. <view class="textarea">
  647. <textarea
  648. v-model="ansItem.ansText.text"
  649. placeholder="在此输入答案"
  650. ></textarea>
  651. </view>
  652. <view class="imgs">
  653. <view
  654. class="img"
  655. v-for="(img, imgIndex) in ansItem.ansText.imageList"
  656. :key="imgIndex"
  657. >
  658. <text
  659. @click="
  660. deleteImgChild(imgIndex, bankIndex, ansIndex)
  661. "
  662. >x</text
  663. >
  664. <image :src="$method.splitImgHost(img, true)"></image>
  665. </view>
  666. </view>
  667. </view>
  668. <view
  669. class="ans_submit answerInfos"
  670. v-if="
  671. bank.ques[ansIndex] &&
  672. (bank.ques[ansIndex].text ||
  673. bank.ques[ansIndex].imageList.length)
  674. "
  675. >
  676. <view class="answerTitle">我的答案</view>
  677. {{ bank.ques[ansIndex].text || "" }}
  678. <view
  679. class="imgs"
  680. v-if="
  681. bank.ques[ansIndex] &&
  682. bank.ques[ansIndex].imageList.length
  683. "
  684. >
  685. <image
  686. class="img"
  687. :key="quesIndex"
  688. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  689. .imageList"
  690. :src="$method.splitImgHost(ques, true)"
  691. ></image>
  692. </view>
  693. </view>
  694. </view>
  695. </view>
  696. <view v-if="bank.ques[ansIndex]">
  697. <view class="pad_8 answerInfos">
  698. <view class="answerTitle">答案解析</view>
  699. <view class="answerContent">
  700. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  701. </view>
  702. </view>
  703. </view>
  704. </template>
  705. </view>
  706. </template>
  707. <view class="footer_btn">
  708. <view
  709. class="collect show"
  710. @click="collect(collectList[bankIndex], bankIndex)"
  711. >
  712. <view v-if="collectList[bankIndex]">
  713. <image src="/static/icon/collected.png" mode=""></image>
  714. <view>取消收藏</view>
  715. </view>
  716. <view v-if="!collectList[bankIndex]">
  717. <image src="/static/icon/collect.png" mode=""></image>
  718. <view>收藏</view>
  719. </view>
  720. </view>
  721. <view class="flex_center" @click="openFooterTab">
  722. <view class="up-icon">
  723. <image src="/static/up.png"></image>
  724. </view>
  725. 答题卡
  726. </view>
  727. <view class="collect show" @click="pdsubmit">
  728. <view>
  729. <image src="/static/jj.png" mode=""></image>
  730. <view>交卷</view>
  731. </view>
  732. </view>
  733. </view>
  734. </view>
  735. </swiper-item>
  736. </swiper>
  737. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  738. <view class="popupView">
  739. <view class="popupTops">
  740. <view class="topIcon"></view>
  741. 点击编号即可跳转至对应题目
  742. </view>
  743. <view class="popupContent">
  744. <scroll-view scroll-y="true" style="height: 506rpx">
  745. <view class="boxSty">
  746. <view
  747. v-for="(item, index) in questionList"
  748. :key="index"
  749. @click="changeIndex(index)"
  750. :class="{
  751. isRight: isRight(item, index),
  752. isWrong: isWrong(item, index),
  753. isOver: isOver(item, index),
  754. isPart: isPart(item, index),
  755. }"
  756. class="liListSty"
  757. >{{ index + 1 }}</view
  758. >
  759. </view>
  760. </scroll-view>
  761. </view>
  762. </view>
  763. </u-popup>
  764. <view class="dialog" v-if="showDialog">
  765. <view class="text">左右滑动切换上下题</view>
  766. <view class="btn" @click="hideDialog">我知道了</view>
  767. </view>
  768. <u-popup
  769. v-model="showpopups"
  770. mode="center"
  771. border-radius="24"
  772. height="439rpx"
  773. width="640rpx"
  774. :mask-close-able="false"
  775. >
  776. <view class="popboxs">
  777. <view class="classTops">温馨提示</view>
  778. <view class="textStys">
  779. {{
  780. cgType === 7
  781. ? "您还未交卷,确定结束做题吗?"
  782. : cgType === 8
  783. ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
  784. : cgType === 6
  785. ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
  786. : cgType == 9
  787. ? `您已完成所有题目,快去交卷吧!`
  788. : ""
  789. }}
  790. </view>
  791. <view class="classFootsty" v-if="cgType === 6">
  792. <view class="btnsty btns1" @click="submit">立即交卷</view>
  793. <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
  794. </view>
  795. <view class="classFootsty" v-if="cgType === 7">
  796. <view class="btnsty btns1" @click="backPages">下次继续</view>
  797. <view class="btnsty btns2" @click="submit">结束做题</view>
  798. </view>
  799. <view class="classFootsty" v-if="cgType === 8">
  800. <view class="btnsty btns1" @click="backPages()">下次继续</view>
  801. <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
  802. </view>
  803. <view class="classFootsty" v-if="cgType === 9">
  804. <view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
  805. <view class="btnsty btns2" @click="submit">立即交卷</view>
  806. </view>
  807. </view>
  808. </u-popup>
  809. </view>
  810. </template>
  811. <script>
  812. export default {
  813. data() {
  814. return {
  815. id: "",
  816. current: 0,
  817. showpopups: false,
  818. questionList: [],
  819. ast: ["A", "B", "C", "D", "E", "F", "G"],
  820. judge: ["正确", "错误"],
  821. show: false,
  822. showDialog: false,
  823. bankList: [],
  824. collectList: [],
  825. goodsId: "",
  826. recordId: "",
  827. isLastCount: false, //是否有未答题目
  828. lastCount: 0, //剩余没有回答的题目数
  829. chapterId: "",
  830. moduleId: "",
  831. isSubmit: false,
  832. examData: {},
  833. orderGoodsId: "",
  834. cgType: 0, //对应设计稿弹窗编码
  835. };
  836. },
  837. onLoad(option) {
  838. this.orderGoodsId = option.orderGoodsId || "";
  839. this.id = option.id || "";
  840. this.goodsId = option.goodsid || "";
  841. this.chapterId = option.chapterId || "";
  842. this.moduleId = option.moduleId || "";
  843. this.recordId = option.recordId || "";
  844. let showDialog = uni.getStorageSync("showDialog");
  845. if (showDialog) {
  846. this.showDialog = false;
  847. } else {
  848. this.showDialog = true;
  849. uni.setStorageSync("showDialog", "1");
  850. }
  851. this.goodsQuestionList();
  852. },
  853. onUnload() {
  854. if (this.isSubmit) {
  855. return;
  856. }
  857. this.examRecordEdit();
  858. },
  859. methods: {
  860. /**
  861. * 是否有上传图片
  862. */
  863. hasImgs(bank) {
  864. return bank.ansText.imageList.length == 0;
  865. },
  866. /**
  867. * @param {Object} state
  868. * @param {Object} index
  869. * 收藏
  870. */
  871. collect(state, index) {
  872. if (!state) {
  873. this.$api
  874. .collectQuestion({
  875. examId: this.id,
  876. questionId: this.questionList[index].questionId,
  877. goodsId: this.goodsId || "",
  878. orderGoodsId: this.orderGoodsId,
  879. doMode: 1, //做题模式 1章卷 2随机练习
  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. console.log('单选');
  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>