questionBank.vue 58 KB

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