index.vue 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524
  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 } 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. this.bankType = doType;
  991. this.examData = res.data.data;
  992. if (this.bankType == 2) {
  993. this.needBack = true;
  994. }
  995. resolve();
  996. });
  997. });
  998. },
  999. /**
  1000. * 点击后退按钮
  1001. */
  1002. clickLeft() {
  1003. if (this.bankType == 1) {
  1004. let ansCount = this.questionOverNum(true); //已答题数
  1005. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1006. //所有题目答完
  1007. if (this.lastCount == 0) {
  1008. // this.testOver = true;
  1009. this.cgType = 7;
  1010. //未答完
  1011. } else {
  1012. this.cgType = 8;
  1013. // this.isLastCount = true;
  1014. }
  1015. this.showpopups = true;
  1016. } else if (this.bankType == 2) {
  1017. let ansCount = this.questionOverNum(true); //已答题数
  1018. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1019. //所有题目答完
  1020. if (this.lastCount == 0) {
  1021. this.testOver = true;
  1022. //未答完
  1023. } else {
  1024. this.isLastCount = true;
  1025. }
  1026. }
  1027. },
  1028. /**
  1029. * 返回上一页
  1030. */
  1031. backPages() {
  1032. this.needBack = false;
  1033. uni.navigateBack({
  1034. delta: 1,
  1035. });
  1036. },
  1037. /**
  1038. * 获取已经回答的题目数
  1039. * hasSpecail (是否包含简答和案例)
  1040. */
  1041. questionOverNum(hasSpecail) {
  1042. let count = 0;
  1043. this.questionList.forEach((item) => {
  1044. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1045. if (item.ques) {
  1046. count++;
  1047. }
  1048. } else if (item.type == 4) {
  1049. //案例题
  1050. if (hasSpecail) {
  1051. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1052. if (
  1053. jsonItem.type == 1 ||
  1054. jsonItem.type == 2 ||
  1055. jsonItem.type == 3
  1056. ) {
  1057. if (item.ques[indexs]) {
  1058. return true;
  1059. } else {
  1060. return false;
  1061. }
  1062. } else if (jsonItem.type == 5) {
  1063. if (
  1064. item.ques[indexs] &&
  1065. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1066. ) {
  1067. console.log("chil");
  1068. return true;
  1069. } else {
  1070. return false;
  1071. }
  1072. }
  1073. });
  1074. if (isOver) {
  1075. count++;
  1076. console.log(item, 444);
  1077. }
  1078. }
  1079. } else if (item.type == 5) {
  1080. //简答题
  1081. if (hasSpecail) {
  1082. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1083. console.log(5, item);
  1084. count++;
  1085. }
  1086. }
  1087. }
  1088. });
  1089. return count;
  1090. },
  1091. mockSubscribeEdit() {
  1092. this.$api
  1093. .mockSubscribeEdit({
  1094. subscribeId: this.subscribeId,
  1095. handStatus: this.isAutoSubmit ? 2 : 1,
  1096. })
  1097. .then((res) => {});
  1098. },
  1099. /**
  1100. * 是否做完所有题目
  1101. */
  1102. isDoOver() {
  1103. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1104. if (this.questionList.length == questionOverNum) {
  1105. //全部做完弹窗
  1106. this.cgType = 9;
  1107. this.showpopups = true;
  1108. }
  1109. },
  1110. /**
  1111. * 暂不交卷
  1112. */
  1113. noSubmit() {
  1114. //设为允许退出页面
  1115. this.needBack = false;
  1116. uni.navigateBack({
  1117. delta: 1,
  1118. });
  1119. },
  1120. /**
  1121. * 不离开
  1122. */
  1123. noLeave() {
  1124. this.isLastCount = false;
  1125. },
  1126. /**
  1127. * 立即离开并交卷
  1128. */
  1129. leaveNow() {
  1130. this.needBack = false;
  1131. this.isSubmit = true;
  1132. this.submit(false);
  1133. uni.navigateBack({
  1134. delta: 1,
  1135. });
  1136. },
  1137. /**
  1138. * 立即交卷
  1139. */
  1140. submitNow() {
  1141. console.log("sds");
  1142. this.showpopups = false;
  1143. this.needBack = false;
  1144. this.submit();
  1145. },
  1146. /**
  1147. * 离开页面统计回答正确题数
  1148. */
  1149. mockRecordEdit() {
  1150. if (!this.isSubmit) {
  1151. if (this.subscribeId) {
  1152. this.mockSubscribeEdit();
  1153. }
  1154. let {
  1155. doQuestionNum,
  1156. doQuestionIds,
  1157. rightQuestionNum,
  1158. historyExamJson,
  1159. } = this.$method.calculateScore(this.questionList);
  1160. this.$api
  1161. .mockRecordEdit({
  1162. examId: this.examId,
  1163. eachExamId: this.eachExamId,
  1164. goodsId: this.goodsId,
  1165. recordId: this.recordId,
  1166. doQuestionIds,
  1167. rightQuestionNum,
  1168. status: 1,
  1169. doQuestionNum,
  1170. historyExamJson,
  1171. })
  1172. .then((res) => {});
  1173. }
  1174. },
  1175. /**
  1176. * 记录总题数
  1177. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1178. */
  1179. mockRecord(hasSpecial) {
  1180. let questionList = 0;
  1181. // if(!hasSpecial) {
  1182. this.questionList.forEach((item, index) => {
  1183. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1184. questionList++;
  1185. }
  1186. });
  1187. // } else {
  1188. // questionList = this.questionList.length;
  1189. // }
  1190. this.$api
  1191. .mockRecord({
  1192. examId: this.examId,
  1193. eachExamId: this.eachExamId,
  1194. totalQuestionNum: questionList,
  1195. allQuestionNum: this.questionList.length,
  1196. doMode: this.doMode,
  1197. simulateExamId: this.simulateExamId,
  1198. })
  1199. .then((res) => {
  1200. this.recordId = res.data.data;
  1201. //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
  1202. });
  1203. },
  1204. /**
  1205. * @param {Object} second倒计时过滤器
  1206. */
  1207. countdown(second) {
  1208. if (second) {
  1209. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  1210. let m = parseInt((second / 60) % 60); // 计算分数
  1211. let s = parseInt(second % 60); // 计算当前秒数
  1212. if (h < 10) h = "0" + h;
  1213. if (m < 10) m = "0" + m;
  1214. if (s < 10) s = "0" + s;
  1215. return h + ":" + m + ":" + s;
  1216. } else {
  1217. return "";
  1218. }
  1219. },
  1220. hideDialog() {
  1221. this.showDialog = false;
  1222. },
  1223. noListTip(content = "该试卷暂无题目") {
  1224. this.hideDialog();
  1225. uni.showModal({
  1226. showCancel: false,
  1227. content,
  1228. success: (k) => {
  1229. if (k.confirm) {
  1230. this.isSubmit = true;
  1231. uni.navigateBack();
  1232. }
  1233. },
  1234. });
  1235. },
  1236. /**
  1237. * 请求题目列表
  1238. */
  1239. goodsQuestionList() {
  1240. // app/common/bank/question/list
  1241. this.$api[
  1242. this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
  1243. ]({
  1244. examId: this.examId,
  1245. goodsId: this.goodsId,
  1246. orderGoodsId: this.orderGoodsId,
  1247. from: 3,
  1248. }).then((res) => {
  1249. if (res.data.code == 500) {
  1250. return this.noListTip("你已完成所有题目");
  1251. }
  1252. let data = res.data.data;
  1253. if (this.doMode == 3) {
  1254. this.simulateExamId = data.simulateExamId;
  1255. data = data.questionList;
  1256. }
  1257. if (!data.length) {
  1258. return this.noListTip();
  1259. }
  1260. if (this.subscribeId) {
  1261. this.lastTime = this.examEndTime - this.sysTime;
  1262. //考试时间到了自动交卷
  1263. if (this.lastTime) {
  1264. this.timer = setInterval(() => {
  1265. if (this.lastTime <= 0) {
  1266. clearInterval(this.timer);
  1267. uni.showToast({
  1268. icon: "none",
  1269. mask: true,
  1270. title: "考试时间已到,系统将自动交卷",
  1271. duration: 5000,
  1272. });
  1273. this.isAutoSubmit = true;
  1274. this.submit();
  1275. return;
  1276. }
  1277. this.lastTime--;
  1278. }, 1000);
  1279. } else {
  1280. }
  1281. }
  1282. data.forEach((item, index) => {
  1283. // if (typeof item.jsonStr == 'string') {
  1284. item.jsonStr = JSON.parse(item.jsonStr);
  1285. if (item.type == 2) {
  1286. //多选
  1287. item.jsonStr.forEach((str) => {
  1288. str.optionsId = "" + str.optionsId;
  1289. });
  1290. let arr = item.answerQuestion.split(",");
  1291. arr.forEach((a, i) => {
  1292. arr[i] = "" + a;
  1293. });
  1294. item.ans = arr;
  1295. item.analysisContent &&
  1296. (item.analysisContent = item.analysisContent.replace(
  1297. /<img/gi,
  1298. '<img style="max-width:100%;"'
  1299. ));
  1300. item.content &&
  1301. (item.content = item.content.replace(
  1302. /<img/gi,
  1303. '<img style="max-width:100%;"'
  1304. ));
  1305. return;
  1306. } else if (item.type == 5) {
  1307. //简答题
  1308. item.ansText = {
  1309. text: "",
  1310. imageList: [],
  1311. };
  1312. item.ques = {
  1313. text: "",
  1314. imageList: [],
  1315. };
  1316. item.analysisContent &&
  1317. (item.analysisContent = item.analysisContent.replace(
  1318. /<img/gi,
  1319. '<img style="max-width:100%;"'
  1320. ));
  1321. item.content &&
  1322. (item.content = item.content.replace(
  1323. /<img/gi,
  1324. '<img style="max-width:100%;"'
  1325. ));
  1326. } else if (item.type == 4) {
  1327. //案例题
  1328. item.ques = [];
  1329. item.current = 0;
  1330. let ansArr = [];
  1331. item.jsonStr.forEach((json, index) => {
  1332. if (json.type == 1) {
  1333. ansArr[index] = json.answerQuestion;
  1334. json.content &&
  1335. (json.content = json.content.replace(
  1336. /<img/gi,
  1337. '<img style="max-width:100%;"'
  1338. ));
  1339. } else if (json.type == 2) {
  1340. json.optionsList.forEach((str) => {
  1341. str.optionsId = "" + str.optionsId;
  1342. });
  1343. let arr = json.answerQuestion.split(",");
  1344. arr.forEach((a, i) => {
  1345. arr[i] = "" + a;
  1346. });
  1347. ansArr[index] = arr;
  1348. json.content &&
  1349. (json.content = json.content.replace(
  1350. /<img/gi,
  1351. '<img style="max-width:100%;"'
  1352. ));
  1353. } else if (json.type == 3) {
  1354. ansArr[index] = json.answerQuestion;
  1355. json.content &&
  1356. (json.content = json.content.replace(
  1357. /<img/gi,
  1358. '<img style="max-width:100%;"'
  1359. ));
  1360. } else if (json.type == 5) {
  1361. ansArr[index] = {
  1362. text: json.answerQuestion,
  1363. imageList: [],
  1364. };
  1365. json.ansText = {
  1366. text: "",
  1367. imageList: [],
  1368. };
  1369. json.content &&
  1370. (json.content = json.content.replace(
  1371. /<img/gi,
  1372. '<img style="max-width:100%;"'
  1373. ));
  1374. }
  1375. });
  1376. item.analysisContent &&
  1377. (item.analysisContent = item.analysisContent.replace(
  1378. /<img/gi,
  1379. '<img style="max-width:100%;"'
  1380. ));
  1381. item.content &&
  1382. (item.content = item.content.replace(
  1383. /<img/gi,
  1384. '<img style="max-width:100%;"'
  1385. ));
  1386. item.ans = ansArr;
  1387. return;
  1388. }
  1389. item.analysisContent &&
  1390. (item.analysisContent = item.analysisContent.replace(
  1391. /<img/gi,
  1392. '<img style="max-width:100%;"'
  1393. ));
  1394. item.content &&
  1395. (item.content = item.content.replace(
  1396. /<img/gi,
  1397. '<img style="max-width:100%;"'
  1398. ));
  1399. item.ans = item.answerQuestion;
  1400. // }
  1401. });
  1402. this.questionList = data;
  1403. this.lastCount = this.questionList.length;
  1404. this.mockRecord();
  1405. });
  1406. },
  1407. /**
  1408. * @param {Object} e单选点击
  1409. */
  1410. radioSelect(optionsId, bindex) {
  1411. // if (this.questionList[bindex].ques) return;
  1412. // 类型为考试的可以重新在选择答案
  1413. if (this.questionList[bindex].ques && this.bankType == 1) {
  1414. return;
  1415. }
  1416. this.$set(this.questionList[bindex], "ques", optionsId);
  1417. // if ((bindex + 1) < this.questionList.length) {
  1418. // this.current = bindex + 1
  1419. // }
  1420. console.log("改变后:", this.questionList[bindex].ques);
  1421. this.isDoOver();
  1422. },
  1423. /**
  1424. * @param {Object} e案例单选点击
  1425. */
  1426. radioSelectChild(optionsId, ansIndex, bindex) {
  1427. // if (this.questionList[bindex].ques[ansIndex]) return;
  1428. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1429. return;
  1430. }
  1431. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1432. this.isDoOver();
  1433. },
  1434. /**
  1435. * @param {Object} 多选点击
  1436. */
  1437. checkboxSelect(optionsId, bindex, index) {
  1438. if (this.questionList[bindex].ques && this.bankType == 1) {
  1439. return;
  1440. }
  1441. this.$set(
  1442. this.questionList[bindex].jsonStr[index],
  1443. "checked",
  1444. !this.questionList[bindex].jsonStr[index].checked
  1445. );
  1446. },
  1447. /**
  1448. * @param {Object} 案例多选点击
  1449. */
  1450. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1451. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1452. return;
  1453. }
  1454. this.$set(
  1455. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  1456. "checked",
  1457. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1458. .checked
  1459. );
  1460. },
  1461. isCheckboxChecked(arr) {
  1462. return arr.some((item) => {
  1463. if (item.checked) {
  1464. return true;
  1465. }
  1466. });
  1467. },
  1468. /**
  1469. * @param {Object} 多选确认
  1470. */
  1471. checkboxSubmit(bindex) {
  1472. // if (this.questionList[bindex].ques) return;
  1473. if (this.questionList[bindex].ques && this.bankType == 1) {
  1474. return;
  1475. }
  1476. let arr = [];
  1477. this.questionList[bindex].jsonStr.forEach((item) => {
  1478. if (item.checked) {
  1479. arr.push(item.optionsId);
  1480. }
  1481. });
  1482. if (!arr.length) {
  1483. delete this.questionList[bindex].ques;
  1484. uni.showToast({
  1485. title: "请选择答案",
  1486. icon: "none",
  1487. });
  1488. return;
  1489. }
  1490. this.$set(this.questionList[bindex], "ques", arr);
  1491. this.$u.toast("已确认答案");
  1492. this.isDoOver();
  1493. // 切换下一题
  1494. if (
  1495. this.bankType != 1 &&
  1496. this.cgType != 9 &&
  1497. bindex != this.questionList.length - 1
  1498. ) {
  1499. this.current = bindex + 1;
  1500. this.getCollectInfo(this.current);
  1501. }
  1502. },
  1503. /**
  1504. * @param {Object} 案例多选确认
  1505. */
  1506. checkboxSubmitChild(bindex, ansIndex) {
  1507. // if (this.questionList[bindex].ques[ansIndex]) return;
  1508. if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
  1509. return;
  1510. }
  1511. let arr = [];
  1512. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1513. (item) => {
  1514. if (item.checked) {
  1515. arr.push(item.optionsId);
  1516. }
  1517. }
  1518. );
  1519. if (!arr.length) {
  1520. delete this.questionList[bindex].ques[ansIndex];
  1521. uni.showToast({
  1522. title: "请选择答案",
  1523. icon: "none",
  1524. });
  1525. return;
  1526. }
  1527. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1528. this.$u.toast("已确认答案");
  1529. this.isDoOver();
  1530. // 切换下一题
  1531. if (
  1532. this.bankType != 1 &&
  1533. this.cgType != 9 &&
  1534. ansIndex != this.questionList[bindex].ques.length - 1
  1535. ) {
  1536. this.questionList[bindex].current += 1;
  1537. }
  1538. },
  1539. /**
  1540. * @param {Object} index
  1541. * @param {Object} bindex
  1542. * 判断题
  1543. */
  1544. judgeSelect(index, bindex) {
  1545. // if (this.questionList[bindex].ques) return;
  1546. if (this.questionList[bindex].ques && this.bankType == 1) {
  1547. return;
  1548. }
  1549. // 答案: 判断题1正确 0错误
  1550. let value = index == 0 ? "1" : "0";
  1551. // this.$set(this.questionList[bindex], "ques", index + "");
  1552. this.$set(this.questionList[bindex], "ques", value);
  1553. this.isDoOver();
  1554. },
  1555. /**
  1556. * @param {Object} ansindex
  1557. * @param {Object} childindex
  1558. * @param {Object} bindex
  1559. * 案例判断题
  1560. */
  1561. judgeSelectChild(ansindex, childindex, bindex) {
  1562. // if (this.questionList[bindex].ques[ansindex]) return;
  1563. if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
  1564. return;
  1565. }
  1566. this.$set(
  1567. this.questionList[bindex].ques,
  1568. ansindex,
  1569. childindex == 0 ? "1" : "0"
  1570. );
  1571. this.isDoOver();
  1572. },
  1573. openFooterTab() {
  1574. this.show = true;
  1575. },
  1576. changeIndex(index) {
  1577. this.current = index;
  1578. },
  1579. swiperChange(e) {
  1580. this.current = e.detail.current;
  1581. },
  1582. pdsubmit() {
  1583. // if (this.bankType == 1) {
  1584. let ansCount = this.questionOverNum(true); //已答题数
  1585. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1586. //没有答完
  1587. if (this.lastCount !== 0) {
  1588. this.cgType = 6;
  1589. this.showpopups = true;
  1590. return;
  1591. }
  1592. // }
  1593. if (this.bankType == 2) {
  1594. if (this.lastTime > 0) {
  1595. let lastTime = this.countdown(this.lastTime);
  1596. uni.showModal({
  1597. title: "提示",
  1598. content: `时间还剩余${lastTime},确定交卷吗?`,
  1599. confirmText: "交卷",
  1600. cancelText: "继续答题",
  1601. success: (res) => {
  1602. if (res.confirm) {
  1603. //确定
  1604. this.submit();
  1605. } else {
  1606. //取消
  1607. }
  1608. },
  1609. });
  1610. return;
  1611. }
  1612. }
  1613. this.submit();
  1614. },
  1615. /**
  1616. * 交卷
  1617. */
  1618. submit(isShowTip = true) {
  1619. let form = this.$method.calculateScore(this.questionList);
  1620. if (this.subscribeId) {
  1621. this.mockSubscribeEdit();
  1622. }
  1623. //交卷
  1624. this.$api
  1625. .mockRecordEdit({
  1626. examId: this.examId,
  1627. eachExamId: this.eachExamId,
  1628. recordId: this.recordId,
  1629. status: 1,
  1630. examTime: parseInt(this.allTimes),
  1631. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1632. ...form,
  1633. })
  1634. .then((res) => {
  1635. this.isSubmit = true;
  1636. if (res.data.code == 200) {
  1637. if (!isShowTip) {
  1638. return;
  1639. }
  1640. uni.showToast({
  1641. title: "交卷成功",
  1642. duration: 1000,
  1643. icon: "none",
  1644. });
  1645. setTimeout(() => {
  1646. uni.redirectTo({
  1647. url:
  1648. "/pages5/examReport/index?&examId=" +
  1649. this.examId +
  1650. "&id=" +
  1651. this.recordId +
  1652. "&eachExamId=" +
  1653. this.eachExamId +
  1654. "&subscribeId=" +
  1655. this.subscribeId +
  1656. "&doMode=" +
  1657. this.doMode,
  1658. });
  1659. }, 1000);
  1660. }
  1661. });
  1662. //错题集id提交(客观题)
  1663. this.$api
  1664. .mockWrongRecord({
  1665. eachExamId: this.eachExamId,
  1666. examId: this.examId,
  1667. questionIds: form.questionIds,
  1668. recordId: this.recordId,
  1669. doMode: this.doMode,
  1670. })
  1671. .then((res) => {});
  1672. },
  1673. /**
  1674. * @param {Object} imgIndex
  1675. * @param {Object} bankIndex
  1676. * 删除简答图片
  1677. */
  1678. deleteImg(imgIndex, bankIndex) {
  1679. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1680. },
  1681. /**
  1682. * @param {Object} imgIndex
  1683. * @param {Object} bankIndex
  1684. * @param {Object} ansIndex
  1685. * 删除案例题简答图片
  1686. */
  1687. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1688. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1689. imgIndex,
  1690. 1
  1691. );
  1692. },
  1693. /**
  1694. * @param {Object} bankindex
  1695. * 选择上传图片
  1696. */
  1697. chooseImg(bankindex) {
  1698. if (
  1699. this.questionList[bankindex] &&
  1700. this.questionList[bankindex].ansText &&
  1701. this.questionList[bankindex].ansText.imageList.length >= 4
  1702. ) {
  1703. uni.showToast({
  1704. icon: "none",
  1705. title: "最多选择4张",
  1706. });
  1707. return;
  1708. }
  1709. uni.chooseImage({
  1710. count: 1, //默认9
  1711. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1712. sourceType: ["album", "camera"], //从相册选择
  1713. success: (res) => {
  1714. let self = this;
  1715. // console.log(JSON.stringify(res.tempFilePaths));
  1716. let img = res.tempFilePaths[0];
  1717. uni.getImageInfo({
  1718. src: img,
  1719. success: async (res) => {
  1720. let canvasWidth = res.width; //图片原始长宽
  1721. let canvasHeight = res.height;
  1722. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1723. uni.compressImage({
  1724. src: img,
  1725. quality: 75,
  1726. width: "50%",
  1727. height: "50%",
  1728. success: async (rest) => {
  1729. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1730. this.questionList[bankindex].ansText.imageList.push(dir);
  1731. },
  1732. });
  1733. } else {
  1734. const dir = await self.uploadFile(img, 0);
  1735. this.questionList[bankindex].ansText.imageList.push(dir);
  1736. }
  1737. },
  1738. });
  1739. },
  1740. });
  1741. },
  1742. /**
  1743. * @param {Object} bankindex
  1744. * @param {Object} ansindex
  1745. * 案例题选择上传图片
  1746. */
  1747. chooseImgChild(bankindex, ansindex) {
  1748. if (
  1749. this.questionList[bankindex].jsonStr[ansindex] &&
  1750. this.questionList[bankindex].jsonStr[ansindex].ansText &&
  1751. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList
  1752. .length >= 4
  1753. ) {
  1754. uni.showToast({
  1755. icon: "none",
  1756. title: "最多选择4张",
  1757. });
  1758. return;
  1759. }
  1760. uni.chooseImage({
  1761. count: 1, //默认9
  1762. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1763. sourceType: ["album", "camera"], //从相册选择
  1764. success: (res) => {
  1765. let self = this;
  1766. // console.log(JSON.stringify(res.tempFilePaths));
  1767. let img = res.tempFilePaths[0];
  1768. uni.getImageInfo({
  1769. src: img,
  1770. success: async (res) => {
  1771. let canvasWidth = res.width; //图片原始长宽
  1772. let canvasHeight = res.height;
  1773. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1774. uni.compressImage({
  1775. src: img,
  1776. quality: 75,
  1777. width: "50%",
  1778. height: "50%",
  1779. success: async (rest) => {
  1780. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1781. this.questionList[bankindex].jsonStr[
  1782. ansindex
  1783. ].ansText.imageList.push(dir);
  1784. },
  1785. });
  1786. } else {
  1787. const dir = await self.uploadFile(img, 0);
  1788. this.questionList[bankindex].jsonStr[
  1789. ansindex
  1790. ].ansText.imageList.push(dir);
  1791. }
  1792. },
  1793. });
  1794. },
  1795. });
  1796. },
  1797. uploadFile(options, int) {
  1798. var self = this;
  1799. return new Promise((resolve, reject) => {
  1800. var data = {
  1801. orderGoodsId: this.orderGoodsId,
  1802. imageStatus: int,
  1803. };
  1804. self.$api.aliyunpolicy(data).then((res) => {
  1805. console.log(res.data, 6);
  1806. if (res.data.code != 200) {
  1807. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1808. return;
  1809. }
  1810. var ossToken = res.data.data.resultContent;
  1811. if (ossToken.host == null || ossToken.host == undefined) {
  1812. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1813. return;
  1814. }
  1815. uni.uploadFile({
  1816. url: ossToken.host,
  1817. name: "file",
  1818. filePath: options,
  1819. fileType: "image",
  1820. header: {
  1821. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1822. },
  1823. formData: {
  1824. key: ossToken.dir,
  1825. OSSAccessKeyId: ossToken.accessid,
  1826. policy: ossToken.policy,
  1827. Signature: ossToken.signature,
  1828. callback: ossToken.callback,
  1829. success_action_status: 200,
  1830. },
  1831. success: (result) => {
  1832. // if (result.statusCode === 200) {
  1833. resolve(ossToken.dir);
  1834. // } else {
  1835. // uni.showToast({
  1836. // title: "上传失败",
  1837. // icon: "none",
  1838. // });
  1839. // return;
  1840. // }
  1841. },
  1842. fail: (error) => {
  1843. uni.showToast({
  1844. title: "上传接口报错" + error,
  1845. icon: "none",
  1846. });
  1847. return;
  1848. },
  1849. });
  1850. });
  1851. });
  1852. },
  1853. /**
  1854. * @param {Object} type
  1855. * @param {Object} bankindex
  1856. * 简答题答案确认
  1857. */
  1858. submitAns(bankindex) {
  1859. console.log(this.questionList[bankindex]);
  1860. if (
  1861. !this.questionList[bankindex].ansText.text &&
  1862. !this.questionList[bankindex].ansText.imageList.length
  1863. ) {
  1864. uni.showToast({
  1865. title: "请输入内容或上传图片",
  1866. duration: 2000,
  1867. icon: "none",
  1868. });
  1869. return;
  1870. }
  1871. this.$set(this.questionList[bankindex], "ques", {
  1872. imageList: this.questionList[bankindex].ansText.imageList || [],
  1873. text: this.questionList[bankindex].ansText.text || "",
  1874. });
  1875. this.$u.toast("已确认答案");
  1876. this.isDoOver();
  1877. },
  1878. /**
  1879. * @param {Object} bankindex
  1880. * @param {Object} ansindex
  1881. * 案例题简答答案确认
  1882. */
  1883. submitAnsChild(bankindex, ansindex) {
  1884. if (
  1885. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  1886. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  1887. ) {
  1888. uni.showToast({
  1889. title: "请输入内容或上传图片",
  1890. duration: 2000,
  1891. icon: "none",
  1892. });
  1893. return;
  1894. }
  1895. this.$set(this.questionList[bankindex].ques, ansindex, {
  1896. imageList:
  1897. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList ||
  1898. [],
  1899. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || "",
  1900. });
  1901. this.$u.toast("已确认答案");
  1902. this.isDoOver();
  1903. },
  1904. right(bankIndex, ansIndex, option) {
  1905. if (
  1906. this.questionList[bankIndex].ques[ansIndex] &&
  1907. this.questionList[bankIndex].ans[ansIndex]
  1908. ) {
  1909. if (
  1910. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1911. option.optionsId
  1912. ) != -1 ||
  1913. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1914. option.optionsId
  1915. ) != -1
  1916. ) {
  1917. return true;
  1918. } else {
  1919. return false;
  1920. }
  1921. } else {
  1922. return false;
  1923. }
  1924. },
  1925. wrong(bankIndex, ansIndex, option) {
  1926. if (
  1927. this.questionList[bankIndex].ques[ansIndex] &&
  1928. this.questionList[bankIndex].ans[ansIndex]
  1929. ) {
  1930. if (
  1931. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1932. option.optionsId
  1933. ) != -1 &&
  1934. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1935. option.optionsId
  1936. ) == -1
  1937. ) {
  1938. return true;
  1939. } else {
  1940. return false;
  1941. }
  1942. } else {
  1943. return false;
  1944. }
  1945. },
  1946. tabSelect(index, bankindex) {
  1947. this.$set(this.questionList[bankindex], "current", index);
  1948. },
  1949. showPhoto(contentStr) {
  1950. // #ifdef H5
  1951. return;
  1952. // #endif
  1953. if (contentStr && typeof contentStr == "string") {
  1954. let reg = /<img[^>]*src[=\'\"\s]+([^\'\"]*)[\'\"]?[^>]*>/gi;
  1955. let strArr = contentStr.match(reg);
  1956. strArr.forEach((str, index) => {
  1957. strArr[index] = str.replace(reg, "$1");
  1958. });
  1959. // 预览图片
  1960. uni.previewImage({
  1961. urls: strArr,
  1962. longPressActions: {
  1963. itemList: ["发送给朋友", "保存图片", "收藏"],
  1964. success: function (data) {
  1965. console.log(
  1966. "选中了第" +
  1967. (data.tapIndex + 1) +
  1968. "个按钮,第" +
  1969. (data.index + 1) +
  1970. "张图片"
  1971. );
  1972. },
  1973. fail: function (err) {
  1974. console.log(err.errMsg);
  1975. },
  1976. },
  1977. });
  1978. }
  1979. },
  1980. },
  1981. computed: {
  1982. ...mapGetters(["sysTime"]),
  1983. doMode() {
  1984. // 做题模式 1章卷 2随机练习 3模拟组卷
  1985. return this.examData.simulateStatus ? 3 : undefined;
  1986. },
  1987. },
  1988. components: {
  1989. BankBom,
  1990. },
  1991. };
  1992. </script>
  1993. <style lang="scss" scoped>
  1994. .questionBank {
  1995. width: 100%;
  1996. height: 100vh;
  1997. display: flex;
  1998. flex-direction: column;
  1999. }
  2000. .swiper {
  2001. width: 100%;
  2002. flex: 1;
  2003. }
  2004. .lisSty {
  2005. margin-bottom: 16rpx;
  2006. display: flex;
  2007. align-items: center;
  2008. .flex_auto {
  2009. flex: 1;
  2010. word-break: break-all;
  2011. }
  2012. }
  2013. .activeTI {
  2014. vertical-align: middle;
  2015. display: inline-block;
  2016. border: 1rpx solid #eee;
  2017. border-radius: 50rpx;
  2018. height: 48rpx;
  2019. line-height: 46rpx;
  2020. text-align: center;
  2021. width: 48rpx;
  2022. margin-right: 15rpx;
  2023. color: #666;
  2024. font-size: 30rpx;
  2025. &.right {
  2026. color: #fff;
  2027. background: #36c75a;
  2028. }
  2029. &.wrong {
  2030. color: #fff;
  2031. background: #ff3b30;
  2032. }
  2033. &.checked,
  2034. &.user_choose {
  2035. color: #fff;
  2036. background: #007aff;
  2037. }
  2038. }
  2039. .submit_checkbox {
  2040. position: fixed;
  2041. left: 0;
  2042. right: 0;
  2043. bottom: 120rpx;
  2044. margin: 20rpx auto;
  2045. width: 526rpx;
  2046. height: 80rpx;
  2047. background: rgba(0, 122, 255, 1);
  2048. color: #fff;
  2049. text-align: center;
  2050. line-height: 80rpx;
  2051. font-size: 30rpx;
  2052. border-radius: 40rpx;
  2053. &.disabled {
  2054. opacity: 0.6;
  2055. }
  2056. }
  2057. .titles {
  2058. overflow: hidden;
  2059. margin-bottom: 24rpx;
  2060. }
  2061. .titBox {
  2062. padding: 41rpx 25rpx 24rpx 25rpx;
  2063. }
  2064. .titBox_title {
  2065. padding: 21rpx;
  2066. }
  2067. .tabs {
  2068. margin: 10rpx;
  2069. display: flex;
  2070. .tab {
  2071. margin: 0 4rpx;
  2072. padding: 10rpx 13rpx;
  2073. text-align: center;
  2074. color: #007aff;
  2075. font-size: 28rpx;
  2076. border-radius: 16rpx;
  2077. background: #fff;
  2078. &.current {
  2079. color: #fff;
  2080. background: #007aff;
  2081. }
  2082. }
  2083. }
  2084. .ans {
  2085. margin: 8rpx 8rpx 8rpx;
  2086. .ans_input {
  2087. border-radius: 16rpx;
  2088. background: #fff;
  2089. .top {
  2090. border-bottom: 1rpx solid #eeeeee;
  2091. padding: 16rpx;
  2092. display: flex;
  2093. align-items: center;
  2094. .icon {
  2095. margin-right: 20rpx;
  2096. width: 40rpx;
  2097. height: 38rpx;
  2098. }
  2099. .progress {
  2100. flex: 1;
  2101. }
  2102. .submit {
  2103. width: 168rpx;
  2104. height: 48rpx;
  2105. line-height: 48rpx;
  2106. text-align: center;
  2107. color: #fff;
  2108. font-size: 30rpx;
  2109. background: #007aff;
  2110. border-radius: 24rpx;
  2111. &.disabled {
  2112. opacity: 0.6;
  2113. }
  2114. }
  2115. }
  2116. .textarea {
  2117. textarea {
  2118. width: 100%;
  2119. height: 287rpx;
  2120. padding: 10rpx;
  2121. }
  2122. }
  2123. .imgs {
  2124. overflow: hidden;
  2125. display: flex;
  2126. width: 100%;
  2127. .img {
  2128. width: 104rpx;
  2129. height: 104rpx;
  2130. border-radius: 8rpx;
  2131. position: relative;
  2132. margin: 20rpx;
  2133. text {
  2134. position: absolute;
  2135. right: -15rpx;
  2136. top: -15rpx;
  2137. width: 30rpx;
  2138. height: 30rpx;
  2139. text-align: center;
  2140. line-height: 30rpx;
  2141. color: #fff;
  2142. background: #ff3b30;
  2143. border-radius: 50%;
  2144. }
  2145. image {
  2146. width: 100%;
  2147. height: 100%;
  2148. }
  2149. }
  2150. }
  2151. }
  2152. .ans_submit {
  2153. padding: 16rpx;
  2154. border-radius: 16rpx;
  2155. background: #fff;
  2156. .imgs {
  2157. overflow: hidden;
  2158. display: flex;
  2159. width: 100%;
  2160. .img {
  2161. width: 104rpx;
  2162. height: 104rpx;
  2163. border-radius: 8rpx;
  2164. position: relative;
  2165. margin: 20rpx;
  2166. image {
  2167. width: 100%;
  2168. height: 100%;
  2169. }
  2170. }
  2171. }
  2172. }
  2173. }
  2174. .leftLetters {
  2175. display: flex;
  2176. align-items: center;
  2177. width: 220rpx;
  2178. .btnType {
  2179. padding: 5rpx 10rpx;
  2180. border: 1rpx solid #007aff;
  2181. border-radius: 10rpx;
  2182. background-color: rgba(0, 122, 255, 0.1);
  2183. font-size: 28rpx;
  2184. color: #007aff;
  2185. margin-right: 15rpx;
  2186. }
  2187. }
  2188. .firstLetter {
  2189. display: flex;
  2190. justify-content: space-between;
  2191. align-items: center;
  2192. margin-bottom: 30rpx;
  2193. }
  2194. .pageContent {
  2195. position: relative;
  2196. background-color: #eaeef1;
  2197. height: 100%;
  2198. padding-top: 8rpx;
  2199. padding-bottom: 100rpx;
  2200. overflow-y: scroll;
  2201. }
  2202. .pad_8 {
  2203. background-color: #fff;
  2204. margin: 0rpx 8rpx 8rpx;
  2205. border-radius: 16rpx;
  2206. &.no-margin {
  2207. margin-top: -16rpx;
  2208. border-radius: 0 0 16rpx 16rpx;
  2209. }
  2210. }
  2211. .answer {
  2212. height: 80rpx;
  2213. line-height: 80rpx;
  2214. padding: 0rpx 24rpx;
  2215. display: flex;
  2216. align-items: center;
  2217. justify-content: space-between;
  2218. color: #666;
  2219. font-size: 30rpx;
  2220. }
  2221. .answerInfos {
  2222. padding: 25rpx 25rpx 25rpx 23rpx;
  2223. }
  2224. .answerTitle {
  2225. margin-bottom: 28rpx;
  2226. color: #666;
  2227. font-size: 30rpx;
  2228. }
  2229. .answerContent {
  2230. font-size: 30rpx;
  2231. color: #666;
  2232. }
  2233. .textChild {
  2234. display: inline-block;
  2235. vertical-align: middle;
  2236. }
  2237. .dialog {
  2238. position: fixed;
  2239. left: 0;
  2240. top: 0;
  2241. width: 100%;
  2242. height: 100%;
  2243. background-color: rgba(0, 0, 0, 0.8);
  2244. display: flex;
  2245. flex-direction: column;
  2246. align-items: center;
  2247. justify-content: center;
  2248. z-index: 20000;
  2249. .pointer {
  2250. width: 338rpx;
  2251. height: 240rpx;
  2252. }
  2253. .text {
  2254. font-size: 32rpx;
  2255. color: #ffffff;
  2256. text-align: center;
  2257. }
  2258. .btn {
  2259. width: 242rpx;
  2260. height: 82rpx;
  2261. border: 2rpx solid #ffffff;
  2262. border-radius: 16rpx;
  2263. text-align: center;
  2264. line-height: 82rpx;
  2265. margin: 41rpx auto;
  2266. color: #fff;
  2267. font-size: 32rpx;
  2268. }
  2269. }
  2270. .dialog-arrow {
  2271. padding-top: 124rpx;
  2272. position: fixed;
  2273. left: 0;
  2274. top: 0;
  2275. width: 100%;
  2276. height: 100%;
  2277. background-color: rgba(0, 0, 0, 0.8);
  2278. z-index: 20000;
  2279. .pointer {
  2280. margin-left: 87rpx;
  2281. display: block;
  2282. width: 95rpx;
  2283. height: 98rpx;
  2284. }
  2285. .text {
  2286. padding-left: 177rpx;
  2287. font-size: 32rpx;
  2288. color: #ffffff;
  2289. }
  2290. .btn {
  2291. width: 242rpx;
  2292. height: 82rpx;
  2293. border: 2rpx solid #ffffff;
  2294. border-radius: 16rpx;
  2295. text-align: center;
  2296. line-height: 82rpx;
  2297. margin: 500rpx auto 0;
  2298. color: #fff;
  2299. font-size: 32rpx;
  2300. }
  2301. }
  2302. .dialog_wrap {
  2303. position: fixed;
  2304. left: 0;
  2305. top: 0;
  2306. width: 100%;
  2307. height: 100%;
  2308. z-index: 9999999999;
  2309. .bg {
  2310. background: rgba(0, 0, 0, 0.3);
  2311. position: absolute;
  2312. left: 0;
  2313. top: 0;
  2314. width: 100%;
  2315. height: 100%;
  2316. }
  2317. .dialog {
  2318. position: absolute;
  2319. left: 50%;
  2320. top: 50%;
  2321. transform: translate3D(-50%, -50%, 0);
  2322. width: 640rpx;
  2323. height: 439rpx;
  2324. background: #ffffff;
  2325. border-radius: 24rpx;
  2326. .title {
  2327. font-size: 30rpx;
  2328. font-weight: bold;
  2329. color: #333333;
  2330. line-height: 48rpx;
  2331. text-align: center;
  2332. margin-top: 40rpx;
  2333. }
  2334. .content {
  2335. margin: 35rpx 35rpx 0;
  2336. font-size: 30rpx;
  2337. color: #666666;
  2338. line-height: 48rpx;
  2339. }
  2340. .btns {
  2341. margin-top: 35rpx;
  2342. display: flex;
  2343. align-items: center;
  2344. justify-content: center;
  2345. .btn {
  2346. width: 200rpx;
  2347. height: 80rpx;
  2348. line-height: 80rpx;
  2349. text-align: center;
  2350. background: #f5f5f5;
  2351. border-radius: 40rpx;
  2352. font-size: 30rpx;
  2353. color: rgba(0, 122, 255, 1);
  2354. background: #f5f5f5;
  2355. margin: 0 20rpx;
  2356. &.active {
  2357. color: #f5f5f5;
  2358. background: rgba(0, 122, 255, 1);
  2359. }
  2360. }
  2361. }
  2362. }
  2363. }
  2364. .popboxs {
  2365. width: 100%;
  2366. height: 100%;
  2367. display: flex;
  2368. flex-direction: column;
  2369. align-items: center;
  2370. }
  2371. .classTops {
  2372. flex-shrink: 0;
  2373. padding: 39rpx 0rpx 4rpx;
  2374. font-weight: bold;
  2375. color: #333;
  2376. font-size: 30rpx;
  2377. }
  2378. .textStys {
  2379. width: 100%;
  2380. flex: 1;
  2381. padding: 36rpx;
  2382. }
  2383. .classFootsty {
  2384. flex-shrink: 0;
  2385. display: flex;
  2386. align-items: center;
  2387. justify-content: center;
  2388. padding: 10rpx 0rpx 40rpx;
  2389. .btnsty {
  2390. width: 200rpx;
  2391. height: 80rpx;
  2392. border-radius: 40rpx;
  2393. font-weight: bold;
  2394. font-size: 30rpx;
  2395. text-align: center;
  2396. line-height: 80rpx;
  2397. }
  2398. .btns1 {
  2399. background-color: #f5f5f5;
  2400. color: #007aff;
  2401. }
  2402. .btns2 {
  2403. margin-left: 40rpx;
  2404. background-color: #007aff;
  2405. color: #ffffff;
  2406. }
  2407. }
  2408. </style>