questionBank.vue 58 KB

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