index.vue 88 KB

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