questionBank.vue 61 KB

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