questionBank.vue 58 KB

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