questionBank.vue 60 KB

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