questionBank.vue 62 KB

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