questionBank.vue 87 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996
  1. <template>
  2. <view class="questionBank">
  3. <uni-nav-bar
  4. @clickLeft="clickLeft"
  5. left-icon="back"
  6. ref="navbar"
  7. :statusBar="true"
  8. :title="examData.examName"
  9. ></uni-nav-bar>
  10. <swiper class="swiper" :current="current" @change="swiperChange">
  11. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  12. <view class="pageContent">
  13. <view class="pad_8 titBox">
  14. <view class="firstLetter">
  15. <view class="leftLetters">
  16. <view class="btnType">
  17. <text v-if="bank.type == 1">单选</text>
  18. <text v-if="bank.type == 2">多选</text>
  19. <text v-if="bank.type == 3">判断</text>
  20. <text v-if="bank.type == 4">案例</text>
  21. <text v-if="bank.type == 5">简答</text>
  22. </view>
  23. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  24. </view>
  25. <view style="color: #666; font-size: 28rpx">{{
  26. countdown(lastTime)
  27. }}</view>
  28. </view>
  29. <view class="titles" @click="showPhoto(bank.content)"
  30. ><rich-text :nodes="bank.content"></rich-text
  31. ></view>
  32. </view>
  33. <template v-if="bank.type == 1">
  34. <view class="pad_8 titBox no-margin">
  35. <view v-if="!bank.ques">
  36. <view
  37. v-for="(item, index) in bank.jsonStr"
  38. :key="index"
  39. class="lisSty"
  40. @click="radioSelect(item.optionsId, bankIndex)"
  41. >
  42. <view class="activeTI">{{ ast[index] }}</view>
  43. <view class="flex_auto"
  44. >{{ item.content }}
  45. <view v-if="item.imgUrl">
  46. <image
  47. style="width: 600rpx"
  48. mode="widthFix"
  49. :src="$method.splitImgHost(item.imgUrl)"
  50. ></image>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view v-if="bank.ques">
  56. <view
  57. v-for="(item, index) in bank.jsonStr"
  58. :key="index"
  59. class="lisSty"
  60. @click="radioSelect(item.optionsId, bankIndex)"
  61. >
  62. <text
  63. :class="{
  64. right:
  65. bankType == 1 &&
  66. (item.optionsId == bank.ques ||
  67. item.optionsId == bank.ans),
  68. wrong:
  69. bankType == 1 &&
  70. item.optionsId == bank.ques &&
  71. bank.ques != bank.ans,
  72. user_choose: bankType == 2 && item.optionsId == bank.ques,
  73. }"
  74. class="activeTI"
  75. >
  76. {{ ast[index] }}
  77. </text>
  78. <view class="flex_auto">
  79. {{ item.content }}
  80. <view v-if="item.imgUrl">
  81. <image
  82. style="width: 600rpx"
  83. mode="widthFix"
  84. :src="$method.splitImgHost(item.imgUrl)"
  85. ></image>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view v-if="bankType == 1 && bank.ques">
  92. <view class="pad_8 answer">
  93. <view>题目答案:{{ ast[bank.ans - 1] }} </view>
  94. <view>我的答案:{{ ast[bank.ques - 1] }}</view>
  95. </view>
  96. <view class="pad_8 answerInfos">
  97. <view class="answerTitle">答案解析</view>
  98. <view class="answerContent"
  99. ><rich-text :nodes="bank.analysisContent"></rich-text
  100. ></view>
  101. </view>
  102. </view>
  103. </template>
  104. <template v-if="bank.type == 2">
  105. <view class="pad_8 titBox no-margin">
  106. <view v-if="!bank.ques">
  107. <view
  108. v-for="(item, index) in bank.jsonStr"
  109. :key="index"
  110. class="lisSty"
  111. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  112. >
  113. <view :class="{ checked: item.checked }" class="activeTI">{{
  114. ast[index]
  115. }}</view>
  116. <view class="flex_auto">
  117. {{ item.content }}
  118. <view v-if="item.imgUrl">
  119. <image
  120. style="width: 600rpx"
  121. mode="widthFix"
  122. :src="$method.splitImgHost(item.imgUrl)"
  123. ></image>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <view v-if="bank.ques">
  129. <view
  130. v-for="(item, index) in bank.jsonStr"
  131. :key="index"
  132. class="lisSty"
  133. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  134. >
  135. <text
  136. :class="{
  137. right:
  138. bankType == 1 &&
  139. (bank.ques.indexOf(item.optionsId) != -1 ||
  140. bank.ans.indexOf(item.optionsId) != -1),
  141. wrong:
  142. bankType == 1 &&
  143. bank.ques.indexOf(item.optionsId) != -1 &&
  144. bank.ans.indexOf(item.optionsId) == -1,
  145. user_choose: bankType == 2 && item.checked,
  146. }"
  147. class="activeTI"
  148. >
  149. {{ ast[index] }}
  150. </text>
  151. <view class="flex_auto">
  152. {{ item.content }}
  153. <view v-if="item.imgUrl">
  154. <image
  155. style="width: 600rpx"
  156. mode="widthFix"
  157. :src="$method.splitImgHost(item.imgUrl)"
  158. ></image>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <view
  164. v-if="bankType == 2 || (bankType == 1 && !bank.ques)"
  165. class="submit_checkbox"
  166. :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
  167. @click="checkboxSubmit(bankIndex)"
  168. >确认答案</view
  169. >
  170. </view>
  171. <view v-if="bankType == 1 && bank.ques">
  172. <view class="pad_8 answer">
  173. <view>
  174. 题目答案:
  175. <text
  176. v-for="(ansItem, ansIndex) in bank.ans"
  177. :key="ansIndex"
  178. >{{ ast[ansItem - 1] }}</text
  179. >
  180. </view>
  181. <view>
  182. 我的答案:
  183. <text
  184. v-for="(quesItem, quesIndex) in bank.ques"
  185. :key="quesIndex"
  186. >{{ ast[quesItem - 1] }}</text
  187. >
  188. </view>
  189. </view>
  190. <view class="pad_8 answerInfos">
  191. <view class="answerTitle">答案解析</view>
  192. <view class="answerContent"
  193. ><rich-text :nodes="bank.analysisContent"></rich-text
  194. ></view>
  195. </view>
  196. </view>
  197. </template>
  198. <template v-if="bank.type == 3">
  199. <view class="pad_8 titBox no-margin">
  200. <view v-if="!bank.ques">
  201. <view
  202. v-for="(item, index) in judge"
  203. :key="index"
  204. class="lisSty"
  205. @click="judgeSelect(index, bankIndex)"
  206. >
  207. <view class="activeTI">{{ ast[index] }}</view>
  208. <view class="flex_auto">
  209. {{ item }}
  210. <view v-if="item.imgUrl">
  211. <image
  212. style="width: 600rpx"
  213. mode="widthFix"
  214. :src="$method.splitImgHost(item.imgUrl)"
  215. ></image>
  216. </view>
  217. </view>
  218. </view>
  219. </view>
  220. <view v-if="bank.ques">
  221. <view
  222. v-for="(item, index) in judge"
  223. :key="index"
  224. class="lisSty"
  225. @click="judgeSelect(index, bankIndex)"
  226. >
  227. <!-- right: bankType == 1 && (index == bank.ques || index == bank.ans),
  228. wrong: bankType == 1 && (index == bank.ques && bank.ques != bank.ans),
  229. user_choose: bankType == 2 && (index == bank.ques), -->
  230. <text
  231. :class="{
  232. right:
  233. bankType == 1 &&
  234. (index == (bank.ques == 1 ? 0 : 1) ||
  235. index != bank.ans),
  236. wrong:
  237. bankType == 1 &&
  238. index == (bank.ques == 1 ? 0 : 1) &&
  239. bank.ques != bank.ans,
  240. user_choose:
  241. bankType == 2 && index == (bank.ques == 1 ? 0 : 1),
  242. }"
  243. class="activeTI"
  244. >
  245. {{ ast[index] }}
  246. </text>
  247. <view class="flex_auto">
  248. {{ item }}
  249. <view v-if="item.imgUrl">
  250. <image
  251. style="width: 600rpx"
  252. mode="widthFix"
  253. :src="$method.splitImgHost(item.imgUrl)"
  254. ></image>
  255. </view>
  256. </view>
  257. </view>
  258. </view>
  259. </view>
  260. <view v-if="bankType == 1 && bank.ques">
  261. <view class="pad_8 answer">
  262. <view>题目答案:{{ ast[bank.ans == 1 ? 0 : 1] }}</view>
  263. <view>我的答案:{{ ast[bank.ques == 1 ? 0 : 1] }}</view>
  264. </view>
  265. <view class="pad_8 answerInfos">
  266. <view class="answerTitle">答案解析</view>
  267. <view class="answerContent"
  268. ><rich-text :nodes="bank.analysisContent"></rich-text
  269. ></view>
  270. </view>
  271. </view>
  272. </template>
  273. <!-- 简答题 -->
  274. <template v-if="bank.type == 5">
  275. <view class="pad_8 titBox">
  276. <view class="ans">
  277. <view
  278. class="ans_input"
  279. v-if="
  280. bankType == 2 ||
  281. (bankType == 1 &&
  282. (!bank.ques ||
  283. (!bank.ques.imageList.length && !bank.ques.text)))
  284. "
  285. >
  286. <view class="top flex">
  287. <image
  288. :data-index="bankIndex"
  289. class="icon"
  290. @click="chooseImg(bankIndex)"
  291. src="/static/camera.png"
  292. mode=""
  293. ></image>
  294. <view class="progress"
  295. >{{ bank.ansText.imageList.length || "0" }}/4</view
  296. >
  297. <view
  298. class="submit"
  299. :class="{ disabled: !bank.ansText.text && hasImgs(bank) }"
  300. @click="submitAns(bankIndex)"
  301. >确认答案</view
  302. >
  303. </view>
  304. <view class="textarea">
  305. <textarea
  306. v-model="bank.ansText.text"
  307. placeholder="在此输入答案"
  308. ></textarea>
  309. </view>
  310. <view class="imgs">
  311. <view
  312. class="img"
  313. v-for="(img, imgIndex) in bank.ansText.imageList"
  314. :key="imgIndex"
  315. >
  316. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  317. <image :src="$method.splitImgHost(img, true)"></image>
  318. </view>
  319. </view>
  320. </view>
  321. <view
  322. class="ans_submit answerInfos"
  323. v-if="
  324. bankType == 1 &&
  325. bank.ques &&
  326. (bank.ques.imageList.length || bank.ques.text)
  327. "
  328. >
  329. <view class="answerTitle">我的答案:</view>
  330. {{ bank.ques.text }}
  331. <view class="imgs"
  332. ><image
  333. class="img"
  334. :key="quesIndex"
  335. v-for="(ques, quesIndex) in bank.ques.imageList"
  336. :src="$method.splitImgHost(ques, true)"
  337. ></image
  338. ></view>
  339. </view>
  340. </view>
  341. </view>
  342. <view
  343. v-if="
  344. bankType == 1 &&
  345. bank.ques &&
  346. (bank.ques.imageList.length || bank.ques.text)
  347. "
  348. >
  349. <view class="pad_8 answerInfos">
  350. <view class="answerTitle">答案解析:</view>
  351. <view class="answerContent"
  352. ><rich-text :nodes="bank.analysisContent"></rich-text
  353. ></view>
  354. </view>
  355. </view>
  356. </template>
  357. <!-- 案例题 -->
  358. <template v-if="bank.type == 4">
  359. <view class="tabs">
  360. <view
  361. class="tab"
  362. :class="{ current: tabIndex == bank.current }"
  363. :key="tabIndex"
  364. v-for="(tab, tabIndex) in bank.jsonStr"
  365. @click="tabSelect(tabIndex, bankIndex)"
  366. >
  367. 问题{{ tabIndex + 1 }}
  368. </view>
  369. </view>
  370. <view
  371. v-for="(ansItem, ansIndex) in bank.jsonStr"
  372. v-if="bank.current == ansIndex"
  373. :key="ansIndex"
  374. >
  375. <template v-if="ansItem.type == 1">
  376. <view class="pad_8 titBox">
  377. <view class="leftLetters">
  378. <view class="btnType">
  379. <text>单选</text>
  380. </view>
  381. </view>
  382. <view class="titles"
  383. ><rich-text :nodes="ansItem.content"></rich-text
  384. ></view>
  385. <view v-if="!bank.ques[ansIndex]">
  386. <view
  387. v-for="(option, childIndex) in ansItem.optionsList"
  388. :key="childIndex"
  389. class="lisSty"
  390. @click="
  391. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  392. "
  393. >
  394. <view class="activeTI">{{ ast[childIndex] }}</view>
  395. <view class="flex_auto">
  396. <rich-text
  397. class="textChild"
  398. :nodes="option.content"
  399. ></rich-text>
  400. <view v-if="option.imgUrl">
  401. <image
  402. style="width: 600rpx"
  403. mode="widthFix"
  404. :src="$method.splitImgHost(option.imgUrl)"
  405. ></image>
  406. </view>
  407. </view>
  408. </view>
  409. </view>
  410. <view v-if="bank.ques[ansIndex]">
  411. <view
  412. v-for="(option, childIndex) in ansItem.optionsList"
  413. :key="childIndex"
  414. class="lisSty"
  415. @click="
  416. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  417. "
  418. >
  419. <text
  420. :class="{
  421. right:
  422. bankType == 1 &&
  423. (option.optionsId == bank.ques[ansIndex] ||
  424. option.optionsId == bank.ans[ansIndex]),
  425. wrong:
  426. bankType == 1 &&
  427. option.optionsId == bank.ques[ansIndex] &&
  428. bank.ques[ansIndex] != bank.ans[ansIndex],
  429. user_choose:
  430. bankType == 2 &&
  431. option.optionsId == bank.ques[ansIndex],
  432. }"
  433. class="activeTI"
  434. >
  435. {{ ast[childIndex] }}
  436. </text>
  437. <view class="flex_auto">
  438. <rich-text :nodes="option.content"></rich-text>
  439. <view v-if="option.imgUrl">
  440. <image
  441. style="width: 600rpx"
  442. mode="widthFix"
  443. :src="$method.splitImgHost(option.imgUrl)"
  444. ></image>
  445. </view>
  446. </view>
  447. </view>
  448. </view>
  449. </view>
  450. <view v-if="bankType == 1 && bank.ques[ansIndex]">
  451. <view class="pad_8 answer">
  452. <view>题目答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  453. <view>我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view>
  454. </view>
  455. <view class="pad_8 answerInfos">
  456. <view class="answerTitle">答案解析</view>
  457. <view class="answerContent"
  458. ><rich-text :nodes="option.analysisContent"></rich-text
  459. ></view>
  460. </view>
  461. </view>
  462. </template>
  463. <template v-if="ansItem.type == 2">
  464. <view class="pad_8 titBox">
  465. <view class="leftLetters">
  466. <view class="btnType">
  467. <text>多选</text>
  468. </view>
  469. </view>
  470. <view class="titles"
  471. ><rich-text :nodes="ansItem.content"></rich-text
  472. ></view>
  473. <view v-if="!bank.ques[ansIndex]">
  474. <view
  475. v-for="(option, childindex) in ansItem.optionsList"
  476. :key="childindex"
  477. class="lisSty"
  478. @click="
  479. checkboxSelectChild(bankIndex, ansIndex, childindex)
  480. "
  481. >
  482. <view
  483. :class="{ checked: option.checked }"
  484. class="activeTI"
  485. >{{ ast[childindex] }}</view
  486. >
  487. <view class="flex_auto">
  488. <rich-text :nodes="option.content"></rich-text>
  489. <view v-if="option.imgUrl">
  490. <image
  491. style="width: 600rpx"
  492. mode="widthFix"
  493. :src="$method.splitImgHost(option.imgUrl)"
  494. ></image>
  495. </view>
  496. </view>
  497. </view>
  498. </view>
  499. <view
  500. v-if="
  501. bankType == 2 || (bankType == 1 && !bank.ques[ansIndex])
  502. "
  503. class="submit_checkbox"
  504. :class="{
  505. disabled: !isCheckboxChecked(ansItem.optionsList),
  506. }"
  507. @click="checkboxSubmitChild(bankIndex, ansIndex)"
  508. >确认答案</view
  509. >
  510. <view v-if="bank.ques && bank.ques[ansIndex]">
  511. <view
  512. v-for="(option, childindex) in ansItem.optionsList"
  513. :key="childindex"
  514. class="lisSty"
  515. @click="
  516. checkboxSelectChild(bankIndex, ansIndex, childindex)
  517. "
  518. >
  519. <text
  520. :class="{
  521. right:
  522. bankType == 1 && right(bankIndex, ansIndex, option),
  523. wrong:
  524. bankType == 1 && wrong(bankIndex, ansIndex, option),
  525. user_choose: bankType == 2 && option.checked,
  526. }"
  527. class="activeTI"
  528. >
  529. {{ ast[childindex] }}
  530. </text>
  531. <view class="flex_auto">
  532. <rich-text :nodes="option.content"></rich-text>
  533. <view v-if="option.imgUrl">
  534. <image
  535. style="width: 600rpx"
  536. mode="widthFix"
  537. :src="$method.splitImgHost(option.imgUrl)"
  538. ></image>
  539. </view>
  540. </view>
  541. </view>
  542. </view>
  543. </view>
  544. <view v-if="bankType == 1 && bank.ques[ansIndex]">
  545. <view class="pad_8 answer">
  546. <view>
  547. 题目答案:
  548. <text
  549. :key="ansItemIndex1"
  550. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  551. >{{ ast[ansItem1 - 1] }}</text
  552. >
  553. </view>
  554. <view>
  555. 我的答案:
  556. <text
  557. :key="quesItemIndex"
  558. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  559. >{{ ast[quesItem - 1] }}</text
  560. >
  561. </view>
  562. </view>
  563. <view class="pad_8 answerInfos">
  564. <view class="answerTitle">答案解析</view>
  565. <view class="answerContent"
  566. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  567. ></view>
  568. </view>
  569. </view>
  570. </template>
  571. <template v-if="ansItem.type == 3">
  572. <view class="pad_8 titBox">
  573. <view class="leftLetters">
  574. <view class="btnType">
  575. <text>判断</text>
  576. </view>
  577. </view>
  578. <view class="titles"
  579. ><rich-text :nodes="ansItem.content"></rich-text
  580. ></view>
  581. <view v-if="!bank.ques[ansIndex]">
  582. <view
  583. v-for="(option, childindex) in judge"
  584. :key="childindex"
  585. class="lisSty"
  586. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  587. >
  588. <view class="activeTI">{{ ast[childindex] }}</view>
  589. <view class="flex_auto">
  590. {{ option }}
  591. <view v-if="option.imgUrl">
  592. <image
  593. style="width: 600rpx"
  594. mode="widthFix"
  595. :src="$method.splitImgHost(option.imgUrl)"
  596. ></image>
  597. </view>
  598. </view>
  599. </view>
  600. </view>
  601. <view v-if="bank.ques[ansIndex]">
  602. <view
  603. v-for="(option, childindex) in judge"
  604. :key="childindex"
  605. class="lisSty"
  606. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  607. >
  608. <text
  609. :class="{
  610. right:
  611. bankType == 1 &&
  612. (childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) ||
  613. childindex != bank.ans[ansIndex]),
  614. wrong:
  615. bankType == 1 &&
  616. childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) &&
  617. bank.ques[ansIndex] != bank.ans[ansIndex],
  618. user_choose:
  619. bankType == 2 &&
  620. childindex == (bank.ques[ansIndex] == 1 ? 0 : 1),
  621. }"
  622. class="activeTI"
  623. >
  624. {{ ast[childindex] }}
  625. </text>
  626. <view class="flex_auto">
  627. {{ option }}
  628. <view v-if="option.imgUrl">
  629. <image
  630. style="width: 600rpx"
  631. mode="widthFix"
  632. :src="$method.splitImgHost(option.imgUrl)"
  633. ></image>
  634. </view>
  635. </view>
  636. </view>
  637. </view>
  638. </view>
  639. <view v-if="bankType == 1 && bank.ques[ansIndex]">
  640. <view class="pad_8 answer">
  641. <view
  642. >题目答案:{{
  643. ast[bank.ans[ansIndex] == 1 ? 0 : 1]
  644. }}</view
  645. >
  646. <view
  647. >我的答案:{{
  648. ast[bank.ques[ansIndex] == 1 ? 0 : 1]
  649. }}</view
  650. >
  651. </view>
  652. <view class="pad_8 answerInfos">
  653. <view class="answerTitle">答案解析</view>
  654. <view class="answerContent"
  655. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  656. ></view>
  657. </view>
  658. </view>
  659. </template>
  660. <!-- 简答题 -->
  661. <template v-if="ansItem.type == 5">
  662. <view class="pad_8 titBox_title">
  663. <view class="leftLetters">
  664. <view class="btnType">
  665. <text>简答</text>
  666. </view>
  667. </view>
  668. <view><rich-text :nodes="ansItem.content"></rich-text></view>
  669. </view>
  670. <view class="pad_8 titBox_title">
  671. <view class="ans">
  672. <view
  673. class="ans_input"
  674. v-if="
  675. bankType == 2 ||
  676. (bankType == 1 &&
  677. (!bank.ques[ansIndex] ||
  678. (!bank.ques[ansIndex].text &&
  679. !bank.ques[ansIndex].imageList.length)))
  680. "
  681. >
  682. <view class="top flex">
  683. <image
  684. class="icon"
  685. @click="chooseImgChild(bankIndex, ansIndex)"
  686. src="/static/camera.png"
  687. mode=""
  688. ></image>
  689. <view class="progress"
  690. >{{ ansItem.ansText.imageList.length || "0" }}/4</view
  691. >
  692. <view
  693. class="submit"
  694. :class="{
  695. disabled: !ansItem.ansText.text && hasImgs(ansItem),
  696. }"
  697. @click="submitAnsChild(bankIndex, ansIndex)"
  698. >确认答案</view
  699. >
  700. </view>
  701. <view class="textarea">
  702. <textarea
  703. v-model="ansItem.ansText.text"
  704. placeholder="在此输入答案"
  705. ></textarea>
  706. </view>
  707. <view class="imgs">
  708. <view
  709. class="img"
  710. v-for="(img, imgIndex) in ansItem.ansText.imageList"
  711. :key="imgIndex"
  712. >
  713. <text
  714. @click="
  715. deleteImgChild(imgIndex, bankIndex, ansIndex)
  716. "
  717. >x</text
  718. >
  719. <image :src="$method.splitImgHost(img, true)"></image>
  720. </view>
  721. </view>
  722. </view>
  723. <view
  724. class="ans_submit answerInfos"
  725. v-if="
  726. bankType == 1 &&
  727. bank.ques[ansIndex] &&
  728. (bank.ques[ansIndex].imageList.length ||
  729. bank.ques[ansIndex].text)
  730. "
  731. >
  732. <view class="answerTitle">我的答案</view>
  733. {{ bank.ques[ansIndex].text || "" }}
  734. <view class="imgs">
  735. <image
  736. class="img"
  737. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  738. .imageList"
  739. :key="quesIndex"
  740. :src="$method.splitImgHost(ques, true)"
  741. ></image>
  742. </view>
  743. </view>
  744. </view>
  745. </view>
  746. <view
  747. v-if="
  748. bankType == 1 &&
  749. (bank.ques[ansIndex].imageList.length ||
  750. bank.ques[ansIndex].text)
  751. "
  752. >
  753. <view class="pad_8 answerInfos">
  754. <view class="answerTitle">答案解析</view>
  755. <view class="answerContent"
  756. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  757. ></view>
  758. </view>
  759. </view>
  760. </template>
  761. </view>
  762. </template>
  763. <view class="footer_btn">
  764. <view
  765. class="collect"
  766. :class="{ show: goodsId && !isFromVideo ? true : false }"
  767. @click="collect(collectList[bankIndex], bankIndex)"
  768. >
  769. <view v-if="collectList[bankIndex]">
  770. <image src="/static/icon/collected.png" mode=""></image>
  771. <view>取消收藏</view>
  772. </view>
  773. <view v-if="!collectList[bankIndex]">
  774. <image src="/static/icon/collect.png" mode=""></image>
  775. <view>收藏</view>
  776. </view>
  777. </view>
  778. <view class="flex_center" @click="openFooterTab">
  779. <view class="up-icon">
  780. <image src="/static/up.png"></image>
  781. </view>
  782. 答题卡
  783. </view>
  784. <view class="collect show" @click="pdsubmit">
  785. <view>
  786. <image src="/static/jj.png" mode=""></image>
  787. <view>交卷</view>
  788. </view>
  789. </view>
  790. </view>
  791. </view>
  792. </swiper-item>
  793. </swiper>
  794. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  795. <view class="popupView">
  796. <view class="popupTops">
  797. <view class="topIcon"></view>
  798. 点击编号即可跳转至对应题目
  799. </view>
  800. <view class="popupContent">
  801. <scroll-view scroll-y="true" style="height: 506rpx">
  802. <view class="boxSty">
  803. <view
  804. v-for="(item, index) in questionList"
  805. :key="index"
  806. @click="changeIndex(index)"
  807. :class="{
  808. isRight: bankType == 1 && isRight(item, index),
  809. isWrong: bankType == 1 && isWrong(item, index),
  810. isPart: bankType == 1 && isPart(item, index),
  811. isOver: bankType == 1 && isOver(item, index),
  812. check_ans: bankType == 2 && isCheck(item, index),
  813. }"
  814. class="liListSty"
  815. >
  816. {{ index + 1 }}
  817. </view>
  818. </view>
  819. </scroll-view>
  820. </view>
  821. </view>
  822. </u-popup>
  823. <view class="dialog" v-if="showDialog">
  824. <image class="pointer" src="/static/pointer.png" mode=""></image>
  825. <view class="text">左右滑动切换上下题</view>
  826. <view class="btn" @click="showDialog = false">我知道了</view>
  827. </view>
  828. <view class="dialog-arrow" v-if="showArrow">
  829. <image class="pointer" src="/static/arrow-left.png" mode=""></image>
  830. <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
  831. <view class="btn" @click="showArrow = false">我知道了</view>
  832. </view>
  833. <view class="dialog_wrap" v-if="testOver">
  834. <view class="bg"></view>
  835. <view class="dialog">
  836. <view class="title">温馨提示</view>
  837. <view class="content">
  838. <view>您已完成所有题目,</view>
  839. <view>快去交卷吧!</view>
  840. </view>
  841. <view class="btns">
  842. <view class="btn" @click="noSubmit()">暂不交卷</view>
  843. <view class="btn active" @click="submitNow()">立即交卷</view>
  844. </view>
  845. </view>
  846. </view>
  847. <view class="dialog_wrap" v-if="isLastCount">
  848. <view class="bg"></view>
  849. <view class="dialog">
  850. <view class="title">温馨提示</view>
  851. <view class="content">
  852. <view
  853. >您当前正在测试,还剩{{ lastCount }}道题未完成,离开视为交卷</view
  854. >
  855. </view>
  856. <view class="btns">
  857. <view class="btn" @click="noLeave()">暂不离开</view>
  858. <view class="btn active" @click="leaveNow()">继续离开</view>
  859. </view>
  860. </view>
  861. </view>
  862. <u-popup
  863. v-model="showpopups"
  864. mode="center"
  865. border-radius="24"
  866. height="439rpx"
  867. width="640rpx"
  868. :mask-close-able="false"
  869. >
  870. <view class="popboxs">
  871. <view class="classTops">温馨提示</view>
  872. <view class="textStys">
  873. {{
  874. cgType === 7
  875. ? "您还未交卷,确定结束做题吗?"
  876. : cgType === 8
  877. ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
  878. : cgType === 6
  879. ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
  880. : cgType == 9
  881. ? `您已完成所有题目,快去交卷吧!`
  882. : ""
  883. }}
  884. </view>
  885. <view class="classFootsty" v-if="cgType === 6">
  886. <view class="btnsty btns1" @click="submit">立即交卷</view>
  887. <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
  888. </view>
  889. <view class="classFootsty" v-if="cgType === 7">
  890. <view class="btnsty btns1" @click="backPages">下次继续</view>
  891. <view class="btnsty btns2" @click="submit">结束做题</view>
  892. </view>
  893. <view class="classFootsty" v-if="cgType === 8">
  894. <view class="btnsty btns1" @click="backPages()">下次继续</view>
  895. <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
  896. </view>
  897. <view class="classFootsty" v-if="cgType === 9">
  898. <view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
  899. <view class="btnsty btns2" @click="submit">立即交卷</view>
  900. </view>
  901. </view>
  902. </u-popup>
  903. </view>
  904. </template>
  905. <script>
  906. export default {
  907. data() {
  908. return {
  909. showpopups: false,
  910. id: "",
  911. current: 0,
  912. questionList: [],
  913. ast: ["A", "B", "C", "D", "E", "F", "G"],
  914. judge: ["正确", "错误"],
  915. ans: [],
  916. ques: [],
  917. show: false,
  918. showDialog: false,
  919. bankList: [],
  920. collectList: [],
  921. goodsId: "",
  922. recordId: "",
  923. isSubmit: false,
  924. lastTime: 0, //剩余考试时长
  925. allTimes: 0, //总考试时长
  926. timer: null,
  927. wrongList: [],
  928. bankType: 0, //试卷类型
  929. needBack: false, //是否是考试
  930. testOver: false,
  931. isLastCount: false, //是否有未答题目
  932. lastCount: 0, //剩余没有回答的题目数
  933. chapterId: 0,
  934. moduleId: 0,
  935. showArrow: false, //退出提示
  936. isFromVideo: "",
  937. gradeId: "",
  938. examData: {},
  939. orderGoodsId: "",
  940. cgType: 0, //对应设计稿弹窗编码
  941. // courseId: '',
  942. entryType: "", // 进入做题页面的入口类型,daily-每日一练进来,random-随机练习, 其他的-题库做题进入
  943. bankNum: 5, // 随机练习的题目数量
  944. simulateExamId: undefined,
  945. };
  946. },
  947. async onLoad(option) {
  948. this.entryType = option.entryType || "";
  949. this.bankNum = option.bankNum;
  950. // this.courseId = option.courseId || ''
  951. this.orderGoodsId = option.orderGoodsId || 0;
  952. this.current = +option.current || 0;
  953. this.id = option.id;
  954. this.goodsId = option.goodsid;
  955. this.chapterId = option.chapterId || 0;
  956. this.moduleId = option.moduleId || 0;
  957. this.isFromVideo = option.isFromVideo || "";
  958. this.gradeId = option.gradeId || "";
  959. let isBack = option.isback;
  960. let showDialog = uni.getStorageSync("showDialog");
  961. if (showDialog) {
  962. this.showDialog = false;
  963. } else {
  964. this.showDialog = true;
  965. uni.setStorageSync("showDialog", "1");
  966. }
  967. //考试被迫返回
  968. if (isBack) {
  969. let app = getApp();
  970. let globalData = app.globalData;
  971. for (var k in globalData.bankData) {
  972. this[k] = globalData.bankData[k];
  973. }
  974. this.showArrow = true;
  975. this.timer = setInterval(() => {
  976. if (this.lastTime <= 0) {
  977. clearInterval(this.timer);
  978. uni.showToast({
  979. icon: "none",
  980. mask: true,
  981. title: "考试时间已到,系统将自动交卷",
  982. duration: 10000,
  983. });
  984. this.submit();
  985. return;
  986. }
  987. this.lastTime--;
  988. }, 1000);
  989. } else {
  990. if (this.entryType == "random") {
  991. this.bankType = 1; // 随机练习全部都是练习类型
  992. this.randomQuestionList();
  993. } else {
  994. //进入页面
  995. await this.bankExam();
  996. // 请求题目列表
  997. this.goodsQuestionList();
  998. }
  999. }
  1000. },
  1001. onUnload() {
  1002. if (this.isSubmit) {
  1003. clearInterval(this.timer);
  1004. return;
  1005. }
  1006. //考试试卷 阻止ios手势返回,自动跳回答题页
  1007. if (this.needBack) {
  1008. let app = getApp();
  1009. app.globalData.bankData = this.$data;
  1010. clearInterval(this.timer);
  1011. uni.navigateTo({
  1012. url:
  1013. "/pages2/bank/questionBank?id=" +
  1014. this.id +
  1015. "&goodsid=" +
  1016. this.goodsId +
  1017. "&isback=true&orderGoodsId=" +
  1018. this.orderGoodsId,
  1019. });
  1020. } else {
  1021. //点击返回按钮确认允许退出,记录答题记录
  1022. clearInterval(this.timer);
  1023. this.examRecordEdit();
  1024. }
  1025. },
  1026. methods: {
  1027. /**
  1028. * 是否有上传图片
  1029. */
  1030. hasImgs(bank) {
  1031. return bank.ansText.imageList.length == 0;
  1032. },
  1033. /**
  1034. * 获取试卷类型2考试,1练习
  1035. * bank/exam + data
  1036. */
  1037. bankExam() {
  1038. return new Promise((resolve) => {
  1039. this.$api.bankExam(this.id).then((res) => {
  1040. if (this.entryType == "daily") {
  1041. // 每日一练类型都是为练习
  1042. this.bankType = 1;
  1043. } else {
  1044. this.bankType = res.data.data.doType;
  1045. }
  1046. this.examData = res.data.data;
  1047. this.allTimes = this.examData.answerTime * 60;
  1048. this.lastTime =
  1049. this.examData.answerTime && this.examData.answerTime * 60;
  1050. if (this.bankType == 2) {
  1051. this.needBack = true;
  1052. }
  1053. resolve();
  1054. });
  1055. });
  1056. },
  1057. /**
  1058. * 点击后退按钮
  1059. */
  1060. clickLeft() {
  1061. if (this.bankType == 1) {
  1062. let ansCount = this.questionOverNum(true); //已答题数
  1063. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1064. //所有题目答完
  1065. if (this.lastCount == 0) {
  1066. // this.testOver = true;
  1067. this.cgType = 7;
  1068. //未答完
  1069. } else {
  1070. this.cgType = 8;
  1071. // this.isLastCount = true;
  1072. }
  1073. this.showpopups = true;
  1074. } else if (this.bankType == 2) {
  1075. let ansCount = this.questionOverNum(true); //已答题数
  1076. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1077. //所有题目答完
  1078. if (this.lastCount == 0) {
  1079. this.testOver = true;
  1080. //未答完
  1081. } else {
  1082. this.isLastCount = true;
  1083. }
  1084. }
  1085. },
  1086. /**
  1087. * 返回上一页
  1088. */
  1089. backPages() {
  1090. this.needBack = false;
  1091. uni.navigateBack({
  1092. delta: 1,
  1093. });
  1094. },
  1095. /**
  1096. * 获取已经回答的题目数
  1097. * hasSpecail (是否包含简答和案例)
  1098. */
  1099. questionOverNum(hasSpecail) {
  1100. let count = 0;
  1101. this.questionList.forEach((item) => {
  1102. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1103. if (item.ques) {
  1104. count++;
  1105. }
  1106. } else if (item.type == 4) {
  1107. //案例题
  1108. if (hasSpecail) {
  1109. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1110. if (
  1111. jsonItem.type == 1 ||
  1112. jsonItem.type == 2 ||
  1113. jsonItem.type == 3
  1114. ) {
  1115. if (item.ques[indexs]) {
  1116. return true;
  1117. } else {
  1118. return false;
  1119. }
  1120. } else if (jsonItem.type == 5) {
  1121. if (
  1122. item.ques[indexs] &&
  1123. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1124. ) {
  1125. console.log("chil");
  1126. return true;
  1127. } else {
  1128. return false;
  1129. }
  1130. }
  1131. });
  1132. if (isOver) {
  1133. count++;
  1134. }
  1135. }
  1136. } else if (item.type == 5) {
  1137. //简答题
  1138. if (hasSpecail) {
  1139. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1140. console.log(5, item);
  1141. count++;
  1142. }
  1143. }
  1144. }
  1145. });
  1146. return count;
  1147. },
  1148. /**
  1149. * 是否做完所有题目
  1150. */
  1151. isDoOver() {
  1152. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1153. if (this.questionList.length == questionOverNum) {
  1154. //全部做完弹窗
  1155. this.cgType = 9;
  1156. this.showpopups = true;
  1157. }
  1158. },
  1159. /**
  1160. * 暂不交卷
  1161. */
  1162. noSubmit() {
  1163. //设为允许退出页面
  1164. this.needBack = false;
  1165. uni.navigateBack({
  1166. delta: 1,
  1167. });
  1168. },
  1169. /**
  1170. * 不离开
  1171. */
  1172. noLeave() {
  1173. this.isLastCount = false;
  1174. },
  1175. /**
  1176. * 立即离开并交卷
  1177. */
  1178. leaveNow() {
  1179. this.needBack = false;
  1180. this.isSubmit = true;
  1181. this.submit(false);
  1182. uni.navigateBack({
  1183. delta: 1,
  1184. });
  1185. },
  1186. /**
  1187. * 立即交卷
  1188. */
  1189. submitNow() {
  1190. this.showpopups = false;
  1191. this.needBack = false;
  1192. this.submit();
  1193. },
  1194. /**
  1195. * 离开页面统计回答正确题数
  1196. */
  1197. examRecordEdit() {
  1198. if (!this.isSubmit) {
  1199. let {
  1200. doQuestionNum,
  1201. doQuestionIds,
  1202. rightQuestionNum,
  1203. historyExamJson,
  1204. } = this.$method.calculateScore(this.questionList);
  1205. this.$api
  1206. .examRecordEdit({
  1207. orderGoodsId: this.orderGoodsId,
  1208. examId: this.id,
  1209. goodsId: this.goodsId,
  1210. recordId: this.recordId,
  1211. doQuestionIds,
  1212. rightQuestionNum,
  1213. moduleExamId: this.moduleId || 0,
  1214. chapterExamId: this.chapterId || 0,
  1215. status: 0,
  1216. doQuestionNum,
  1217. historyExamJson,
  1218. })
  1219. .then((res) => {
  1220. if (res.data.code == 200) {
  1221. this.entryType == "daily" && this.dailyExam();
  1222. }
  1223. });
  1224. }
  1225. },
  1226. /**
  1227. * 记录总题数
  1228. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1229. */
  1230. examRecord(hasSpecial) {
  1231. let questionList = 0;
  1232. // if(!hasSpecial) {
  1233. this.questionList.forEach((item, index) => {
  1234. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1235. questionList++;
  1236. }
  1237. });
  1238. // } else {
  1239. // questionList = this.questionList.length;
  1240. // }
  1241. this.$api
  1242. .examRecord({
  1243. chapterExamId: this.chapterId || 0,
  1244. orderGoodsId: this.orderGoodsId,
  1245. moduleExamId: this.moduleId || 0,
  1246. examId: this.id,
  1247. goodsId: this.goodsId,
  1248. totalQuestionNum: questionList,
  1249. allQuestionNum: this.questionList.length,
  1250. doMode: this.doMode,
  1251. simulateExamId: this.simulateExamId,
  1252. })
  1253. .then((res) => {
  1254. this.recordId = res.data.data;
  1255. //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
  1256. if (this.bankType == 1) {
  1257. this.examRecordEdit();
  1258. }
  1259. });
  1260. },
  1261. /**
  1262. * @param {Object} second倒计时过滤器
  1263. */
  1264. countdown(second) {
  1265. if (second) {
  1266. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  1267. let m = parseInt((second / 60) % 60); // 计算分数
  1268. let s = parseInt(second % 60); // 计算当前秒数
  1269. if (h < 10) h = "0" + h;
  1270. if (m < 10) m = "0" + m;
  1271. if (s < 10) s = "0" + s;
  1272. return h + ":" + m + ":" + s;
  1273. } else {
  1274. return "";
  1275. }
  1276. },
  1277. hideDialog() {
  1278. this.showDialog = false;
  1279. },
  1280. // 请求随机练习题目列表
  1281. randomQuestionList() {
  1282. this.$http({
  1283. url: "/bank/exam/temp",
  1284. method: "post",
  1285. data: {
  1286. goodsId: this.goodsId,
  1287. orderGoodsId: this.orderGoodsId,
  1288. number: this.bankNum,
  1289. },
  1290. }).then((res) => {
  1291. if (res.data.code == 200) {
  1292. this.examData = res.data.data || {};
  1293. this.id = this.examData.examId;
  1294. if (!this.examData.questionList.length) {
  1295. return this.noListTip();
  1296. }
  1297. this.dataAnlyze(this.examData.questionList || []);
  1298. } else {
  1299. this.$u.toast(res.data.msg);
  1300. setTimeout(() => {
  1301. uni.navigateBack();
  1302. }, 2000);
  1303. }
  1304. });
  1305. },
  1306. noListTip(content = "该试卷暂无题目") {
  1307. this.hideDialog();
  1308. uni.showModal({
  1309. showCancel: false,
  1310. content,
  1311. success: (k) => {
  1312. if (k.confirm) {
  1313. this.isSubmit = true;
  1314. uni.navigateBack();
  1315. }
  1316. },
  1317. });
  1318. },
  1319. /**
  1320. * 请求题目列表 app/common/bank/question/list
  1321. */
  1322. goodsQuestionList() {
  1323. this.$api[
  1324. this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
  1325. ]({
  1326. examId: this.id,
  1327. goodsId: this.goodsId,
  1328. orderGoodsId: this.orderGoodsId,
  1329. from: 1,
  1330. }).then((res) => {
  1331. if (res.data.code == 500) {
  1332. return this.noListTip("你已完成所有题目");
  1333. }
  1334. let data = res.data.data;
  1335. if (this.doMode == 3) {
  1336. this.simulateExamId = data.simulateExamId;
  1337. data = data.questionList;
  1338. }
  1339. if (!data.length) {
  1340. return this.noListTip();
  1341. }
  1342. //考试时间到了自动交卷
  1343. if (this.lastTime) {
  1344. this.timer = setInterval(() => {
  1345. if (this.lastTime <= 0) {
  1346. clearInterval(this.timer);
  1347. uni.showToast({
  1348. icon: "none",
  1349. mask: true,
  1350. title: "考试时间已到,系统将自动交卷",
  1351. duration: 10000,
  1352. });
  1353. this.submit();
  1354. return;
  1355. }
  1356. this.lastTime--;
  1357. }, 1000);
  1358. } else {
  1359. }
  1360. this.dataAnlyze(data);
  1361. });
  1362. },
  1363. dataAnlyze(datas = []) {
  1364. console.log("datas:", datas);
  1365. datas.forEach((item, index) => {
  1366. // if (typeof item.jsonStr == 'string') {
  1367. item.jsonStr = JSON.parse(item.jsonStr);
  1368. if (item.type == 2) {
  1369. //多选
  1370. item.jsonStr.forEach((str) => {
  1371. str.optionsId = "" + str.optionsId;
  1372. });
  1373. let arr = item.answerQuestion.split(",");
  1374. arr.forEach((a, i) => {
  1375. arr[i] = "" + a;
  1376. });
  1377. item.ans = arr;
  1378. item.analysisContent &&
  1379. (item.analysisContent = item.analysisContent.replace(
  1380. /<img/gi,
  1381. '<img style="max-width:100%;"'
  1382. ));
  1383. item.content &&
  1384. (item.content = item.content.replace(
  1385. /<img/gi,
  1386. '<img style="max-width:100%;"'
  1387. ));
  1388. return;
  1389. } else if (item.type == 5) {
  1390. //简答题
  1391. item.ansText = {
  1392. text: "",
  1393. imageList: [],
  1394. };
  1395. item.ques = {
  1396. text: "",
  1397. imageList: [],
  1398. };
  1399. item.analysisContent &&
  1400. (item.analysisContent = item.analysisContent.replace(
  1401. /<img/gi,
  1402. '<img style="max-width:100%;"'
  1403. ));
  1404. item.content &&
  1405. (item.content = item.content.replace(
  1406. /<img/gi,
  1407. '<img style="max-width:100%;"'
  1408. ));
  1409. } else if (item.type == 4) {
  1410. //案例题
  1411. item.ques = [];
  1412. item.current = 0;
  1413. let ansArr = [];
  1414. item.jsonStr.forEach((json, index) => {
  1415. if (json.type == 1) {
  1416. ansArr[index] = json.answerQuestion;
  1417. json.content &&
  1418. (json.content = json.content.replace(
  1419. /<img/gi,
  1420. '<img style="max-width:100%;"'
  1421. ));
  1422. } else if (json.type == 2) {
  1423. json.optionsList.forEach((str) => {
  1424. str.optionsId = "" + str.optionsId;
  1425. });
  1426. let arr = json.answerQuestion.split(",");
  1427. arr.forEach((a, i) => {
  1428. arr[i] = "" + a;
  1429. });
  1430. ansArr[index] = arr;
  1431. json.content &&
  1432. (json.content = json.content.replace(
  1433. /<img/gi,
  1434. '<img style="max-width:100%;"'
  1435. ));
  1436. } else if (json.type == 3) {
  1437. ansArr[index] = json.answerQuestion;
  1438. json.content &&
  1439. (json.content = json.content.replace(
  1440. /<img/gi,
  1441. '<img style="max-width:100%;"'
  1442. ));
  1443. } else if (json.type == 5) {
  1444. ansArr[index] = {
  1445. text: json.answerQuestion,
  1446. imageList: [],
  1447. };
  1448. json.ansText = {
  1449. text: "",
  1450. imageList: [],
  1451. };
  1452. json.content &&
  1453. (json.content = json.content.replace(
  1454. /<img/gi,
  1455. '<img style="max-width:100%;"'
  1456. ));
  1457. }
  1458. });
  1459. item.analysisContent &&
  1460. (item.analysisContent = item.analysisContent.replace(
  1461. /<img/gi,
  1462. '<img style="max-width:100%;"'
  1463. ));
  1464. item.content &&
  1465. (item.content = item.content.replace(
  1466. /<img/gi,
  1467. '<img style="max-width:100%;"'
  1468. ));
  1469. item.ans = ansArr;
  1470. return;
  1471. }
  1472. item.analysisContent &&
  1473. (item.analysisContent = item.analysisContent.replace(
  1474. /<img/gi,
  1475. '<img style="max-width:100%;"'
  1476. ));
  1477. item.content &&
  1478. (item.content = item.content.replace(
  1479. /<img/gi,
  1480. '<img style="max-width:100%;"'
  1481. ));
  1482. item.ans = item.answerQuestion;
  1483. // }
  1484. });
  1485. this.questionList = datas;
  1486. this.lastCount = this.questionList.length;
  1487. this.examRecord();
  1488. this.getCollectInfo(this.current);
  1489. },
  1490. /**
  1491. * @param {Object} e单选点击
  1492. */
  1493. radioSelect(optionsId, bindex) {
  1494. // if (this.questionList[bindex].ques) return;
  1495. if (this.questionList[bindex].ques && this.bankType == 1) {
  1496. return;
  1497. }
  1498. this.$set(this.questionList[bindex], "ques", optionsId);
  1499. // if ((bindex + 1) < this.questionList.length) {
  1500. // this.current = bindex + 1
  1501. // }
  1502. this.isDoOver();
  1503. // 回答错误
  1504. // if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1505. // // /exam/wwrong/record
  1506. // this.$api
  1507. // .examWrongRecord({
  1508. // orderGoodsId: this.orderGoodsId,
  1509. // examId: this.id,
  1510. // goodsId: this.goodsId,
  1511. // moduleExamId: this.moduleId || 0,
  1512. // chapterExamId: this.chapterId || 0,
  1513. // questionIds: [this.questionList[bindex].questionId],
  1514. // recordId: this.recordId,
  1515. // })
  1516. // .then((res) => {});
  1517. // } else {
  1518. // // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1519. // // if(question) {
  1520. // // this.$api.wrongRecordDelete({
  1521. // // "examId": +this.id,
  1522. // // "goodsId": +this.goodsId,
  1523. // // "questionId": this.questionList[bindex].questionId,
  1524. // // }).then(res => {
  1525. // // })
  1526. // // }
  1527. // }
  1528. },
  1529. /**
  1530. * @param {Object} e案例单选点击
  1531. */
  1532. radioSelectChild(optionsId, ansIndex, bindex) {
  1533. // if (this.questionList[bindex].ques[ansIndex]) return;
  1534. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1535. return;
  1536. }
  1537. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1538. this.isDoOver();
  1539. },
  1540. /**
  1541. * @param {Object} 多选点击
  1542. */
  1543. checkboxSelect(optionsId, bindex, index) {
  1544. if (this.questionList[bindex].ques && this.bankType == 1) {
  1545. return;
  1546. }
  1547. this.$set(
  1548. this.questionList[bindex].jsonStr[index],
  1549. "checked",
  1550. !this.questionList[bindex].jsonStr[index].checked
  1551. );
  1552. },
  1553. /**
  1554. * @param {Object} 案例多选点击
  1555. */
  1556. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1557. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1558. return;
  1559. }
  1560. this.$set(
  1561. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  1562. "checked",
  1563. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1564. .checked
  1565. );
  1566. },
  1567. isCheckboxChecked(arr) {
  1568. return arr.some((item) => {
  1569. if (item.checked) {
  1570. return true;
  1571. }
  1572. });
  1573. },
  1574. /**
  1575. * @param {Object} 多选确认
  1576. */
  1577. checkboxSubmit(bindex) {
  1578. if (this.questionList[bindex].ques && this.bankType == 1) {
  1579. return;
  1580. }
  1581. let arr = [];
  1582. this.questionList[bindex].jsonStr.forEach((item) => {
  1583. if (item.checked) {
  1584. arr.push(item.optionsId);
  1585. }
  1586. });
  1587. if (!arr.length) {
  1588. delete this.questionList[bindex].ques;
  1589. uni.showToast({
  1590. title: "请选择答案",
  1591. icon: "none",
  1592. });
  1593. return;
  1594. }
  1595. this.$set(this.questionList[bindex], "ques", arr);
  1596. this.$u.toast("已确认答案");
  1597. this.isDoOver();
  1598. // 切换下一题
  1599. if (
  1600. this.bankType != 1 &&
  1601. this.cgType != 9 &&
  1602. bindex != this.questionList.length - 1
  1603. ) {
  1604. this.current = bindex + 1;
  1605. this.getCollectInfo(this.current);
  1606. }
  1607. },
  1608. /**
  1609. * @param {Object} 案例多选确认
  1610. */
  1611. checkboxSubmitChild(bindex, ansIndex) {
  1612. // if (this.questionList[bindex].ques[ansIndex]) return;
  1613. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1614. return;
  1615. }
  1616. let arr = [];
  1617. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1618. (item) => {
  1619. if (item.checked) {
  1620. arr.push(item.optionsId);
  1621. }
  1622. }
  1623. );
  1624. if (!arr.length) {
  1625. delete this.questionList[bindex].ques[ansIndex];
  1626. uni.showToast({
  1627. title: "请选择答案",
  1628. icon: "none",
  1629. });
  1630. return;
  1631. }
  1632. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1633. this.$u.toast("已确认答案");
  1634. this.isDoOver();
  1635. // 切换下一题
  1636. if (
  1637. this.bankType != 1 &&
  1638. this.cgType != 9 &&
  1639. ansIndex != this.questionList[bindex].ques.length - 1
  1640. ) {
  1641. this.questionList[bindex].current += 1;
  1642. }
  1643. },
  1644. /**
  1645. * @param {Object} index
  1646. * @param {Object} bindex
  1647. * 判断题
  1648. */
  1649. judgeSelect(index, bindex) {
  1650. // if (this.questionList[bindex].ques) return;
  1651. if (this.questionList[bindex].ques && this.bankType == 1) {
  1652. return;
  1653. } // 答案: 判断题1正确 0错误
  1654. this.$set(this.questionList[bindex], "ques", index == 0 ? "1" : "0");
  1655. console.log(
  1656. "this.questionList[bindex]:",
  1657. this.questionList[bindex].ques,
  1658. this.questionList[bindex].ans
  1659. );
  1660. this.isDoOver();
  1661. // 回答错误
  1662. // if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1663. // this.$api
  1664. // .examWrongRecord({
  1665. // orderGoodsId: this.orderGoodsId,
  1666. // examId: this.id,
  1667. // goodsId: this.goodsId,
  1668. // moduleExamId: this.moduleId || 0,
  1669. // chapterExamId: this.chapterId || 0,
  1670. // questionIds: [this.questionList[bindex].questionId],
  1671. // recordId: this.recordId,
  1672. // })
  1673. // .then((res) => {});
  1674. // } else {
  1675. // // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1676. // // if(question) {
  1677. // // this.$api.wrongRecordDelete({
  1678. // // "examId": +this.id,
  1679. // // "goodsId": +this.goodsId,
  1680. // // "questionId": this.questionList[bindex].questionId,
  1681. // // }).then(res => {
  1682. // // })
  1683. // // }
  1684. // }
  1685. },
  1686. /**
  1687. * @param {Object} ansindex
  1688. * @param {Object} childindex
  1689. * @param {Object} bindex
  1690. * 案例判断题
  1691. */
  1692. judgeSelectChild(ansindex, childindex, bindex) {
  1693. // if (this.questionList[bindex].ques[ansindex]) return;
  1694. if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
  1695. return;
  1696. }
  1697. this.$set(
  1698. this.questionList[bindex].ques,
  1699. ansindex,
  1700. childindex == 0 ? "1" : "0"
  1701. );
  1702. this.isDoOver();
  1703. },
  1704. openFooterTab() {
  1705. this.show = true;
  1706. },
  1707. changeIndex(index) {
  1708. this.current = index;
  1709. },
  1710. swiperChange(e) {
  1711. this.current = e.detail.current;
  1712. this.getCollectInfo(this.current);
  1713. },
  1714. /**
  1715. * @param {Object} current
  1716. * 获取收藏信息
  1717. */
  1718. getCollectInfo(current) {
  1719. this.$api
  1720. .getCollectInfo({
  1721. examId: this.id,
  1722. questionId: this.questionList[current].questionId,
  1723. goodsId: this.goodsId,
  1724. orderGoodsId: this.orderGoodsId,
  1725. })
  1726. .then((res) => {
  1727. if (res.data.code == 500) {
  1728. this.$set(this.collectList, current, false);
  1729. } else if (res.data.code == 200) {
  1730. this.$set(this.collectList, current, res.data.data);
  1731. }
  1732. });
  1733. },
  1734. pdsubmit() {
  1735. // if (this.bankType == 1) {
  1736. let ansCount = this.questionOverNum(true); //已答题数
  1737. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1738. //没有答完
  1739. if (this.lastCount !== 0) {
  1740. this.cgType = 6;
  1741. this.showpopups = true;
  1742. return;
  1743. }
  1744. // }
  1745. if (this.bankType == 2) {
  1746. if (this.lastTime > 0) {
  1747. let lastTime = this.countdown(this.lastTime);
  1748. uni.showModal({
  1749. title: "提示",
  1750. content: `时间还剩余${lastTime},确定交卷吗?`,
  1751. confirmText: "交卷",
  1752. cancelText: "继续答题",
  1753. success: (res) => {
  1754. if (res.confirm) {
  1755. //确定
  1756. this.submit();
  1757. } else {
  1758. //取消
  1759. }
  1760. },
  1761. });
  1762. return;
  1763. }
  1764. }
  1765. this.submit();
  1766. },
  1767. /**
  1768. * 交卷
  1769. */
  1770. submit(isShowTip = true) {
  1771. let form = this.$method.calculateScore(this.questionList);
  1772. //交卷
  1773. this.$api
  1774. .examRecordEdit({
  1775. examId: this.id,
  1776. goodsId: this.goodsId,
  1777. recordId: this.recordId,
  1778. orderGoodsId: this.orderGoodsId,
  1779. status: 1, // 1是交卷 2是中途离开
  1780. moduleExamId: this.moduleId || 0,
  1781. chapterExamId: this.chapterId || 0,
  1782. examTime: parseInt(this.allTimes),
  1783. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1784. ...form,
  1785. })
  1786. .then((res) => {
  1787. this.isSubmit = true;
  1788. if (res.data.code == 200) {
  1789. this.entryType == "daily" && this.dailyExam();
  1790. if (!isShowTip) {
  1791. return;
  1792. }
  1793. uni.showToast({
  1794. title: "交卷成功",
  1795. duration: 1000,
  1796. icon: "none",
  1797. });
  1798. setTimeout(() => {
  1799. uni.redirectTo({
  1800. url:
  1801. "/pages2/bank/question_report?goodsId=" +
  1802. this.goodsId +
  1803. "&chapterId=" +
  1804. this.chapterId +
  1805. "&moduleId=" +
  1806. this.moduleId +
  1807. "&examId=" +
  1808. this.id +
  1809. "&id=" +
  1810. this.recordId +
  1811. "&orderGoodsId=" +
  1812. this.orderGoodsId +
  1813. "&entryType=" +
  1814. this.entryType +
  1815. "&bankNum=" +
  1816. this.bankNum +
  1817. "&doMode=" +
  1818. this.doMode +
  1819. "&courseType=1",
  1820. });
  1821. }, 1000);
  1822. }
  1823. });
  1824. //错题集id提交(客观题)
  1825. this.$api.examWrongRecord({
  1826. examId: this.id,
  1827. goodsId: this.goodsId,
  1828. orderGoodsId: this.orderGoodsId,
  1829. questionIds: form.questionIds,
  1830. recordId: this.recordId,
  1831. type: 1, // 题库试卷传1
  1832. doMode: this.doMode,
  1833. });
  1834. },
  1835. // 每日一练试卷打卡
  1836. dailyExam() {
  1837. const dateStamp = parseInt(
  1838. new Date(new Date().toLocaleDateString()).getTime() / 1000
  1839. );
  1840. this.$http({
  1841. url: "/bank/question/special/exam/record",
  1842. method: "post",
  1843. data: {
  1844. examId: this.id,
  1845. chapterExamId: this.chapterId, // 章卷ID
  1846. moduleExamId: this.moduleId, //模块卷ID
  1847. goodsId: this.goodsId,
  1848. recordTime: dateStamp, // 传当天0点时间戳(秒)
  1849. },
  1850. }).then((res) => {
  1851. if (res.data.code == 200) {
  1852. }
  1853. });
  1854. },
  1855. /**
  1856. * @param {Object} state
  1857. * @param {Object} index
  1858. * 收藏
  1859. */
  1860. collect(state, index) {
  1861. if (!state) {
  1862. this.$api
  1863. .collectQuestion({
  1864. examId: this.id,
  1865. questionId: this.questionList[index].questionId,
  1866. goodsId: this.goodsId || "",
  1867. orderGoodsId: this.orderGoodsId,
  1868. doMode: this.doMode,
  1869. })
  1870. .then((res) => {
  1871. if (res.data.code == 200) {
  1872. this.$set(this.collectList, index, true);
  1873. uni.showToast({
  1874. title: "收藏成功",
  1875. duration: 2000,
  1876. icon: "none",
  1877. });
  1878. this.getCollectInfo(index);
  1879. }
  1880. });
  1881. } else {
  1882. this.$api
  1883. .deleteCollectQuestion(this.collectList[index].collectQuestionId)
  1884. .then((res) => {
  1885. if (res.data.code == 200) {
  1886. this.$set(this.collectList, index, false);
  1887. uni.showToast({
  1888. title: "取消收藏成功",
  1889. duration: 2000,
  1890. icon: "none",
  1891. });
  1892. }
  1893. });
  1894. }
  1895. return;
  1896. },
  1897. /**
  1898. * @param {Object} imgIndex
  1899. * @param {Object} bankIndex
  1900. * 删除简答图片
  1901. */
  1902. deleteImg(imgIndex, bankIndex) {
  1903. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1904. },
  1905. /**
  1906. * @param {Object} imgIndex
  1907. * @param {Object} bankIndex
  1908. * @param {Object} ansIndex
  1909. * 删除案例题简答图片
  1910. */
  1911. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1912. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1913. imgIndex,
  1914. 1
  1915. );
  1916. },
  1917. /**
  1918. * @param {Object} bankindex
  1919. * 选择上传图片
  1920. */
  1921. chooseImg(bankindex) {
  1922. if (
  1923. this.questionList[bankindex] &&
  1924. this.questionList[bankindex].ansText &&
  1925. this.questionList[bankindex].ansText.imageList.length >= 4
  1926. ) {
  1927. uni.showToast({
  1928. icon: "none",
  1929. title: "最多选择4张",
  1930. });
  1931. return;
  1932. }
  1933. uni.chooseImage({
  1934. count: 1, //默认9
  1935. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1936. sourceType: ["album", "camera"], //从相册选择
  1937. success: (res) => {
  1938. let self = this;
  1939. // console.log(JSON.stringify(res.tempFilePaths));
  1940. let img = res.tempFilePaths[0];
  1941. uni.getImageInfo({
  1942. src: img,
  1943. success: async (res) => {
  1944. let canvasWidth = res.width; //图片原始长宽
  1945. let canvasHeight = res.height;
  1946. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1947. uni.compressImage({
  1948. src: img,
  1949. quality: 75,
  1950. width: "50%",
  1951. height: "50%",
  1952. success: async (rest) => {
  1953. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1954. this.questionList[bankindex].ansText.imageList.push(dir);
  1955. },
  1956. });
  1957. } else {
  1958. const dir = await self.uploadFile(img, 0);
  1959. this.questionList[bankindex].ansText.imageList.push(dir);
  1960. }
  1961. },
  1962. });
  1963. },
  1964. });
  1965. },
  1966. /**
  1967. * @param {Object} bankindex
  1968. * @param {Object} ansindex
  1969. * 案例题选择上传图片
  1970. */
  1971. chooseImgChild(bankindex, ansindex) {
  1972. if (
  1973. this.questionList[bankindex].jsonStr[ansindex] &&
  1974. this.questionList[bankindex].jsonStr[ansindex].ansText &&
  1975. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList
  1976. .length >= 4
  1977. ) {
  1978. uni.showToast({
  1979. icon: "none",
  1980. title: "最多选择4张",
  1981. });
  1982. return;
  1983. }
  1984. uni.chooseImage({
  1985. count: 1, //默认9
  1986. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1987. sourceType: ["album", "camera"], //从相册选择
  1988. success: (res) => {
  1989. let self = this;
  1990. // console.log(JSON.stringify(res.tempFilePaths));
  1991. let img = res.tempFilePaths[0];
  1992. uni.getImageInfo({
  1993. src: img,
  1994. success: async (res) => {
  1995. let canvasWidth = res.width; //图片原始长宽
  1996. let canvasHeight = res.height;
  1997. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1998. uni.compressImage({
  1999. src: img,
  2000. quality: 75,
  2001. width: "50%",
  2002. height: "50%",
  2003. success: async (rest) => {
  2004. const dir = await self.uploadFile(rest.tempFilePath, 0);
  2005. this.questionList[bankindex].jsonStr[
  2006. ansindex
  2007. ].ansText.imageList.push(dir);
  2008. },
  2009. });
  2010. } else {
  2011. const dir = await self.uploadFile(img, 0);
  2012. this.questionList[bankindex].jsonStr[
  2013. ansindex
  2014. ].ansText.imageList.push(dir);
  2015. }
  2016. },
  2017. });
  2018. },
  2019. });
  2020. },
  2021. uploadFile(options, int) {
  2022. var self = this;
  2023. return new Promise((resolve, reject) => {
  2024. var data = {
  2025. orderGoodsId: this.orderGoodsId,
  2026. imageStatus: int,
  2027. };
  2028. self.$api.aliyunpolicy(data).then((res) => {
  2029. console.log(res.data, 6);
  2030. if (res.data.code != 200) {
  2031. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2032. return;
  2033. }
  2034. var ossToken = res.data.data.resultContent;
  2035. if (ossToken.host == null || ossToken.host == undefined) {
  2036. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2037. return;
  2038. }
  2039. uni.uploadFile({
  2040. url: ossToken.host,
  2041. name: "file",
  2042. filePath: options,
  2043. fileType: "image",
  2044. header: {
  2045. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2046. },
  2047. formData: {
  2048. key: ossToken.dir,
  2049. OSSAccessKeyId: ossToken.accessid,
  2050. policy: ossToken.policy,
  2051. Signature: ossToken.signature,
  2052. callback: ossToken.callback,
  2053. success_action_status: 200,
  2054. },
  2055. success: (result) => {
  2056. // if (result.statusCode === 200) {
  2057. resolve(ossToken.dir);
  2058. // } else {
  2059. // uni.showToast({
  2060. // title: "上传失败",
  2061. // icon: "none",
  2062. // });
  2063. // return;
  2064. // }
  2065. },
  2066. fail: (error) => {
  2067. uni.showToast({
  2068. title: "上传接口报错" + error,
  2069. icon: "none",
  2070. });
  2071. return;
  2072. },
  2073. });
  2074. });
  2075. });
  2076. },
  2077. /**
  2078. * @param {Object} type
  2079. * @param {Object} bankindex
  2080. * 简答题答案确认
  2081. */
  2082. submitAns(bankindex) {
  2083. if (
  2084. !this.questionList[bankindex].ansText.text &&
  2085. !this.questionList[bankindex].ansText.imageList.length
  2086. ) {
  2087. uni.showToast({
  2088. title: "请输入内容或上传图片",
  2089. duration: 2000,
  2090. icon: "none",
  2091. });
  2092. return;
  2093. }
  2094. this.$set(this.questionList[bankindex], "ques", {
  2095. imageList: this.questionList[bankindex].ansText.imageList || [],
  2096. text: this.questionList[bankindex].ansText.text || "",
  2097. });
  2098. this.$u.toast("已确认答案");
  2099. this.isDoOver();
  2100. },
  2101. /**
  2102. * @param {Object} bankindex
  2103. * @param {Object} ansindex
  2104. * 案例题简答答案确认
  2105. */
  2106. submitAnsChild(bankindex, ansindex) {
  2107. if (
  2108. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  2109. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  2110. ) {
  2111. uni.showToast({
  2112. title: "请输入内容或上传图片",
  2113. duration: 2000,
  2114. icon: "none",
  2115. });
  2116. return;
  2117. }
  2118. this.$set(this.questionList[bankindex].ques, ansindex, {
  2119. imageList:
  2120. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList ||
  2121. [],
  2122. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || "",
  2123. });
  2124. this.$u.toast("已确认答案");
  2125. this.isDoOver();
  2126. },
  2127. isCheck(item, index) {
  2128. // 案例题处理
  2129. let { ques, type, ans } = item;
  2130. if (type == 4) {
  2131. return ans.length == ques.length;
  2132. }
  2133. if (ques) {
  2134. return true;
  2135. }
  2136. },
  2137. isRight(item, index) {
  2138. //单选
  2139. if (this.questionList[index].ques) {
  2140. if (item.type == 1) {
  2141. return this.questionList[index].ques == this.questionList[index].ans;
  2142. //多选
  2143. } else if (item.type == 2) {
  2144. //每一项都相等
  2145. return this.questionList[index].ans.every((item, i) => {
  2146. return item == this.questionList[index].ques[i];
  2147. });
  2148. //判断
  2149. } else if (item.type == 3) {
  2150. return this.questionList[index].ques == this.questionList[index].ans;
  2151. // } else if (item.type == 5) {
  2152. // if(this.questionList[index].ques.text){
  2153. // return true
  2154. // }else{
  2155. // return false
  2156. // }
  2157. } else {
  2158. return false;
  2159. }
  2160. } else {
  2161. return false;
  2162. }
  2163. },
  2164. right(bankIndex, ansIndex, option) {
  2165. if (
  2166. this.questionList[bankIndex].ques[ansIndex] &&
  2167. this.questionList[bankIndex].ans[ansIndex]
  2168. ) {
  2169. if (
  2170. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2171. option.optionsId
  2172. ) != -1 ||
  2173. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2174. option.optionsId
  2175. ) != -1
  2176. ) {
  2177. return true;
  2178. } else {
  2179. return false;
  2180. }
  2181. } else {
  2182. return false;
  2183. }
  2184. },
  2185. wrong(bankIndex, ansIndex, option) {
  2186. if (
  2187. this.questionList[bankIndex].ques[ansIndex] &&
  2188. this.questionList[bankIndex].ans[ansIndex]
  2189. ) {
  2190. if (
  2191. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2192. option.optionsId
  2193. ) != -1 &&
  2194. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2195. option.optionsId
  2196. ) == -1
  2197. ) {
  2198. return true;
  2199. } else {
  2200. return false;
  2201. }
  2202. } else {
  2203. return false;
  2204. }
  2205. },
  2206. isWrong(item, index) {
  2207. if (this.questionList[index].ques) {
  2208. //单选
  2209. if (item.type == 1) {
  2210. return this.questionList[index].ques != this.questionList[index].ans;
  2211. //多选
  2212. } else if (item.type == 2) {
  2213. //每一项都相等
  2214. return this.questionList[index].ques.some((item, i) => {
  2215. return this.questionList[index].ans.indexOf(item) == -1;
  2216. });
  2217. //判断
  2218. } else if (item.type == 3) {
  2219. return this.questionList[index].ques != this.questionList[index].ans;
  2220. } else {
  2221. return false;
  2222. }
  2223. } else {
  2224. return false;
  2225. }
  2226. },
  2227. isPart(item, index) {
  2228. if (this.questionList[index].ques) {
  2229. if (item.type == 2) {
  2230. let isWrong = this.questionList[index].ques.some((item, i) => {
  2231. return this.questionList[index].ans.indexOf(item) == -1;
  2232. });
  2233. let isRight = this.questionList[index].ans.every((item, i) => {
  2234. return item == this.questionList[index].ques[i];
  2235. });
  2236. if (!isRight && !isWrong) {
  2237. return true;
  2238. }
  2239. }
  2240. } else {
  2241. return false;
  2242. }
  2243. },
  2244. isOver(item, index) {
  2245. if (this.questionList[index].ques) {
  2246. if (item.type == 4) {
  2247. //案例题
  2248. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  2249. if (
  2250. jsonItem.type == 1 ||
  2251. jsonItem.type == 2 ||
  2252. jsonItem.type == 3
  2253. ) {
  2254. if (item.ques[indexs]) {
  2255. return true;
  2256. } else {
  2257. return false;
  2258. }
  2259. } else if (jsonItem.type == 5) {
  2260. if (
  2261. item.ques[indexs] &&
  2262. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  2263. ) {
  2264. console.log("chil");
  2265. return true;
  2266. } else {
  2267. return false;
  2268. }
  2269. }
  2270. });
  2271. if (isOver) {
  2272. return true;
  2273. } else {
  2274. return false;
  2275. }
  2276. } else if (item.type == 5) {
  2277. //简答题
  2278. //每一项都相等
  2279. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  2280. return true;
  2281. }
  2282. //判断
  2283. } else {
  2284. return false;
  2285. }
  2286. } else {
  2287. return false;
  2288. }
  2289. },
  2290. tabSelect(index, bankindex) {
  2291. this.$set(this.questionList[bankindex], "current", index);
  2292. },
  2293. showPhoto(contentStr) {
  2294. if (contentStr && typeof contentStr == "string") {
  2295. let reg = /<img[^>]*src[=\'\"\s]+([^\'\"]*)[\'\"]?[^>]*>/gi;
  2296. let strArr = contentStr.match(reg);
  2297. strArr.forEach((str, index) => {
  2298. strArr[index] = str.replace(reg, "$1");
  2299. });
  2300. // 预览图片
  2301. uni.previewImage({
  2302. urls: strArr,
  2303. longPressActions: {
  2304. itemList: ["发送给朋友", "保存图片", "收藏"],
  2305. success: function (data) {
  2306. console.log(
  2307. "选中了第" +
  2308. (data.tapIndex + 1) +
  2309. "个按钮,第" +
  2310. (data.index + 1) +
  2311. "张图片"
  2312. );
  2313. },
  2314. fail: function (err) {
  2315. console.log(err.errMsg);
  2316. },
  2317. },
  2318. });
  2319. }
  2320. },
  2321. },
  2322. computed: {
  2323. doMode() {
  2324. // 做题模式 1章卷 2随机练习 3模拟组卷
  2325. return this.examData.simulateStatus
  2326. ? 3
  2327. : this.entryType == "random"
  2328. ? 2
  2329. : 1;
  2330. },
  2331. },
  2332. };
  2333. </script>
  2334. <style lang="scss" scoped>
  2335. .questionBank {
  2336. width: 100%;
  2337. height: 100vh;
  2338. display: flex;
  2339. flex-direction: column;
  2340. }
  2341. .swiper {
  2342. width: 100%;
  2343. flex: 1;
  2344. }
  2345. .lisSty {
  2346. margin-bottom: 16rpx;
  2347. display: flex;
  2348. align-items: center;
  2349. .flex_auto {
  2350. word-break: break-all;
  2351. flex: 1;
  2352. }
  2353. }
  2354. .activeTI {
  2355. vertical-align: middle;
  2356. display: inline-block;
  2357. border: 1rpx solid #eee;
  2358. border-radius: 50rpx;
  2359. height: 48rpx;
  2360. line-height: 46rpx;
  2361. text-align: center;
  2362. width: 48rpx;
  2363. margin-right: 15rpx;
  2364. color: #666;
  2365. font-size: 30rpx;
  2366. &.right {
  2367. color: #fff;
  2368. background: #36c75a;
  2369. }
  2370. &.wrong {
  2371. color: #fff;
  2372. background: #ff3b30;
  2373. }
  2374. &.checked,
  2375. &.user_choose {
  2376. color: #fff;
  2377. background: #007aff;
  2378. }
  2379. }
  2380. .submit_checkbox {
  2381. position: fixed;
  2382. left: 0;
  2383. right: 0;
  2384. bottom: 120rpx;
  2385. margin: 20rpx auto;
  2386. width: 526rpx;
  2387. height: 80rpx;
  2388. background: rgba(0, 122, 255, 1);
  2389. color: #fff;
  2390. text-align: center;
  2391. line-height: 80rpx;
  2392. font-size: 30rpx;
  2393. border-radius: 40rpx;
  2394. &.disabled {
  2395. opacity: 0.6;
  2396. }
  2397. }
  2398. .titles {
  2399. overflow: hidden;
  2400. margin-bottom: 24rpx;
  2401. }
  2402. .titBox {
  2403. padding: 41rpx 25rpx 24rpx 25rpx;
  2404. }
  2405. .titBox_title {
  2406. padding: 21rpx;
  2407. }
  2408. .tabs {
  2409. margin: 10rpx;
  2410. display: flex;
  2411. .tab {
  2412. margin: 0 4rpx;
  2413. padding: 10rpx 13rpx;
  2414. text-align: center;
  2415. color: #007aff;
  2416. font-size: 28rpx;
  2417. border-radius: 16rpx;
  2418. background: #fff;
  2419. &.current {
  2420. color: #fff;
  2421. background: #007aff;
  2422. }
  2423. }
  2424. }
  2425. .ans {
  2426. margin: 8rpx 8rpx 8rpx;
  2427. .ans_input {
  2428. border-radius: 16rpx;
  2429. background: #fff;
  2430. .top {
  2431. border-bottom: 1rpx solid #eeeeee;
  2432. padding: 16rpx;
  2433. display: flex;
  2434. align-items: center;
  2435. .icon {
  2436. margin-right: 20rpx;
  2437. width: 40rpx;
  2438. height: 38rpx;
  2439. }
  2440. .progress {
  2441. flex: 1;
  2442. }
  2443. .submit {
  2444. width: 168rpx;
  2445. height: 48rpx;
  2446. line-height: 48rpx;
  2447. text-align: center;
  2448. color: #fff;
  2449. font-size: 30rpx;
  2450. background: #007aff;
  2451. border-radius: 24rpx;
  2452. &.disabled {
  2453. opacity: 0.6;
  2454. }
  2455. }
  2456. }
  2457. .textarea {
  2458. textarea {
  2459. width: 100%;
  2460. height: 287rpx;
  2461. padding: 10rpx;
  2462. }
  2463. }
  2464. .imgs {
  2465. overflow: hidden;
  2466. display: flex;
  2467. width: 100%;
  2468. .img {
  2469. width: 104rpx;
  2470. height: 104rpx;
  2471. border-radius: 8rpx;
  2472. position: relative;
  2473. margin: 20rpx;
  2474. text {
  2475. position: absolute;
  2476. right: -15rpx;
  2477. top: -15rpx;
  2478. width: 30rpx;
  2479. height: 30rpx;
  2480. text-align: center;
  2481. line-height: 30rpx;
  2482. color: #fff;
  2483. background: #ff3b30;
  2484. border-radius: 50%;
  2485. }
  2486. image {
  2487. width: 100%;
  2488. height: 100%;
  2489. }
  2490. }
  2491. }
  2492. }
  2493. .ans_submit {
  2494. padding: 16rpx;
  2495. border-radius: 16rpx;
  2496. background: #fff;
  2497. .imgs {
  2498. overflow: hidden;
  2499. display: flex;
  2500. width: 100%;
  2501. .img {
  2502. width: 104rpx;
  2503. height: 104rpx;
  2504. border-radius: 8rpx;
  2505. position: relative;
  2506. margin: 20rpx;
  2507. image {
  2508. width: 100%;
  2509. height: 100%;
  2510. }
  2511. }
  2512. }
  2513. }
  2514. }
  2515. .leftLetters {
  2516. display: flex;
  2517. align-items: center;
  2518. width: 220rpx;
  2519. .btnType {
  2520. padding: 5rpx 10rpx;
  2521. border: 1rpx solid #007aff;
  2522. border-radius: 10rpx;
  2523. background-color: rgba(0, 122, 255, 0.1);
  2524. font-size: 28rpx;
  2525. color: #007aff;
  2526. margin-right: 15rpx;
  2527. }
  2528. }
  2529. .firstLetter {
  2530. display: flex;
  2531. justify-content: space-between;
  2532. align-items: center;
  2533. margin-bottom: 30rpx;
  2534. }
  2535. .popupView {
  2536. height: 100%;
  2537. padding-bottom: 100rpx;
  2538. .popupTops {
  2539. height: 77rpx;
  2540. border-bottom: 1rpx solid #eee;
  2541. text-align: center;
  2542. line-height: 77rpx;
  2543. font-size: 24rpx;
  2544. color: #999;
  2545. position: relative;
  2546. .topIcon {
  2547. position: absolute;
  2548. top: 10rpx;
  2549. left: 50%;
  2550. transform: translateX(-50%);
  2551. width: 80rpx;
  2552. height: 8rpx;
  2553. background-color: #999;
  2554. border-radius: 4rpx;
  2555. }
  2556. }
  2557. .popupContent {
  2558. }
  2559. }
  2560. .pageContent {
  2561. position: relative;
  2562. background-color: #eaeef1;
  2563. height: 100%;
  2564. padding-top: 8rpx;
  2565. padding-bottom: 100rpx;
  2566. overflow-y: scroll;
  2567. }
  2568. .pad_8 {
  2569. background-color: #fff;
  2570. margin: 0rpx 8rpx 8rpx;
  2571. border-radius: 16rpx;
  2572. &.no-margin {
  2573. margin-top: -16rpx;
  2574. border-radius: 0 0 16rpx 16rpx;
  2575. }
  2576. }
  2577. .answer {
  2578. height: 80rpx;
  2579. line-height: 80rpx;
  2580. padding: 0rpx 24rpx;
  2581. display: flex;
  2582. align-items: center;
  2583. justify-content: space-between;
  2584. color: #666;
  2585. font-size: 30rpx;
  2586. }
  2587. .footer_btn {
  2588. background-color: #fff;
  2589. z-index: 10078;
  2590. position: fixed;
  2591. bottom: 0rpx;
  2592. display: flex;
  2593. align-items: center;
  2594. justify-content: space-between;
  2595. width: 100%;
  2596. height: 98rpx;
  2597. padding: 0rpx 38rpx;
  2598. border-top: 1rpx solid #eee;
  2599. .flex_center {
  2600. flex: 1;
  2601. display: flex;
  2602. justify-content: center;
  2603. align-items: center;
  2604. flex-direction: column;
  2605. margin: 0 200rpx;
  2606. font-size: 24rpx;
  2607. color: #999999;
  2608. .up-icon {
  2609. margin-bottom: 18rpx;
  2610. width: 100%;
  2611. display: flex;
  2612. justify-content: center;
  2613. image {
  2614. width: 58rpx;
  2615. height: 21rpx;
  2616. }
  2617. }
  2618. }
  2619. .collect {
  2620. visibility: hidden;
  2621. width: 100rpx;
  2622. &.show {
  2623. visibility: visible;
  2624. }
  2625. > view {
  2626. display: flex;
  2627. flex-direction: column;
  2628. align-items: center;
  2629. justify-content: center;
  2630. image {
  2631. width: 32rpx;
  2632. height: 32rpx;
  2633. margin-bottom: 6rpx;
  2634. }
  2635. view {
  2636. font-size: 24rpx;
  2637. color: #999999;
  2638. }
  2639. }
  2640. }
  2641. }
  2642. .boxSty {
  2643. padding: 44rpx 41rpx 0rpx;
  2644. }
  2645. .liListSty {
  2646. border: 1rpx solid #eeeeee;
  2647. width: 88rpx;
  2648. height: 88rpx;
  2649. border-radius: 32rpx;
  2650. text-align: center;
  2651. line-height: 88rpx;
  2652. color: #333;
  2653. font-size: 32rpx;
  2654. float: left;
  2655. margin: 20rpx 23rpx;
  2656. &.isRight {
  2657. border: 1rpx solid #eeeeee;
  2658. color: #fff;
  2659. background: #36c75a;
  2660. }
  2661. &.isWrong {
  2662. border: 1rpx solid #eeeeee;
  2663. color: #fff;
  2664. background: #ff3b30;
  2665. }
  2666. &.isPart {
  2667. border: 1rpx solid #eeeeee;
  2668. color: #fff;
  2669. background: #ffc53d;
  2670. }
  2671. &.isOver {
  2672. border: 1rpx solid #eeeeee;
  2673. color: #fff;
  2674. background: blue;
  2675. }
  2676. &.check_ans {
  2677. border: 1rpx solid #eeeeee;
  2678. color: #fff;
  2679. background: #007aff;
  2680. }
  2681. }
  2682. .answerInfos {
  2683. padding: 25rpx 25rpx 25rpx 23rpx;
  2684. }
  2685. .answerTitle {
  2686. margin-bottom: 28rpx;
  2687. color: #666;
  2688. font-size: 30rpx;
  2689. }
  2690. .answerContent {
  2691. font-size: 30rpx;
  2692. color: #666;
  2693. }
  2694. .textChild {
  2695. display: inline-block;
  2696. vertical-align: middle;
  2697. }
  2698. .dialog {
  2699. position: fixed;
  2700. left: 0;
  2701. top: 0;
  2702. width: 100%;
  2703. height: 100%;
  2704. background-color: rgba(0, 0, 0, 0.8);
  2705. display: flex;
  2706. flex-direction: column;
  2707. align-items: center;
  2708. justify-content: center;
  2709. z-index: 20000;
  2710. .pointer {
  2711. width: 338rpx;
  2712. height: 240rpx;
  2713. }
  2714. .text {
  2715. font-size: 32rpx;
  2716. color: #ffffff;
  2717. text-align: center;
  2718. }
  2719. .btn {
  2720. width: 242rpx;
  2721. height: 82rpx;
  2722. border: 2rpx solid #ffffff;
  2723. border-radius: 16rpx;
  2724. text-align: center;
  2725. line-height: 82rpx;
  2726. margin: 41rpx auto;
  2727. color: #fff;
  2728. font-size: 32rpx;
  2729. }
  2730. }
  2731. .dialog-arrow {
  2732. padding-top: 124rpx;
  2733. position: fixed;
  2734. left: 0;
  2735. top: 0;
  2736. width: 100%;
  2737. height: 100%;
  2738. background-color: rgba(0, 0, 0, 0.8);
  2739. z-index: 20000;
  2740. .pointer {
  2741. margin-left: 87rpx;
  2742. display: block;
  2743. width: 95rpx;
  2744. height: 98rpx;
  2745. }
  2746. .text {
  2747. padding-left: 177rpx;
  2748. font-size: 32rpx;
  2749. color: #ffffff;
  2750. }
  2751. .btn {
  2752. width: 242rpx;
  2753. height: 82rpx;
  2754. border: 2rpx solid #ffffff;
  2755. border-radius: 16rpx;
  2756. text-align: center;
  2757. line-height: 82rpx;
  2758. margin: 500rpx auto 0;
  2759. color: #fff;
  2760. font-size: 32rpx;
  2761. }
  2762. }
  2763. .dialog_wrap {
  2764. position: fixed;
  2765. left: 0;
  2766. top: 0;
  2767. width: 100%;
  2768. height: 100%;
  2769. z-index: 9999999999;
  2770. .bg {
  2771. background: rgba(0, 0, 0, 0.3);
  2772. position: absolute;
  2773. left: 0;
  2774. top: 0;
  2775. width: 100%;
  2776. height: 100%;
  2777. }
  2778. .dialog {
  2779. position: absolute;
  2780. left: 50%;
  2781. top: 50%;
  2782. transform: translate3D(-50%, -50%, 0);
  2783. width: 640rpx;
  2784. height: 439rpx;
  2785. background: #ffffff;
  2786. border-radius: 24rpx;
  2787. .title {
  2788. font-size: 30rpx;
  2789. font-weight: bold;
  2790. color: #333333;
  2791. line-height: 48rpx;
  2792. text-align: center;
  2793. margin-top: 40rpx;
  2794. }
  2795. .content {
  2796. margin: 35rpx 35rpx 0;
  2797. font-size: 30rpx;
  2798. color: #666666;
  2799. line-height: 48rpx;
  2800. }
  2801. .btns {
  2802. margin-top: 35rpx;
  2803. display: flex;
  2804. align-items: center;
  2805. justify-content: center;
  2806. .btn {
  2807. width: 200rpx;
  2808. height: 80rpx;
  2809. line-height: 80rpx;
  2810. text-align: center;
  2811. background: #f5f5f5;
  2812. border-radius: 40rpx;
  2813. font-size: 30rpx;
  2814. color: rgba(0, 122, 255, 1);
  2815. background: #f5f5f5;
  2816. margin: 0 20rpx;
  2817. &.active {
  2818. color: #f5f5f5;
  2819. background: rgba(0, 122, 255, 1);
  2820. }
  2821. }
  2822. }
  2823. }
  2824. }
  2825. .popboxs {
  2826. width: 100%;
  2827. height: 100%;
  2828. display: flex;
  2829. flex-direction: column;
  2830. align-items: center;
  2831. }
  2832. .classTops {
  2833. flex-shrink: 0;
  2834. padding: 39rpx 0rpx 4rpx;
  2835. font-weight: bold;
  2836. color: #333;
  2837. font-size: 30rpx;
  2838. }
  2839. .textStys {
  2840. width: 100%;
  2841. flex: 1;
  2842. padding: 36rpx;
  2843. }
  2844. .classFootsty {
  2845. flex-shrink: 0;
  2846. display: flex;
  2847. align-items: center;
  2848. justify-content: center;
  2849. padding: 10rpx 0rpx 40rpx;
  2850. .btnsty {
  2851. width: 200rpx;
  2852. height: 80rpx;
  2853. border-radius: 40rpx;
  2854. font-weight: bold;
  2855. font-size: 30rpx;
  2856. text-align: center;
  2857. line-height: 80rpx;
  2858. }
  2859. .btns1 {
  2860. background-color: #f5f5f5;
  2861. color: #007aff;
  2862. }
  2863. .btns2 {
  2864. margin-left: 40rpx;
  2865. background-color: #007aff;
  2866. color: #ffffff;
  2867. }
  2868. }
  2869. </style>