questionBank.vue 87 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999
  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, reject) => {
  1039. this.$api.bankExam(this.id).then((res) => {
  1040. const { examLimitClient, doType } = res.data.data;
  1041. if (!this.$method.examClientCanLearn(examLimitClient)) {
  1042. reject();
  1043. }
  1044. if (this.entryType == "daily") {
  1045. // 每日一练类型都是为练习
  1046. this.bankType = 1;
  1047. } else {
  1048. this.bankType = doType;
  1049. }
  1050. this.examData = res.data.data;
  1051. this.allTimes = this.examData.answerTime * 60;
  1052. this.lastTime =
  1053. this.examData.answerTime && this.examData.answerTime * 60;
  1054. if (this.bankType == 2) {
  1055. this.needBack = true;
  1056. }
  1057. resolve();
  1058. });
  1059. });
  1060. },
  1061. /**
  1062. * 点击后退按钮
  1063. */
  1064. clickLeft() {
  1065. if (this.bankType == 1) {
  1066. let ansCount = this.questionOverNum(true); //已答题数
  1067. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1068. //所有题目答完
  1069. if (this.lastCount == 0) {
  1070. // this.testOver = true;
  1071. this.cgType = 7;
  1072. //未答完
  1073. } else {
  1074. this.cgType = 8;
  1075. // this.isLastCount = true;
  1076. }
  1077. this.showpopups = true;
  1078. } else if (this.bankType == 2) {
  1079. let ansCount = this.questionOverNum(true); //已答题数
  1080. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1081. //所有题目答完
  1082. if (this.lastCount == 0) {
  1083. this.testOver = true;
  1084. //未答完
  1085. } else {
  1086. this.isLastCount = true;
  1087. }
  1088. }
  1089. },
  1090. /**
  1091. * 返回上一页
  1092. */
  1093. backPages() {
  1094. this.needBack = false;
  1095. uni.navigateBack({
  1096. delta: 1,
  1097. });
  1098. },
  1099. /**
  1100. * 获取已经回答的题目数
  1101. * hasSpecail (是否包含简答和案例)
  1102. */
  1103. questionOverNum(hasSpecail) {
  1104. let count = 0;
  1105. this.questionList.forEach((item) => {
  1106. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1107. if (item.ques) {
  1108. count++;
  1109. }
  1110. } else if (item.type == 4) {
  1111. //案例题
  1112. if (hasSpecail) {
  1113. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1114. if (
  1115. jsonItem.type == 1 ||
  1116. jsonItem.type == 2 ||
  1117. jsonItem.type == 3
  1118. ) {
  1119. if (item.ques[indexs]) {
  1120. return true;
  1121. } else {
  1122. return false;
  1123. }
  1124. } else if (jsonItem.type == 5) {
  1125. if (
  1126. item.ques[indexs] &&
  1127. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1128. ) {
  1129. console.log("chil");
  1130. return true;
  1131. } else {
  1132. return false;
  1133. }
  1134. }
  1135. });
  1136. if (isOver) {
  1137. count++;
  1138. }
  1139. }
  1140. } else if (item.type == 5) {
  1141. //简答题
  1142. if (hasSpecail) {
  1143. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1144. console.log(5, item);
  1145. count++;
  1146. }
  1147. }
  1148. }
  1149. });
  1150. return count;
  1151. },
  1152. /**
  1153. * 是否做完所有题目
  1154. */
  1155. isDoOver() {
  1156. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1157. if (this.questionList.length == questionOverNum) {
  1158. //全部做完弹窗
  1159. this.cgType = 9;
  1160. this.showpopups = true;
  1161. }
  1162. },
  1163. /**
  1164. * 暂不交卷
  1165. */
  1166. noSubmit() {
  1167. //设为允许退出页面
  1168. this.needBack = false;
  1169. uni.navigateBack({
  1170. delta: 1,
  1171. });
  1172. },
  1173. /**
  1174. * 不离开
  1175. */
  1176. noLeave() {
  1177. this.isLastCount = false;
  1178. },
  1179. /**
  1180. * 立即离开并交卷
  1181. */
  1182. leaveNow() {
  1183. this.needBack = false;
  1184. this.isSubmit = true;
  1185. this.submit(false);
  1186. uni.navigateBack({
  1187. delta: 1,
  1188. });
  1189. },
  1190. /**
  1191. * 立即交卷
  1192. */
  1193. submitNow() {
  1194. this.showpopups = false;
  1195. this.needBack = false;
  1196. this.submit();
  1197. },
  1198. /**
  1199. * 离开页面统计回答正确题数
  1200. */
  1201. examRecordEdit() {
  1202. if (!this.isSubmit) {
  1203. let {
  1204. doQuestionNum,
  1205. doQuestionIds,
  1206. rightQuestionNum,
  1207. historyExamJson,
  1208. } = this.$method.calculateScore(this.questionList);
  1209. this.$api
  1210. .examRecordEdit({
  1211. orderGoodsId: this.orderGoodsId,
  1212. examId: this.id,
  1213. goodsId: this.goodsId,
  1214. recordId: this.recordId,
  1215. doQuestionIds,
  1216. rightQuestionNum,
  1217. moduleExamId: this.moduleId || 0,
  1218. chapterExamId: this.chapterId || 0,
  1219. status: 0,
  1220. doQuestionNum,
  1221. historyExamJson,
  1222. })
  1223. .then((res) => {
  1224. if (res.data.code == 200) {
  1225. this.entryType == "daily" && this.dailyExam();
  1226. }
  1227. });
  1228. }
  1229. },
  1230. /**
  1231. * 记录总题数
  1232. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1233. */
  1234. examRecord(hasSpecial) {
  1235. let questionList = 0;
  1236. // if(!hasSpecial) {
  1237. this.questionList.forEach((item, index) => {
  1238. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1239. questionList++;
  1240. }
  1241. });
  1242. // } else {
  1243. // questionList = this.questionList.length;
  1244. // }
  1245. this.$api
  1246. .examRecord({
  1247. chapterExamId: this.chapterId || 0,
  1248. orderGoodsId: this.orderGoodsId,
  1249. moduleExamId: this.moduleId || 0,
  1250. examId: this.id,
  1251. goodsId: this.goodsId,
  1252. totalQuestionNum: questionList,
  1253. allQuestionNum: this.questionList.length,
  1254. doMode: this.doMode,
  1255. simulateExamId: this.simulateExamId,
  1256. })
  1257. .then((res) => {
  1258. this.recordId = res.data.data;
  1259. //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
  1260. if (this.bankType == 1) {
  1261. this.examRecordEdit();
  1262. }
  1263. });
  1264. },
  1265. /**
  1266. * @param {Object} second倒计时过滤器
  1267. */
  1268. countdown(second) {
  1269. if (second) {
  1270. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  1271. let m = parseInt((second / 60) % 60); // 计算分数
  1272. let s = parseInt(second % 60); // 计算当前秒数
  1273. if (h < 10) h = "0" + h;
  1274. if (m < 10) m = "0" + m;
  1275. if (s < 10) s = "0" + s;
  1276. return h + ":" + m + ":" + s;
  1277. } else {
  1278. return "";
  1279. }
  1280. },
  1281. hideDialog() {
  1282. this.showDialog = false;
  1283. },
  1284. // 请求随机练习题目列表
  1285. randomQuestionList() {
  1286. this.$http({
  1287. url: "/bank/exam/temp",
  1288. method: "post",
  1289. data: {
  1290. goodsId: this.goodsId,
  1291. orderGoodsId: this.orderGoodsId,
  1292. number: this.bankNum,
  1293. },
  1294. }).then((res) => {
  1295. if (res.data.code == 200) {
  1296. this.examData = res.data.data || {};
  1297. this.id = this.examData.examId;
  1298. if (!this.examData.questionList.length) {
  1299. return this.noListTip();
  1300. }
  1301. this.dataAnlyze(this.examData.questionList || []);
  1302. } else {
  1303. this.$u.toast(res.data.msg);
  1304. setTimeout(() => {
  1305. uni.navigateBack();
  1306. }, 2000);
  1307. }
  1308. });
  1309. },
  1310. noListTip(content = "该试卷暂无题目") {
  1311. this.hideDialog();
  1312. uni.showModal({
  1313. showCancel: false,
  1314. content,
  1315. success: (k) => {
  1316. if (k.confirm) {
  1317. this.isSubmit = true;
  1318. uni.navigateBack();
  1319. }
  1320. },
  1321. });
  1322. },
  1323. /**
  1324. * 请求题目列表 app/common/bank/question/list
  1325. */
  1326. goodsQuestionList() {
  1327. this.$api[
  1328. this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
  1329. ]({
  1330. examId: this.id,
  1331. goodsId: this.goodsId,
  1332. orderGoodsId: this.orderGoodsId,
  1333. from: 1,
  1334. }).then((res) => {
  1335. if (res.data.code == 500) {
  1336. return this.noListTip("你已完成所有题目");
  1337. }
  1338. let data = res.data.data;
  1339. if (this.doMode == 3) {
  1340. this.simulateExamId = data.simulateExamId;
  1341. data = data.questionList;
  1342. }
  1343. if (!data.length) {
  1344. return this.noListTip();
  1345. }
  1346. //考试时间到了自动交卷
  1347. if (this.lastTime) {
  1348. this.timer = setInterval(() => {
  1349. if (this.lastTime <= 0) {
  1350. clearInterval(this.timer);
  1351. uni.showToast({
  1352. icon: "none",
  1353. mask: true,
  1354. title: "考试时间已到,系统将自动交卷",
  1355. duration: 10000,
  1356. });
  1357. this.submit();
  1358. return;
  1359. }
  1360. this.lastTime--;
  1361. }, 1000);
  1362. } else {
  1363. }
  1364. this.dataAnlyze(data);
  1365. });
  1366. },
  1367. dataAnlyze(datas = []) {
  1368. console.log("datas:", datas);
  1369. datas.forEach((item, index) => {
  1370. // if (typeof item.jsonStr == 'string') {
  1371. item.jsonStr = JSON.parse(item.jsonStr);
  1372. if (item.type == 2) {
  1373. //多选
  1374. item.jsonStr.forEach((str) => {
  1375. str.optionsId = "" + str.optionsId;
  1376. });
  1377. let arr = item.answerQuestion.split(",");
  1378. arr.forEach((a, i) => {
  1379. arr[i] = "" + a;
  1380. });
  1381. item.ans = arr;
  1382. item.analysisContent &&
  1383. (item.analysisContent = item.analysisContent.replace(
  1384. /<img/gi,
  1385. '<img style="max-width:100%;"'
  1386. ));
  1387. item.content &&
  1388. (item.content = item.content.replace(
  1389. /<img/gi,
  1390. '<img style="max-width:100%;"'
  1391. ));
  1392. return;
  1393. } else if (item.type == 5) {
  1394. //简答题
  1395. item.ansText = {
  1396. text: "",
  1397. imageList: [],
  1398. };
  1399. item.ques = {
  1400. text: "",
  1401. imageList: [],
  1402. };
  1403. item.analysisContent &&
  1404. (item.analysisContent = item.analysisContent.replace(
  1405. /<img/gi,
  1406. '<img style="max-width:100%;"'
  1407. ));
  1408. item.content &&
  1409. (item.content = item.content.replace(
  1410. /<img/gi,
  1411. '<img style="max-width:100%;"'
  1412. ));
  1413. } else if (item.type == 4) {
  1414. //案例题
  1415. item.ques = [];
  1416. item.current = 0;
  1417. let ansArr = [];
  1418. item.jsonStr.forEach((json, index) => {
  1419. if (json.type == 1) {
  1420. ansArr[index] = json.answerQuestion;
  1421. json.content &&
  1422. (json.content = json.content.replace(
  1423. /<img/gi,
  1424. '<img style="max-width:100%;"'
  1425. ));
  1426. } else if (json.type == 2) {
  1427. json.optionsList.forEach((str) => {
  1428. str.optionsId = "" + str.optionsId;
  1429. });
  1430. let arr = json.answerQuestion.split(",");
  1431. arr.forEach((a, i) => {
  1432. arr[i] = "" + a;
  1433. });
  1434. ansArr[index] = arr;
  1435. json.content &&
  1436. (json.content = json.content.replace(
  1437. /<img/gi,
  1438. '<img style="max-width:100%;"'
  1439. ));
  1440. } else if (json.type == 3) {
  1441. ansArr[index] = json.answerQuestion;
  1442. json.content &&
  1443. (json.content = json.content.replace(
  1444. /<img/gi,
  1445. '<img style="max-width:100%;"'
  1446. ));
  1447. } else if (json.type == 5) {
  1448. ansArr[index] = {
  1449. text: json.answerQuestion,
  1450. imageList: [],
  1451. };
  1452. json.ansText = {
  1453. text: "",
  1454. imageList: [],
  1455. };
  1456. json.content &&
  1457. (json.content = json.content.replace(
  1458. /<img/gi,
  1459. '<img style="max-width:100%;"'
  1460. ));
  1461. }
  1462. });
  1463. item.analysisContent &&
  1464. (item.analysisContent = item.analysisContent.replace(
  1465. /<img/gi,
  1466. '<img style="max-width:100%;"'
  1467. ));
  1468. item.content &&
  1469. (item.content = item.content.replace(
  1470. /<img/gi,
  1471. '<img style="max-width:100%;"'
  1472. ));
  1473. item.ans = ansArr;
  1474. return;
  1475. }
  1476. item.analysisContent &&
  1477. (item.analysisContent = item.analysisContent.replace(
  1478. /<img/gi,
  1479. '<img style="max-width:100%;"'
  1480. ));
  1481. item.content &&
  1482. (item.content = item.content.replace(
  1483. /<img/gi,
  1484. '<img style="max-width:100%;"'
  1485. ));
  1486. item.ans = item.answerQuestion;
  1487. // }
  1488. });
  1489. this.questionList = datas;
  1490. this.lastCount = this.questionList.length;
  1491. this.examRecord();
  1492. this.getCollectInfo(this.current);
  1493. },
  1494. /**
  1495. * @param {Object} e单选点击
  1496. */
  1497. radioSelect(optionsId, bindex) {
  1498. // if (this.questionList[bindex].ques) return;
  1499. if (this.questionList[bindex].ques && this.bankType == 1) {
  1500. return;
  1501. }
  1502. this.$set(this.questionList[bindex], "ques", optionsId);
  1503. // if ((bindex + 1) < this.questionList.length) {
  1504. // this.current = bindex + 1
  1505. // }
  1506. this.isDoOver();
  1507. // 回答错误
  1508. // if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1509. // // /exam/wwrong/record
  1510. // this.$api
  1511. // .examWrongRecord({
  1512. // orderGoodsId: this.orderGoodsId,
  1513. // examId: this.id,
  1514. // goodsId: this.goodsId,
  1515. // moduleExamId: this.moduleId || 0,
  1516. // chapterExamId: this.chapterId || 0,
  1517. // questionIds: [this.questionList[bindex].questionId],
  1518. // recordId: this.recordId,
  1519. // })
  1520. // .then((res) => {});
  1521. // } else {
  1522. // // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1523. // // if(question) {
  1524. // // this.$api.wrongRecordDelete({
  1525. // // "examId": +this.id,
  1526. // // "goodsId": +this.goodsId,
  1527. // // "questionId": this.questionList[bindex].questionId,
  1528. // // }).then(res => {
  1529. // // })
  1530. // // }
  1531. // }
  1532. },
  1533. /**
  1534. * @param {Object} e案例单选点击
  1535. */
  1536. radioSelectChild(optionsId, ansIndex, bindex) {
  1537. // if (this.questionList[bindex].ques[ansIndex]) return;
  1538. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1539. return;
  1540. }
  1541. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1542. this.isDoOver();
  1543. },
  1544. /**
  1545. * @param {Object} 多选点击
  1546. */
  1547. checkboxSelect(optionsId, bindex, index) {
  1548. if (this.questionList[bindex].ques && this.bankType == 1) {
  1549. return;
  1550. }
  1551. this.$set(
  1552. this.questionList[bindex].jsonStr[index],
  1553. "checked",
  1554. !this.questionList[bindex].jsonStr[index].checked
  1555. );
  1556. },
  1557. /**
  1558. * @param {Object} 案例多选点击
  1559. */
  1560. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1561. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1562. return;
  1563. }
  1564. this.$set(
  1565. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  1566. "checked",
  1567. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1568. .checked
  1569. );
  1570. },
  1571. isCheckboxChecked(arr) {
  1572. return arr.some((item) => {
  1573. if (item.checked) {
  1574. return true;
  1575. }
  1576. });
  1577. },
  1578. /**
  1579. * @param {Object} 多选确认
  1580. */
  1581. checkboxSubmit(bindex) {
  1582. if (this.questionList[bindex].ques && this.bankType == 1) {
  1583. return;
  1584. }
  1585. let arr = [];
  1586. this.questionList[bindex].jsonStr.forEach((item) => {
  1587. if (item.checked) {
  1588. arr.push(item.optionsId);
  1589. }
  1590. });
  1591. if (!arr.length) {
  1592. delete this.questionList[bindex].ques;
  1593. uni.showToast({
  1594. title: "请选择答案",
  1595. icon: "none",
  1596. });
  1597. return;
  1598. }
  1599. this.$set(this.questionList[bindex], "ques", arr);
  1600. this.$u.toast("已确认答案");
  1601. this.isDoOver();
  1602. // 切换下一题
  1603. if (
  1604. this.bankType != 1 &&
  1605. this.cgType != 9 &&
  1606. bindex != this.questionList.length - 1
  1607. ) {
  1608. this.current = bindex + 1;
  1609. this.getCollectInfo(this.current);
  1610. }
  1611. },
  1612. /**
  1613. * @param {Object} 案例多选确认
  1614. */
  1615. checkboxSubmitChild(bindex, ansIndex) {
  1616. // if (this.questionList[bindex].ques[ansIndex]) return;
  1617. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1618. return;
  1619. }
  1620. let arr = [];
  1621. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1622. (item) => {
  1623. if (item.checked) {
  1624. arr.push(item.optionsId);
  1625. }
  1626. }
  1627. );
  1628. if (!arr.length) {
  1629. delete this.questionList[bindex].ques[ansIndex];
  1630. uni.showToast({
  1631. title: "请选择答案",
  1632. icon: "none",
  1633. });
  1634. return;
  1635. }
  1636. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1637. this.$u.toast("已确认答案");
  1638. this.isDoOver();
  1639. // 切换下一题
  1640. if (
  1641. this.bankType != 1 &&
  1642. this.cgType != 9 &&
  1643. ansIndex != this.questionList[bindex].ques.length - 1
  1644. ) {
  1645. this.questionList[bindex].current += 1;
  1646. }
  1647. },
  1648. /**
  1649. * @param {Object} index
  1650. * @param {Object} bindex
  1651. * 判断题
  1652. */
  1653. judgeSelect(index, bindex) {
  1654. // if (this.questionList[bindex].ques) return;
  1655. if (this.questionList[bindex].ques && this.bankType == 1) {
  1656. return;
  1657. } // 答案: 判断题1正确 0错误
  1658. this.$set(this.questionList[bindex], "ques", index == 0 ? "1" : "0");
  1659. console.log(
  1660. "this.questionList[bindex]:",
  1661. this.questionList[bindex].ques,
  1662. this.questionList[bindex].ans
  1663. );
  1664. this.isDoOver();
  1665. // 回答错误
  1666. // if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1667. // this.$api
  1668. // .examWrongRecord({
  1669. // orderGoodsId: this.orderGoodsId,
  1670. // examId: this.id,
  1671. // goodsId: this.goodsId,
  1672. // moduleExamId: this.moduleId || 0,
  1673. // chapterExamId: this.chapterId || 0,
  1674. // questionIds: [this.questionList[bindex].questionId],
  1675. // recordId: this.recordId,
  1676. // })
  1677. // .then((res) => {});
  1678. // } else {
  1679. // // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1680. // // if(question) {
  1681. // // this.$api.wrongRecordDelete({
  1682. // // "examId": +this.id,
  1683. // // "goodsId": +this.goodsId,
  1684. // // "questionId": this.questionList[bindex].questionId,
  1685. // // }).then(res => {
  1686. // // })
  1687. // // }
  1688. // }
  1689. },
  1690. /**
  1691. * @param {Object} ansindex
  1692. * @param {Object} childindex
  1693. * @param {Object} bindex
  1694. * 案例判断题
  1695. */
  1696. judgeSelectChild(ansindex, childindex, bindex) {
  1697. // if (this.questionList[bindex].ques[ansindex]) return;
  1698. if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
  1699. return;
  1700. }
  1701. this.$set(
  1702. this.questionList[bindex].ques,
  1703. ansindex,
  1704. childindex == 0 ? "1" : "0"
  1705. );
  1706. this.isDoOver();
  1707. },
  1708. openFooterTab() {
  1709. this.show = true;
  1710. },
  1711. changeIndex(index) {
  1712. this.current = index;
  1713. },
  1714. swiperChange(e) {
  1715. this.current = e.detail.current;
  1716. this.getCollectInfo(this.current);
  1717. },
  1718. /**
  1719. * @param {Object} current
  1720. * 获取收藏信息
  1721. */
  1722. getCollectInfo(current) {
  1723. this.$api
  1724. .getCollectInfo({
  1725. examId: this.id,
  1726. questionId: this.questionList[current].questionId,
  1727. goodsId: this.goodsId,
  1728. orderGoodsId: this.orderGoodsId,
  1729. })
  1730. .then((res) => {
  1731. if (res.data.code == 500) {
  1732. this.$set(this.collectList, current, false);
  1733. } else if (res.data.code == 200) {
  1734. this.$set(this.collectList, current, res.data.data);
  1735. }
  1736. });
  1737. },
  1738. pdsubmit() {
  1739. // if (this.bankType == 1) {
  1740. let ansCount = this.questionOverNum(true); //已答题数
  1741. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1742. //没有答完
  1743. if (this.lastCount !== 0) {
  1744. this.cgType = 6;
  1745. this.showpopups = true;
  1746. return;
  1747. }
  1748. // }
  1749. if (this.bankType == 2) {
  1750. if (this.lastTime > 0) {
  1751. let lastTime = this.countdown(this.lastTime);
  1752. uni.showModal({
  1753. title: "提示",
  1754. content: `时间还剩余${lastTime},确定交卷吗?`,
  1755. confirmText: "交卷",
  1756. cancelText: "继续答题",
  1757. success: (res) => {
  1758. if (res.confirm) {
  1759. //确定
  1760. this.submit();
  1761. } else {
  1762. //取消
  1763. }
  1764. },
  1765. });
  1766. return;
  1767. }
  1768. }
  1769. this.submit();
  1770. },
  1771. /**
  1772. * 交卷
  1773. */
  1774. submit(isShowTip = true) {
  1775. let form = this.$method.calculateScore(this.questionList);
  1776. //交卷
  1777. this.$api
  1778. .examRecordEdit({
  1779. examId: this.id,
  1780. goodsId: this.goodsId,
  1781. recordId: this.recordId,
  1782. orderGoodsId: this.orderGoodsId,
  1783. status: 1, // 1是交卷 2是中途离开
  1784. moduleExamId: this.moduleId || 0,
  1785. chapterExamId: this.chapterId || 0,
  1786. examTime: parseInt(this.allTimes),
  1787. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1788. ...form,
  1789. })
  1790. .then((res) => {
  1791. this.isSubmit = true;
  1792. if (res.data.code == 200) {
  1793. this.entryType == "daily" && this.dailyExam();
  1794. if (!isShowTip) {
  1795. return;
  1796. }
  1797. uni.showToast({
  1798. title: "交卷成功",
  1799. duration: 1000,
  1800. icon: "none",
  1801. });
  1802. setTimeout(() => {
  1803. uni.redirectTo({
  1804. url:
  1805. "/pages2/bank/question_report?goodsId=" +
  1806. this.goodsId +
  1807. "&chapterId=" +
  1808. this.chapterId +
  1809. "&moduleId=" +
  1810. this.moduleId +
  1811. "&examId=" +
  1812. this.id +
  1813. "&id=" +
  1814. this.recordId +
  1815. "&orderGoodsId=" +
  1816. this.orderGoodsId +
  1817. "&entryType=" +
  1818. this.entryType +
  1819. "&bankNum=" +
  1820. this.bankNum +
  1821. "&doMode=" +
  1822. this.doMode +
  1823. "&courseType=1",
  1824. });
  1825. }, 1000);
  1826. }
  1827. });
  1828. //错题集id提交(客观题)
  1829. this.$api.examWrongRecord({
  1830. examId: this.id,
  1831. goodsId: this.goodsId,
  1832. orderGoodsId: this.orderGoodsId,
  1833. questionIds: form.questionIds,
  1834. recordId: this.recordId,
  1835. type: 1, // 题库试卷传1
  1836. doMode: this.doMode,
  1837. });
  1838. },
  1839. // 每日一练试卷打卡
  1840. dailyExam() {
  1841. const dateStamp = parseInt(
  1842. new Date(new Date().toLocaleDateString()).getTime() / 1000
  1843. );
  1844. this.$http({
  1845. url: "/bank/question/special/exam/record",
  1846. method: "post",
  1847. data: {
  1848. examId: this.id,
  1849. chapterExamId: this.chapterId, // 章卷ID
  1850. moduleExamId: this.moduleId, //模块卷ID
  1851. goodsId: this.goodsId,
  1852. recordTime: dateStamp, // 传当天0点时间戳(秒)
  1853. },
  1854. }).then((res) => {
  1855. if (res.data.code == 200) {
  1856. }
  1857. });
  1858. },
  1859. /**
  1860. * @param {Object} state
  1861. * @param {Object} index
  1862. * 收藏
  1863. */
  1864. collect(state, index) {
  1865. if (!state) {
  1866. this.$api
  1867. .collectQuestion({
  1868. examId: this.id,
  1869. questionId: this.questionList[index].questionId,
  1870. goodsId: this.goodsId || "",
  1871. orderGoodsId: this.orderGoodsId,
  1872. doMode: this.doMode,
  1873. })
  1874. .then((res) => {
  1875. if (res.data.code == 200) {
  1876. this.$set(this.collectList, index, true);
  1877. uni.showToast({
  1878. title: "收藏成功",
  1879. duration: 2000,
  1880. icon: "none",
  1881. });
  1882. this.getCollectInfo(index);
  1883. }
  1884. });
  1885. } else {
  1886. this.$api
  1887. .deleteCollectQuestion(this.collectList[index].collectQuestionId)
  1888. .then((res) => {
  1889. if (res.data.code == 200) {
  1890. this.$set(this.collectList, index, false);
  1891. uni.showToast({
  1892. title: "取消收藏成功",
  1893. duration: 2000,
  1894. icon: "none",
  1895. });
  1896. }
  1897. });
  1898. }
  1899. return;
  1900. },
  1901. /**
  1902. * @param {Object} imgIndex
  1903. * @param {Object} bankIndex
  1904. * 删除简答图片
  1905. */
  1906. deleteImg(imgIndex, bankIndex) {
  1907. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1908. },
  1909. /**
  1910. * @param {Object} imgIndex
  1911. * @param {Object} bankIndex
  1912. * @param {Object} ansIndex
  1913. * 删除案例题简答图片
  1914. */
  1915. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1916. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1917. imgIndex,
  1918. 1
  1919. );
  1920. },
  1921. /**
  1922. * @param {Object} bankindex
  1923. * 选择上传图片
  1924. */
  1925. chooseImg(bankindex) {
  1926. if (
  1927. this.questionList[bankindex] &&
  1928. this.questionList[bankindex].ansText &&
  1929. this.questionList[bankindex].ansText.imageList.length >= 4
  1930. ) {
  1931. uni.showToast({
  1932. icon: "none",
  1933. title: "最多选择4张",
  1934. });
  1935. return;
  1936. }
  1937. uni.chooseImage({
  1938. count: 1, //默认9
  1939. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1940. sourceType: ["album", "camera"], //从相册选择
  1941. success: (res) => {
  1942. let self = this;
  1943. // console.log(JSON.stringify(res.tempFilePaths));
  1944. let img = res.tempFilePaths[0];
  1945. uni.getImageInfo({
  1946. src: img,
  1947. success: async (res) => {
  1948. let canvasWidth = res.width; //图片原始长宽
  1949. let canvasHeight = res.height;
  1950. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1951. uni.compressImage({
  1952. src: img,
  1953. quality: 75,
  1954. width: "50%",
  1955. height: "50%",
  1956. success: async (rest) => {
  1957. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1958. this.questionList[bankindex].ansText.imageList.push(dir);
  1959. },
  1960. });
  1961. } else {
  1962. const dir = await self.uploadFile(img, 0);
  1963. this.questionList[bankindex].ansText.imageList.push(dir);
  1964. }
  1965. },
  1966. });
  1967. },
  1968. });
  1969. },
  1970. /**
  1971. * @param {Object} bankindex
  1972. * @param {Object} ansindex
  1973. * 案例题选择上传图片
  1974. */
  1975. chooseImgChild(bankindex, ansindex) {
  1976. if (
  1977. this.questionList[bankindex].jsonStr[ansindex] &&
  1978. this.questionList[bankindex].jsonStr[ansindex].ansText &&
  1979. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList
  1980. .length >= 4
  1981. ) {
  1982. uni.showToast({
  1983. icon: "none",
  1984. title: "最多选择4张",
  1985. });
  1986. return;
  1987. }
  1988. uni.chooseImage({
  1989. count: 1, //默认9
  1990. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1991. sourceType: ["album", "camera"], //从相册选择
  1992. success: (res) => {
  1993. let self = this;
  1994. // console.log(JSON.stringify(res.tempFilePaths));
  1995. let img = res.tempFilePaths[0];
  1996. uni.getImageInfo({
  1997. src: img,
  1998. success: async (res) => {
  1999. let canvasWidth = res.width; //图片原始长宽
  2000. let canvasHeight = res.height;
  2001. if (canvasWidth > 1000 || canvasHeight > 1000) {
  2002. uni.compressImage({
  2003. src: img,
  2004. quality: 75,
  2005. width: "50%",
  2006. height: "50%",
  2007. success: async (rest) => {
  2008. const dir = await self.uploadFile(rest.tempFilePath, 0);
  2009. this.questionList[bankindex].jsonStr[
  2010. ansindex
  2011. ].ansText.imageList.push(dir);
  2012. },
  2013. });
  2014. } else {
  2015. const dir = await self.uploadFile(img, 0);
  2016. this.questionList[bankindex].jsonStr[
  2017. ansindex
  2018. ].ansText.imageList.push(dir);
  2019. }
  2020. },
  2021. });
  2022. },
  2023. });
  2024. },
  2025. uploadFile(options, int) {
  2026. var self = this;
  2027. return new Promise((resolve, reject) => {
  2028. var data = {
  2029. orderGoodsId: this.orderGoodsId,
  2030. imageStatus: int,
  2031. };
  2032. self.$api.aliyunpolicy(data).then((res) => {
  2033. console.log(res.data, 6);
  2034. if (res.data.code != 200) {
  2035. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2036. return;
  2037. }
  2038. var ossToken = res.data.data.resultContent;
  2039. if (ossToken.host == null || ossToken.host == undefined) {
  2040. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2041. return;
  2042. }
  2043. uni.uploadFile({
  2044. url: ossToken.host,
  2045. name: "file",
  2046. filePath: options,
  2047. fileType: "image",
  2048. header: {
  2049. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2050. },
  2051. formData: {
  2052. key: ossToken.dir,
  2053. OSSAccessKeyId: ossToken.accessid,
  2054. policy: ossToken.policy,
  2055. Signature: ossToken.signature,
  2056. callback: ossToken.callback,
  2057. success_action_status: 200,
  2058. },
  2059. success: (result) => {
  2060. // if (result.statusCode === 200) {
  2061. resolve(ossToken.dir);
  2062. // } else {
  2063. // uni.showToast({
  2064. // title: "上传失败",
  2065. // icon: "none",
  2066. // });
  2067. // return;
  2068. // }
  2069. },
  2070. fail: (error) => {
  2071. uni.showToast({
  2072. title: "上传接口报错" + error,
  2073. icon: "none",
  2074. });
  2075. return;
  2076. },
  2077. });
  2078. });
  2079. });
  2080. },
  2081. /**
  2082. * @param {Object} type
  2083. * @param {Object} bankindex
  2084. * 简答题答案确认
  2085. */
  2086. submitAns(bankindex) {
  2087. if (
  2088. !this.questionList[bankindex].ansText.text &&
  2089. !this.questionList[bankindex].ansText.imageList.length
  2090. ) {
  2091. uni.showToast({
  2092. title: "请输入内容或上传图片",
  2093. duration: 2000,
  2094. icon: "none",
  2095. });
  2096. return;
  2097. }
  2098. this.$set(this.questionList[bankindex], "ques", {
  2099. imageList: this.questionList[bankindex].ansText.imageList || [],
  2100. text: this.questionList[bankindex].ansText.text || "",
  2101. });
  2102. this.$u.toast("已确认答案");
  2103. this.isDoOver();
  2104. },
  2105. /**
  2106. * @param {Object} bankindex
  2107. * @param {Object} ansindex
  2108. * 案例题简答答案确认
  2109. */
  2110. submitAnsChild(bankindex, ansindex) {
  2111. if (
  2112. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  2113. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  2114. ) {
  2115. uni.showToast({
  2116. title: "请输入内容或上传图片",
  2117. duration: 2000,
  2118. icon: "none",
  2119. });
  2120. return;
  2121. }
  2122. this.$set(this.questionList[bankindex].ques, ansindex, {
  2123. imageList:
  2124. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList ||
  2125. [],
  2126. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || "",
  2127. });
  2128. this.$u.toast("已确认答案");
  2129. this.isDoOver();
  2130. },
  2131. isCheck(item, index) {
  2132. // 案例题处理
  2133. let { ques, type, ans } = item;
  2134. if (type == 4) {
  2135. return ans.length == ques.length;
  2136. }
  2137. if (ques) {
  2138. return true;
  2139. }
  2140. },
  2141. isRight(item, index) {
  2142. //单选
  2143. if (this.questionList[index].ques) {
  2144. if (item.type == 1) {
  2145. return this.questionList[index].ques == this.questionList[index].ans;
  2146. //多选
  2147. } else if (item.type == 2) {
  2148. //每一项都相等
  2149. return this.questionList[index].ans.every((item, i) => {
  2150. return item == this.questionList[index].ques[i];
  2151. });
  2152. //判断
  2153. } else if (item.type == 3) {
  2154. return this.questionList[index].ques == this.questionList[index].ans;
  2155. // } else if (item.type == 5) {
  2156. // if(this.questionList[index].ques.text){
  2157. // return true
  2158. // }else{
  2159. // return false
  2160. // }
  2161. } else {
  2162. return false;
  2163. }
  2164. } else {
  2165. return false;
  2166. }
  2167. },
  2168. right(bankIndex, ansIndex, option) {
  2169. if (
  2170. this.questionList[bankIndex].ques[ansIndex] &&
  2171. this.questionList[bankIndex].ans[ansIndex]
  2172. ) {
  2173. if (
  2174. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2175. option.optionsId
  2176. ) != -1 ||
  2177. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2178. option.optionsId
  2179. ) != -1
  2180. ) {
  2181. return true;
  2182. } else {
  2183. return false;
  2184. }
  2185. } else {
  2186. return false;
  2187. }
  2188. },
  2189. wrong(bankIndex, ansIndex, option) {
  2190. if (
  2191. this.questionList[bankIndex].ques[ansIndex] &&
  2192. this.questionList[bankIndex].ans[ansIndex]
  2193. ) {
  2194. if (
  2195. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2196. option.optionsId
  2197. ) != -1 &&
  2198. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2199. option.optionsId
  2200. ) == -1
  2201. ) {
  2202. return true;
  2203. } else {
  2204. return false;
  2205. }
  2206. } else {
  2207. return false;
  2208. }
  2209. },
  2210. isWrong(item, index) {
  2211. if (this.questionList[index].ques) {
  2212. //单选
  2213. if (item.type == 1) {
  2214. return this.questionList[index].ques != this.questionList[index].ans;
  2215. //多选
  2216. } else if (item.type == 2) {
  2217. //每一项都相等
  2218. return this.questionList[index].ques.some((item, i) => {
  2219. return this.questionList[index].ans.indexOf(item) == -1;
  2220. });
  2221. //判断
  2222. } else if (item.type == 3) {
  2223. return this.questionList[index].ques != this.questionList[index].ans;
  2224. } else {
  2225. return false;
  2226. }
  2227. } else {
  2228. return false;
  2229. }
  2230. },
  2231. isPart(item, index) {
  2232. if (this.questionList[index].ques) {
  2233. if (item.type == 2) {
  2234. let isWrong = this.questionList[index].ques.some((item, i) => {
  2235. return this.questionList[index].ans.indexOf(item) == -1;
  2236. });
  2237. let isRight = this.questionList[index].ans.every((item, i) => {
  2238. return item == this.questionList[index].ques[i];
  2239. });
  2240. if (!isRight && !isWrong) {
  2241. return true;
  2242. }
  2243. }
  2244. } else {
  2245. return false;
  2246. }
  2247. },
  2248. isOver(item, index) {
  2249. if (this.questionList[index].ques) {
  2250. if (item.type == 4) {
  2251. //案例题
  2252. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  2253. if (
  2254. jsonItem.type == 1 ||
  2255. jsonItem.type == 2 ||
  2256. jsonItem.type == 3
  2257. ) {
  2258. if (item.ques[indexs]) {
  2259. return true;
  2260. } else {
  2261. return false;
  2262. }
  2263. } else if (jsonItem.type == 5) {
  2264. if (
  2265. item.ques[indexs] &&
  2266. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  2267. ) {
  2268. console.log("chil");
  2269. return true;
  2270. } else {
  2271. return false;
  2272. }
  2273. }
  2274. });
  2275. if (isOver) {
  2276. return true;
  2277. } else {
  2278. return false;
  2279. }
  2280. } else if (item.type == 5) {
  2281. //简答题
  2282. //每一项都相等
  2283. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  2284. return true;
  2285. }
  2286. //判断
  2287. } else {
  2288. return false;
  2289. }
  2290. } else {
  2291. return false;
  2292. }
  2293. },
  2294. tabSelect(index, bankindex) {
  2295. this.$set(this.questionList[bankindex], "current", index);
  2296. },
  2297. showPhoto(contentStr) {
  2298. if (contentStr && typeof contentStr == "string") {
  2299. let reg = /<img[^>]*src[=\'\"\s]+([^\'\"]*)[\'\"]?[^>]*>/gi;
  2300. let strArr = contentStr.match(reg);
  2301. strArr.forEach((str, index) => {
  2302. strArr[index] = str.replace(reg, "$1");
  2303. });
  2304. // 预览图片
  2305. uni.previewImage({
  2306. urls: strArr,
  2307. longPressActions: {
  2308. itemList: ["发送给朋友", "保存图片", "收藏"],
  2309. success: function (data) {
  2310. console.log(
  2311. "选中了第" +
  2312. (data.tapIndex + 1) +
  2313. "个按钮,第" +
  2314. (data.index + 1) +
  2315. "张图片"
  2316. );
  2317. },
  2318. fail: function (err) {
  2319. console.log(err.errMsg);
  2320. },
  2321. },
  2322. });
  2323. }
  2324. },
  2325. },
  2326. computed: {
  2327. doMode() {
  2328. // 做题模式 1章卷 2随机练习 3模拟组卷
  2329. return this.examData.simulateStatus
  2330. ? 3
  2331. : this.entryType == "random"
  2332. ? 2
  2333. : 1;
  2334. },
  2335. },
  2336. };
  2337. </script>
  2338. <style lang="scss" scoped>
  2339. .questionBank {
  2340. width: 100%;
  2341. height: 100vh;
  2342. display: flex;
  2343. flex-direction: column;
  2344. }
  2345. .swiper {
  2346. width: 100%;
  2347. flex: 1;
  2348. }
  2349. .lisSty {
  2350. margin-bottom: 16rpx;
  2351. display: flex;
  2352. align-items: center;
  2353. .flex_auto {
  2354. word-break: break-all;
  2355. flex: 1;
  2356. }
  2357. }
  2358. .activeTI {
  2359. vertical-align: middle;
  2360. display: inline-block;
  2361. border: 1rpx solid #eee;
  2362. border-radius: 50rpx;
  2363. height: 48rpx;
  2364. line-height: 46rpx;
  2365. text-align: center;
  2366. width: 48rpx;
  2367. margin-right: 15rpx;
  2368. color: #666;
  2369. font-size: 30rpx;
  2370. &.right {
  2371. color: #fff;
  2372. background: #36c75a;
  2373. }
  2374. &.wrong {
  2375. color: #fff;
  2376. background: #ff3b30;
  2377. }
  2378. &.checked,
  2379. &.user_choose {
  2380. color: #fff;
  2381. background: #007aff;
  2382. }
  2383. }
  2384. .submit_checkbox {
  2385. position: fixed;
  2386. left: 0;
  2387. right: 0;
  2388. bottom: 120rpx;
  2389. margin: 20rpx auto;
  2390. width: 526rpx;
  2391. height: 80rpx;
  2392. background: rgba(0, 122, 255, 1);
  2393. color: #fff;
  2394. text-align: center;
  2395. line-height: 80rpx;
  2396. font-size: 30rpx;
  2397. border-radius: 40rpx;
  2398. &.disabled {
  2399. opacity: 0.6;
  2400. }
  2401. }
  2402. .titles {
  2403. overflow: hidden;
  2404. margin-bottom: 24rpx;
  2405. }
  2406. .titBox {
  2407. padding: 41rpx 25rpx 24rpx 25rpx;
  2408. }
  2409. .titBox_title {
  2410. padding: 21rpx;
  2411. }
  2412. .tabs {
  2413. margin: 10rpx;
  2414. display: flex;
  2415. .tab {
  2416. margin: 0 4rpx;
  2417. padding: 10rpx 13rpx;
  2418. text-align: center;
  2419. color: #007aff;
  2420. font-size: 28rpx;
  2421. border-radius: 16rpx;
  2422. background: #fff;
  2423. &.current {
  2424. color: #fff;
  2425. background: #007aff;
  2426. }
  2427. }
  2428. }
  2429. .ans {
  2430. margin: 8rpx 8rpx 8rpx;
  2431. .ans_input {
  2432. border-radius: 16rpx;
  2433. background: #fff;
  2434. .top {
  2435. border-bottom: 1rpx solid #eeeeee;
  2436. padding: 16rpx;
  2437. display: flex;
  2438. align-items: center;
  2439. .icon {
  2440. margin-right: 20rpx;
  2441. width: 40rpx;
  2442. height: 38rpx;
  2443. }
  2444. .progress {
  2445. flex: 1;
  2446. }
  2447. .submit {
  2448. width: 168rpx;
  2449. height: 48rpx;
  2450. line-height: 48rpx;
  2451. text-align: center;
  2452. color: #fff;
  2453. font-size: 30rpx;
  2454. background: #007aff;
  2455. border-radius: 24rpx;
  2456. &.disabled {
  2457. opacity: 0.6;
  2458. }
  2459. }
  2460. }
  2461. .textarea {
  2462. textarea {
  2463. width: 100%;
  2464. height: 287rpx;
  2465. padding: 10rpx;
  2466. }
  2467. }
  2468. .imgs {
  2469. overflow: hidden;
  2470. display: flex;
  2471. width: 100%;
  2472. .img {
  2473. width: 104rpx;
  2474. height: 104rpx;
  2475. border-radius: 8rpx;
  2476. position: relative;
  2477. margin: 20rpx;
  2478. text {
  2479. position: absolute;
  2480. right: -15rpx;
  2481. top: -15rpx;
  2482. width: 30rpx;
  2483. height: 30rpx;
  2484. text-align: center;
  2485. line-height: 30rpx;
  2486. color: #fff;
  2487. background: #ff3b30;
  2488. border-radius: 50%;
  2489. }
  2490. image {
  2491. width: 100%;
  2492. height: 100%;
  2493. }
  2494. }
  2495. }
  2496. }
  2497. .ans_submit {
  2498. padding: 16rpx;
  2499. border-radius: 16rpx;
  2500. background: #fff;
  2501. .imgs {
  2502. overflow: hidden;
  2503. display: flex;
  2504. width: 100%;
  2505. .img {
  2506. width: 104rpx;
  2507. height: 104rpx;
  2508. border-radius: 8rpx;
  2509. position: relative;
  2510. margin: 20rpx;
  2511. image {
  2512. width: 100%;
  2513. height: 100%;
  2514. }
  2515. }
  2516. }
  2517. }
  2518. }
  2519. .leftLetters {
  2520. display: flex;
  2521. align-items: center;
  2522. width: 220rpx;
  2523. .btnType {
  2524. padding: 5rpx 10rpx;
  2525. border: 1rpx solid #007aff;
  2526. border-radius: 10rpx;
  2527. background-color: rgba(0, 122, 255, 0.1);
  2528. font-size: 28rpx;
  2529. color: #007aff;
  2530. margin-right: 15rpx;
  2531. }
  2532. }
  2533. .firstLetter {
  2534. display: flex;
  2535. justify-content: space-between;
  2536. align-items: center;
  2537. margin-bottom: 30rpx;
  2538. }
  2539. .popupView {
  2540. height: 100%;
  2541. padding-bottom: 100rpx;
  2542. .popupTops {
  2543. height: 77rpx;
  2544. border-bottom: 1rpx solid #eee;
  2545. text-align: center;
  2546. line-height: 77rpx;
  2547. font-size: 24rpx;
  2548. color: #999;
  2549. position: relative;
  2550. .topIcon {
  2551. position: absolute;
  2552. top: 10rpx;
  2553. left: 50%;
  2554. transform: translateX(-50%);
  2555. width: 80rpx;
  2556. height: 8rpx;
  2557. background-color: #999;
  2558. border-radius: 4rpx;
  2559. }
  2560. }
  2561. .popupContent {
  2562. }
  2563. }
  2564. .pageContent {
  2565. position: relative;
  2566. background-color: #eaeef1;
  2567. height: 100%;
  2568. padding-top: 8rpx;
  2569. padding-bottom: 100rpx;
  2570. overflow-y: scroll;
  2571. }
  2572. .pad_8 {
  2573. background-color: #fff;
  2574. margin: 0rpx 8rpx 8rpx;
  2575. border-radius: 16rpx;
  2576. &.no-margin {
  2577. margin-top: -16rpx;
  2578. border-radius: 0 0 16rpx 16rpx;
  2579. }
  2580. }
  2581. .answer {
  2582. height: 80rpx;
  2583. line-height: 80rpx;
  2584. padding: 0rpx 24rpx;
  2585. display: flex;
  2586. align-items: center;
  2587. justify-content: space-between;
  2588. color: #666;
  2589. font-size: 30rpx;
  2590. }
  2591. .footer_btn {
  2592. background-color: #fff;
  2593. z-index: 10078;
  2594. position: fixed;
  2595. bottom: 0rpx;
  2596. display: flex;
  2597. align-items: center;
  2598. justify-content: space-between;
  2599. width: 100%;
  2600. height: 98rpx;
  2601. padding: 0rpx 38rpx;
  2602. border-top: 1rpx solid #eee;
  2603. .flex_center {
  2604. flex: 1;
  2605. display: flex;
  2606. justify-content: center;
  2607. align-items: center;
  2608. flex-direction: column;
  2609. margin: 0 200rpx;
  2610. font-size: 24rpx;
  2611. color: #999999;
  2612. .up-icon {
  2613. margin-bottom: 18rpx;
  2614. width: 100%;
  2615. display: flex;
  2616. justify-content: center;
  2617. image {
  2618. width: 58rpx;
  2619. height: 21rpx;
  2620. }
  2621. }
  2622. }
  2623. .collect {
  2624. visibility: hidden;
  2625. width: 100rpx;
  2626. &.show {
  2627. visibility: visible;
  2628. }
  2629. > view {
  2630. display: flex;
  2631. flex-direction: column;
  2632. align-items: center;
  2633. justify-content: center;
  2634. image {
  2635. width: 32rpx;
  2636. height: 32rpx;
  2637. margin-bottom: 6rpx;
  2638. }
  2639. view {
  2640. font-size: 24rpx;
  2641. color: #999999;
  2642. }
  2643. }
  2644. }
  2645. }
  2646. .boxSty {
  2647. padding: 44rpx 41rpx 0rpx;
  2648. }
  2649. .liListSty {
  2650. border: 1rpx solid #eeeeee;
  2651. width: 88rpx;
  2652. height: 88rpx;
  2653. border-radius: 32rpx;
  2654. text-align: center;
  2655. line-height: 88rpx;
  2656. color: #333;
  2657. font-size: 32rpx;
  2658. float: left;
  2659. margin: 20rpx 23rpx;
  2660. &.isRight {
  2661. border: 1rpx solid #eeeeee;
  2662. color: #fff;
  2663. background: #36c75a;
  2664. }
  2665. &.isWrong {
  2666. border: 1rpx solid #eeeeee;
  2667. color: #fff;
  2668. background: #ff3b30;
  2669. }
  2670. &.isPart {
  2671. border: 1rpx solid #eeeeee;
  2672. color: #fff;
  2673. background: #ffc53d;
  2674. }
  2675. &.isOver {
  2676. border: 1rpx solid #eeeeee;
  2677. color: #fff;
  2678. background: blue;
  2679. }
  2680. &.check_ans {
  2681. border: 1rpx solid #eeeeee;
  2682. color: #fff;
  2683. background: #007aff;
  2684. }
  2685. }
  2686. .answerInfos {
  2687. padding: 25rpx 25rpx 25rpx 23rpx;
  2688. }
  2689. .answerTitle {
  2690. margin-bottom: 28rpx;
  2691. color: #666;
  2692. font-size: 30rpx;
  2693. }
  2694. .answerContent {
  2695. font-size: 30rpx;
  2696. color: #666;
  2697. }
  2698. .textChild {
  2699. display: inline-block;
  2700. vertical-align: middle;
  2701. }
  2702. .dialog {
  2703. position: fixed;
  2704. left: 0;
  2705. top: 0;
  2706. width: 100%;
  2707. height: 100%;
  2708. background-color: rgba(0, 0, 0, 0.8);
  2709. display: flex;
  2710. flex-direction: column;
  2711. align-items: center;
  2712. justify-content: center;
  2713. z-index: 20000;
  2714. .pointer {
  2715. width: 338rpx;
  2716. height: 240rpx;
  2717. }
  2718. .text {
  2719. font-size: 32rpx;
  2720. color: #ffffff;
  2721. text-align: center;
  2722. }
  2723. .btn {
  2724. width: 242rpx;
  2725. height: 82rpx;
  2726. border: 2rpx solid #ffffff;
  2727. border-radius: 16rpx;
  2728. text-align: center;
  2729. line-height: 82rpx;
  2730. margin: 41rpx auto;
  2731. color: #fff;
  2732. font-size: 32rpx;
  2733. }
  2734. }
  2735. .dialog-arrow {
  2736. padding-top: 124rpx;
  2737. position: fixed;
  2738. left: 0;
  2739. top: 0;
  2740. width: 100%;
  2741. height: 100%;
  2742. background-color: rgba(0, 0, 0, 0.8);
  2743. z-index: 20000;
  2744. .pointer {
  2745. margin-left: 87rpx;
  2746. display: block;
  2747. width: 95rpx;
  2748. height: 98rpx;
  2749. }
  2750. .text {
  2751. padding-left: 177rpx;
  2752. font-size: 32rpx;
  2753. color: #ffffff;
  2754. }
  2755. .btn {
  2756. width: 242rpx;
  2757. height: 82rpx;
  2758. border: 2rpx solid #ffffff;
  2759. border-radius: 16rpx;
  2760. text-align: center;
  2761. line-height: 82rpx;
  2762. margin: 500rpx auto 0;
  2763. color: #fff;
  2764. font-size: 32rpx;
  2765. }
  2766. }
  2767. .dialog_wrap {
  2768. position: fixed;
  2769. left: 0;
  2770. top: 0;
  2771. width: 100%;
  2772. height: 100%;
  2773. z-index: 9999999999;
  2774. .bg {
  2775. background: rgba(0, 0, 0, 0.3);
  2776. position: absolute;
  2777. left: 0;
  2778. top: 0;
  2779. width: 100%;
  2780. height: 100%;
  2781. }
  2782. .dialog {
  2783. position: absolute;
  2784. left: 50%;
  2785. top: 50%;
  2786. transform: translate3D(-50%, -50%, 0);
  2787. width: 640rpx;
  2788. height: 439rpx;
  2789. background: #ffffff;
  2790. border-radius: 24rpx;
  2791. .title {
  2792. font-size: 30rpx;
  2793. font-weight: bold;
  2794. color: #333333;
  2795. line-height: 48rpx;
  2796. text-align: center;
  2797. margin-top: 40rpx;
  2798. }
  2799. .content {
  2800. margin: 35rpx 35rpx 0;
  2801. font-size: 30rpx;
  2802. color: #666666;
  2803. line-height: 48rpx;
  2804. }
  2805. .btns {
  2806. margin-top: 35rpx;
  2807. display: flex;
  2808. align-items: center;
  2809. justify-content: center;
  2810. .btn {
  2811. width: 200rpx;
  2812. height: 80rpx;
  2813. line-height: 80rpx;
  2814. text-align: center;
  2815. background: #f5f5f5;
  2816. border-radius: 40rpx;
  2817. font-size: 30rpx;
  2818. color: rgba(0, 122, 255, 1);
  2819. background: #f5f5f5;
  2820. margin: 0 20rpx;
  2821. &.active {
  2822. color: #f5f5f5;
  2823. background: rgba(0, 122, 255, 1);
  2824. }
  2825. }
  2826. }
  2827. }
  2828. }
  2829. .popboxs {
  2830. width: 100%;
  2831. height: 100%;
  2832. display: flex;
  2833. flex-direction: column;
  2834. align-items: center;
  2835. }
  2836. .classTops {
  2837. flex-shrink: 0;
  2838. padding: 39rpx 0rpx 4rpx;
  2839. font-weight: bold;
  2840. color: #333;
  2841. font-size: 30rpx;
  2842. }
  2843. .textStys {
  2844. width: 100%;
  2845. flex: 1;
  2846. padding: 36rpx;
  2847. }
  2848. .classFootsty {
  2849. flex-shrink: 0;
  2850. display: flex;
  2851. align-items: center;
  2852. justify-content: center;
  2853. padding: 10rpx 0rpx 40rpx;
  2854. .btnsty {
  2855. width: 200rpx;
  2856. height: 80rpx;
  2857. border-radius: 40rpx;
  2858. font-weight: bold;
  2859. font-size: 30rpx;
  2860. text-align: center;
  2861. line-height: 80rpx;
  2862. }
  2863. .btns1 {
  2864. background-color: #f5f5f5;
  2865. color: #007aff;
  2866. }
  2867. .btns2 {
  2868. margin-left: 40rpx;
  2869. background-color: #007aff;
  2870. color: #ffffff;
  2871. }
  2872. }
  2873. </style>