questionBank.vue 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395
  1. <template>
  2. <view class="questionBank">
  3. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" ref="navbar" :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 || (!bank.ques.imageList.length && !bank.ques.text)">
  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.imageList.length || bank.ques.text">
  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.imageList.length || bank.ques.text">
  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] || (!bank.ques[ansIndex].text && !bank.ques[ansIndex].imageList.length)">
  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] || bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text">
  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].imageList.length || bank.ques[ansIndex].text">
  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="showDialog = false">我知道了</view>
  368. </view>
  369. <view class="dialog-arrow" v-if="showArrow">
  370. <image class="pointer" src="/static/arrow-left.png" mode=""></image>
  371. <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
  372. <view class="btn" @click="showArrow = false">我知道了</view>
  373. </view>
  374. <view class="dialog_wrap" v-if="testOver">
  375. <view class="bg"></view>
  376. <view class="dialog">
  377. <view class="title">温馨提示</view>
  378. <view class="content">
  379. <view>您已完成所有题目,</view>
  380. <view>快去交卷吧!</view>
  381. </view>
  382. <view class="btns">
  383. <view class="btn" @click="noSubmit()">暂不交卷</view>
  384. <view class="btn active" @click="submitNow()">立即交卷</view>
  385. </view>
  386. </view>
  387. </view>
  388. <view class="dialog_wrap" v-if="isLastCount">
  389. <view class="bg"></view>
  390. <view class="dialog">
  391. <view class="title">温馨提示</view>
  392. <view class="content">
  393. <view>您当前正在测试,还剩{{ lastCount }}道题未完成,离开视为交卷</view>
  394. </view>
  395. <view class="btns">
  396. <view class="btn" @click="noLeave()">暂不离开</view>
  397. <view class="btn active" @click="leaveNow()">继续离开</view>
  398. </view>
  399. </view>
  400. </view>
  401. <u-popup v-model="showpopups" mode="center" border-radius="24" height="439rpx" width="640rpx" :mask-close-able="false">
  402. <view class="popboxs">
  403. <view class="classTops">温馨提示</view>
  404. <view class="textStys">
  405. {{
  406. cgType === 7
  407. ? '您还未交卷,确定结束做题吗?'
  408. : cgType === 8
  409. ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
  410. : cgType === 6
  411. ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
  412. : ''
  413. }}
  414. </view>
  415. <view class="classFootsty" v-if="cgType === 6">
  416. <view class="btnsty btns1" @click="submit">立即交卷</view>
  417. <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
  418. </view>
  419. <view class="classFootsty" v-if="cgType === 7">
  420. <view class="btnsty btns1" @click="showpopups = false">下次继续</view>
  421. <view class="btnsty btns2" @click="backPages">结束做题</view>
  422. </view>
  423. <view class="classFootsty" v-if="cgType === 8">
  424. <view class="btnsty btns1" @click="backPages()">下次继续</view>
  425. <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
  426. </view>
  427. </view>
  428. </u-popup>
  429. </view>
  430. </template>
  431. <script>
  432. export default {
  433. data() {
  434. return {
  435. showpopups: false,
  436. id: '',
  437. current: 0,
  438. questionList: [],
  439. ast: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
  440. judge: ['错误', '正确'],
  441. ans: [],
  442. ques: [],
  443. show: false,
  444. showDialog: false,
  445. bankList: [],
  446. collectList: [],
  447. goodsId: '',
  448. recordId: '',
  449. isSubmit: false,
  450. lastTime: 0, //剩余考试时长
  451. allTimes: 0, //总考试时长
  452. timer: null,
  453. wrongList: [],
  454. bankType: 0, //试卷类型
  455. needBack: false, //是否是考试
  456. testOver: false,
  457. isLastCount: false, //是否有未答题目
  458. lastCount: 0, //剩余没有回答的题目数
  459. chapterId: 0,
  460. moduleId: 0,
  461. showArrow:false, //退出提示
  462. isFromVideo:'',
  463. gradeId:'',
  464. cgType: 0 //对应设计稿弹窗编码
  465. };
  466. },
  467. async onLoad(option) {
  468. this.current = +option.current || 0
  469. this.id = option.id;
  470. this.goodsId = option.goodsid;
  471. this.chapterId = option.chapterId;
  472. this.moduleId = option.moduleId;
  473. this.isFromVideo = option.isFromVideo||'';
  474. this.gradeId = option.gradeId || '';
  475. let isBack = option.isback;
  476. let showDialog = uni.getStorageSync('showDialog');
  477. if(showDialog) {
  478. this.showDialog = false;
  479. } else {
  480. this.showDialog = true;
  481. uni.setStorageSync('showDialog','1');
  482. }
  483. //考试被迫返回
  484. if (isBack) {
  485. let app = getApp();
  486. let globalData = app.globalData;
  487. for (var k in globalData.bankData) {
  488. this[k] = globalData.bankData[k];
  489. }
  490. this.showArrow = true;
  491. this.timer = setInterval(() => {
  492. if (this.lastTime <= 0) {
  493. clearInterval(this.timer);
  494. uni.showToast({
  495. icon:'none',
  496. mask:true,
  497. title:'考试时间到,自动交卷',
  498. duration:10000
  499. })
  500. this.submit();
  501. return;
  502. }
  503. this.lastTime--;
  504. }, 1000);
  505. } else {
  506. //进入页面
  507. await this.bankExam();
  508. this.goodsQuestionList();
  509. }
  510. },
  511. onUnload() {
  512. if (this.isSubmit) {
  513. clearInterval(this.timer)
  514. return;
  515. }
  516. //考试试卷 阻止ios手势返回,自动跳回答题页
  517. if (this.needBack) {
  518. let app = getApp();
  519. app.globalData.bankData = this.$data;
  520. clearInterval(this.timer);
  521. uni.navigateTo({
  522. url: '/pages2/bank/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
  523. });
  524. } else {
  525. //点击返回按钮确认允许退出,记录答题记录
  526. clearInterval(this.timer)
  527. this.examRecordEdit();
  528. }
  529. },
  530. methods: {
  531. /**
  532. * 是否有上传图片
  533. */
  534. hasImgs(bank) {
  535. return bank.ansText.imageList.length == 0;
  536. },
  537. /**
  538. * 获取试卷类型2考试,1练习
  539. */
  540. bankExam() {
  541. return new Promise(resolve => {
  542. this.$api.bankExam(this.id).then(res => {
  543. this.bankType = res.data.data.doType;
  544. if (this.bankType == 2) {
  545. this.needBack = true;
  546. }
  547. resolve()
  548. });
  549. })
  550. },
  551. /**
  552. * 点击后退按钮
  553. */
  554. clickLeft() {
  555. if (this.bankType == 1) {
  556. let ansCount = this.questionOverNum(true); //已答题数
  557. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  558. //所有题目答完
  559. if (this.lastCount == 0) {
  560. // this.testOver = true;
  561. this.cgType = 7;
  562. //未答完
  563. } else {
  564. this.cgType = 8;
  565. // this.isLastCount = true;
  566. }
  567. this.showpopups = true;
  568. } else if (this.bankType == 2) {
  569. let ansCount = this.questionOverNum(true); //已答题数
  570. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  571. //所有题目答完
  572. if (this.lastCount == 0) {
  573. this.testOver = true;
  574. //未答完
  575. } else {
  576. this.isLastCount = true;
  577. }
  578. }
  579. },
  580. /**
  581. * 返回上一页
  582. */
  583. backPages() {
  584. this.needBack = false;
  585. uni.navigateBack({
  586. delta: 1
  587. });
  588. },
  589. /**
  590. * 获取已经回答的题目数
  591. * hasSpecail (是否包含简答和案例)
  592. */
  593. questionOverNum(hasSpecail) {
  594. let count = 0;
  595. this.questionList.forEach(item => {
  596. if (item.type == 1 || item.type == 2 || item.type == 3) {
  597. if (item.ques) {
  598. count++;
  599. }
  600. } else if (item.type == 4) {
  601. //案例题
  602. if(hasSpecail) {
  603. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  604. if (jsonItem.type == 1 || jsonItem.type == 2 || jsonItem.type == 3) {
  605. if (item.ques[indexs]) {
  606. return true;
  607. } else {
  608. return false;
  609. }
  610. } else if (jsonItem.type == 5) {
  611. if (item.ques[indexs] && (item.ques[indexs].text.length || item.ques[indexs].imageList.length)) {
  612. return true;
  613. } else {
  614. return false;
  615. }
  616. }
  617. });
  618. if (isOver) {
  619. count++;
  620. console.log(item, 444);
  621. }
  622. }
  623. } else if (item.type == 5) {
  624. //简答题
  625. if(hasSpecail) {
  626. if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
  627. count++;
  628. }
  629. }
  630. }
  631. });
  632. return count;
  633. },
  634. /**
  635. * 暂不交卷
  636. */
  637. noSubmit() {
  638. //设为允许退出页面
  639. this.needBack = false;
  640. uni.navigateBack({
  641. delta: 1
  642. });
  643. },
  644. /**
  645. * 不离开
  646. */
  647. noLeave() {
  648. this.isLastCount = false;
  649. },
  650. /**
  651. * 立即离开并交卷
  652. */
  653. leaveNow() {
  654. this.needBack = false;
  655. this.isSubmit = true;
  656. uni.navigateBack({
  657. delta: 1
  658. });
  659. let score = 0; //计算总分
  660. let reportStatus = 0;
  661. let number = 0; //做对的题目数量
  662. let doQuestionNum = 0; //做过的题目数量
  663. let allScore = 0; //总分
  664. let passScore = 0;
  665. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  666. let doQuestionIds = []; //做过的题目id
  667. let rightQuestionIds = []; //做对的题目id
  668. this.questionList.forEach((item, index) => {
  669. // passScore = item.passScore
  670. if (item.type == 1) {
  671. //正确
  672. if (item.ques == item.ans) {
  673. item.scoreResult = item.score;
  674. score += item.score;
  675. number++;
  676. rightQuestionIds.push(item.questionId)
  677. } else { //错误
  678. item.scoreResult = 0;
  679. doWrongQuestionIds.push(item.questionId)
  680. }
  681. allScore += item.score;
  682. if (item.ques) {
  683. doQuestionNum++;
  684. doQuestionIds.push(item.questionId)
  685. }
  686. } else if (item.type == 2) {
  687. let isRight =
  688. item.ans &&
  689. item.ans.every((quesItem, quesIndex) => {
  690. if(item.ques) {
  691. return item.ques[quesIndex] == item.ans[quesIndex];
  692. } else {
  693. return false;
  694. }
  695. });
  696. if (isRight) {
  697. score += item.score;
  698. number++;
  699. item.scoreResult = item.score;
  700. rightQuestionIds.push(item.questionId)
  701. } else {
  702. let checkboxScore = item.score; //获取单题总分数
  703. item.ques && item.ques.forEach((ques,quesIndex) => {
  704. //选错一个全扣
  705. if(item.ques) {
  706. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  707. checkboxScore = 0;
  708. }
  709. } else {
  710. checkboxScore = 0;
  711. }
  712. })
  713. console.log(checkboxScore)
  714. //没选错
  715. if(checkboxScore) {
  716. item.ans.forEach((ans,quesIndex) => {
  717. //漏选扣一部分
  718. if(item.ques) {
  719. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  720. checkboxScore -= item.partScore;
  721. }
  722. } else {
  723. checkboxScore = 0;
  724. }
  725. })
  726. }
  727. if(checkboxScore <= 0) { //0分
  728. item.scoreResult = 0;
  729. doWrongQuestionIds.push(item.questionId)
  730. } else { //部分分
  731. number++;
  732. item.scoreResult = checkboxScore;
  733. score += checkboxScore;
  734. rightQuestionIds.push(item.questionId)
  735. }
  736. }
  737. allScore += item.score;
  738. if (item.ques && item.ques.length) {
  739. doQuestionNum++;
  740. doQuestionIds.push(item.questionId)
  741. }
  742. } else if (item.type == 3) {
  743. if (item.ques == item.ans) {
  744. item.scoreResult = item.score;
  745. score += item.score;
  746. number++;
  747. rightQuestionIds.push(item.questionId)
  748. } else {
  749. item.scoreResult = 0;
  750. doWrongQuestionIds.push(item.questionId)
  751. }
  752. allScore += item.score;
  753. if (item.ques) {
  754. doQuestionNum++;
  755. doQuestionIds.push(item.questionId)
  756. }
  757. } else if (item.type == 4) {
  758. if (item.ques && item.ques.length) {
  759. doQuestionNum++;
  760. }
  761. } else if (item.type == 5) {
  762. if (item.ques) {
  763. doQuestionNum++;
  764. }
  765. }
  766. });
  767. //大于60分及格
  768. if(score >= 60) {
  769. reportStatus = 1
  770. } else {
  771. reportStatus = 0
  772. }
  773. //交卷
  774. this.$api
  775. .examRecordEdit({
  776. examId: this.id,
  777. goodsId: this.goodsId,
  778. reportStatus:reportStatus,
  779. recordId: this.recordId,
  780. rightQuestionNum: number,
  781. status: 1,
  782. moduleExamId:this.moduleId || 0,
  783. chapterExamId:this.chapterId || 0,
  784. doQuestionIds:doQuestionIds.join(','),
  785. rightQuestionIds:rightQuestionIds.join(','),
  786. doQuestionNum: doQuestionNum,
  787. performance: score,
  788. totalScore: allScore,
  789. examTime: parseInt(this.allTimes),
  790. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  791. historyExamJson: JSON.stringify(this.questionList)
  792. })
  793. .then(res => {
  794. this.isSubmit = true;
  795. if (res.data.code == 200) {
  796. }
  797. });
  798. //错题集id提交(客观题)
  799. this.$api.examWrongRecord({
  800. moduleExamId:this.moduleId || 0,
  801. chapterExamId:this.chapterId || 0,
  802. examId: this.id,
  803. goodsId: this.goodsId,
  804. questionIds: doWrongQuestionIds,
  805. recordId: this.recordId
  806. }).then(res => {
  807. });
  808. },
  809. /**
  810. * 立即交卷
  811. */
  812. submitNow() {
  813. this.showpopups = false;
  814. this.needBack = false;
  815. this.submit();
  816. },
  817. /**
  818. * 离开页面统计回答正确题数
  819. */
  820. examRecordEdit() {
  821. if (!this.isSubmit) {
  822. let number = 0;
  823. let score = 0;
  824. let doQuestionNum = 0;
  825. this.questionList.forEach((item, index) => {
  826. if (item.type == 1) {
  827. if (item.ques == item.ans) {
  828. score += item.score;
  829. number++;
  830. }
  831. if (item.ques) {
  832. doQuestionNum++;
  833. }
  834. } else if (item.type == 2) {
  835. let isRight =
  836. item.ans &&
  837. item.ans.every((quesItem, quesIndex) => {
  838. if(item.ques) {
  839. return item.ques[quesIndex] == item.ans[quesIndex];
  840. } else {
  841. return false;
  842. }
  843. });
  844. if (isRight) {
  845. score += item.score;
  846. number++;
  847. } else {
  848. let checkboxScore = item.score; //获取单题总分数
  849. item.ques && item.ques.forEach((ques,quesIndex) => {
  850. //选错一个全扣
  851. if(item.ques) {
  852. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  853. checkboxScore = 0;
  854. }
  855. } else {
  856. checkboxScore = 0;
  857. }
  858. })
  859. console.log(checkboxScore)
  860. //没选错
  861. if(checkboxScore) {
  862. item.ans.forEach((ans,quesIndex) => {
  863. //漏选扣一部分
  864. if(item.ques) {
  865. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  866. checkboxScore -= item.partScore;
  867. }
  868. } else {
  869. checkboxScore = 0;
  870. }
  871. })
  872. }
  873. if(checkboxScore <= 0) { //0分
  874. } else { //部分分
  875. number++;
  876. score += checkboxScore;
  877. }
  878. }
  879. if (item.ques && item.ques.length) {
  880. doQuestionNum++;
  881. }
  882. } else if (item.type == 3) {
  883. if (item.ques == item.ans) {
  884. score += item.score;
  885. number++;
  886. }
  887. if (item.ques) {
  888. doQuestionNum++;
  889. }
  890. } else if (item == 4) {
  891. if (item.ques.length) {
  892. doQuestionNum++;
  893. }
  894. } else if (item.type == 5) {
  895. if (item.ques) {
  896. doQuestionNum++;
  897. }
  898. }
  899. });
  900. this.$api
  901. .examRecordEdit({
  902. examId: this.id,
  903. goodsId: this.goodsId,
  904. recordId: this.recordId,
  905. rightQuestionNum: number,
  906. moduleExamId:this.moduleId || 0,
  907. chapterExamId:this.chapterId || 0,
  908. status: 0,
  909. doQuestionNum: doQuestionNum,
  910. historyExamJson: JSON.stringify(this.questionList)
  911. })
  912. .then(res => {});
  913. }
  914. },
  915. /**
  916. * 记录总题数
  917. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  918. */
  919. examRecord(hasSpecial) {
  920. let questionList = 0;
  921. if(!hasSpecial) {
  922. this.questionList.forEach((item, index) => {
  923. if(item.type == 1 || item.type == 2 || item.type == 3) {
  924. questionList++;
  925. }
  926. })
  927. } else {
  928. questionList = this.questionList.length;
  929. }
  930. this.$api
  931. .examRecord({
  932. chapterExamId: this.chapterId || 0,
  933. moduleExamId: this.moduleId || 0,
  934. examId: this.id,
  935. goodsId: this.goodsId,
  936. totalQuestionNum: questionList
  937. })
  938. .then(res => {
  939. this.recordId = res.data.data;
  940. //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
  941. if(this.bankType == 1) {
  942. this.examRecordEdit();
  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. mask:true,
  994. title:'考试时间到,自动交卷',
  995. duration:10000
  996. })
  997. this.submit();
  998. return;
  999. }
  1000. this.lastTime--;
  1001. }, 1000);
  1002. } else {
  1003. }
  1004. res.data.data.forEach((item, index) => {
  1005. if (typeof item.jsonStr == 'string') {
  1006. item.jsonStr = JSON.parse(item.jsonStr);
  1007. if (item.type == 2) {
  1008. //多选
  1009. item.jsonStr.forEach(str => {
  1010. str.optionsId = '' + str.optionsId;
  1011. });
  1012. let arr = item.answerQuestion.split(',');
  1013. arr.forEach((a, i) => {
  1014. arr[i] = '' + a;
  1015. });
  1016. item.ans = arr;
  1017. return;
  1018. } else if (item.type == 5) {
  1019. //简答题
  1020. item.ansText = {
  1021. text: '',
  1022. imageList: []
  1023. };
  1024. item.ques = {
  1025. text: '',
  1026. imageList: []
  1027. }
  1028. } else if (item.type == 4) {
  1029. //案例题
  1030. console.log(item.jsonStr);
  1031. item.ques = [];
  1032. item.current = 0;
  1033. let ansArr = [];
  1034. item.jsonStr.forEach((json, index) => {
  1035. if (json.type == 1) {
  1036. ansArr[index] = json.answerQuestion;
  1037. } else if (json.type == 2) {
  1038. json.optionsList.forEach(str => {
  1039. str.optionsId = '' + str.optionsId;
  1040. });
  1041. let arr = json.answerQuestion.split(',');
  1042. arr.forEach((a, i) => {
  1043. arr[i] = '' + a;
  1044. });
  1045. ansArr[index] = arr;
  1046. } else if (json.type == 3) {
  1047. ansArr[index] = json.answerQuestion;
  1048. } else if (json.type == 5) {
  1049. ansArr[index] = {
  1050. text: '',
  1051. imageList: []
  1052. };
  1053. json.ansText = {
  1054. text: '',
  1055. imageList: []
  1056. };
  1057. }
  1058. });
  1059. item.ans = ansArr;
  1060. return;
  1061. }
  1062. item.ans = item.answerQuestion;
  1063. }
  1064. });
  1065. this.questionList = res.data.data;
  1066. this.lastCount = this.questionList.length;
  1067. this.examRecord();
  1068. this.getCollectInfo(this.current);
  1069. });
  1070. },
  1071. /**
  1072. * @param {Object} e单选点击
  1073. */
  1074. radioSelect(optionsId, bindex) {
  1075. if (this.questionList[bindex].ques) return;
  1076. this.$set(this.questionList[bindex], 'ques', optionsId);
  1077. // 回答错误
  1078. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1079. this.$api
  1080. .examWrongRecord({
  1081. examId: this.id,
  1082. goodsId: this.goodsId,
  1083. moduleExamId:this.moduleId || 0,
  1084. chapterExamId:this.chapterId || 0,
  1085. questionIds: [this.questionList[bindex].questionId],
  1086. recordId: this.recordId
  1087. })
  1088. .then(res => {});
  1089. } else {
  1090. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1091. // if(question) {
  1092. // this.$api.wrongRecordDelete({
  1093. // "examId": +this.id,
  1094. // "goodsId": +this.goodsId,
  1095. // "questionId": this.questionList[bindex].questionId,
  1096. // }).then(res => {
  1097. // })
  1098. // }
  1099. }
  1100. },
  1101. /**
  1102. * @param {Object} e案例单选点击
  1103. */
  1104. radioSelectChild(optionsId, ansIndex, bindex) {
  1105. if (this.questionList[bindex].ques[ansIndex]) return;
  1106. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1107. },
  1108. /**
  1109. * @param {Object} 多选点击
  1110. */
  1111. checkboxSelect(optionsId, bindex, index) {
  1112. this.$set(this.questionList[bindex].jsonStr[index], 'checked', !this.questionList[bindex].jsonStr[index].checked);
  1113. },
  1114. /**
  1115. * @param {Object} 案例多选点击
  1116. */
  1117. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1118. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex], 'checked', !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked);
  1119. },
  1120. /**
  1121. * @param {Object} 多选确认
  1122. */
  1123. checkboxSubmit(bindex) {
  1124. if (this.questionList[bindex].ques) return;
  1125. let arr = [];
  1126. this.questionList[bindex].jsonStr.forEach(item => {
  1127. if (item.checked) {
  1128. arr.push(item.optionsId);
  1129. }
  1130. });
  1131. this.$set(this.questionList[bindex], 'ques', arr);
  1132. let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
  1133. return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
  1134. });
  1135. // 回答错误
  1136. if (isWrong) {
  1137. this.$api
  1138. .examWrongRecord({
  1139. examId: this.id,
  1140. goodsId: this.goodsId,
  1141. moduleExamId:this.moduleId || 0,
  1142. chapterExamId:this.chapterId || 0,
  1143. questionIds: [this.questionList[bindex].questionId],
  1144. recordId: this.recordId
  1145. })
  1146. .then(res => {});
  1147. } else {
  1148. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1149. // if(question) {
  1150. // this.$api.wrongRecordDelete({
  1151. // "examId": +this.id,
  1152. // "goodsId": +this.goodsId,
  1153. // "questionId": this.questionList[bindex].questionId,
  1154. // }).then(res => {
  1155. // })
  1156. // }
  1157. }
  1158. },
  1159. /**
  1160. * @param {Object} 案例多选确认
  1161. */
  1162. checkboxSubmitChild(bindex, ansIndex) {
  1163. if (this.questionList[bindex].ques[ansIndex]) return;
  1164. let arr = [];
  1165. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  1166. if (item.checked) {
  1167. arr.push(item.optionsId);
  1168. }
  1169. });
  1170. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1171. },
  1172. /**
  1173. * @param {Object} index
  1174. * @param {Object} bindex
  1175. * 判断题
  1176. */
  1177. judgeSelect(index, bindex) {
  1178. if (this.questionList[bindex].ques) return;
  1179. this.$set(this.questionList[bindex], 'ques', index + '');
  1180. // 回答错误
  1181. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1182. this.$api
  1183. .examWrongRecord({
  1184. examId: this.id,
  1185. goodsId: this.goodsId,
  1186. moduleExamId:this.moduleId || 0,
  1187. chapterExamId:this.chapterId || 0,
  1188. questionIds:[this.questionList[bindex].questionId],
  1189. recordId: this.recordId
  1190. })
  1191. .then(res => {});
  1192. } else {
  1193. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1194. // if(question) {
  1195. // this.$api.wrongRecordDelete({
  1196. // "examId": +this.id,
  1197. // "goodsId": +this.goodsId,
  1198. // "questionId": this.questionList[bindex].questionId,
  1199. // }).then(res => {
  1200. // })
  1201. // }
  1202. }
  1203. },
  1204. /**
  1205. * @param {Object} ansindex
  1206. * @param {Object} childindex
  1207. * @param {Object} bindex
  1208. * 案例判断题
  1209. */
  1210. judgeSelectChild(ansindex, childindex, bindex) {
  1211. if (this.questionList[bindex].ques[ansindex]) return;
  1212. this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
  1213. },
  1214. openFooterTab() {
  1215. this.show = true;
  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. .questionBank {
  1736. width:100%;
  1737. height:100vh;
  1738. display: flex;
  1739. flex-direction: column;
  1740. }
  1741. .swiper {
  1742. width: 100%;
  1743. flex:1;
  1744. }
  1745. .lisSty {
  1746. margin-bottom: 16rpx;
  1747. display: flex;
  1748. .flex_auto {
  1749. flex: 1;
  1750. }
  1751. }
  1752. .activeTI {
  1753. vertical-align: middle;
  1754. display: inline-block;
  1755. border: 1rpx solid #eee;
  1756. border-radius: 50rpx;
  1757. height: 48rpx;
  1758. line-height: 46rpx;
  1759. text-align: center;
  1760. width: 48rpx;
  1761. margin-right: 15rpx;
  1762. color: #666;
  1763. font-size: 30rpx;
  1764. &.right {
  1765. color: #fff;
  1766. background: green;
  1767. }
  1768. &.wrong {
  1769. color: #fff;
  1770. background: red;
  1771. }
  1772. &.checked {
  1773. color: #fff;
  1774. background: blue;
  1775. }
  1776. }
  1777. .submit_checkbox {
  1778. margin: 20rpx auto;
  1779. width: 526rpx;
  1780. height: 80rpx;
  1781. background: rgba(0, 122, 255, 1);
  1782. color: #fff;
  1783. text-align: center;
  1784. line-height: 80rpx;
  1785. font-size: 30rpx;
  1786. border-radius: 40rpx;
  1787. }
  1788. .titles {
  1789. overflow: hidden;
  1790. margin-bottom: 24rpx;
  1791. }
  1792. .titBox {
  1793. padding: 41rpx 25rpx 24rpx 25rpx;
  1794. }
  1795. .tabs {
  1796. margin: 10rpx;
  1797. display: flex;
  1798. .tab {
  1799. margin: 0 10rpx;
  1800. width: 96rpx;
  1801. height: 48rpx;
  1802. line-height: 48rpx;
  1803. text-align: center;
  1804. color: #007aff;
  1805. font-size: 28rpx;
  1806. border-radius: 16rpx;
  1807. &.current {
  1808. color: #fff;
  1809. background: #007aff;
  1810. }
  1811. }
  1812. }
  1813. .ans {
  1814. margin: 8rpx 8rpx 8rpx;
  1815. .ans_input {
  1816. border-radius: 16rpx;
  1817. background: #fff;
  1818. .top {
  1819. border-bottom: 1rpx solid #eeeeee;
  1820. padding: 16rpx;
  1821. display: flex;
  1822. align-items: center;
  1823. .icon {
  1824. margin-right: 20rpx;
  1825. width: 40rpx;
  1826. height: 38rpx;
  1827. }
  1828. .progress {
  1829. flex: 1;
  1830. }
  1831. .submit {
  1832. width: 168rpx;
  1833. height: 48rpx;
  1834. line-height: 48rpx;
  1835. text-align: center;
  1836. color: #fff;
  1837. font-size: 30rpx;
  1838. background: #007aff;
  1839. border-radius: 24rpx;
  1840. &.disabled {
  1841. opacity: 0.6;
  1842. }
  1843. }
  1844. }
  1845. .textarea {
  1846. textarea {
  1847. width: 100%;
  1848. height: 287rpx;
  1849. padding: 10rpx;
  1850. }
  1851. }
  1852. .imgs {
  1853. overflow: hidden;
  1854. display: flex;
  1855. width: 100%;
  1856. .img {
  1857. width: 104rpx;
  1858. height: 104rpx;
  1859. border-radius: 8rpx;
  1860. position: relative;
  1861. margin: 20rpx;
  1862. text {
  1863. position: absolute;
  1864. right: -15rpx;
  1865. top: -15rpx;
  1866. width: 30rpx;
  1867. height: 30rpx;
  1868. text-align: center;
  1869. line-height: 30rpx;
  1870. color: #fff;
  1871. background: red;
  1872. border-radius: 50%;
  1873. }
  1874. image {
  1875. width: 100%;
  1876. height: 100%;
  1877. }
  1878. }
  1879. }
  1880. }
  1881. .ans_submit {
  1882. padding: 16rpx;
  1883. border-radius: 16rpx;
  1884. background: #fff;
  1885. .imgs {
  1886. overflow: hidden;
  1887. display: flex;
  1888. width: 100%;
  1889. .img {
  1890. width: 104rpx;
  1891. height: 104rpx;
  1892. border-radius: 8rpx;
  1893. position: relative;
  1894. margin: 20rpx;
  1895. image {
  1896. width: 100%;
  1897. height: 100%;
  1898. }
  1899. }
  1900. }
  1901. }
  1902. }
  1903. .firstLetter {
  1904. display: flex;
  1905. justify-content: space-between;
  1906. align-items: center;
  1907. margin-bottom: 30rpx;
  1908. .leftLetters {
  1909. display: flex;
  1910. align-items: center;
  1911. width: 220rpx;
  1912. .btnType {
  1913. padding: 5rpx 10rpx;
  1914. border: 1rpx solid #007aff;
  1915. border-radius: 10rpx;
  1916. background-color: rgba(0, 122, 255, 0.1);
  1917. font-size: 28rpx;
  1918. color: #007aff;
  1919. margin-right: 15rpx;
  1920. }
  1921. }
  1922. }
  1923. .popupView {
  1924. height: 100%;
  1925. padding-bottom: 100rpx;
  1926. .popupTops {
  1927. height: 77rpx;
  1928. border-bottom: 1rpx solid #eee;
  1929. text-align: center;
  1930. line-height: 77rpx;
  1931. font-size: 24rpx;
  1932. color: #999;
  1933. position: relative;
  1934. .topIcon {
  1935. position: absolute;
  1936. top: 10rpx;
  1937. left: 50%;
  1938. transform: translateX(-50%);
  1939. width: 80rpx;
  1940. height: 8rpx;
  1941. background-color: #999;
  1942. border-radius: 4rpx;
  1943. }
  1944. }
  1945. .popupContent {
  1946. }
  1947. }
  1948. .pageContent {
  1949. position: relative;
  1950. background-color: #eaeef1;
  1951. height: 100%;
  1952. padding-top: 8rpx;
  1953. padding-bottom: 100rpx;
  1954. overflow-y: scroll;
  1955. }
  1956. .pad_8 {
  1957. background-color: #fff;
  1958. margin: 0rpx 8rpx 8rpx;
  1959. border-radius: 16rpx;
  1960. &.no-margin {
  1961. margin-top:-16rpx;
  1962. border-radius: 0 0 16rpx 16rpx;
  1963. }
  1964. }
  1965. .answer {
  1966. height: 80rpx;
  1967. line-height: 80rpx;
  1968. padding: 0rpx 24rpx;
  1969. display: flex;
  1970. align-items: center;
  1971. justify-content: space-between;
  1972. color: #666;
  1973. font-size: 30rpx;
  1974. }
  1975. .footer_btn {
  1976. background-color: #fff;
  1977. z-index: 10078;
  1978. position: fixed;
  1979. bottom: 0rpx;
  1980. display: flex;
  1981. align-items: center;
  1982. justify-content: space-between;
  1983. width: 100%;
  1984. height: 98rpx;
  1985. padding: 0rpx 38rpx;
  1986. border-top: 1rpx solid #eee;
  1987. .flex_center {
  1988. flex:1;
  1989. display: flex;
  1990. justify-content: center;
  1991. align-items: center;
  1992. flex-direction: column;
  1993. margin:0 200rpx;
  1994. font-size: 24rpx;
  1995. color: #999999;
  1996. .up-icon {
  1997. margin-bottom:18rpx;
  1998. width:100%;
  1999. display: flex;
  2000. justify-content: center;
  2001. image {
  2002. width:58rpx;
  2003. height:21rpx;
  2004. }
  2005. }
  2006. }
  2007. .collect {
  2008. visibility: hidden;
  2009. width:100rpx;
  2010. &.show {
  2011. visibility: visible;
  2012. }
  2013. >view {
  2014. display: flex;
  2015. flex-direction: column;
  2016. align-items: center;
  2017. justify-content: center;
  2018. image {
  2019. width:32rpx;
  2020. height:32rpx;
  2021. margin-bottom:6rpx;
  2022. }
  2023. view {
  2024. font-size: 24rpx;
  2025. color: #999999;
  2026. }
  2027. }
  2028. }
  2029. }
  2030. .boxSty {
  2031. padding: 44rpx 41rpx 0rpx;
  2032. }
  2033. .liListSty {
  2034. border: 1rpx solid #eeeeee;
  2035. width: 88rpx;
  2036. height: 88rpx;
  2037. border-radius: 32rpx;
  2038. text-align: center;
  2039. line-height: 88rpx;
  2040. color: #333;
  2041. font-size: 32rpx;
  2042. float: left;
  2043. margin: 20rpx 23rpx;
  2044. &.isRight {
  2045. border: 1rpx solid #eeeeee;
  2046. color: #fff;
  2047. background: green;
  2048. }
  2049. &.isWrong {
  2050. border: 1rpx solid #eeeeee;
  2051. color: #fff;
  2052. background: red;
  2053. }
  2054. }
  2055. .answerInfos {
  2056. padding: 25rpx 25rpx 25rpx 23rpx;
  2057. }
  2058. .answerTitle {
  2059. margin-bottom: 28rpx;
  2060. color: #666;
  2061. font-size: 30rpx;
  2062. }
  2063. .answerContent {
  2064. font-size: 30rpx;
  2065. color: #666;
  2066. }
  2067. .textChild {
  2068. display: inline-block;
  2069. vertical-align: middle;
  2070. }
  2071. .dialog {
  2072. position: fixed;
  2073. left: 0;
  2074. top: 0;
  2075. width: 100%;
  2076. height: 100%;
  2077. background-color: rgba(0, 0, 0, 0.8);
  2078. display: flex;
  2079. flex-direction: column;
  2080. align-items: center;
  2081. justify-content: center;
  2082. z-index: 20000;
  2083. .pointer {
  2084. width:338rpx;
  2085. height:240rpx;
  2086. }
  2087. .text {
  2088. font-size: 32rpx;
  2089. color: #ffffff;
  2090. text-align: center;
  2091. }
  2092. .btn {
  2093. width: 242rpx;
  2094. height: 82rpx;
  2095. border: 2rpx solid #ffffff;
  2096. border-radius: 16rpx;
  2097. text-align: center;
  2098. line-height: 82rpx;
  2099. margin: 41rpx auto;
  2100. color: #fff;
  2101. font-size: 32rpx;
  2102. }
  2103. }
  2104. .dialog-arrow {
  2105. padding-top:124rpx;
  2106. position: fixed;
  2107. left: 0;
  2108. top: 0;
  2109. width: 100%;
  2110. height: 100%;
  2111. background-color: rgba(0, 0, 0, 0.8);
  2112. z-index: 20000;
  2113. .pointer {
  2114. margin-left:87rpx;
  2115. display: block;
  2116. width:95rpx;
  2117. height:98rpx;
  2118. }
  2119. .text {
  2120. padding-left:177rpx;
  2121. font-size: 32rpx;
  2122. color: #ffffff;
  2123. }
  2124. .btn {
  2125. width: 242rpx;
  2126. height: 82rpx;
  2127. border: 2rpx solid #ffffff;
  2128. border-radius: 16rpx;
  2129. text-align: center;
  2130. line-height: 82rpx;
  2131. margin: 500rpx auto 0;
  2132. color: #fff;
  2133. font-size: 32rpx;
  2134. }
  2135. }
  2136. .dialog_wrap {
  2137. position: fixed;
  2138. left: 0;
  2139. top: 0;
  2140. width: 100%;
  2141. height: 100%;
  2142. z-index: 9999999999;
  2143. .bg {
  2144. background: rgba(0, 0, 0, 0.3);
  2145. position: absolute;
  2146. left: 0;
  2147. top: 0;
  2148. width: 100%;
  2149. height: 100%;
  2150. }
  2151. .dialog {
  2152. position: absolute;
  2153. left: 50%;
  2154. top: 50%;
  2155. transform: translate3D(-50%, -50%, 0);
  2156. width: 640rpx;
  2157. height: 439rpx;
  2158. background: #ffffff;
  2159. border-radius: 24rpx;
  2160. .title {
  2161. font-size: 30rpx;
  2162. font-weight: bold;
  2163. color: #333333;
  2164. line-height: 48rpx;
  2165. text-align: center;
  2166. margin-top: 40rpx;
  2167. }
  2168. .content {
  2169. margin: 35rpx 35rpx 0;
  2170. font-size: 30rpx;
  2171. color: #666666;
  2172. line-height: 48rpx;
  2173. }
  2174. .btns {
  2175. margin-top: 35rpx;
  2176. display: flex;
  2177. align-items: center;
  2178. justify-content: center;
  2179. .btn {
  2180. width: 200rpx;
  2181. height: 80rpx;
  2182. line-height: 80rpx;
  2183. text-align: center;
  2184. background: #f5f5f5;
  2185. border-radius: 40rpx;
  2186. font-size: 30rpx;
  2187. color: rgba(0, 122, 255, 1);
  2188. background: #f5f5f5;
  2189. margin: 0 20rpx;
  2190. &.active {
  2191. color: #f5f5f5;
  2192. background: rgba(0, 122, 255, 1);
  2193. }
  2194. }
  2195. }
  2196. }
  2197. }
  2198. .popboxs {
  2199. width: 100%;
  2200. height: 100%;
  2201. display: flex;
  2202. flex-direction: column;
  2203. align-items: center;
  2204. }
  2205. .classTops {
  2206. flex-shrink: 0;
  2207. padding: 39rpx 0rpx 4rpx;
  2208. font-weight: bold;
  2209. color: #333;
  2210. font-size: 30rpx;
  2211. }
  2212. .textStys {
  2213. width: 100%;
  2214. flex: 1;
  2215. padding: 36rpx;
  2216. }
  2217. .classFootsty {
  2218. flex-shrink: 0;
  2219. display: flex;
  2220. align-items: center;
  2221. justify-content: center;
  2222. padding: 10rpx 0rpx 40rpx;
  2223. .btnsty {
  2224. width: 200rpx;
  2225. height: 80rpx;
  2226. border-radius: 40rpx;
  2227. font-weight: bold;
  2228. font-size: 30rpx;
  2229. text-align: center;
  2230. line-height: 80rpx;
  2231. }
  2232. .btns1 {
  2233. background-color: #f5f5f5;
  2234. color: #007aff;
  2235. }
  2236. .btns2 {
  2237. margin-left: 40rpx;
  2238. background-color: #007aff;
  2239. color: #ffffff;
  2240. }
  2241. }
  2242. </style>