questionBank.vue 58 KB

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