index.vue 61 KB

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