questionBank.vue 57 KB

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