questionBank.vue 61 KB

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