index.vue 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079
  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. this.showpopups = false;
  1291. this.needBack = false;
  1292. this.submit();
  1293. },
  1294. /**
  1295. * 离开页面统计回答正确题数
  1296. */
  1297. mockRecordEdit() {
  1298. if (!this.isSubmit) {
  1299. let number = 0;
  1300. let score = 0;
  1301. let doQuestionNum = 0;
  1302. let doQuestionIds = []; //做过的题目id
  1303. this.questionList.forEach((item, index) => {
  1304. if (item.type == 1) {
  1305. if (item.ques == item.ans) {
  1306. score += item.score;
  1307. number++;
  1308. }
  1309. if (item.ques) {
  1310. doQuestionNum++;
  1311. doQuestionIds.push(item.questionId);
  1312. }
  1313. } else if (item.type == 2) {
  1314. let isRight =
  1315. item.ans &&
  1316. item.ans.every((quesItem, quesIndex) => {
  1317. if (item.ques) {
  1318. return item.ques[quesIndex] == item.ans[quesIndex];
  1319. } else {
  1320. return false;
  1321. }
  1322. });
  1323. if (isRight) {
  1324. score += item.score;
  1325. number++;
  1326. } else {
  1327. let checkboxScore = 1; //获取单题总分数
  1328. item.ques &&
  1329. item.ques.forEach((ques, quesIndex) => {
  1330. //选错一个全扣
  1331. if (item.ques) {
  1332. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1333. checkboxScore = 0;
  1334. }
  1335. } else {
  1336. checkboxScore = 0;
  1337. }
  1338. });
  1339. console.log(checkboxScore);
  1340. //没选错
  1341. if (checkboxScore) {
  1342. checkboxScore = 0;
  1343. item.ans.forEach((ans, quesIndex) => {
  1344. //漏选扣一部分,对n题给n X partScore 分
  1345. if (item.ques) {
  1346. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1347. checkboxScore += item.partScore;
  1348. }
  1349. } else {
  1350. checkboxScore = 0;
  1351. }
  1352. });
  1353. }
  1354. if (checkboxScore <= 0) {
  1355. //0分
  1356. } else {
  1357. //部分分
  1358. // number++;
  1359. score += checkboxScore;
  1360. }
  1361. }
  1362. if (item.ques && item.ques.length) {
  1363. doQuestionNum++;
  1364. doQuestionIds.push(item.questionId);
  1365. }
  1366. } else if (item.type == 3) {
  1367. if (item.ques == item.ans) {
  1368. score += item.score;
  1369. number++;
  1370. }
  1371. if (item.ques) {
  1372. doQuestionNum++;
  1373. doQuestionIds.push(item.questionId);
  1374. }
  1375. } else if (item == 4) {
  1376. if (item.ques.length) {
  1377. doQuestionNum++;
  1378. doQuestionIds.push(item.questionId);
  1379. }
  1380. } else if (item.type == 5) {
  1381. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1382. doQuestionNum++;
  1383. doQuestionIds.push(item.questionId);
  1384. }
  1385. }
  1386. });
  1387. if(this.subscribeId) {
  1388. this.mockSubscribeEdit();
  1389. }
  1390. this.$api
  1391. .mockRecordEdit({
  1392. examId: this.examId,
  1393. eachExamId:this.eachExamId,
  1394. goodsId: this.goodsId,
  1395. recordId: this.recordId,
  1396. doQuestionIds: doQuestionIds.join(","),
  1397. rightQuestionNum: number,
  1398. status: 1,
  1399. doQuestionNum: doQuestionNum,
  1400. historyExamJson: JSON.stringify(this.questionList),
  1401. })
  1402. .then((res) => {});
  1403. }
  1404. },
  1405. /**
  1406. * 记录总题数
  1407. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1408. */
  1409. mockRecord(hasSpecial) {
  1410. let questionList = 0;
  1411. // if(!hasSpecial) {
  1412. this.questionList.forEach((item, index) => {
  1413. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1414. questionList++;
  1415. }
  1416. });
  1417. // } else {
  1418. // questionList = this.questionList.length;
  1419. // }
  1420. this.$api
  1421. .mockRecord({
  1422. examId: this.examId,
  1423. eachExamId:this.eachExamId,
  1424. totalQuestionNum: questionList,
  1425. allQuestionNum: this.questionList.length,
  1426. })
  1427. .then((res) => {
  1428. this.recordId = res.data.data;
  1429. //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
  1430. });
  1431. },
  1432. /**
  1433. * @param {Object} second倒计时过滤器
  1434. */
  1435. countdown(second) {
  1436. if (second) {
  1437. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  1438. let m = parseInt((second / 60) % 60); // 计算分数
  1439. let s = parseInt(second % 60); // 计算当前秒数
  1440. if (h < 10) h = "0" + h;
  1441. if (m < 10) m = "0" + m;
  1442. if (s < 10) s = "0" + s;
  1443. return h + ":" + m + ":" + s;
  1444. } else {
  1445. return "";
  1446. }
  1447. },
  1448. hideDialog() {
  1449. this.showDialog = false
  1450. },
  1451. /**
  1452. * 请求题目列表
  1453. */
  1454. goodsQuestionList() {
  1455. this.$api
  1456. .goodsQuestionList({
  1457. examId: this.examId,
  1458. })
  1459. .then((res) => {
  1460. if (!res.data.data.length) {
  1461. this.hideDialog();
  1462. uni.showModal({
  1463. showCancel: false,
  1464. content: "该试卷暂无题目",
  1465. success: (k) => {
  1466. if (k.confirm) {
  1467. this.isSubmit = true;
  1468. uni.navigateBack();
  1469. }
  1470. },
  1471. });
  1472. return;
  1473. }
  1474. if (this.subscribeId) {
  1475. this.lastTime = this.examEndTime - this.sysTime;
  1476. //考试时间到了自动交卷
  1477. if (this.lastTime) {
  1478. this.timer = setInterval(() => {
  1479. if (this.lastTime <= 0) {
  1480. clearInterval(this.timer);
  1481. uni.showToast({
  1482. icon: "none",
  1483. mask: true,
  1484. title: "考试时间已到,系统将自动交卷",
  1485. duration: 5000,
  1486. });
  1487. this.isAutoSubmit = true;
  1488. this.submit();
  1489. return;
  1490. }
  1491. this.lastTime--;
  1492. }, 1000);
  1493. } else {
  1494. }
  1495. }
  1496. res.data.data.forEach((item, index) => {
  1497. // if (typeof item.jsonStr == 'string') {
  1498. item.jsonStr = JSON.parse(item.jsonStr);
  1499. if (item.type == 2) {
  1500. //多选
  1501. item.jsonStr.forEach((str) => {
  1502. str.optionsId = "" + str.optionsId;
  1503. });
  1504. let arr = item.answerQuestion.split(",");
  1505. arr.forEach((a, i) => {
  1506. arr[i] = "" + a;
  1507. });
  1508. item.ans = arr;
  1509. item.analysisContent &&
  1510. (item.analysisContent = item.analysisContent.replace(
  1511. /<img/gi,
  1512. '<img style="max-width:100%;"'
  1513. ));
  1514. item.content &&
  1515. (item.content = item.content.replace(
  1516. /<img/gi,
  1517. '<img style="max-width:100%;"'
  1518. ));
  1519. return;
  1520. } else if (item.type == 5) {
  1521. //简答题
  1522. item.ansText = {
  1523. text: "",
  1524. imageList: [],
  1525. };
  1526. item.ques = {
  1527. text: "",
  1528. imageList: [],
  1529. };
  1530. item.analysisContent &&
  1531. (item.analysisContent = item.analysisContent.replace(
  1532. /<img/gi,
  1533. '<img style="max-width:100%;"'
  1534. ));
  1535. item.content &&
  1536. (item.content = item.content.replace(
  1537. /<img/gi,
  1538. '<img style="max-width:100%;"'
  1539. ));
  1540. } else if (item.type == 4) {
  1541. //案例题
  1542. item.ques = [];
  1543. item.current = 0;
  1544. let ansArr = [];
  1545. item.jsonStr.forEach((json, index) => {
  1546. if (json.type == 1) {
  1547. ansArr[index] = json.answerQuestion;
  1548. json.content &&
  1549. (json.content = json.content.replace(
  1550. /<img/gi,
  1551. '<img style="max-width:100%;"'
  1552. ));
  1553. } else if (json.type == 2) {
  1554. json.optionsList.forEach((str) => {
  1555. str.optionsId = "" + str.optionsId;
  1556. });
  1557. let arr = json.answerQuestion.split(",");
  1558. arr.forEach((a, i) => {
  1559. arr[i] = "" + a;
  1560. });
  1561. ansArr[index] = arr;
  1562. json.content &&
  1563. (json.content = json.content.replace(
  1564. /<img/gi,
  1565. '<img style="max-width:100%;"'
  1566. ));
  1567. } else if (json.type == 3) {
  1568. ansArr[index] = json.answerQuestion;
  1569. json.content &&
  1570. (json.content = json.content.replace(
  1571. /<img/gi,
  1572. '<img style="max-width:100%;"'
  1573. ));
  1574. } else if (json.type == 5) {
  1575. ansArr[index] = {
  1576. text: json.answerQuestion,
  1577. imageList: [],
  1578. };
  1579. json.ansText = {
  1580. text: "",
  1581. imageList: [],
  1582. };
  1583. json.content &&
  1584. (json.content = json.content.replace(
  1585. /<img/gi,
  1586. '<img style="max-width:100%;"'
  1587. ));
  1588. }
  1589. });
  1590. item.analysisContent &&
  1591. (item.analysisContent = item.analysisContent.replace(
  1592. /<img/gi,
  1593. '<img style="max-width:100%;"'
  1594. ));
  1595. item.content &&
  1596. (item.content = item.content.replace(
  1597. /<img/gi,
  1598. '<img style="max-width:100%;"'
  1599. ));
  1600. item.ans = ansArr;
  1601. return;
  1602. }
  1603. item.analysisContent &&
  1604. (item.analysisContent = item.analysisContent.replace(
  1605. /<img/gi,
  1606. '<img style="max-width:100%;"'
  1607. ));
  1608. item.content &&
  1609. (item.content = item.content.replace(
  1610. /<img/gi,
  1611. '<img style="max-width:100%;"'
  1612. ));
  1613. item.ans = item.answerQuestion;
  1614. // }
  1615. });
  1616. this.questionList = res.data.data;
  1617. this.lastCount = this.questionList.length;
  1618. this.mockRecord();
  1619. });
  1620. },
  1621. /**
  1622. * @param {Object} e单选点击
  1623. */
  1624. radioSelect(optionsId, bindex) {
  1625. if (this.questionList[bindex].ques) return;
  1626. this.$set(this.questionList[bindex], "ques", optionsId);
  1627. this.isDoOver();
  1628. },
  1629. /**
  1630. * @param {Object} e案例单选点击
  1631. */
  1632. radioSelectChild(optionsId, ansIndex, bindex) {
  1633. if (this.questionList[bindex].ques[ansIndex]) return;
  1634. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1635. this.isDoOver();
  1636. },
  1637. /**
  1638. * @param {Object} 多选点击
  1639. */
  1640. checkboxSelect(optionsId, bindex, index) {
  1641. this.$set(
  1642. this.questionList[bindex].jsonStr[index],
  1643. "checked",
  1644. !this.questionList[bindex].jsonStr[index].checked
  1645. );
  1646. },
  1647. /**
  1648. * @param {Object} 案例多选点击
  1649. */
  1650. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1651. this.$set(
  1652. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  1653. "checked",
  1654. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1655. .checked
  1656. );
  1657. },
  1658. isCheckboxChecked(arr) {
  1659. return arr.some((item) => {
  1660. if (item.checked) {
  1661. return true;
  1662. }
  1663. });
  1664. },
  1665. /**
  1666. * @param {Object} 多选确认
  1667. */
  1668. checkboxSubmit(bindex) {
  1669. if (this.questionList[bindex].ques) return;
  1670. let arr = [];
  1671. this.questionList[bindex].jsonStr.forEach((item) => {
  1672. if (item.checked) {
  1673. arr.push(item.optionsId);
  1674. }
  1675. });
  1676. if (!arr.length) {
  1677. uni.showToast({
  1678. title: "请选择答案",
  1679. icon: "none",
  1680. });
  1681. return;
  1682. }
  1683. this.$set(this.questionList[bindex], "ques", arr);
  1684. this.isDoOver();
  1685. let isWrong = this.questionList[bindex].ques.some(
  1686. (quesItem, quesIndex) => {
  1687. return (
  1688. this.questionList[bindex].ques[quesIndex] !=
  1689. this.questionList[bindex].ans[quesIndex]
  1690. );
  1691. }
  1692. );
  1693. },
  1694. /**
  1695. * @param {Object} 案例多选确认
  1696. */
  1697. checkboxSubmitChild(bindex, ansIndex) {
  1698. if (this.questionList[bindex].ques[ansIndex]) return;
  1699. let arr = [];
  1700. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1701. (item) => {
  1702. if (item.checked) {
  1703. arr.push(item.optionsId);
  1704. }
  1705. }
  1706. );
  1707. if (!arr.length) {
  1708. uni.showToast({
  1709. title: "请选择答案",
  1710. icon: "none",
  1711. });
  1712. return;
  1713. }
  1714. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1715. this.isDoOver();
  1716. },
  1717. /**
  1718. * @param {Object} index
  1719. * @param {Object} bindex
  1720. * 判断题
  1721. */
  1722. judgeSelect(index, bindex) {
  1723. if (this.questionList[bindex].ques) return;
  1724. this.$set(this.questionList[bindex], "ques", index + "");
  1725. this.isDoOver();
  1726. },
  1727. /**
  1728. * @param {Object} ansindex
  1729. * @param {Object} childindex
  1730. * @param {Object} bindex
  1731. * 案例判断题
  1732. */
  1733. judgeSelectChild(ansindex, childindex, bindex) {
  1734. if (this.questionList[bindex].ques[ansindex]) return;
  1735. this.$set(this.questionList[bindex].ques, ansindex, childindex + "");
  1736. this.isDoOver();
  1737. },
  1738. openFooterTab() {
  1739. this.show = true;
  1740. },
  1741. changeIndex(index) {
  1742. this.current = index;
  1743. },
  1744. swiperChange(e) {
  1745. this.current = e.detail.current;
  1746. },
  1747. pdsubmit() {
  1748. // if (this.bankType == 1) {
  1749. let ansCount = this.questionOverNum(true); //已答题数
  1750. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1751. //没有答完
  1752. if (this.lastCount !== 0) {
  1753. this.cgType = 6;
  1754. this.showpopups = true;
  1755. return;
  1756. }
  1757. // }
  1758. if (this.bankType == 2) {
  1759. if (this.lastTime > 0) {
  1760. let lastTime = this.countdown(this.lastTime);
  1761. uni.showModal({
  1762. title: "提示",
  1763. content: `时间还剩余${lastTime},确定交卷吗?`,
  1764. confirmText: "交卷",
  1765. cancelText: "继续答题",
  1766. success: (res) => {
  1767. if (res.confirm) {
  1768. //确定
  1769. this.submit();
  1770. } else {
  1771. //取消
  1772. }
  1773. },
  1774. });
  1775. return;
  1776. }
  1777. }
  1778. this.submit();
  1779. },
  1780. /**
  1781. * 交卷
  1782. */
  1783. submit() {
  1784. let score = 0; //计算总分
  1785. let reportStatus = 0;
  1786. let number = 0; //做对的题目数量
  1787. let doQuestionNum = 0; //做过的题目数量
  1788. let allScore = 0; //总分
  1789. let passScore = 0;
  1790. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1791. let doQuestionIds = []; //做过的题目id
  1792. let lessQuestionNum = 0;
  1793. let rightQuestionIds = []; //做对的题目id
  1794. this.questionList.forEach((item, index) => {
  1795. passScore = item.passScore;
  1796. if (item.type == 1) {
  1797. //正确
  1798. if (item.ques == item.ans) {
  1799. item.scoreResult = item.score;
  1800. score += item.score;
  1801. number++;
  1802. rightQuestionIds.push(item.questionId);
  1803. } else {
  1804. //错误
  1805. item.scoreResult = 0;
  1806. if (item.ques) {
  1807. doWrongQuestionIds.push(item.questionId);
  1808. }
  1809. }
  1810. allScore += item.score;
  1811. if (item.ques) {
  1812. doQuestionNum++;
  1813. doQuestionIds.push(item.questionId);
  1814. }
  1815. } else if (item.type == 2) {
  1816. let isRight =
  1817. item.ans &&
  1818. item.ans.every((quesItem, quesIndex) => {
  1819. if (item.ques) {
  1820. return item.ques[quesIndex] == item.ans[quesIndex];
  1821. } else {
  1822. return false;
  1823. }
  1824. });
  1825. if (isRight) {
  1826. score += item.score;
  1827. number++;
  1828. item.scoreResult = item.score;
  1829. rightQuestionIds.push(item.questionId);
  1830. } else {
  1831. let hasPart = false;
  1832. let checkboxScore = 1; //获取单题总分数
  1833. item.ques &&
  1834. item.ques.forEach((ques, quesIndex) => {
  1835. //选错一个全扣
  1836. if (item.ques) {
  1837. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1838. checkboxScore = 0;
  1839. }
  1840. } else {
  1841. checkboxScore = 0;
  1842. }
  1843. });
  1844. //没选错
  1845. if (checkboxScore) {
  1846. checkboxScore = 0;
  1847. item.ans.forEach((ans, quesIndex) => {
  1848. //漏选扣一部分,对n题给n X partScore 分
  1849. if (item.ques) {
  1850. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1851. checkboxScore += item.partScore;
  1852. hasPart = true;
  1853. }
  1854. } else {
  1855. checkboxScore = 0;
  1856. }
  1857. });
  1858. }
  1859. if (!hasPart) {
  1860. //0分
  1861. item.scoreResult = 0;
  1862. if (item.ques) {
  1863. doWrongQuestionIds.push(item.questionId);
  1864. }
  1865. } else {
  1866. //部分分
  1867. // number++;
  1868. lessQuestionNum++
  1869. // doWrongQuestionIds.push(item.questionId);
  1870. item.scoreResult = checkboxScore;
  1871. score += checkboxScore;
  1872. // rightQuestionIds.push(item.questionId)
  1873. }
  1874. }
  1875. allScore += item.score;
  1876. if (item.ques && item.ques.length) {
  1877. doQuestionNum++;
  1878. doQuestionIds.push(item.questionId);
  1879. }
  1880. } else if (item.type == 3) {
  1881. if (item.ques == item.ans) {
  1882. item.scoreResult = item.score;
  1883. score += item.score;
  1884. number++;
  1885. rightQuestionIds.push(item.questionId);
  1886. } else {
  1887. item.scoreResult = 0;
  1888. if (item.ques) {
  1889. doWrongQuestionIds.push(item.questionId);
  1890. }
  1891. }
  1892. allScore += item.score;
  1893. if (item.ques) {
  1894. doQuestionNum++;
  1895. doQuestionIds.push(item.questionId);
  1896. }
  1897. } else if (item.type == 4) {
  1898. allScore += item.score;
  1899. if (item.ques && item.ques.length) {
  1900. doQuestionNum++;
  1901. doQuestionIds.push(item.questionId);
  1902. }
  1903. } else if (item.type == 5) {
  1904. allScore += item.score;
  1905. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1906. doQuestionNum++;
  1907. doQuestionIds.push(item.questionId);
  1908. }
  1909. }
  1910. });
  1911. //大于及格
  1912. if (score >= passScore) {
  1913. reportStatus = 1;
  1914. } else {
  1915. reportStatus = 0;
  1916. }
  1917. if(this.subscribeId) {
  1918. this.mockSubscribeEdit();
  1919. }
  1920. //交卷
  1921. this.$api
  1922. .mockRecordEdit({
  1923. examId: this.examId,
  1924. eachExamId:this.eachExamId,
  1925. reportStatus: reportStatus,
  1926. recordId: this.recordId,
  1927. rightQuestionNum: number,
  1928. status: 1,
  1929. lessQuestionNum:lessQuestionNum,
  1930. doQuestionIds: doQuestionIds.join(","),
  1931. rightQuestionIds: rightQuestionIds.join(","),
  1932. doQuestionNum: doQuestionNum,
  1933. performance: score,
  1934. totalScore: allScore,
  1935. examTime: parseInt(this.allTimes),
  1936. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1937. historyExamJson: JSON.stringify(this.questionList),
  1938. })
  1939. .then((res) => {
  1940. this.isSubmit = true;
  1941. if (res.data.code == 200) {
  1942. uni.showToast({
  1943. title: "交卷成功",
  1944. duration: 1000,
  1945. icon: "none",
  1946. });
  1947. setTimeout(() => {
  1948. uni.redirectTo({
  1949. url:
  1950. "/pages5/examReport/index?&examId=" +
  1951. this.examId +
  1952. "&id=" +
  1953. this.recordId+
  1954. "&eachExamId="+this.eachExamId +
  1955. "&subscribeId="+this.subscribeId
  1956. });
  1957. }, 1000);
  1958. }
  1959. });
  1960. //错题集id提交(客观题)
  1961. if(doWrongQuestionIds.length) {
  1962. this.$api
  1963. .mockWrongRecord({
  1964. eachExamId:this.eachExamId,
  1965. examId: this.examId,
  1966. questionIds: doWrongQuestionIds,
  1967. recordId: this.recordId,
  1968. })
  1969. .then((res) => {});
  1970. }
  1971. },
  1972. /**
  1973. * @param {Object} imgIndex
  1974. * @param {Object} bankIndex
  1975. * 删除简答图片
  1976. */
  1977. deleteImg(imgIndex, bankIndex) {
  1978. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1979. },
  1980. /**
  1981. * @param {Object} imgIndex
  1982. * @param {Object} bankIndex
  1983. * @param {Object} ansIndex
  1984. * 删除案例题简答图片
  1985. */
  1986. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1987. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1988. imgIndex,
  1989. 1
  1990. );
  1991. },
  1992. /**
  1993. * @param {Object} bankindex
  1994. * 选择上传图片
  1995. */
  1996. chooseImg(bankindex) {
  1997. if (
  1998. this.questionList[bankindex] &&
  1999. this.questionList[bankindex].ansText &&
  2000. this.questionList[bankindex].ansText.imageList.length >= 4
  2001. ) {
  2002. uni.showToast({
  2003. icon: "none",
  2004. title: "最多选择4张",
  2005. });
  2006. return;
  2007. }
  2008. uni.chooseImage({
  2009. count: 1, //默认9
  2010. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  2011. sourceType: ["album", "camera"], //从相册选择
  2012. success: (res) => {
  2013. let self = this;
  2014. // console.log(JSON.stringify(res.tempFilePaths));
  2015. let img = res.tempFilePaths[0];
  2016. uni.getImageInfo({
  2017. src: img,
  2018. success: async (res) => {
  2019. let canvasWidth = res.width; //图片原始长宽
  2020. let canvasHeight = res.height;
  2021. if (canvasWidth > 1000 || canvasHeight > 1000) {
  2022. uni.compressImage({
  2023. src: img,
  2024. quality: 75,
  2025. width: "50%",
  2026. height: "50%",
  2027. success: async (rest) => {
  2028. const dir = await self.uploadFile(rest.tempFilePath, 0);
  2029. this.questionList[bankindex].ansText.imageList.push(dir);
  2030. },
  2031. });
  2032. } else {
  2033. const dir = await self.uploadFile(img, 0);
  2034. this.questionList[bankindex].ansText.imageList.push(dir);
  2035. }
  2036. },
  2037. });
  2038. },
  2039. });
  2040. },
  2041. /**
  2042. * @param {Object} bankindex
  2043. * @param {Object} ansindex
  2044. * 案例题选择上传图片
  2045. */
  2046. chooseImgChild(bankindex, ansindex) {
  2047. if (
  2048. this.questionList[bankindex].jsonStr[ansindex] &&
  2049. this.questionList[bankindex].jsonStr[ansindex].ansText &&
  2050. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList
  2051. .length >= 4
  2052. ) {
  2053. uni.showToast({
  2054. icon: "none",
  2055. title: "最多选择4张",
  2056. });
  2057. return;
  2058. }
  2059. uni.chooseImage({
  2060. count: 1, //默认9
  2061. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  2062. sourceType: ["album", "camera"], //从相册选择
  2063. success: (res) => {
  2064. let self = this;
  2065. // console.log(JSON.stringify(res.tempFilePaths));
  2066. let img = res.tempFilePaths[0];
  2067. uni.getImageInfo({
  2068. src: img,
  2069. success: async (res) => {
  2070. let canvasWidth = res.width; //图片原始长宽
  2071. let canvasHeight = res.height;
  2072. if (canvasWidth > 1000 || canvasHeight > 1000) {
  2073. uni.compressImage({
  2074. src: img,
  2075. quality: 75,
  2076. width: "50%",
  2077. height: "50%",
  2078. success: async (rest) => {
  2079. const dir = await self.uploadFile(rest.tempFilePath, 0);
  2080. this.questionList[bankindex].jsonStr[
  2081. ansindex
  2082. ].ansText.imageList.push(dir);
  2083. },
  2084. });
  2085. } else {
  2086. const dir = await self.uploadFile(img, 0);
  2087. this.questionList[bankindex].jsonStr[
  2088. ansindex
  2089. ].ansText.imageList.push(dir);
  2090. }
  2091. },
  2092. });
  2093. },
  2094. });
  2095. },
  2096. uploadFile(options, int) {
  2097. var self = this;
  2098. return new Promise((resolve, reject) => {
  2099. var data = {
  2100. orderGoodsId: this.orderGoodsId,
  2101. imageStatus: int,
  2102. };
  2103. self.$api.aliyunpolicy(data).then((res) => {
  2104. console.log(res.data, 6);
  2105. if (res.data.code != 200) {
  2106. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2107. return;
  2108. }
  2109. var ossToken = res.data.data.resultContent;
  2110. if (ossToken.host == null || ossToken.host == undefined) {
  2111. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2112. return;
  2113. }
  2114. uni.uploadFile({
  2115. url: ossToken.host,
  2116. name: "file",
  2117. filePath: options,
  2118. fileType: "image",
  2119. header: {
  2120. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2121. },
  2122. formData: {
  2123. key: ossToken.dir,
  2124. OSSAccessKeyId: ossToken.accessid,
  2125. policy: ossToken.policy,
  2126. Signature: ossToken.signature,
  2127. callback: ossToken.callback,
  2128. success_action_status: 200,
  2129. },
  2130. success: (result) => {
  2131. if (result.statusCode === 200) {
  2132. resolve(ossToken.dir);
  2133. } else {
  2134. uni.showToast({
  2135. title: "上传失败",
  2136. icon: "none",
  2137. });
  2138. return;
  2139. }
  2140. },
  2141. fail: (error) => {
  2142. uni.showToast({
  2143. title: "上传接口报错" + error,
  2144. icon: "none",
  2145. });
  2146. return;
  2147. },
  2148. });
  2149. });
  2150. });
  2151. },
  2152. /**
  2153. * @param {Object} type
  2154. * @param {Object} bankindex
  2155. * 简答题答案确认
  2156. */
  2157. submitAns(bankindex) {
  2158. console.log(this.questionList[bankindex]);
  2159. if (
  2160. !this.questionList[bankindex].ansText.text &&
  2161. !this.questionList[bankindex].ansText.imageList.length
  2162. ) {
  2163. uni.showToast({
  2164. title: "请输入内容或上传图片",
  2165. duration: 2000,
  2166. icon: "none",
  2167. });
  2168. return;
  2169. }
  2170. this.$set(this.questionList[bankindex], "ques", {
  2171. imageList: this.questionList[bankindex].ansText.imageList || [],
  2172. text: this.questionList[bankindex].ansText.text || "",
  2173. });
  2174. this.isDoOver();
  2175. },
  2176. /**
  2177. * @param {Object} bankindex
  2178. * @param {Object} ansindex
  2179. * 案例题简答答案确认
  2180. */
  2181. submitAnsChild(bankindex, ansindex) {
  2182. if (
  2183. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  2184. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  2185. ) {
  2186. uni.showToast({
  2187. title: "请输入内容或上传图片",
  2188. duration: 2000,
  2189. icon: "none",
  2190. });
  2191. return;
  2192. }
  2193. this.$set(this.questionList[bankindex].ques, ansindex, {
  2194. imageList:
  2195. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList ||
  2196. [],
  2197. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || "",
  2198. });
  2199. this.isDoOver();
  2200. },
  2201. isRight(item, index) {
  2202. //单选
  2203. if (this.questionList[index].ques) {
  2204. if (item.type == 1) {
  2205. return this.questionList[index].ques == this.questionList[index].ans;
  2206. //多选
  2207. } else if (item.type == 2) {
  2208. //每一项都相等
  2209. return this.questionList[index].ans.every((item, i) => {
  2210. return item == this.questionList[index].ques[i];
  2211. });
  2212. //判断
  2213. } else if (item.type == 3) {
  2214. return this.questionList[index].ques == this.questionList[index].ans;
  2215. // } else if (item.type == 5) {
  2216. // if(this.questionList[index].ques.text){
  2217. // return true
  2218. // }else{
  2219. // return false
  2220. // }
  2221. } else {
  2222. return false;
  2223. }
  2224. } else {
  2225. return false;
  2226. }
  2227. },
  2228. right(bankIndex, ansIndex, option) {
  2229. if (
  2230. this.questionList[bankIndex].ques[ansIndex] &&
  2231. this.questionList[bankIndex].ans[ansIndex]
  2232. ) {
  2233. if (
  2234. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2235. option.optionsId
  2236. ) != -1 ||
  2237. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2238. option.optionsId
  2239. ) != -1
  2240. ) {
  2241. return true;
  2242. } else {
  2243. return false;
  2244. }
  2245. } else {
  2246. return false;
  2247. }
  2248. },
  2249. wrong(bankIndex, ansIndex, option) {
  2250. if (
  2251. this.questionList[bankIndex].ques[ansIndex] &&
  2252. this.questionList[bankIndex].ans[ansIndex]
  2253. ) {
  2254. if (
  2255. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2256. option.optionsId
  2257. ) != -1 &&
  2258. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2259. option.optionsId
  2260. ) == -1
  2261. ) {
  2262. return true;
  2263. } else {
  2264. return false;
  2265. }
  2266. } else {
  2267. return false;
  2268. }
  2269. },
  2270. isWrong(item, index) {
  2271. if (this.questionList[index].ques) {
  2272. //单选
  2273. if (item.type == 1) {
  2274. return this.questionList[index].ques != this.questionList[index].ans;
  2275. //多选
  2276. } else if (item.type == 2) {
  2277. //每一项都相等
  2278. return this.questionList[index].ques.some((item, i) => {
  2279. return this.questionList[index].ans.indexOf(item) == -1;
  2280. });
  2281. //判断
  2282. } else if (item.type == 3) {
  2283. return this.questionList[index].ques != this.questionList[index].ans;
  2284. } else {
  2285. return false;
  2286. }
  2287. } else {
  2288. return false;
  2289. }
  2290. },
  2291. isPart(item, index) {
  2292. if (this.questionList[index].ques) {
  2293. if (item.type == 2) {
  2294. let isWrong = this.questionList[index].ques.some((item, i) => {
  2295. return this.questionList[index].ans.indexOf(item) == -1;
  2296. });
  2297. let isRight = this.questionList[index].ans.every((item, i) => {
  2298. return item == this.questionList[index].ques[i];
  2299. });
  2300. if (!isRight && !isWrong) {
  2301. return true;
  2302. }
  2303. }
  2304. } else {
  2305. return false;
  2306. }
  2307. },
  2308. isOver(item, index) {
  2309. if (this.questionList[index].ques) {
  2310. if (item.type == 4) {
  2311. //案例题
  2312. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  2313. if (
  2314. jsonItem.type == 1 ||
  2315. jsonItem.type == 2 ||
  2316. jsonItem.type == 3
  2317. ) {
  2318. if (item.ques[indexs]) {
  2319. return true;
  2320. } else {
  2321. return false;
  2322. }
  2323. } else if (jsonItem.type == 5) {
  2324. if (
  2325. item.ques[indexs] &&
  2326. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  2327. ) {
  2328. console.log("chil");
  2329. return true;
  2330. } else {
  2331. return false;
  2332. }
  2333. }
  2334. });
  2335. if (isOver) {
  2336. return true;
  2337. } else {
  2338. return false;
  2339. }
  2340. } else if (item.type == 5) {
  2341. //简答题
  2342. //每一项都相等
  2343. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  2344. return true;
  2345. }
  2346. //判断
  2347. } else {
  2348. return false;
  2349. }
  2350. } else {
  2351. return false;
  2352. }
  2353. },
  2354. tabSelect(index, bankindex) {
  2355. this.$set(this.questionList[bankindex], "current", index);
  2356. },
  2357. showPhoto(contentStr) {
  2358. if (contentStr && typeof contentStr == "string") {
  2359. let reg = /<img[^>]*src[=\'\"\s]+([^\'\"]*)[\'\"]?[^>]*>/gi;
  2360. let strArr = contentStr.match(reg);
  2361. strArr.forEach((str, index) => {
  2362. strArr[index] = str.replace(reg, "$1");
  2363. });
  2364. // 预览图片
  2365. uni.previewImage({
  2366. urls: strArr,
  2367. longPressActions: {
  2368. itemList: ["发送给朋友", "保存图片", "收藏"],
  2369. success: function (data) {
  2370. console.log(
  2371. "选中了第" +
  2372. (data.tapIndex + 1) +
  2373. "个按钮,第" +
  2374. (data.index + 1) +
  2375. "张图片"
  2376. );
  2377. },
  2378. fail: function (err) {
  2379. console.log(err.errMsg);
  2380. },
  2381. },
  2382. });
  2383. }
  2384. },
  2385. },
  2386. };
  2387. </script>
  2388. <style lang="scss" scoped>
  2389. .questionBank {
  2390. width: 100%;
  2391. height: 100vh;
  2392. display: flex;
  2393. flex-direction: column;
  2394. }
  2395. .swiper {
  2396. width: 100%;
  2397. flex: 1;
  2398. }
  2399. .lisSty {
  2400. margin-bottom: 16rpx;
  2401. display: flex;
  2402. align-items: center;
  2403. .flex_auto {
  2404. flex: 1;
  2405. }
  2406. }
  2407. .activeTI {
  2408. vertical-align: middle;
  2409. display: inline-block;
  2410. border: 1rpx solid #eee;
  2411. border-radius: 50rpx;
  2412. height: 48rpx;
  2413. line-height: 46rpx;
  2414. text-align: center;
  2415. width: 48rpx;
  2416. margin-right: 15rpx;
  2417. color: #666;
  2418. font-size: 30rpx;
  2419. &.right {
  2420. color: #fff;
  2421. background: #36c75a;
  2422. }
  2423. &.wrong {
  2424. color: #fff;
  2425. background: #ff3b30;
  2426. }
  2427. &.checked {
  2428. color: #fff;
  2429. background: #007aff;
  2430. }
  2431. }
  2432. .submit_checkbox {
  2433. position: fixed;
  2434. left: 0;
  2435. right: 0;
  2436. bottom: 120rpx;
  2437. margin: 20rpx auto;
  2438. width: 526rpx;
  2439. height: 80rpx;
  2440. background: rgba(0, 122, 255, 1);
  2441. color: #fff;
  2442. text-align: center;
  2443. line-height: 80rpx;
  2444. font-size: 30rpx;
  2445. border-radius: 40rpx;
  2446. &.disabled {
  2447. opacity: 0.6;
  2448. }
  2449. }
  2450. .titles {
  2451. overflow: hidden;
  2452. margin-bottom: 24rpx;
  2453. }
  2454. .titBox {
  2455. padding: 41rpx 25rpx 24rpx 25rpx;
  2456. }
  2457. .titBox_title {
  2458. padding: 21rpx;
  2459. }
  2460. .tabs {
  2461. margin: 10rpx;
  2462. display: flex;
  2463. .tab {
  2464. margin: 0 4rpx;
  2465. padding: 10rpx 13rpx;
  2466. text-align: center;
  2467. color: #007aff;
  2468. font-size: 28rpx;
  2469. border-radius: 16rpx;
  2470. background: #fff;
  2471. &.current {
  2472. color: #fff;
  2473. background: #007aff;
  2474. }
  2475. }
  2476. }
  2477. .ans {
  2478. margin: 8rpx 8rpx 8rpx;
  2479. .ans_input {
  2480. border-radius: 16rpx;
  2481. background: #fff;
  2482. .top {
  2483. border-bottom: 1rpx solid #eeeeee;
  2484. padding: 16rpx;
  2485. display: flex;
  2486. align-items: center;
  2487. .icon {
  2488. margin-right: 20rpx;
  2489. width: 40rpx;
  2490. height: 38rpx;
  2491. }
  2492. .progress {
  2493. flex: 1;
  2494. }
  2495. .submit {
  2496. width: 168rpx;
  2497. height: 48rpx;
  2498. line-height: 48rpx;
  2499. text-align: center;
  2500. color: #fff;
  2501. font-size: 30rpx;
  2502. background: #007aff;
  2503. border-radius: 24rpx;
  2504. &.disabled {
  2505. opacity: 0.6;
  2506. }
  2507. }
  2508. }
  2509. .textarea {
  2510. textarea {
  2511. width: 100%;
  2512. height: 287rpx;
  2513. padding: 10rpx;
  2514. }
  2515. }
  2516. .imgs {
  2517. overflow: hidden;
  2518. display: flex;
  2519. width: 100%;
  2520. .img {
  2521. width: 104rpx;
  2522. height: 104rpx;
  2523. border-radius: 8rpx;
  2524. position: relative;
  2525. margin: 20rpx;
  2526. text {
  2527. position: absolute;
  2528. right: -15rpx;
  2529. top: -15rpx;
  2530. width: 30rpx;
  2531. height: 30rpx;
  2532. text-align: center;
  2533. line-height: 30rpx;
  2534. color: #fff;
  2535. background: #ff3b30;
  2536. border-radius: 50%;
  2537. }
  2538. image {
  2539. width: 100%;
  2540. height: 100%;
  2541. }
  2542. }
  2543. }
  2544. }
  2545. .ans_submit {
  2546. padding: 16rpx;
  2547. border-radius: 16rpx;
  2548. background: #fff;
  2549. .imgs {
  2550. overflow: hidden;
  2551. display: flex;
  2552. width: 100%;
  2553. .img {
  2554. width: 104rpx;
  2555. height: 104rpx;
  2556. border-radius: 8rpx;
  2557. position: relative;
  2558. margin: 20rpx;
  2559. image {
  2560. width: 100%;
  2561. height: 100%;
  2562. }
  2563. }
  2564. }
  2565. }
  2566. }
  2567. .leftLetters {
  2568. display: flex;
  2569. align-items: center;
  2570. width: 220rpx;
  2571. .btnType {
  2572. padding: 5rpx 10rpx;
  2573. border: 1rpx solid #007aff;
  2574. border-radius: 10rpx;
  2575. background-color: rgba(0, 122, 255, 0.1);
  2576. font-size: 28rpx;
  2577. color: #007aff;
  2578. margin-right: 15rpx;
  2579. }
  2580. }
  2581. .firstLetter {
  2582. display: flex;
  2583. justify-content: space-between;
  2584. align-items: center;
  2585. margin-bottom: 30rpx;
  2586. }
  2587. .popupView {
  2588. height: 100%;
  2589. padding-bottom: 100rpx;
  2590. .popupTops {
  2591. height: 77rpx;
  2592. border-bottom: 1rpx solid #eee;
  2593. text-align: center;
  2594. line-height: 77rpx;
  2595. font-size: 24rpx;
  2596. color: #999;
  2597. position: relative;
  2598. .topIcon {
  2599. position: absolute;
  2600. top: 10rpx;
  2601. left: 50%;
  2602. transform: translateX(-50%);
  2603. width: 80rpx;
  2604. height: 8rpx;
  2605. background-color: #999;
  2606. border-radius: 4rpx;
  2607. }
  2608. }
  2609. .popupContent {
  2610. }
  2611. }
  2612. .pageContent {
  2613. position: relative;
  2614. background-color: #eaeef1;
  2615. height: 100%;
  2616. padding-top: 8rpx;
  2617. padding-bottom: 100rpx;
  2618. overflow-y: scroll;
  2619. }
  2620. .pad_8 {
  2621. background-color: #fff;
  2622. margin: 0rpx 8rpx 8rpx;
  2623. border-radius: 16rpx;
  2624. &.no-margin {
  2625. margin-top: -16rpx;
  2626. border-radius: 0 0 16rpx 16rpx;
  2627. }
  2628. }
  2629. .answer {
  2630. height: 80rpx;
  2631. line-height: 80rpx;
  2632. padding: 0rpx 24rpx;
  2633. display: flex;
  2634. align-items: center;
  2635. justify-content: space-between;
  2636. color: #666;
  2637. font-size: 30rpx;
  2638. }
  2639. .footer_btn {
  2640. background-color: #fff;
  2641. z-index: 10078;
  2642. position: fixed;
  2643. bottom: 0rpx;
  2644. display: flex;
  2645. align-items: center;
  2646. justify-content: space-between;
  2647. width: 100%;
  2648. height: 98rpx;
  2649. padding: 0rpx 38rpx;
  2650. border-top: 1rpx solid #eee;
  2651. .flex_center {
  2652. flex: 1;
  2653. display: flex;
  2654. justify-content: center;
  2655. align-items: center;
  2656. flex-direction: column;
  2657. margin: 0 200rpx;
  2658. font-size: 24rpx;
  2659. color: #999999;
  2660. .up-icon {
  2661. margin-bottom: 18rpx;
  2662. width: 100%;
  2663. display: flex;
  2664. justify-content: center;
  2665. image {
  2666. width: 58rpx;
  2667. height: 21rpx;
  2668. }
  2669. }
  2670. }
  2671. .collect {
  2672. visibility: hidden;
  2673. width: 100rpx;
  2674. &.show {
  2675. visibility: visible;
  2676. }
  2677. > view {
  2678. display: flex;
  2679. flex-direction: column;
  2680. align-items: center;
  2681. justify-content: center;
  2682. image {
  2683. width: 32rpx;
  2684. height: 32rpx;
  2685. margin-bottom: 6rpx;
  2686. }
  2687. view {
  2688. font-size: 24rpx;
  2689. color: #999999;
  2690. }
  2691. }
  2692. }
  2693. }
  2694. .boxSty {
  2695. padding: 44rpx 41rpx 0rpx;
  2696. }
  2697. .liListSty {
  2698. border: 1rpx solid #eeeeee;
  2699. width: 88rpx;
  2700. height: 88rpx;
  2701. border-radius: 32rpx;
  2702. text-align: center;
  2703. line-height: 88rpx;
  2704. color: #333;
  2705. font-size: 32rpx;
  2706. float: left;
  2707. margin: 20rpx 23rpx;
  2708. &.isRight {
  2709. border: 1rpx solid #eeeeee;
  2710. color: #fff;
  2711. background: #36c75a;
  2712. }
  2713. &.isWrong {
  2714. border: 1rpx solid #eeeeee;
  2715. color: #fff;
  2716. background: #ff3b30;
  2717. }
  2718. &.isPart {
  2719. border: 1rpx solid #eeeeee;
  2720. color: #fff;
  2721. background: #FFC53D;
  2722. }
  2723. &.isOver {
  2724. border: 1rpx solid #eeeeee;
  2725. color: #fff;
  2726. background: blue;
  2727. }
  2728. }
  2729. .answerInfos {
  2730. padding: 25rpx 25rpx 25rpx 23rpx;
  2731. }
  2732. .answerTitle {
  2733. margin-bottom: 28rpx;
  2734. color: #666;
  2735. font-size: 30rpx;
  2736. }
  2737. .answerContent {
  2738. font-size: 30rpx;
  2739. color: #666;
  2740. }
  2741. .textChild {
  2742. display: inline-block;
  2743. vertical-align: middle;
  2744. }
  2745. .dialog {
  2746. position: fixed;
  2747. left: 0;
  2748. top: 0;
  2749. width: 100%;
  2750. height: 100%;
  2751. background-color: rgba(0, 0, 0, 0.8);
  2752. display: flex;
  2753. flex-direction: column;
  2754. align-items: center;
  2755. justify-content: center;
  2756. z-index: 20000;
  2757. .pointer {
  2758. width: 338rpx;
  2759. height: 240rpx;
  2760. }
  2761. .text {
  2762. font-size: 32rpx;
  2763. color: #ffffff;
  2764. text-align: center;
  2765. }
  2766. .btn {
  2767. width: 242rpx;
  2768. height: 82rpx;
  2769. border: 2rpx solid #ffffff;
  2770. border-radius: 16rpx;
  2771. text-align: center;
  2772. line-height: 82rpx;
  2773. margin: 41rpx auto;
  2774. color: #fff;
  2775. font-size: 32rpx;
  2776. }
  2777. }
  2778. .dialog-arrow {
  2779. padding-top: 124rpx;
  2780. position: fixed;
  2781. left: 0;
  2782. top: 0;
  2783. width: 100%;
  2784. height: 100%;
  2785. background-color: rgba(0, 0, 0, 0.8);
  2786. z-index: 20000;
  2787. .pointer {
  2788. margin-left: 87rpx;
  2789. display: block;
  2790. width: 95rpx;
  2791. height: 98rpx;
  2792. }
  2793. .text {
  2794. padding-left: 177rpx;
  2795. font-size: 32rpx;
  2796. color: #ffffff;
  2797. }
  2798. .btn {
  2799. width: 242rpx;
  2800. height: 82rpx;
  2801. border: 2rpx solid #ffffff;
  2802. border-radius: 16rpx;
  2803. text-align: center;
  2804. line-height: 82rpx;
  2805. margin: 500rpx auto 0;
  2806. color: #fff;
  2807. font-size: 32rpx;
  2808. }
  2809. }
  2810. .dialog_wrap {
  2811. position: fixed;
  2812. left: 0;
  2813. top: 0;
  2814. width: 100%;
  2815. height: 100%;
  2816. z-index: 9999999999;
  2817. .bg {
  2818. background: rgba(0, 0, 0, 0.3);
  2819. position: absolute;
  2820. left: 0;
  2821. top: 0;
  2822. width: 100%;
  2823. height: 100%;
  2824. }
  2825. .dialog {
  2826. position: absolute;
  2827. left: 50%;
  2828. top: 50%;
  2829. transform: translate3D(-50%, -50%, 0);
  2830. width: 640rpx;
  2831. height: 439rpx;
  2832. background: #ffffff;
  2833. border-radius: 24rpx;
  2834. .title {
  2835. font-size: 30rpx;
  2836. font-weight: bold;
  2837. color: #333333;
  2838. line-height: 48rpx;
  2839. text-align: center;
  2840. margin-top: 40rpx;
  2841. }
  2842. .content {
  2843. margin: 35rpx 35rpx 0;
  2844. font-size: 30rpx;
  2845. color: #666666;
  2846. line-height: 48rpx;
  2847. }
  2848. .btns {
  2849. margin-top: 35rpx;
  2850. display: flex;
  2851. align-items: center;
  2852. justify-content: center;
  2853. .btn {
  2854. width: 200rpx;
  2855. height: 80rpx;
  2856. line-height: 80rpx;
  2857. text-align: center;
  2858. background: #f5f5f5;
  2859. border-radius: 40rpx;
  2860. font-size: 30rpx;
  2861. color: rgba(0, 122, 255, 1);
  2862. background: #f5f5f5;
  2863. margin: 0 20rpx;
  2864. &.active {
  2865. color: #f5f5f5;
  2866. background: rgba(0, 122, 255, 1);
  2867. }
  2868. }
  2869. }
  2870. }
  2871. }
  2872. .popboxs {
  2873. width: 100%;
  2874. height: 100%;
  2875. display: flex;
  2876. flex-direction: column;
  2877. align-items: center;
  2878. }
  2879. .classTops {
  2880. flex-shrink: 0;
  2881. padding: 39rpx 0rpx 4rpx;
  2882. font-weight: bold;
  2883. color: #333;
  2884. font-size: 30rpx;
  2885. }
  2886. .textStys {
  2887. width: 100%;
  2888. flex: 1;
  2889. padding: 36rpx;
  2890. }
  2891. .classFootsty {
  2892. flex-shrink: 0;
  2893. display: flex;
  2894. align-items: center;
  2895. justify-content: center;
  2896. padding: 10rpx 0rpx 40rpx;
  2897. .btnsty {
  2898. width: 200rpx;
  2899. height: 80rpx;
  2900. border-radius: 40rpx;
  2901. font-weight: bold;
  2902. font-size: 30rpx;
  2903. text-align: center;
  2904. line-height: 80rpx;
  2905. }
  2906. .btns1 {
  2907. background-color: #f5f5f5;
  2908. color: #007aff;
  2909. }
  2910. .btns2 {
  2911. margin-left: 40rpx;
  2912. background-color: #007aff;
  2913. color: #ffffff;
  2914. }
  2915. }
  2916. </style>