questionBank.vue 54 KB

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