questionBank.vue 58 KB

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