index.vue 89 KB

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