index.vue 74 KB

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