questionBank.vue 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305
  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] && (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 && (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. if(item.ques) {
  656. return item.ques[quesIndex] == item.ans[quesIndex];
  657. } else {
  658. return false;
  659. }
  660. });
  661. if (isRight) {
  662. score += item.score;
  663. number++;
  664. item.scoreResult = item.score;
  665. rightQuestionIds.push(item.questionId)
  666. } else {
  667. let checkboxScore = item.score; //获取单题总分数
  668. item.ques && item.ques.forEach((ques,quesIndex) => {
  669. //选错一个全扣
  670. if(item.ques) {
  671. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  672. checkboxScore = 0;
  673. }
  674. } else {
  675. checkboxScore = 0;
  676. }
  677. })
  678. console.log(checkboxScore)
  679. //没选错
  680. if(checkboxScore) {
  681. item.ans.forEach((ans,quesIndex) => {
  682. //漏选扣一部分
  683. if(item.ques) {
  684. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  685. checkboxScore -= item.partScore;
  686. }
  687. } else {
  688. checkboxScore = 0;
  689. }
  690. })
  691. }
  692. if(checkboxScore <= 0) { //0分
  693. item.scoreResult = 0;
  694. doWrongQuestionIds.push(item.questionId)
  695. } else { //部分分
  696. number++;
  697. item.scoreResult = checkboxScore;
  698. score += checkboxScore;
  699. rightQuestionIds.push(item.questionId)
  700. }
  701. }
  702. allScore += item.score;
  703. if (item.ques && item.ques.length) {
  704. doQuestionNum++;
  705. doQuestionIds.push(item.questionId)
  706. }
  707. } else if (item.type == 3) {
  708. if (item.ques == item.ans) {
  709. item.scoreResult = item.score;
  710. score += item.score;
  711. number++;
  712. rightQuestionIds.push(item.questionId)
  713. } else {
  714. item.scoreResult = 0;
  715. doWrongQuestionIds.push(item.questionId)
  716. }
  717. allScore += item.score;
  718. if (item.ques) {
  719. doQuestionNum++;
  720. doQuestionIds.push(item.questionId)
  721. }
  722. } else if (item.type == 4) {
  723. if (item.ques && item.ques.length) {
  724. doQuestionNum++;
  725. }
  726. } else if (item.type == 5) {
  727. if (item.ques) {
  728. doQuestionNum++;
  729. }
  730. }
  731. });
  732. //大于60分及格
  733. if(score >= 60) {
  734. reportStatus = 1
  735. } else {
  736. reportStatus = 0
  737. }
  738. //交卷
  739. this.$api
  740. .examRecordEdit({
  741. examId: this.id,
  742. goodsId: this.goodsId,
  743. reportStatus:reportStatus,
  744. recordId: this.recordId,
  745. rightQuestionNum: number,
  746. status: 1,
  747. doQuestionIds:doQuestionIds.join(','),
  748. rightQuestionIds:rightQuestionIds.join(','),
  749. doQuestionNum: doQuestionNum,
  750. performance: score,
  751. totalScore: allScore,
  752. examTime: parseInt(this.allTimes),
  753. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  754. historyExamJson: JSON.stringify(this.questionList)
  755. })
  756. .then(res => {
  757. this.isSubmit = true;
  758. if (res.data.code == 200) {
  759. }
  760. });
  761. //错题集id提交(客观题)
  762. this.$api.examWrongRecord({
  763. examId: this.id,
  764. goodsId: this.goodsId,
  765. questionIds: doWrongQuestionIds,
  766. recordId: this.recordId
  767. }).then(res => {
  768. });
  769. },
  770. /**
  771. * 立即交卷
  772. */
  773. submitNow() {
  774. this.showpopups = false;
  775. this.needBack = false;
  776. this.submit();
  777. },
  778. /**
  779. * 离开页面统计回答正确题数
  780. */
  781. examRecordEdit() {
  782. if (!this.isSubmit) {
  783. let number = 0;
  784. let score = 0;
  785. let doQuestionNum = 0;
  786. this.questionList.forEach((item, index) => {
  787. if (item.type == 1) {
  788. if (item.ques == item.ans) {
  789. score += item.score;
  790. number++;
  791. }
  792. if (item.ques) {
  793. doQuestionNum++;
  794. }
  795. } else if (item.type == 2) {
  796. let isRight =
  797. item.ans &&
  798. item.ans.every((quesItem, quesIndex) => {
  799. if(item.ques) {
  800. return item.ques[quesIndex] == item.ans[quesIndex];
  801. } else {
  802. return false;
  803. }
  804. });
  805. if (isRight) {
  806. score += item.score;
  807. number++;
  808. } else {
  809. let checkboxScore = item.score; //获取单题总分数
  810. item.ques && item.ques.forEach((ques,quesIndex) => {
  811. //选错一个全扣
  812. if(item.ques) {
  813. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  814. checkboxScore = 0;
  815. }
  816. } else {
  817. checkboxScore = 0;
  818. }
  819. })
  820. console.log(checkboxScore)
  821. //没选错
  822. if(checkboxScore) {
  823. item.ans.forEach((ans,quesIndex) => {
  824. //漏选扣一部分
  825. if(item.ques) {
  826. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  827. checkboxScore -= item.partScore;
  828. }
  829. } else {
  830. checkboxScore = 0;
  831. }
  832. })
  833. }
  834. if(checkboxScore <= 0) { //0分
  835. } else { //部分分
  836. number++;
  837. score += checkboxScore;
  838. }
  839. }
  840. if (item.ques && item.ques.length) {
  841. doQuestionNum++;
  842. }
  843. } else if (item.type == 3) {
  844. if (item.ques == item.ans) {
  845. score += item.score;
  846. number++;
  847. }
  848. if (item.ques) {
  849. doQuestionNum++;
  850. }
  851. } else if (item == 4) {
  852. if (item.ques.length) {
  853. doQuestionNum++;
  854. }
  855. } else if (item.type == 5) {
  856. if (item.ques) {
  857. doQuestionNum++;
  858. }
  859. }
  860. });
  861. this.$api
  862. .examRecordEdit({
  863. examId: this.id,
  864. goodsId: this.goodsId,
  865. recordId: this.recordId,
  866. rightQuestionNum: number,
  867. status: 0,
  868. doQuestionNum: doQuestionNum,
  869. historyExamJson: JSON.stringify(this.questionList)
  870. })
  871. .then(res => {});
  872. }
  873. },
  874. /**
  875. * 记录总题数
  876. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  877. */
  878. examRecord(hasSpecial) {
  879. let questionList = 0;
  880. if(!hasSpecial) {
  881. this.questionList.forEach((item, index) => {
  882. if(item.type == 1 || item.type == 2 || item.type == 3) {
  883. questionList++;
  884. }
  885. })
  886. } else {
  887. questionList = this.questionList.length;
  888. }
  889. if(this.isFromVideo) { //视频课程
  890. this.$api
  891. .bankRecord({
  892. chapterExamId: this.chapterId || 0,
  893. moduleExamId: this.moduleId || 0,
  894. examId: this.id,
  895. goodsId: this.goodsId,
  896. gradeId:this.gradeId,
  897. totalQuestionNum: questionList
  898. })
  899. .then(res => {
  900. this.recordId = res.data.data;
  901. });
  902. } else { //题库
  903. this.$api
  904. .examRecord({
  905. chapterExamId: this.chapterId || 0,
  906. moduleExamId: this.moduleId || 0,
  907. examId: this.id,
  908. goodsId: this.goodsId,
  909. totalQuestionNum: questionList
  910. })
  911. .then(res => {
  912. this.recordId = res.data.data;
  913. });
  914. }
  915. },
  916. /**
  917. * @param {Object} second倒计时过滤器
  918. */
  919. countdown(second) {
  920. if (second) {
  921. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  922. let m = parseInt((second / 60) % 60); // 计算分数
  923. let s = parseInt(second % 60); // 计算当前秒数
  924. if (h < 10) h = '0' + h;
  925. if (m < 10) m = '0' + m;
  926. if (s < 10) s = '0' + s;
  927. return h + ':' + m + ':' + s;
  928. } else {
  929. return '';
  930. }
  931. },
  932. /**
  933. * 请求题目列表
  934. */
  935. goodsQuestionList() {
  936. this.$api
  937. .goodsQuestionList({
  938. examId: this.id
  939. })
  940. .then(res => {
  941. if (!res.data.data.length) {
  942. this.hideDialog();
  943. uni.showModal({
  944. showCancel: false,
  945. content: '该试卷暂无题目',
  946. success: function(k) {
  947. if (k.confirm) {
  948. uni.navigateBack();
  949. }
  950. }
  951. });
  952. return;
  953. }
  954. this.allTimes = res.data.data[0].answerTime * 60;
  955. this.lastTime = res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
  956. //考试时间到了自动交卷
  957. if (this.lastTime) {
  958. this.timer = setInterval(() => {
  959. if (this.lastTime <= 0) {
  960. clearInterval(this.timer);
  961. uni.showModal({
  962. title: '提示',
  963. content: '考试时间到,自动交卷',
  964. confirmText: '确定',
  965. showCancel: false,
  966. success: res => {
  967. this.submit();
  968. }
  969. });
  970. return;
  971. }
  972. this.lastTime--;
  973. }, 1000);
  974. } else {
  975. }
  976. res.data.data.forEach((item, index) => {
  977. if (typeof item.jsonStr == 'string') {
  978. item.jsonStr = JSON.parse(item.jsonStr);
  979. if (item.type == 2) {
  980. //多选
  981. item.jsonStr.forEach(str => {
  982. str.optionsId = '' + str.optionsId;
  983. });
  984. let arr = item.answerQuestion.split(',');
  985. arr.forEach((a, i) => {
  986. arr[i] = '' + a;
  987. });
  988. item.ans = arr;
  989. return;
  990. } else if (item.type == 5) {
  991. //简答题
  992. item.ansText = {
  993. text: '',
  994. imageList: []
  995. };
  996. } else if (item.type == 4) {
  997. //案例题
  998. console.log(item.jsonStr);
  999. item.ques = [];
  1000. item.current = 0;
  1001. let ansArr = [];
  1002. item.jsonStr.forEach((json, index) => {
  1003. if (json.type == 1) {
  1004. ansArr[index] = json.answerQuestion;
  1005. } else if (json.type == 2) {
  1006. json.optionsList.forEach(str => {
  1007. str.optionsId = '' + str.optionsId;
  1008. });
  1009. let arr = json.answerQuestion.split(',');
  1010. arr.forEach((a, i) => {
  1011. arr[i] = '' + a;
  1012. });
  1013. ansArr[index] = arr;
  1014. } else if (json.type == 3) {
  1015. ansArr[index] = json.answerQuestion;
  1016. } else if (json.type == 5) {
  1017. ansArr[index] = {
  1018. text: '',
  1019. imageList: []
  1020. };
  1021. json.ansText = {
  1022. text: '',
  1023. imageList: []
  1024. };
  1025. }
  1026. });
  1027. item.ans = ansArr;
  1028. return;
  1029. }
  1030. item.ans = item.answerQuestion;
  1031. }
  1032. });
  1033. this.questionList = res.data.data;
  1034. this.lastCount = this.questionList.length;
  1035. this.examRecord();
  1036. this.getCollectInfo(this.current);
  1037. });
  1038. },
  1039. /**
  1040. * @param {Object} e单选点击
  1041. */
  1042. radioSelect(optionsId, bindex) {
  1043. if (this.questionList[bindex].ques) return;
  1044. this.$set(this.questionList[bindex], 'ques', optionsId);
  1045. // 回答错误
  1046. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1047. this.$api
  1048. .examWrongRecord({
  1049. examId: this.id,
  1050. goodsId: this.goodsId,
  1051. questionIds: [this.questionList[bindex].questionId],
  1052. recordId: this.recordId
  1053. })
  1054. .then(res => {});
  1055. } else {
  1056. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1057. // if(question) {
  1058. // this.$api.wrongRecordDelete({
  1059. // "examId": +this.id,
  1060. // "goodsId": +this.goodsId,
  1061. // "questionId": this.questionList[bindex].questionId,
  1062. // }).then(res => {
  1063. // })
  1064. // }
  1065. }
  1066. },
  1067. /**
  1068. * @param {Object} e案例单选点击
  1069. */
  1070. radioSelectChild(optionsId, ansIndex, bindex) {
  1071. if (this.questionList[bindex].ques[ansIndex]) return;
  1072. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1073. },
  1074. /**
  1075. * @param {Object} 多选点击
  1076. */
  1077. checkboxSelect(optionsId, bindex, index) {
  1078. this.$set(this.questionList[bindex].jsonStr[index], 'checked', !this.questionList[bindex].jsonStr[index].checked);
  1079. },
  1080. /**
  1081. * @param {Object} 案例多选点击
  1082. */
  1083. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1084. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex], 'checked', !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked);
  1085. },
  1086. /**
  1087. * @param {Object} 多选确认
  1088. */
  1089. checkboxSubmit(bindex) {
  1090. if (this.questionList[bindex].ques) return;
  1091. let arr = [];
  1092. this.questionList[bindex].jsonStr.forEach(item => {
  1093. if (item.checked) {
  1094. arr.push(item.optionsId);
  1095. }
  1096. });
  1097. this.$set(this.questionList[bindex], 'ques', arr);
  1098. let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
  1099. return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
  1100. });
  1101. // 回答错误
  1102. if (isWrong) {
  1103. this.$api
  1104. .examWrongRecord({
  1105. examId: this.id,
  1106. goodsId: this.goodsId,
  1107. questionIds: [this.questionList[bindex].questionId],
  1108. recordId: this.recordId
  1109. })
  1110. .then(res => {});
  1111. } else {
  1112. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1113. // if(question) {
  1114. // this.$api.wrongRecordDelete({
  1115. // "examId": +this.id,
  1116. // "goodsId": +this.goodsId,
  1117. // "questionId": this.questionList[bindex].questionId,
  1118. // }).then(res => {
  1119. // })
  1120. // }
  1121. }
  1122. },
  1123. /**
  1124. * @param {Object} 案例多选确认
  1125. */
  1126. checkboxSubmitChild(bindex, ansIndex) {
  1127. if (this.questionList[bindex].ques[ansIndex]) return;
  1128. let arr = [];
  1129. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  1130. if (item.checked) {
  1131. arr.push(item.optionsId);
  1132. }
  1133. });
  1134. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1135. },
  1136. /**
  1137. * @param {Object} index
  1138. * @param {Object} bindex
  1139. * 判断题
  1140. */
  1141. judgeSelect(index, bindex) {
  1142. if (this.questionList[bindex].ques) return;
  1143. this.$set(this.questionList[bindex], 'ques', index + '');
  1144. // 回答错误
  1145. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1146. this.$api
  1147. .examWrongRecord({
  1148. examId: this.id,
  1149. goodsId: this.goodsId,
  1150. questionIds:[this.questionList[bindex].questionId],
  1151. recordId: this.recordId
  1152. })
  1153. .then(res => {});
  1154. } else {
  1155. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1156. // if(question) {
  1157. // this.$api.wrongRecordDelete({
  1158. // "examId": +this.id,
  1159. // "goodsId": +this.goodsId,
  1160. // "questionId": this.questionList[bindex].questionId,
  1161. // }).then(res => {
  1162. // })
  1163. // }
  1164. }
  1165. },
  1166. /**
  1167. * @param {Object} ansindex
  1168. * @param {Object} childindex
  1169. * @param {Object} bindex
  1170. * 案例判断题
  1171. */
  1172. judgeSelectChild(ansindex, childindex, bindex) {
  1173. if (this.questionList[bindex].ques[ansindex]) return;
  1174. this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
  1175. },
  1176. openFooterTab() {
  1177. this.show = true;
  1178. },
  1179. hideDialog() {
  1180. this.showDialog = false;
  1181. },
  1182. changeIndex(index) {
  1183. this.current = index;
  1184. },
  1185. swiperChange(e) {
  1186. this.current = e.detail.current;
  1187. this.getCollectInfo(this.current);
  1188. },
  1189. /**
  1190. * @param {Object} current
  1191. * 获取收藏信息
  1192. */
  1193. getCollectInfo(current) {
  1194. this.$api
  1195. .getCollectInfo({
  1196. examId: this.id,
  1197. questionId: this.questionList[current].questionId,
  1198. goodsId: this.goodsId
  1199. })
  1200. .then(res => {
  1201. if (res.data.code == 500) {
  1202. this.$set(this.collectList, current, false);
  1203. } else if (res.data.code == 200) {
  1204. this.$set(this.collectList, current, res.data.data);
  1205. }
  1206. });
  1207. },
  1208. pdsubmit() {
  1209. // if (this.bankType == 1) {
  1210. let ansCount = this.questionOverNum(true); //已答题数
  1211. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1212. //没有答完
  1213. if (this.lastCount !== 0) {
  1214. this.cgType = 6;
  1215. this.showpopups = true;
  1216. return;
  1217. }
  1218. // }
  1219. this.submit();
  1220. },
  1221. /**
  1222. * 交卷
  1223. */
  1224. submit() {
  1225. let score = 0; //计算总分
  1226. let reportStatus = 0;
  1227. let number = 0; //做对的题目数量
  1228. let doQuestionNum = 0; //做过的题目数量
  1229. let allScore = 0; //总分
  1230. let passScore = 0;
  1231. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1232. let doQuestionIds = []; //做过的题目id
  1233. let rightQuestionIds = []; //做对的题目id
  1234. this.questionList.forEach((item, index) => {
  1235. passScore = item.passScore
  1236. if (item.type == 1) {
  1237. //正确
  1238. if (item.ques == item.ans) {
  1239. item.scoreResult = item.score;
  1240. score += item.score;
  1241. number++;
  1242. rightQuestionIds.push(item.questionId)
  1243. } else { //错误
  1244. item.scoreResult = 0;
  1245. doWrongQuestionIds.push(item.questionId)
  1246. }
  1247. allScore += item.score;
  1248. if (item.ques) {
  1249. doQuestionNum++;
  1250. doQuestionIds.push(item.questionId)
  1251. }
  1252. } else if (item.type == 2) {
  1253. let isRight =
  1254. item.ans &&
  1255. item.ans.every((quesItem, quesIndex) => {
  1256. if(item.ques) {
  1257. return item.ques[quesIndex] == item.ans[quesIndex];
  1258. } else {
  1259. return false;
  1260. }
  1261. });
  1262. if (isRight) {
  1263. score += item.score;
  1264. number++;
  1265. item.scoreResult = item.score;
  1266. rightQuestionIds.push(item.questionId)
  1267. } else {
  1268. let checkboxScore = item.score; //获取单题总分数
  1269. item.ques && item.ques.forEach((ques,quesIndex) => {
  1270. //选错一个全扣
  1271. if(item.ques) {
  1272. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1273. checkboxScore = 0;
  1274. }
  1275. } else {
  1276. checkboxScore = 0;
  1277. }
  1278. })
  1279. console.log(checkboxScore)
  1280. //没选错
  1281. if(checkboxScore) {
  1282. item.ans.forEach((ans,quesIndex) => {
  1283. //漏选扣一部分
  1284. if(item.ques) {
  1285. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  1286. checkboxScore -= item.partScore;
  1287. }
  1288. } else {
  1289. checkboxScore = 0;
  1290. }
  1291. })
  1292. }
  1293. if(checkboxScore <= 0) { //0分
  1294. item.scoreResult = 0;
  1295. doWrongQuestionIds.push(item.questionId)
  1296. } else { //部分分
  1297. number++;
  1298. item.scoreResult = checkboxScore;
  1299. score += checkboxScore;
  1300. rightQuestionIds.push(item.questionId)
  1301. }
  1302. }
  1303. allScore += item.score;
  1304. if (item.ques && item.ques.length) {
  1305. doQuestionNum++;
  1306. doQuestionIds.push(item.questionId)
  1307. }
  1308. } else if (item.type == 3) {
  1309. if (item.ques == item.ans) {
  1310. item.scoreResult = item.score;
  1311. score += item.score;
  1312. number++;
  1313. rightQuestionIds.push(item.questionId)
  1314. } else {
  1315. item.scoreResult = 0;
  1316. doWrongQuestionIds.push(item.questionId)
  1317. }
  1318. allScore += item.score;
  1319. if (item.ques) {
  1320. doQuestionNum++;
  1321. doQuestionIds.push(item.questionId)
  1322. }
  1323. } else if (item.type == 4) {
  1324. if (item.ques && item.ques.length) {
  1325. doQuestionNum++;
  1326. }
  1327. } else if (item.type == 5) {
  1328. if (item.ques) {
  1329. doQuestionNum++;
  1330. }
  1331. }
  1332. });
  1333. //大于及格
  1334. if(score >= passScore) {
  1335. reportStatus = 1
  1336. } else {
  1337. reportStatus = 0
  1338. }
  1339. //交卷
  1340. this.$api
  1341. .examRecordEdit({
  1342. examId: this.id,
  1343. goodsId: this.goodsId,
  1344. reportStatus:reportStatus,
  1345. recordId: this.recordId,
  1346. rightQuestionNum: number,
  1347. status: 1,
  1348. doQuestionIds:doQuestionIds.join(','),
  1349. rightQuestionIds:rightQuestionIds.join(','),
  1350. doQuestionNum: doQuestionNum,
  1351. performance: score,
  1352. totalScore: allScore,
  1353. examTime: parseInt(this.allTimes),
  1354. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1355. historyExamJson: JSON.stringify(this.questionList)
  1356. })
  1357. .then(res => {
  1358. this.isSubmit = true;
  1359. if (res.data.code == 200) {
  1360. uni.showToast({
  1361. title: '交卷成功',
  1362. duration: 1000,
  1363. icon: 'none'
  1364. });
  1365. setTimeout(() => {
  1366. uni.redirectTo({
  1367. url: '/pages2/bank/question_report?examId='+this.id+'&id=' + this.recordId
  1368. });
  1369. }, 1000);
  1370. }
  1371. });
  1372. //错题集id提交(客观题)
  1373. this.$api.examWrongRecord({
  1374. examId: this.id,
  1375. goodsId: this.goodsId,
  1376. questionIds: doWrongQuestionIds,
  1377. recordId: this.recordId
  1378. }).then(res => {
  1379. });
  1380. },
  1381. /**
  1382. * @param {Object} state
  1383. * @param {Object} index
  1384. * 收藏
  1385. */
  1386. collect(state, index) {
  1387. if (!state) {
  1388. this.$api
  1389. .collectQuestion({
  1390. examId: this.id,
  1391. questionId: this.questionList[index].questionId,
  1392. goodsId: this.goodsId || ''
  1393. })
  1394. .then(res => {
  1395. if (res.data.code == 200) {
  1396. this.$set(this.collectList, index, true);
  1397. uni.showToast({
  1398. title: '收藏成功',
  1399. duration: 2000,
  1400. icon: 'none'
  1401. });
  1402. this.getCollectInfo(index)
  1403. }
  1404. });
  1405. } else {
  1406. this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
  1407. if (res.data.code == 200) {
  1408. this.$set(this.collectList, index, false);
  1409. uni.showToast({
  1410. title: '取消收藏成功',
  1411. duration: 2000,
  1412. icon: 'none'
  1413. });
  1414. }
  1415. });
  1416. }
  1417. return;
  1418. },
  1419. /**
  1420. * @param {Object} imgIndex
  1421. * @param {Object} bankIndex
  1422. * 删除简答图片
  1423. */
  1424. deleteImg(imgIndex, bankIndex) {
  1425. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1426. },
  1427. /**
  1428. * @param {Object} imgIndex
  1429. * @param {Object} bankIndex
  1430. * @param {Object} ansIndex
  1431. * 删除案例题简答图片
  1432. */
  1433. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1434. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex, 1);
  1435. },
  1436. /**
  1437. * @param {Object} bankindex
  1438. * 选择上传图片
  1439. */
  1440. chooseImg(bankindex) {
  1441. if(this.questionList[bankindex] && this.questionList[bankindex].ansText && this.questionList[bankindex].ansText.imageList.length >= 4) {
  1442. uni.showToast({
  1443. icon:'none',
  1444. title:'最多选择4张'
  1445. })
  1446. return;
  1447. }
  1448. uni.chooseImage({
  1449. count: 1, //默认9
  1450. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  1451. sourceType: ['album', 'camera'], //从相册选择
  1452. success: res => {
  1453. let self = this;
  1454. // console.log(JSON.stringify(res.tempFilePaths));
  1455. let img = res.tempFilePaths[0];
  1456. uni.getImageInfo({
  1457. src: img,
  1458. success: async res => {
  1459. let canvasWidth = res.width; //图片原始长宽
  1460. let canvasHeight = res.height;
  1461. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1462. uni.compressImage({
  1463. src: img,
  1464. quality: 75,
  1465. width: '50%',
  1466. height: '50%',
  1467. success: async rest => {
  1468. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1469. this.questionList[bankindex].ansText.imageList.push(dir);
  1470. }
  1471. });
  1472. } else {
  1473. const dir = await self.uploadFile(img, 0);
  1474. this.questionList[bankindex].ansText.imageList.push(dir);
  1475. }
  1476. }
  1477. });
  1478. }
  1479. });
  1480. },
  1481. /**
  1482. * @param {Object} bankindex
  1483. * @param {Object} ansindex
  1484. * 案例题选择上传图片
  1485. */
  1486. chooseImgChild(bankindex, ansindex) {
  1487. if(this.questionList[bankindex].jsonStr[ansindex] && this.questionList[bankindex].jsonStr[ansindex].ansText && this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length >= 4) {
  1488. uni.showToast({
  1489. icon:'none',
  1490. title:'最多选择4张'
  1491. })
  1492. return;
  1493. }
  1494. uni.chooseImage({
  1495. count: 1, //默认9
  1496. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  1497. sourceType: ['album', 'camera'], //从相册选择
  1498. success: res => {
  1499. let self = this;
  1500. // console.log(JSON.stringify(res.tempFilePaths));
  1501. let img = res.tempFilePaths[0];
  1502. uni.getImageInfo({
  1503. src: img,
  1504. success: async res => {
  1505. let canvasWidth = res.width; //图片原始长宽
  1506. let canvasHeight = res.height;
  1507. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1508. uni.compressImage({
  1509. src: img,
  1510. quality: 75,
  1511. width: '50%',
  1512. height: '50%',
  1513. success: async rest => {
  1514. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1515. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir);
  1516. }
  1517. });
  1518. } else {
  1519. const dir = await self.uploadFile(img, 0);
  1520. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir);
  1521. }
  1522. }
  1523. });
  1524. }
  1525. });
  1526. },
  1527. uploadFile(options, int) {
  1528. var self = this;
  1529. return new Promise((resolve, reject) => {
  1530. var data = {
  1531. imageStatus: int
  1532. };
  1533. self.$api.aliyunpolicy(data).then(res => {
  1534. console.log(res.data, 6);
  1535. if (res.data.code != 200) {
  1536. self.$method.showToast('签名错误' + JSON.stringify(res.data));
  1537. return;
  1538. }
  1539. var ossToken = res.data.data.resultContent;
  1540. if (ossToken.host == null || ossToken.host == undefined) {
  1541. self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
  1542. return;
  1543. }
  1544. uni.uploadFile({
  1545. url: ossToken.host,
  1546. name: 'file',
  1547. filePath: options,
  1548. fileType: 'image',
  1549. header: {
  1550. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  1551. },
  1552. formData: {
  1553. key: ossToken.dir,
  1554. OSSAccessKeyId: ossToken.accessid,
  1555. policy: ossToken.policy,
  1556. Signature: ossToken.signature,
  1557. callback: ossToken.callback,
  1558. success_action_status: 200
  1559. },
  1560. success: result => {
  1561. if (result.statusCode === 200) {
  1562. resolve(ossToken.dir);
  1563. } else {
  1564. uni.showToast({
  1565. title: '上传失败',
  1566. icon: 'none'
  1567. });
  1568. return;
  1569. }
  1570. },
  1571. fail: error => {
  1572. uni.showToast({
  1573. title: '上传接口报错' + error,
  1574. icon: 'none'
  1575. });
  1576. return;
  1577. }
  1578. });
  1579. });
  1580. });
  1581. },
  1582. /**
  1583. * @param {Object} type
  1584. * @param {Object} bankindex
  1585. * 简答题答案确认
  1586. */
  1587. submitAns(bankindex) {
  1588. console.log(this.questionList[bankindex]);
  1589. if (!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  1590. uni.showToast({
  1591. title: '请输入内容或上传图片',
  1592. duration: 2000,
  1593. icon: 'none'
  1594. });
  1595. return;
  1596. }
  1597. this.$set(this.questionList[bankindex], 'ques', {
  1598. imageList: this.questionList[bankindex].ansText.imageList,
  1599. text: this.questionList[bankindex].ansText.text
  1600. });
  1601. },
  1602. /**
  1603. * @param {Object} bankindex
  1604. * @param {Object} ansindex
  1605. * 案例题简答答案确认
  1606. */
  1607. submitAnsChild(bankindex, ansindex) {
  1608. if (!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  1609. uni.showToast({
  1610. title: '请输入内容或上传图片',
  1611. duration: 2000,
  1612. icon: 'none'
  1613. });
  1614. return;
  1615. }
  1616. this.$set(this.questionList[bankindex].ques, ansindex, {
  1617. imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  1618. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text
  1619. });
  1620. },
  1621. isRight(item, index) {
  1622. //单选
  1623. if (this.questionList[index].ques) {
  1624. if (item.type == 1) {
  1625. return this.questionList[index].ques == this.questionList[index].ans;
  1626. //多选
  1627. } else if (item.type == 2) {
  1628. //每一项都相等
  1629. return this.questionList[index].ques.every((item, i) => {
  1630. return item == this.questionList[index].ans[i];
  1631. });
  1632. //判断
  1633. } else if (item.type == 3) {
  1634. return this.questionList[index].ques == this.questionList[index].ans;
  1635. // } else if (item.type == 5) {
  1636. // if(this.questionList[index].ques.text){
  1637. // return true
  1638. // }else{
  1639. // return false
  1640. // }
  1641. } else {
  1642. return false;
  1643. }
  1644. } else {
  1645. return false;
  1646. }
  1647. },
  1648. right(bankIndex, ansIndex, option) {
  1649. if (this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1650. if (this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 || this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1) {
  1651. return true;
  1652. } else {
  1653. return false;
  1654. }
  1655. } else {
  1656. return false;
  1657. }
  1658. },
  1659. wrong(bankIndex, ansIndex, option) {
  1660. if (this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1661. if (this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 && this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1) {
  1662. return true;
  1663. } else {
  1664. return false;
  1665. }
  1666. } else {
  1667. return false;
  1668. }
  1669. },
  1670. isWrong(item, index) {
  1671. if (this.questionList[index].ques) {
  1672. //单选
  1673. if (item.type == 1) {
  1674. return this.questionList[index].ques != this.questionList[index].ans;
  1675. //多选
  1676. } else if (item.type == 2) {
  1677. //每一项都相等
  1678. return this.questionList[index].ques.some((item, index) => {
  1679. return item != this.questionList[index].ans;
  1680. });
  1681. //判断
  1682. } else if (item.type == 3) {
  1683. return this.questionList[index].ques != this.questionList[index].ans;
  1684. } else {
  1685. return false;
  1686. }
  1687. } else {
  1688. return false;
  1689. }
  1690. },
  1691. tabSelect(index, bankindex) {
  1692. this.$set(this.questionList[bankindex], 'current', index);
  1693. }
  1694. }
  1695. };
  1696. </script>
  1697. <style lang="scss" scoped>
  1698. .swiper {
  1699. width: 100%;
  1700. height: calc(100vh - 65px);
  1701. }
  1702. .lisSty {
  1703. margin-bottom: 16rpx;
  1704. display: flex;
  1705. .flex_auto {
  1706. flex: 1;
  1707. }
  1708. }
  1709. .activeTI {
  1710. vertical-align: middle;
  1711. display: inline-block;
  1712. border: 1rpx solid #eee;
  1713. border-radius: 50rpx;
  1714. height: 48rpx;
  1715. line-height: 46rpx;
  1716. text-align: center;
  1717. width: 48rpx;
  1718. margin-right: 15rpx;
  1719. color: #666;
  1720. font-size: 30rpx;
  1721. &.right {
  1722. color: #fff;
  1723. background: green;
  1724. }
  1725. &.wrong {
  1726. color: #fff;
  1727. background: red;
  1728. }
  1729. &.checked {
  1730. color: #fff;
  1731. background: blue;
  1732. }
  1733. }
  1734. .submit_checkbox {
  1735. margin: 20rpx auto;
  1736. width: 526rpx;
  1737. height: 80rpx;
  1738. background: rgba(0, 122, 255, 1);
  1739. color: #fff;
  1740. text-align: center;
  1741. line-height: 80rpx;
  1742. font-size: 30rpx;
  1743. border-radius: 40rpx;
  1744. }
  1745. .titles {
  1746. overflow: hidden;
  1747. margin-bottom: 24rpx;
  1748. }
  1749. .titBox {
  1750. padding: 41rpx 25rpx 24rpx 25rpx;
  1751. }
  1752. .tabs {
  1753. margin: 10rpx;
  1754. display: flex;
  1755. .tab {
  1756. margin: 0 10rpx;
  1757. width: 96rpx;
  1758. height: 48rpx;
  1759. line-height: 48rpx;
  1760. text-align: center;
  1761. color: #007aff;
  1762. font-size: 28rpx;
  1763. border-radius: 16rpx;
  1764. &.current {
  1765. color: #fff;
  1766. background: #007aff;
  1767. }
  1768. }
  1769. }
  1770. .ans {
  1771. margin: 8rpx 8rpx 8rpx;
  1772. .ans_input {
  1773. border-radius: 16rpx;
  1774. background: #fff;
  1775. .top {
  1776. border-bottom: 1rpx solid #eeeeee;
  1777. padding: 16rpx;
  1778. display: flex;
  1779. align-items: center;
  1780. .icon {
  1781. margin-right: 20rpx;
  1782. width: 40rpx;
  1783. height: 38rpx;
  1784. }
  1785. .progress {
  1786. flex: 1;
  1787. }
  1788. .submit {
  1789. width: 168rpx;
  1790. height: 48rpx;
  1791. line-height: 48rpx;
  1792. text-align: center;
  1793. color: #fff;
  1794. font-size: 30rpx;
  1795. background: #007aff;
  1796. border-radius: 24rpx;
  1797. &.disabled {
  1798. opacity: 0.6;
  1799. }
  1800. }
  1801. }
  1802. .textarea {
  1803. textarea {
  1804. width: 100%;
  1805. height: 287rpx;
  1806. padding: 10rpx;
  1807. }
  1808. }
  1809. .imgs {
  1810. overflow: hidden;
  1811. display: flex;
  1812. width: 100%;
  1813. .img {
  1814. width: 104rpx;
  1815. height: 104rpx;
  1816. border-radius: 8rpx;
  1817. position: relative;
  1818. margin: 20rpx;
  1819. text {
  1820. position: absolute;
  1821. right: -15rpx;
  1822. top: -15rpx;
  1823. width: 30rpx;
  1824. height: 30rpx;
  1825. text-align: center;
  1826. line-height: 30rpx;
  1827. color: #fff;
  1828. background: red;
  1829. border-radius: 50%;
  1830. }
  1831. image {
  1832. width: 100%;
  1833. height: 100%;
  1834. }
  1835. }
  1836. }
  1837. }
  1838. .ans_submit {
  1839. padding: 16rpx;
  1840. border-radius: 16rpx;
  1841. background: #fff;
  1842. .imgs {
  1843. overflow: hidden;
  1844. display: flex;
  1845. width: 100%;
  1846. .img {
  1847. width: 104rpx;
  1848. height: 104rpx;
  1849. border-radius: 8rpx;
  1850. position: relative;
  1851. margin: 20rpx;
  1852. image {
  1853. width: 100%;
  1854. height: 100%;
  1855. }
  1856. }
  1857. }
  1858. }
  1859. }
  1860. .firstLetter {
  1861. display: flex;
  1862. justify-content: space-between;
  1863. align-items: center;
  1864. margin-bottom: 30rpx;
  1865. .leftLetters {
  1866. display: flex;
  1867. align-items: center;
  1868. width: 220rpx;
  1869. .btnType {
  1870. padding: 5rpx 10rpx;
  1871. border: 1rpx solid #007aff;
  1872. border-radius: 10rpx;
  1873. background-color: rgba(0, 122, 255, 0.1);
  1874. font-size: 28rpx;
  1875. color: #007aff;
  1876. margin-right: 15rpx;
  1877. }
  1878. }
  1879. }
  1880. .popupView {
  1881. height: 100%;
  1882. padding-bottom: 100rpx;
  1883. .popupTops {
  1884. height: 77rpx;
  1885. border-bottom: 1rpx solid #eee;
  1886. text-align: center;
  1887. line-height: 77rpx;
  1888. font-size: 24rpx;
  1889. color: #999;
  1890. position: relative;
  1891. .topIcon {
  1892. position: absolute;
  1893. top: 10rpx;
  1894. left: 50%;
  1895. transform: translateX(-50%);
  1896. width: 80rpx;
  1897. height: 8rpx;
  1898. background-color: #999;
  1899. border-radius: 4rpx;
  1900. }
  1901. }
  1902. .popupContent {
  1903. }
  1904. }
  1905. .pageContent {
  1906. position: relative;
  1907. background-color: #eaeef1;
  1908. height: 100%;
  1909. padding-top: 8rpx;
  1910. padding-bottom: 100rpx;
  1911. overflow-y: scroll;
  1912. }
  1913. .pad_8 {
  1914. background-color: #fff;
  1915. margin: 0rpx 8rpx 8rpx;
  1916. border-radius: 16rpx;
  1917. &.no-margin {
  1918. margin-top:-16rpx;
  1919. border-radius: 0 0 16rpx 16rpx;
  1920. }
  1921. }
  1922. .answer {
  1923. height: 80rpx;
  1924. line-height: 80rpx;
  1925. padding: 0rpx 24rpx;
  1926. display: flex;
  1927. align-items: center;
  1928. justify-content: space-between;
  1929. color: #666;
  1930. font-size: 30rpx;
  1931. }
  1932. .footer_btn {
  1933. background-color: #fff;
  1934. z-index: 10078;
  1935. position: fixed;
  1936. bottom: 0rpx;
  1937. display: flex;
  1938. align-items: center;
  1939. justify-content: space-between;
  1940. width: 100%;
  1941. height: 98rpx;
  1942. padding: 0rpx 38rpx;
  1943. border-top: 1rpx solid #eee;
  1944. .flex_center {
  1945. flex:1;
  1946. display: flex;
  1947. justify-content: center;
  1948. align-items: center;
  1949. flex-direction: column;
  1950. margin:0 200rpx;
  1951. font-size: 24rpx;
  1952. color: #999999;
  1953. .up-icon {
  1954. margin-bottom:18rpx;
  1955. width:100%;
  1956. display: flex;
  1957. justify-content: center;
  1958. image {
  1959. width:58rpx;
  1960. height:21rpx;
  1961. }
  1962. }
  1963. }
  1964. .collect {
  1965. visibility: hidden;
  1966. width:100rpx;
  1967. &.show {
  1968. visibility: visible;
  1969. }
  1970. >view {
  1971. display: flex;
  1972. flex-direction: column;
  1973. align-items: center;
  1974. justify-content: center;
  1975. image {
  1976. width:32rpx;
  1977. height:32rpx;
  1978. margin-bottom:6rpx;
  1979. }
  1980. view {
  1981. font-size: 24rpx;
  1982. color: #999999;
  1983. }
  1984. }
  1985. }
  1986. }
  1987. .boxSty {
  1988. padding: 44rpx 41rpx 0rpx;
  1989. }
  1990. .liListSty {
  1991. border: 1rpx solid #eeeeee;
  1992. width: 88rpx;
  1993. height: 88rpx;
  1994. border-radius: 32rpx;
  1995. text-align: center;
  1996. line-height: 88rpx;
  1997. color: #333;
  1998. font-size: 32rpx;
  1999. float: left;
  2000. margin: 20rpx 23rpx;
  2001. &.isRight {
  2002. border: 1rpx solid #eeeeee;
  2003. color: #fff;
  2004. background: green;
  2005. }
  2006. &.isWrong {
  2007. border: 1rpx solid #eeeeee;
  2008. color: #fff;
  2009. background: red;
  2010. }
  2011. }
  2012. .answerInfos {
  2013. padding: 25rpx 25rpx 25rpx 23rpx;
  2014. }
  2015. .answerTitle {
  2016. margin-bottom: 28rpx;
  2017. color: #666;
  2018. font-size: 30rpx;
  2019. }
  2020. .answerContent {
  2021. font-size: 30rpx;
  2022. color: #666;
  2023. }
  2024. .textChild {
  2025. display: inline-block;
  2026. vertical-align: middle;
  2027. }
  2028. .dialog {
  2029. position: fixed;
  2030. left: 0;
  2031. top: 0;
  2032. width: 100%;
  2033. height: 100%;
  2034. background-color: rgba(0, 0, 0, 0.8);
  2035. display: flex;
  2036. flex-direction: column;
  2037. align-items: center;
  2038. justify-content: center;
  2039. z-index: 20000;
  2040. .pointer {
  2041. width:338rpx;
  2042. height:240rpx;
  2043. }
  2044. .text {
  2045. font-size: 32rpx;
  2046. color: #ffffff;
  2047. text-align: center;
  2048. }
  2049. .btn {
  2050. width: 242rpx;
  2051. height: 82rpx;
  2052. border: 2rpx solid #ffffff;
  2053. border-radius: 16rpx;
  2054. text-align: center;
  2055. line-height: 82rpx;
  2056. margin: 41rpx auto;
  2057. color: #fff;
  2058. font-size: 32rpx;
  2059. }
  2060. }
  2061. .dialog_wrap {
  2062. position: fixed;
  2063. left: 0;
  2064. top: 0;
  2065. width: 100%;
  2066. height: 100%;
  2067. z-index: 9999999999;
  2068. .bg {
  2069. background: rgba(0, 0, 0, 0.3);
  2070. position: absolute;
  2071. left: 0;
  2072. top: 0;
  2073. width: 100%;
  2074. height: 100%;
  2075. }
  2076. .dialog {
  2077. position: absolute;
  2078. left: 50%;
  2079. top: 50%;
  2080. transform: translate3D(-50%, -50%, 0);
  2081. width: 640rpx;
  2082. height: 439rpx;
  2083. background: #ffffff;
  2084. border-radius: 24rpx;
  2085. .title {
  2086. font-size: 30rpx;
  2087. font-weight: bold;
  2088. color: #333333;
  2089. line-height: 48rpx;
  2090. text-align: center;
  2091. margin-top: 40rpx;
  2092. }
  2093. .content {
  2094. margin: 35rpx 35rpx 0;
  2095. font-size: 30rpx;
  2096. color: #666666;
  2097. line-height: 48rpx;
  2098. }
  2099. .btns {
  2100. margin-top: 35rpx;
  2101. display: flex;
  2102. align-items: center;
  2103. justify-content: center;
  2104. .btn {
  2105. width: 200rpx;
  2106. height: 80rpx;
  2107. line-height: 80rpx;
  2108. text-align: center;
  2109. background: #f5f5f5;
  2110. border-radius: 40rpx;
  2111. font-size: 30rpx;
  2112. color: rgba(0, 122, 255, 1);
  2113. background: #f5f5f5;
  2114. margin: 0 20rpx;
  2115. &.active {
  2116. color: #f5f5f5;
  2117. background: rgba(0, 122, 255, 1);
  2118. }
  2119. }
  2120. }
  2121. }
  2122. }
  2123. .popboxs {
  2124. width: 100%;
  2125. height: 100%;
  2126. display: flex;
  2127. flex-direction: column;
  2128. align-items: center;
  2129. }
  2130. .classTops {
  2131. flex-shrink: 0;
  2132. padding: 39rpx 0rpx 4rpx;
  2133. font-weight: bold;
  2134. color: #333;
  2135. font-size: 30rpx;
  2136. }
  2137. .textStys {
  2138. width: 100%;
  2139. flex: 1;
  2140. padding: 36rpx;
  2141. }
  2142. .classFootsty {
  2143. flex-shrink: 0;
  2144. display: flex;
  2145. align-items: center;
  2146. justify-content: center;
  2147. padding: 10rpx 0rpx 40rpx;
  2148. .btnsty {
  2149. width: 200rpx;
  2150. height: 80rpx;
  2151. border-radius: 40rpx;
  2152. font-weight: bold;
  2153. font-size: 30rpx;
  2154. text-align: center;
  2155. line-height: 80rpx;
  2156. }
  2157. .btns1 {
  2158. background-color: #f5f5f5;
  2159. color: #007aff;
  2160. }
  2161. .btns2 {
  2162. margin-left: 40rpx;
  2163. background-color: #007aff;
  2164. color: #ffffff;
  2165. }
  2166. }
  2167. </style>