questionBankExplain.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501
  1. <template>
  2. <view id="questionBank">
  3. <swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
  4. <swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
  5. <view class="pageContent">
  6. <view class="pad_8 titBox" >
  7. <view class="firstLetter">
  8. <view class="leftLetters">
  9. <view class="btnType">
  10. <text v-if="bank.type==1">单选</text>
  11. <text v-if="bank.type==2">多选</text>
  12. <text v-if="bank.type==3">判断</text>
  13. <text v-if="bank.type==4">案例</text>
  14. <text v-if="bank.type==5">简答</text>
  15. </view>
  16. <text>{{bankIndex+1}}/{{questionList.length}}</text>
  17. </view>
  18. <view style="color: #666;font-size: 28rpx;"></view>
  19. <view class="leftLetters"></view>
  20. </view>
  21. <view class="titles">
  22. <rich-text :nodes="bank.content"></rich-text>
  23. </view>
  24. </view>
  25. <template v-if="bank.type == 1">
  26. <view class="pad_8 titBox no-margin">
  27. <view v-if="!bank.ques">
  28. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId,bankIndex)">
  29. <view class="activeTI">{{ ast[index] }}</view>
  30. <view class="flex_auto">{{ item.content }}</view>
  31. </view>
  32. </view>
  33. <view v-if="bank.ques">
  34. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  35. <text :class="{right:(item.optionsId == bank.ques) || (item.optionsId == bank.ans),wrong:(item.optionsId == bank.ques) && (bank.ques != bank.ans)}" class="activeTI">{{ ast[index] }}</text>
  36. <view class="flex_auto">{{ item.content }}</view>
  37. </view>
  38. </view>
  39. <view v-if="bank.ques">
  40. <view class="pad_8 answer">
  41. <view>正确答案:{{ast[bank.ans-1]}}</view>
  42. <view v-if="!explain">我的答案:{{ast[bank.ques-1]}}</view>
  43. </view>
  44. <view class="pad_8 answerInfos">
  45. <view class="answerTitle">答案解析</view>
  46. <view class="answerContent">
  47. <rich-text :nodes="bank.analysisContent"></rich-text>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <template v-if="bank.type == 2">
  54. <view class="pad_8 titBox no-margin">
  55. <view v-if="!bank.ques">
  56. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId,bankIndex,index)">
  57. <view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
  58. <view class="flex_auto">{{ item.content }}</view>
  59. </view>
  60. </view>
  61. <view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">
  62. 确认答案
  63. </view>
  64. <view v-if="bank.ques">
  65. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  66. <text :class="{right:(bank.ques.indexOf(item.optionsId) != -1 ) || (bank.ans.indexOf(item.optionsId) != -1),wrong:(bank.ques.indexOf(item.optionsId) != -1 ) && (bank.ans.indexOf(item.optionsId) == -1)}" class="activeTI">{{ ast[index] }}</text>
  67. <view class="flex_auto">{{ item.content }}</view>
  68. </view>
  69. </view>
  70. <view v-if="bank.ques">
  71. <view class="pad_8 answer">
  72. <view>正确答案:
  73. <text v-for="ansItem in bank.ans">{{ast[ansItem-1]}}</text>
  74. </view>
  75. <view v-if="!explain">我的答案:
  76. <text v-for="quesItem in bank.ques">{{ast[quesItem-1]}}</text>
  77. </view>
  78. </view>
  79. <view class="pad_8 answerInfos">
  80. <view class="answerTitle">答案解析</view>
  81. <view class="answerContent">
  82. <rich-text :nodes="bank.analysisContent"></rich-text>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <template v-if="bank.type == 3">
  89. <view class="pad_8 titBox no-margin">
  90. <view v-if="!bank.ques">
  91. <view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index,bankIndex)">
  92. <view class="activeTI">{{ ast[index] }}</view>
  93. {{ item }}
  94. </view>
  95. </view>
  96. <view v-if="bank.ques">
  97. <view v-for="(item, index) in judge" :key="index" class="lisSty">
  98. <text :class="{right:(index == bank.ques) || (index == bank.ans),wrong:(index == bank.ques) && (bank.ques != bank.ans)}" class="activeTI">{{ ast[index] }}</text>
  99. {{ item }}
  100. </view>
  101. </view>
  102. <view v-if="bank.ques">
  103. <view class="pad_8 answer">
  104. <view>正确答案:{{ast[bank.ans]}}</view>
  105. <view v-if="!explain">我的答案:{{ast[bank.ques]}}</view>
  106. </view>
  107. <view class="pad_8 answerInfos">
  108. <view class="answerTitle">答案解析</view>
  109. <view class="answerContent">
  110. <rich-text :nodes="bank.analysisContent"></rich-text>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </template>
  116. <!-- 简答题 -->
  117. <template v-if="bank.type == 5">
  118. <view class="pad_8 titBox">
  119. <view class="ans">
  120. <view class="ans_input" v-if="!bank.ques">
  121. <view class="top flex">
  122. <image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
  123. <view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
  124. <view class="submit" @click="submitAns(bankIndex)" >确认答案</view>
  125. </view>
  126. <view class="textarea">
  127. <textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea>
  128. </view>
  129. <view class="imgs">
  130. <view class="img" v-for="(img,imgIndex) in bank.ansText.imageList" >
  131. <text @click="deleteImg(imgIndex,bankIndex)">x</text>
  132. <image :src="$method.splitImgHost(img, true)"></image>
  133. </view>
  134. </view>
  135. </view>
  136. <view class="ans_submit answerInfos" v-if="bank.ques && !explain">
  137. <view class="answerTitle">我的答案:</view>
  138. {{bank.ques.text}}
  139. <view class="imgs">
  140. <image class="img" v-for="ques in bank.ques.imageList" :src="$method.splitImgHost(ques,true)"></image>
  141. </view>
  142. </view>
  143. </view>
  144. <view v-if="bank.ques">
  145. <view class="pad_8 answerInfos">
  146. <view class="answerTitle">答案解析:</view>
  147. <view class="answerContent">
  148. <rich-text :nodes="bank.analysisContent"></rich-text>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </template>
  154. <!-- 案例题 -->
  155. <template v-if="bank.type == 4">
  156. <view class="pad_8 titBox">
  157. <view class="tabs">
  158. <view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
  159. </view>
  160. <view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
  161. <view class="titles">
  162. <rich-text :nodes="ansItem.content"></rich-text>
  163. </view>
  164. <template v-if="ansItem.type == 1">
  165. <view v-if="!bank.ques[ansIndex]">
  166. <view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty" @click="radioSelectChild(option.optionsId,ansIndex,bankIndex)">
  167. <view class="activeTI">{{ ast[childIndex] }}</view>
  168. <rich-text class="textChild" :nodes="option.content"></rich-text>
  169. </view>
  170. </view>
  171. <view v-if="bank.ques[ansIndex]">
  172. <view v-for="(option, childIndex) in ansItem.optionsList" :key="index" class="lisSty">
  173. <text :class="{right:(option.optionsId == bank.ques[ansIndex]) || (option.optionsId == bank.ans[ansIndex]),wrong:(option.optionsId == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}" class="activeTI">{{ ast[childIndex] }}</text>
  174. <rich-text :nodes="option.content"></rich-text>
  175. </view>
  176. </view>
  177. <view v-if="bank.ques[ansIndex]">
  178. <view class="pad_8 answer">
  179. <view>正确答案:{{ast[bank.ans[ansIndex]-1]}}</view>
  180. <view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]-1]}}</view>
  181. </view>
  182. <view class="pad_8 answerInfos">
  183. <view class="answerTitle">答案解析</view>
  184. <view class="answerContent">
  185. <rich-text :nodes="option.analysisContent"></rich-text>
  186. </view>
  187. </view>
  188. </view>
  189. </template>
  190. <template v-if="ansItem.type == 2">
  191. <view v-if="!bank.ques[ansIndex]">
  192. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty" @click="checkboxSelectChild(bankIndex,ansIndex,childindex)">
  193. <view :class="{checked:option.checked}" class="activeTI">{{ ast[childindex] }}</view>
  194. <rich-text :nodes="option.content"></rich-text>
  195. </view>
  196. </view>
  197. <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex,ansIndex)">
  198. 确认答案
  199. </view>
  200. <view v-if="bank.ques && bank.ques[ansIndex]">
  201. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
  202. <text :class="{right:right(bankIndex,ansIndex,option),wrong:wrong(bankIndex,ansIndex,option)}" class="activeTI">{{ ast[childindex] }}</text>
  203. <rich-text :nodes="option.content"></rich-text>
  204. </view>
  205. </view>
  206. <view v-if="bank.ques[ansIndex]">
  207. <view class="pad_8 answer">
  208. <view>正确答案:
  209. <text v-for="ansItem1 in bank.ans[ansIndex]">{{ast[ansItem1-1]}}</text>
  210. </view>
  211. <view v-if="!explain">我的答案:
  212. <text v-for="quesItem in bank.ques[ansIndex]">{{ast[quesItem-1]}}</text>
  213. </view>
  214. </view>
  215. <view class="pad_8 answerInfos">
  216. <view class="answerTitle">答案解析</view>
  217. <view class="answerContent">
  218. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  219. </view>
  220. </view>
  221. </view>
  222. </template>
  223. <template v-if="ansItem.type == 3">
  224. <view v-if="!bank.ques[ansIndex]">
  225. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex,childindex,bankIndex)">
  226. <view class="activeTI">{{ ast[childindex] }}</view>
  227. {{ option }}
  228. </view>
  229. </view>
  230. <view v-if="bank.ques[ansIndex]">
  231. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
  232. <text :class="{right:(childindex == bank.ques[ansIndex]) || (childindex == bank.ans[ansIndex]),wrong:(childindex == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}" class="activeTI">{{ ast[childindex] }}</text>
  233. {{ option }}
  234. </view>
  235. </view>
  236. <view v-if="bank.ques[ansIndex]">
  237. <view class="pad_8 answer">
  238. <view>正确答案:{{ast[bank.ans[ansIndex]]}}</view>
  239. <view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]]}}</view>
  240. </view>
  241. <view class="pad_8 answerInfos">
  242. <view class="answerTitle">答案解析</view>
  243. <view class="answerContent">
  244. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  245. </view>
  246. </view>
  247. </view>
  248. </template>
  249. <!-- 简答题 -->
  250. <template v-if="ansItem.type == 5">
  251. <view class="ans">
  252. <view class="ans_input" v-if="!bank.ques[ansIndex]">
  253. <view class="top flex">
  254. <image class="icon" @click="chooseImgChild(bankIndex,ansIndex)" src="/static/08-10_032.jpg" mode=""></image>
  255. <view class="progress">{{ansItem.ansText.imageList.length}}/4</view>
  256. <view class="submit" @click="submitAnsChild(bankIndex,ansIndex)">确认答案</view>
  257. </view>
  258. <view class="textarea">
  259. <textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea>
  260. </view>
  261. <view class="imgs">
  262. <view class="img" v-for="(img,imgIndex) in ansItem.ansText.imageList" >
  263. <text @click="deleteImgChild(imgIndex,bankIndex,ansIndex)">x</text>
  264. <image :src="$method.splitImgHost(img, true)"></image>
  265. </view>
  266. </view>
  267. </view>
  268. <view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && !explain">
  269. <view class="answerTitle">答案我的</view>
  270. {{bank.ques[ansIndex].text}}
  271. <view class="imgs">
  272. <image class="img" v-for="ques in bank.ques[ansIndex].imageList" :src="$method.splitImgHost(ques,true)"></image>
  273. </view>
  274. </view>
  275. </view>
  276. <view v-if="bank.ques[ansIndex]">
  277. <view class="pad_8 answerInfos">
  278. <view class="answerTitle">答案解析</view>
  279. <view class="answerContent">
  280. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  281. </view>
  282. </view>
  283. </view>
  284. </template>
  285. </view>
  286. </view>
  287. </template>
  288. <view class="footer_btn" v-if="isContinue || !isHistory">
  289. <view class="collect" :class="{ show: goodsId ? true : false }" @click="collect(collectList[bankIndex], bankIndex)">
  290. <view v-if="collectList[bankIndex]">
  291. <image src="/static/icon/collected.png" mode=""></image>
  292. <view>取消收藏</view>
  293. </view>
  294. <view v-if="!collectList[bankIndex]">
  295. <image src="/static/icon/collect.png" mode=""></image>
  296. <view>收藏</view>
  297. </view>
  298. </view>
  299. <view class="flex_center" @click="openFooterTab">
  300. <view class="up-icon">
  301. <image src="/static/up.png"></image>
  302. </view>
  303. 答题卡
  304. </view>
  305. <view class="collect" :class="{ show: explain ? false : true }" @click="submit">
  306. <view>
  307. <image src="/static/jj.png" mode=""></image>
  308. <view>交卷</view>
  309. </view>
  310. </view>
  311. </view>
  312. </view>
  313. </swiper-item>
  314. </swiper>
  315. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  316. <view class="popupView">
  317. <view class="popupTops">
  318. <view class="topIcon"></view>
  319. 点击编号即可跳转至对应题目
  320. </view>
  321. <view class="popupContent">
  322. <scroll-view scroll-y="true" style="height: 506rpx;">
  323. <view class="boxSty">
  324. <view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
  325. </view>
  326. </scroll-view>
  327. </view>
  328. </view>
  329. </u-popup>
  330. <view class="dialog" v-if="showDialog">
  331. <view class="text">左右滑动切换上下题</view>
  332. <view class="btn" @click="hideDialog">我知道了</view>
  333. </view>
  334. </view>
  335. </template>
  336. <script>
  337. export default {
  338. data() {
  339. return {
  340. id:'',
  341. current:0,
  342. questionList:[],
  343. ast: ['A', 'B', 'C', 'D','E','F','G'],
  344. judge:['错误','正确'],
  345. show: false,
  346. showDialog:true,
  347. bankList: [],
  348. collectList:[],
  349. goodsId:'',
  350. explain:'', //是否显示答案
  351. isContinue:'', //是否继续做题
  352. chapterId:'',
  353. moduleId:'',
  354. isHistory:'', //是否显示历史答题记录
  355. isSubmit:false,
  356. };
  357. },
  358. onLoad(option){
  359. this.id = option.id;
  360. this.explain = option.explain;
  361. this.isContinue = option.continue;
  362. this.goodsId = option.goodsid;
  363. this.chapterId = option.chapterId;
  364. this.moduleId = option.moduleId;
  365. this.recordId = option.recordId;
  366. this.isHistory = option.isHistory;
  367. this.goodsQuestionList();
  368. },
  369. onUnload() {
  370. if(this.isSubmit || this.isHistory) {
  371. return
  372. }
  373. this.examRecordEdit();
  374. },
  375. methods: {
  376. /**
  377. * @param {Object} state
  378. * @param {Object} index
  379. * 收藏
  380. */
  381. collect(state, index) {
  382. if (!state) {
  383. this.$api
  384. .collectQuestion({
  385. examId: this.id,
  386. questionId: this.questionList[index].questionId,
  387. goodsId: this.goodsId || ''
  388. })
  389. .then(res => {
  390. if (res.data.code == 200) {
  391. this.$set(this.collectList, index, true);
  392. uni.showToast({
  393. title: '收藏成功',
  394. duration: 2000,
  395. icon: 'none'
  396. });
  397. this.getCollectInfo(index)
  398. }
  399. });
  400. } else {
  401. this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
  402. if (res.data.code == 200) {
  403. this.$set(this.collectList, index, false);
  404. uni.showToast({
  405. title: '取消收藏成功',
  406. duration: 2000,
  407. icon: 'none'
  408. });
  409. }
  410. });
  411. }
  412. return;
  413. },
  414. goodsQuestionList() {
  415. //继续答题
  416. if(this.isContinue || this.isHistory) {
  417. console.log(this.isHistory,"历史做题")
  418. console.log(this.isContinue,"继续做题")
  419. this.$api.examReport(this.recordId).then(res => {
  420. let json = JSON.parse(res.data.data.historyExamJson)
  421. this.questionList = json;
  422. })
  423. } else { //解析
  424. this.$api.goodsQuestionList({
  425. examId:this.id
  426. }).then(res => {
  427. res.data.data.forEach((item,index) => {
  428. if(typeof item.jsonStr == 'string') {
  429. item.jsonStr = JSON.parse(item.jsonStr)
  430. if(item.type == 2) { //多选
  431. item.jsonStr.forEach(str => {
  432. str.optionsId = ''+str.optionsId;
  433. })
  434. let arr = item.answerQuestion.split(',');
  435. arr.forEach((a,i) => {
  436. arr[i] = ''+a;
  437. })
  438. item.ans = arr;
  439. if(this.explain) {
  440. item.ques = item.ans;
  441. }
  442. return;
  443. } else if(item.type == 5) {
  444. item.ansText = {
  445. text: '',
  446. imageList: []
  447. }
  448. if(this.explain) {
  449. item.ques = {
  450. text:item.analysisContent
  451. }
  452. return;
  453. }
  454. } else if(item.type == 4) {
  455. console.log(item.jsonStr)
  456. item.ques = []
  457. item.current = 0;
  458. let ansArr = [];
  459. item.jsonStr.forEach((json,index) => {
  460. if(json.type == 1) {
  461. ansArr[index] = json.answerQuestion;
  462. } else if(json.type == 2) {
  463. json.optionsList.forEach(str => {
  464. str.optionsId = ''+str.optionsId;
  465. })
  466. let arr = json.answerQuestion.split(',');
  467. arr.forEach((a,i) => {
  468. arr[i] = ''+a;
  469. })
  470. ansArr[index] = arr
  471. } else if(json.type == 3) {
  472. ansArr[index] = json.answerQuestion;
  473. } else if(json.type == 5) {
  474. ansArr[index] = {
  475. text: '',
  476. imageList: []
  477. }
  478. json.ansText = {
  479. text: '',
  480. imageList: []
  481. }
  482. }
  483. })
  484. item.ans = ansArr
  485. if(this.explain) {
  486. item.ques = item.ans;
  487. }
  488. return;
  489. }
  490. item.ans = item.answerQuestion
  491. if(this.explain) {
  492. item.ques = item.ans;
  493. }
  494. } else {
  495. if(this.explain) {
  496. item.ques = item.ans;
  497. }
  498. }
  499. })
  500. this.questionList = res.data.data;
  501. this.getCollectInfo(this.current);
  502. console.log(this.questionList)
  503. })
  504. }
  505. },
  506. /**
  507. * @param {Object} current
  508. * 获取收藏信息
  509. */
  510. getCollectInfo(current) {
  511. this.$api
  512. .getCollectInfo({
  513. examId: this.id,
  514. questionId: this.questionList[current].questionId,
  515. goodsId: this.goodsId
  516. })
  517. .then(res => {
  518. if (res.data.code == 500) {
  519. this.$set(this.collectList, current, false);
  520. } else if (res.data.code == 200) {
  521. this.$set(this.collectList, current, res.data.data);
  522. }
  523. });
  524. },
  525. /**
  526. * @param {Object} e单选点击
  527. */
  528. radioSelect(optionsId,bindex) {
  529. if(this.questionList[bindex].ques) return;
  530. this.$set(this.questionList[bindex],'ques',optionsId)
  531. },
  532. examRecordEdit() {
  533. if(!this.isSubmit) {
  534. let number = 0;
  535. let score = 0;
  536. let doQuestionNum = 0;
  537. this.questionList.length && this.questionList.forEach((item,index) => {
  538. if(item.type == 1) {
  539. if(item.ques == item.ans) {
  540. score += item.score;
  541. number++
  542. }
  543. if (item.ques) {
  544. doQuestionNum++;
  545. }
  546. } else if(item.type == 2) {
  547. let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
  548. return item.ques[quesIndex] == item.ans[quesIndex]
  549. })
  550. if(isRight) {
  551. score += item.score;
  552. number++
  553. }
  554. if (item.ques && item.ques.length) {
  555. doQuestionNum++;
  556. }
  557. } else if(item.type == 3) {
  558. if(item.ques == item.ans) {
  559. score += item.score;
  560. number++
  561. }
  562. if (item.ques) {
  563. doQuestionNum++;
  564. }
  565. } else if (item == 4) {
  566. if (item.ques.length) {
  567. doQuestionNum++;
  568. }
  569. } else if (item.type == 5) {
  570. if (item.ques) {
  571. doQuestionNum++;
  572. }
  573. }
  574. })
  575. this.$api.examRecordEdit({
  576. examId:this.id,
  577. goodsId:this.goodsId,
  578. recordId: this.recordId,
  579. rightQuestionNum:number,
  580. status:0,
  581. doQuestionNum: doQuestionNum,
  582. historyExamJson:JSON.stringify(this.questionList)
  583. }).then(res => {
  584. })
  585. }
  586. },
  587. /**
  588. * @param {Object} e单选点击
  589. */
  590. radioSelectChild(optionsId,ansIndex,bindex) {
  591. if(this.questionList[bindex].ques[ansIndex]) return;
  592. this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
  593. },
  594. /**
  595. * @param {Object} 多选点击
  596. */
  597. checkboxSelect(optionsId,bindex,index) {
  598. this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
  599. },
  600. /**
  601. * @param {Object} 多选点击
  602. */
  603. checkboxSelectChild(bindex,ansIndex,childIndex) {
  604. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
  605. },
  606. /**
  607. * 提交数据
  608. */
  609. submit() {
  610. let score = 0; //计算总分
  611. let reportStatus = 0;
  612. let number = 0;
  613. let allScore = 0;
  614. let passScore = 0;
  615. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  616. let doQuestionIds = []; //做过的题目id
  617. let rightQuestionIds = []; //做对的题目id
  618. this.questionList.forEach((item,index) => {
  619. passScore = item.passScore
  620. if(item.type == 1) {
  621. if(item.ques == item.ans) {
  622. score += item.score;
  623. number++
  624. rightQuestionIds.push(item.questionId)
  625. } else { //错误
  626. doWrongQuestionIds.push(item.questionId)
  627. }
  628. allScore += item.score
  629. if (item.ques) {
  630. doQuestionNum++;
  631. doQuestionIds.push(item.questionId)
  632. }
  633. } else if(item.type == 2) {
  634. let isRight = item.ans && item.ans.every((quesItem,quesIndex) => {
  635. return item.ques[quesIndex] == item.ans[quesIndex]
  636. })
  637. if(isRight) {
  638. score += item.score;
  639. number++
  640. rightQuestionIds.push(item.questionId)
  641. } else {
  642. let checkboxScore = item.score; //获取单题总分数
  643. item.ques.forEach((ques,quesIndex) => {
  644. //选错一个全扣
  645. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  646. checkboxScore = 0;
  647. }
  648. })
  649. console.log(checkboxScore)
  650. //没选错
  651. if(checkboxScore) {
  652. item.ans.forEach((ans,quesIndex) => {
  653. //漏选扣一部分
  654. console.log(item.ques.indexOf(item.ans[quesIndex]))
  655. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  656. checkboxScore -= item.partScore;
  657. }
  658. })
  659. }
  660. if(checkboxScore <= 0) { //0分
  661. item.scoreResult = 0;
  662. doWrongQuestionIds.push(item.questionId)
  663. } else { //部分分
  664. number++;
  665. item.scoreResult = checkboxScore;
  666. score += checkboxScore;
  667. rightQuestionIds.push(item.questionId)
  668. }
  669. }
  670. allScore += item.score;
  671. if (item.ques && item.ques.length) {
  672. doQuestionNum++;
  673. doQuestionIds.push(item.questionId)
  674. }
  675. } else if(item.type == 3) {
  676. if(item.ques == item.ans) {
  677. score += item.score;
  678. number++
  679. rightQuestionIds.push(item.questionId)
  680. } else {
  681. doWrongQuestionIds.push(item.questionId)
  682. }
  683. allScore += item.score;
  684. if (item.ques) {
  685. doQuestionNum++;
  686. doQuestionIds.push(item.questionId)
  687. }
  688. } else if (item.type == 4) {
  689. if (item.ques && item.ques.length) {
  690. doQuestionNum++;
  691. }
  692. } else if (item.type == 5) {
  693. if (item.ques) {
  694. doQuestionNum++;
  695. }
  696. }
  697. })
  698. //大于60分及格
  699. if(score >= passScore) {
  700. reportStatus = 1
  701. } else {
  702. reportStatus = 0
  703. }
  704. this.$api.examRecordEdit({
  705. examId:this.id,
  706. goodsId:this.goodsId,
  707. reportStatus:reportStatus,
  708. totalScore:allScore,
  709. recordId: this.recordId,
  710. rightQuestionNum:number,
  711. status:1,
  712. doQuestionIds:doQuestionIds.join(','),
  713. rightQuestionIds:rightQuestionIds.join(','),
  714. doQuestionNum: doQuestionNum,
  715. performance: score,
  716. historyExamJson:JSON.stringify(this.questionList)
  717. }).then(res => {
  718. this.isSubmit = true;
  719. if(res.data.code == 200) {
  720. uni.showToast({
  721. title: '交卷成功',
  722. duration: 2000,
  723. icon:'none'
  724. });
  725. setTimeout(() => {
  726. uni.redirectTo({
  727. url:'/pages2/bank/question_report?id='+this.recordId+'&examId='+this.id
  728. })
  729. },2000)
  730. }
  731. })
  732. },
  733. /**
  734. * @param {Object} 多选确认
  735. */
  736. checkboxSubmit(bindex) {
  737. if(this.questionList[bindex].ques) return;
  738. let arr = [];
  739. this.questionList[bindex].jsonStr.forEach(item => {
  740. if(item.checked) {
  741. arr.push(item.optionsId)
  742. }
  743. })
  744. this.$set(this.questionList[bindex],'ques',arr)
  745. },
  746. /**
  747. * @param {Object} 多选确认
  748. */
  749. checkboxSubmitChild(bindex,ansIndex) {
  750. if(this.questionList[bindex].ques[ansIndex]) return;
  751. let arr = [];
  752. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  753. if(item.checked) {
  754. arr.push(item.optionsId)
  755. }
  756. })
  757. this.$set(this.questionList[bindex].ques,ansIndex,arr)
  758. },
  759. judgeSelect(index,bindex) {
  760. if(this.questionList[bindex].ques) return;
  761. this.$set(this.questionList[bindex],'ques',index+'')
  762. },
  763. judgeSelectChild(ansindex,childindex,bindex) {
  764. if(this.questionList[bindex].ques[ansindex]) return;
  765. this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
  766. },
  767. openFooterTab() {
  768. this.show = true;
  769. },
  770. hideDialog() {
  771. this.showDialog = false
  772. },
  773. changeIndex(index) {
  774. this.current = index
  775. },
  776. swiperChange(e) {
  777. this.current = e.detail.current;
  778. },
  779. deleteImg(imgIndex,bankIndex) {
  780. this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
  781. },
  782. deleteImgChild(imgIndex,bankIndex,ansIndex) {
  783. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
  784. },
  785. chooseImg(bankindex) {
  786. uni.chooseImage({
  787. count: 1, //默认9
  788. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  789. sourceType: ['album','camera'], //从相册选择
  790. success: (res) => {
  791. let self = this;
  792. // console.log(JSON.stringify(res.tempFilePaths));
  793. let img = res.tempFilePaths[0];
  794. uni.getImageInfo({
  795. src: img,
  796. success: async res => {
  797. let canvasWidth = res.width; //图片原始长宽
  798. let canvasHeight = res.height;
  799. if (canvasWidth > 1000 || canvasHeight > 1000) {
  800. uni.compressImage({
  801. src: img,
  802. quality: 75,
  803. width: '50%',
  804. height: '50%',
  805. success: async rest => {
  806. const dir = await self.uploadFile(rest.tempFilePath, 0);
  807. this.questionList[bankindex].ansText.imageList.push(dir)
  808. }
  809. });
  810. } else {
  811. const dir = await self.uploadFile(img, 0);
  812. this.questionList[bankindex].ansText.imageList.push(dir)
  813. }
  814. }
  815. });
  816. }
  817. })
  818. },
  819. chooseImgChild(bankindex,ansindex) {
  820. uni.chooseImage({
  821. count: 1, //默认9
  822. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  823. sourceType: ['album','camera'], //从相册选择
  824. success: (res) => {
  825. let self = this;
  826. // console.log(JSON.stringify(res.tempFilePaths));
  827. let img = res.tempFilePaths[0];
  828. uni.getImageInfo({
  829. src: img,
  830. success: async res => {
  831. let canvasWidth = res.width; //图片原始长宽
  832. let canvasHeight = res.height;
  833. if (canvasWidth > 1000 || canvasHeight > 1000) {
  834. uni.compressImage({
  835. src: img,
  836. quality: 75,
  837. width: '50%',
  838. height: '50%',
  839. success: async rest => {
  840. const dir = await self.uploadFile(rest.tempFilePath, 0);
  841. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  842. }
  843. });
  844. } else {
  845. const dir = await self.uploadFile(img, 0);
  846. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  847. }
  848. }
  849. });
  850. }
  851. })
  852. },
  853. uploadFile(options, int) {
  854. var self = this;
  855. return new Promise((resolve, reject) => {
  856. var data = {
  857. imageStatus: int
  858. };
  859. self.$api.aliyunpolicy(data).then(res => {
  860. console.log(res.data,6)
  861. if(res.data.code!=200){
  862. self.$method.showToast('签名错误'+JSON.stringify(res.data))
  863. return
  864. }
  865. var ossToken = res.data.data.resultContent;
  866. if(ossToken.host==null||ossToken.host==undefined){
  867. self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
  868. return
  869. }
  870. uni.uploadFile({
  871. url: ossToken.host,
  872. name: 'file',
  873. filePath: options,
  874. fileType: 'image',
  875. header: {
  876. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  877. },
  878. formData: {
  879. key: ossToken.dir,
  880. OSSAccessKeyId: ossToken.accessid,
  881. policy: ossToken.policy,
  882. Signature: ossToken.signature,
  883. callback: ossToken.callback,
  884. success_action_status: 200
  885. },
  886. success: result => {
  887. if (result.statusCode === 200) {
  888. resolve(ossToken.dir);
  889. } else {
  890. uni.showToast({
  891. title: '上传失败',
  892. icon: 'none'
  893. });
  894. return;
  895. }
  896. },
  897. fail: error => {
  898. uni.showToast({
  899. title: '上传接口报错'+error,
  900. icon: 'none'
  901. });
  902. return;
  903. }
  904. });
  905. });
  906. });
  907. },
  908. submitAns(bankindex) {
  909. console.log(this.questionList[bankindex])
  910. if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  911. uni.showToast({
  912. title: '请输入内容或上传图片',
  913. duration: 2000,
  914. icon:'none'
  915. });
  916. return
  917. }
  918. this.$set(this.questionList[bankindex],'ques',{
  919. imageList:this.questionList[bankindex].ansText.imageList,
  920. text:this.questionList[bankindex].ansText.text,
  921. })
  922. },
  923. submitAnsChild(bankindex,ansindex) {
  924. if(!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  925. uni.showToast({
  926. title: '请输入内容或上传图片',
  927. duration: 2000,
  928. icon:'none'
  929. });
  930. return
  931. }
  932. this.$set(this.questionList[bankindex].ques,ansindex,{
  933. imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  934. text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  935. })
  936. },
  937. isRight(item,index) {
  938. //单选
  939. if(this.questionList[index].ques) {
  940. if(item.type == 1) {
  941. return this.questionList[index].ques == this.questionList[index].ans;
  942. //多选
  943. } else if(item.type == 2) {
  944. //每一项都相等
  945. return this.questionList[index].ques.every((item,i) => {
  946. console.log(item == this.questionList[index].ans[i])
  947. return item == this.questionList[index].ans[i];
  948. })
  949. //判断
  950. } else if(item.type == 3) {
  951. return this.questionList[index].ques == this.questionList[index].ans;
  952. } else {
  953. return false;
  954. }
  955. } else {
  956. return false;
  957. }
  958. },
  959. right(bankIndex,ansIndex,option) {
  960. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  961. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
  962. return true
  963. } else {
  964. return false;
  965. }
  966. } else {
  967. return false;
  968. }
  969. },
  970. wrong(bankIndex,ansIndex,option) {
  971. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  972. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) && (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1)) {
  973. return true;
  974. } else {
  975. return false;
  976. }
  977. } else {
  978. return false;
  979. }
  980. },
  981. isWrong(item,index) {
  982. if(this.questionList[index].ques) {
  983. //单选
  984. if(item.type == 1) {
  985. return this.questionList[index].ques != this.questionList[index].ans;
  986. //多选
  987. } else if(item.type == 2) {
  988. //每一项都相等
  989. return this.questionList[index].ques.some((item,i) => {
  990. return item != this.questionList[index].ans[i];
  991. })
  992. //判断
  993. } else if(item.type == 3) {
  994. return this.questionList[index].ques != this.questionList[index].ans;
  995. } else {
  996. return false;
  997. }
  998. } else {
  999. return false;
  1000. }
  1001. },
  1002. tabSelect(index,bankindex) {
  1003. this.$set(this.questionList[bankindex],'current',index)
  1004. },
  1005. }
  1006. };
  1007. </script>
  1008. <style lang="scss" scoped>
  1009. .swiper {
  1010. width:100%;
  1011. height:100vh;
  1012. }
  1013. .lisSty {
  1014. margin-bottom: 16rpx;
  1015. display: flex;
  1016. .flex_auto {
  1017. flex:1;
  1018. }
  1019. }
  1020. .activeTI {
  1021. vertical-align: middle;
  1022. display: inline-block;
  1023. border: 1rpx solid #eee;
  1024. border-radius: 50rpx;
  1025. height: 48rpx;
  1026. line-height: 46rpx;
  1027. text-align: center;
  1028. width: 48rpx;
  1029. margin-right: 15rpx;
  1030. color: #666;
  1031. font-size: 30rpx;
  1032. &.right {
  1033. color:#fff;
  1034. background:green;
  1035. }
  1036. &.wrong {
  1037. color:#fff;
  1038. background:red;
  1039. }
  1040. &.checked {
  1041. color:#fff;
  1042. background:blue;
  1043. }
  1044. }
  1045. .submit_checkbox {
  1046. margin:20rpx auto;
  1047. width: 526rpx;
  1048. height: 80rpx;
  1049. background: rgba(0, 122, 255, 1);
  1050. color:#fff;
  1051. text-align: center;
  1052. line-height: 80rpx;
  1053. font-size: 30rpx;
  1054. border-radius: 40rpx;
  1055. }
  1056. .titles {
  1057. overflow: hidden;
  1058. margin-bottom: 24rpx;
  1059. }
  1060. .titBox {
  1061. padding: 41rpx 25rpx 24rpx 25rpx;
  1062. }
  1063. .tabs {
  1064. margin:10rpx;
  1065. display: flex;
  1066. .tab {
  1067. margin:0 10rpx;
  1068. width: 96rpx;
  1069. height: 48rpx;
  1070. line-height: 48rpx;
  1071. text-align: center;
  1072. color:#007AFF;
  1073. font-size: 28rpx;
  1074. border-radius: 16rpx;
  1075. &.current {
  1076. color:#fff;
  1077. background: #007AFF;
  1078. }
  1079. }
  1080. }
  1081. .ans {
  1082. margin:8rpx 8rpx 8rpx;
  1083. .ans_input {
  1084. border-radius: 16rpx;
  1085. background:#fff;
  1086. .top {
  1087. border-bottom:1rpx solid #EEEEEE;
  1088. padding: 16rpx;
  1089. display: flex;
  1090. align-items: center;
  1091. .icon {
  1092. margin-right:20rpx;
  1093. width: 40rpx;
  1094. height: 38rpx;
  1095. }
  1096. .progress {
  1097. flex:1;
  1098. }
  1099. .submit {
  1100. width: 168rpx;
  1101. height: 48rpx;
  1102. line-height: 48rpx;
  1103. text-align: center;
  1104. color:#fff;
  1105. font-size: 30rpx;
  1106. background: #007AFF;
  1107. border-radius: 24rpx;
  1108. }
  1109. }
  1110. .textarea {
  1111. textarea {
  1112. width:100%;
  1113. height:287rpx;
  1114. padding:10rpx;
  1115. }
  1116. }
  1117. .imgs {
  1118. overflow: hidden;
  1119. display: flex;
  1120. width:100%;
  1121. .img {
  1122. width: 104rpx;
  1123. height: 104rpx;
  1124. border-radius: 8rpx;
  1125. position:relative;
  1126. margin:20rpx;
  1127. text {
  1128. position:absolute;
  1129. right:-15rpx;
  1130. top:-15rpx;
  1131. width:30rpx;
  1132. height:30rpx;
  1133. text-align: center;
  1134. line-height: 30rpx;
  1135. color:#fff;
  1136. background:red;
  1137. border-radius:50%;
  1138. }
  1139. image {
  1140. width:100%;
  1141. height:100%;
  1142. }
  1143. }
  1144. }
  1145. }
  1146. .ans_submit {
  1147. padding:16rpx;
  1148. border-radius: 16rpx;
  1149. background:#fff;
  1150. .imgs {
  1151. overflow: hidden;
  1152. display: flex;
  1153. width:100%;
  1154. .img {
  1155. width: 104rpx;
  1156. height: 104rpx;
  1157. border-radius: 8rpx;
  1158. position:relative;
  1159. margin:20rpx;
  1160. image {
  1161. width:100%;
  1162. height:100%;
  1163. }
  1164. }
  1165. }
  1166. }
  1167. }
  1168. .firstLetter {
  1169. display: flex;
  1170. justify-content: space-between;
  1171. align-items: center;
  1172. margin-bottom: 30rpx;
  1173. .leftLetters {
  1174. display: flex;
  1175. align-items: center;
  1176. width: 220rpx;
  1177. .btnType {
  1178. padding: 5rpx 10rpx;
  1179. border: 1rpx solid #007aff;
  1180. border-radius: 10rpx;
  1181. background-color: rgba(0, 122, 255, 0.1);
  1182. font-size: 28rpx;
  1183. color: #007aff;
  1184. margin-right: 15rpx;
  1185. }
  1186. }
  1187. }
  1188. .popupView {
  1189. height: 100%;
  1190. padding-bottom: 100rpx;
  1191. .popupTops {
  1192. height: 77rpx;
  1193. border-bottom: 1rpx solid #eee;
  1194. text-align: center;
  1195. line-height: 77rpx;
  1196. font-size: 24rpx;
  1197. color: #999;
  1198. position: relative;
  1199. .topIcon {
  1200. position: absolute;
  1201. top: 10rpx;
  1202. left: 50%;
  1203. transform: translateX(-50%);
  1204. width: 80rpx;
  1205. height: 8rpx;
  1206. background-color: #999;
  1207. border-radius: 4rpx;
  1208. }
  1209. }
  1210. .popupContent {
  1211. }
  1212. }
  1213. .pageContent {
  1214. position:relative;
  1215. background-color: #eaeef1;
  1216. height: 100%;
  1217. overflow-y: scroll;
  1218. padding-top: 8rpx;
  1219. padding-bottom: 100rpx;
  1220. }
  1221. .pad_8 {
  1222. background-color: #fff;
  1223. margin: 0rpx 8rpx 8rpx;
  1224. border-radius: 16rpx;
  1225. &.no-margin {
  1226. margin-top:-16rpx;
  1227. border-radius: 0 0 16rpx 16rpx;
  1228. }
  1229. }
  1230. .answer {
  1231. height: 80rpx;
  1232. line-height: 80rpx;
  1233. padding: 0rpx 24rpx;
  1234. display: flex;
  1235. align-items: center;
  1236. justify-content: space-between;
  1237. color: #666;
  1238. font-size: 30rpx;
  1239. }
  1240. .footer_btn {
  1241. background-color: #fff;
  1242. z-index: 10078;
  1243. position: fixed;
  1244. bottom: 0rpx;
  1245. display: flex;
  1246. align-items: center;
  1247. justify-content: space-between;
  1248. width: 100%;
  1249. height: 98rpx;
  1250. padding: 0rpx 38rpx;
  1251. border-top: 1rpx solid #eee;
  1252. .flex_center {
  1253. flex:1;
  1254. display: flex;
  1255. justify-content: center;
  1256. align-items: center;
  1257. flex-direction: column;
  1258. margin:0 200rpx;
  1259. font-size: 24rpx;
  1260. color: #999999;
  1261. .up-icon {
  1262. margin-bottom:18rpx;
  1263. width:100%;
  1264. display: flex;
  1265. justify-content: center;
  1266. image {
  1267. width:58rpx;
  1268. height:21rpx;
  1269. }
  1270. }
  1271. }
  1272. .collect {
  1273. visibility: hidden;
  1274. width:100rpx;
  1275. &.show {
  1276. visibility: visible;
  1277. }
  1278. >view {
  1279. display: flex;
  1280. flex-direction: column;
  1281. align-items: center;
  1282. justify-content: center;
  1283. image {
  1284. width:32rpx;
  1285. height:32rpx;
  1286. margin-bottom:6rpx;
  1287. }
  1288. view {
  1289. font-size: 24rpx;
  1290. color: #999999;
  1291. }
  1292. }
  1293. }
  1294. }
  1295. .boxSty {
  1296. padding: 44rpx 41rpx 0rpx;
  1297. }
  1298. .liListSty {
  1299. border:1rpx solid #EEEEEE;
  1300. width: 88rpx;
  1301. height: 88rpx;
  1302. border-radius: 32rpx;
  1303. text-align: center;
  1304. line-height: 88rpx;
  1305. color: #333;
  1306. font-size: 32rpx;
  1307. float: left;
  1308. margin: 20rpx 23rpx;
  1309. &.isRight {
  1310. border:1rpx solid #EEEEEE;
  1311. color:#fff;
  1312. background: green;
  1313. }
  1314. &.isWrong {
  1315. border:1rpx solid #EEEEEE;
  1316. color:#fff;
  1317. background: red;
  1318. }
  1319. }
  1320. .answerInfos {
  1321. padding: 25rpx 25rpx 25rpx 23rpx;
  1322. }
  1323. .answerTitle {
  1324. margin-bottom: 28rpx;
  1325. color: #666;
  1326. font-size: 30rpx;
  1327. }
  1328. .answerContent {
  1329. font-size: 30rpx;
  1330. color: #666;
  1331. }
  1332. .textChild {
  1333. display: inline-block;
  1334. vertical-align: middle;
  1335. }
  1336. .dialog {
  1337. position: fixed;
  1338. left:0;
  1339. top:0;
  1340. width:100%;
  1341. height:100%;
  1342. background-color: rgba(0,0,0,0.8);
  1343. display: flex;
  1344. flex-direction: column;
  1345. align-items: center;
  1346. justify-content: center;
  1347. z-index: 20000;
  1348. .text {
  1349. font-size: 32rpx;
  1350. color: #FFFFFF;
  1351. text-align: center;
  1352. }
  1353. .btn {
  1354. width: 242rpx;
  1355. height: 82rpx;
  1356. border: 2rpx solid #FFFFFF;
  1357. border-radius: 16rpx;
  1358. text-align: center;
  1359. line-height: 82rpx;
  1360. margin:41rpx auto;
  1361. color:#fff;
  1362. font-size: 32rpx;
  1363. }
  1364. }
  1365. </style>