questionBank.vue 58 KB

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