questionBank.vue 58 KB

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