questionBank.vue 59 KB

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