questionBank.vue 60 KB

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