questionBankExplain.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531
  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" :class="{disabled:!bank.ansText.text && hasImgs(bank)}" @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 || '0'}}/4</view>
  256. <view class="submit" :class="{disabled:!ansItem.ansText.text && hasImgs(ansItem)}" @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. recordId:'',
  351. explain:'', //是否显示答案
  352. isContinue:'', //是否继续做题
  353. chapterId:'',
  354. moduleId:'',
  355. isHistory:'', //是否显示历史答题记录
  356. isSubmit:false,
  357. };
  358. },
  359. onLoad(option){
  360. this.id = option.id;
  361. this.explain = option.explain;
  362. this.isContinue = option.continue;
  363. this.goodsId = option.goodsid;
  364. this.chapterId = option.chapterId;
  365. this.moduleId = option.moduleId;
  366. this.recordId = option.recordId;
  367. this.isHistory = option.isHistory;
  368. this.goodsQuestionList();
  369. },
  370. onUnload() {
  371. if(this.isSubmit || this.isHistory) {
  372. return
  373. }
  374. this.examRecordEdit();
  375. },
  376. methods: {
  377. /**
  378. * 是否有上传图片
  379. */
  380. hasImgs(bank) {
  381. return bank.ansText.imageList.length == 0;
  382. },
  383. /**
  384. * @param {Object} state
  385. * @param {Object} index
  386. * 收藏
  387. */
  388. collect(state, index) {
  389. if (!state) {
  390. this.$api
  391. .collectQuestion({
  392. examId: this.id,
  393. questionId: this.questionList[index].questionId,
  394. goodsId: this.goodsId || ''
  395. })
  396. .then(res => {
  397. if (res.data.code == 200) {
  398. this.$set(this.collectList, index, true);
  399. uni.showToast({
  400. title: '收藏成功',
  401. duration: 2000,
  402. icon: 'none'
  403. });
  404. this.getCollectInfo(index)
  405. }
  406. });
  407. } else {
  408. this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
  409. if (res.data.code == 200) {
  410. this.$set(this.collectList, index, false);
  411. uni.showToast({
  412. title: '取消收藏成功',
  413. duration: 2000,
  414. icon: 'none'
  415. });
  416. }
  417. });
  418. }
  419. return;
  420. },
  421. goodsQuestionList() {
  422. //继续答题
  423. if(this.isContinue || this.isHistory) {
  424. console.log(this.isHistory,"历史做题")
  425. console.log(this.isContinue,"继续做题")
  426. this.$api.examReport(this.recordId).then(res => {
  427. let json = JSON.parse(res.data.data.historyExamJson)
  428. this.questionList = json;
  429. })
  430. } else { //解析
  431. this.$api.goodsQuestionList({
  432. examId:this.id
  433. }).then(res => {
  434. res.data.data.forEach((item,index) => {
  435. if(typeof item.jsonStr == 'string') {
  436. item.jsonStr = JSON.parse(item.jsonStr)
  437. if(item.type == 2) { //多选
  438. item.jsonStr.forEach(str => {
  439. str.optionsId = ''+str.optionsId;
  440. })
  441. let arr = item.answerQuestion.split(',');
  442. arr.forEach((a,i) => {
  443. arr[i] = ''+a;
  444. })
  445. item.ans = arr;
  446. if(this.explain) {
  447. item.ques = item.ans;
  448. }
  449. return;
  450. } else if(item.type == 5) {
  451. item.ansText = {
  452. text: '',
  453. imageList: []
  454. }
  455. if(this.explain) {
  456. item.ques = {
  457. text:item.analysisContent
  458. }
  459. return;
  460. }
  461. } else if(item.type == 4) {
  462. console.log(item.jsonStr)
  463. item.ques = []
  464. item.current = 0;
  465. let ansArr = [];
  466. item.jsonStr.forEach((json,index) => {
  467. if(json.type == 1) {
  468. ansArr[index] = json.answerQuestion;
  469. } else if(json.type == 2) {
  470. json.optionsList.forEach(str => {
  471. str.optionsId = ''+str.optionsId;
  472. })
  473. let arr = json.answerQuestion.split(',');
  474. arr.forEach((a,i) => {
  475. arr[i] = ''+a;
  476. })
  477. ansArr[index] = arr
  478. } else if(json.type == 3) {
  479. ansArr[index] = json.answerQuestion;
  480. } else if(json.type == 5) {
  481. ansArr[index] = {
  482. text: '',
  483. imageList: []
  484. }
  485. json.ansText = {
  486. text: '',
  487. imageList: []
  488. }
  489. }
  490. })
  491. item.ans = ansArr
  492. if(this.explain) {
  493. item.ques = item.ans;
  494. }
  495. return;
  496. }
  497. item.ans = item.answerQuestion
  498. if(this.explain) {
  499. item.ques = item.ans;
  500. }
  501. } else {
  502. if(this.explain) {
  503. item.ques = item.ans;
  504. }
  505. }
  506. })
  507. this.questionList = res.data.data;
  508. this.getCollectInfo(this.current);
  509. console.log(this.questionList)
  510. })
  511. }
  512. },
  513. /**
  514. * @param {Object} current
  515. * 获取收藏信息
  516. */
  517. getCollectInfo(current) {
  518. this.$api
  519. .getCollectInfo({
  520. examId: this.id,
  521. questionId: this.questionList[current].questionId,
  522. goodsId: this.goodsId
  523. })
  524. .then(res => {
  525. if (res.data.code == 500) {
  526. this.$set(this.collectList, current, false);
  527. } else if (res.data.code == 200) {
  528. this.$set(this.collectList, current, res.data.data);
  529. }
  530. });
  531. },
  532. /**
  533. * @param {Object} e单选点击
  534. */
  535. radioSelect(optionsId,bindex) {
  536. if(this.questionList[bindex].ques) return;
  537. this.$set(this.questionList[bindex],'ques',optionsId)
  538. },
  539. examRecordEdit() {
  540. if(!this.isSubmit) {
  541. let number = 0;
  542. let score = 0;
  543. let doQuestionNum = 0;
  544. this.questionList.length && this.questionList.forEach((item,index) => {
  545. if(item.type == 1) {
  546. if(item.ques == item.ans) {
  547. score += item.score;
  548. number++
  549. }
  550. if (item.ques) {
  551. doQuestionNum++;
  552. }
  553. } else if(item.type == 2) {
  554. let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
  555. return item.ques[quesIndex] == item.ans[quesIndex]
  556. })
  557. if(isRight) {
  558. score += item.score;
  559. number++
  560. }
  561. if (item.ques && item.ques.length) {
  562. doQuestionNum++;
  563. }
  564. } else if(item.type == 3) {
  565. if(item.ques == item.ans) {
  566. score += item.score;
  567. number++
  568. }
  569. if (item.ques) {
  570. doQuestionNum++;
  571. }
  572. } else if (item == 4) {
  573. if (item.ques.length) {
  574. doQuestionNum++;
  575. }
  576. } else if (item.type == 5) {
  577. if (item.ques) {
  578. doQuestionNum++;
  579. }
  580. }
  581. })
  582. this.$api.examRecordEdit({
  583. examId:this.id,
  584. goodsId:this.goodsId,
  585. recordId: this.recordId,
  586. rightQuestionNum:number,
  587. status:0,
  588. doQuestionNum: doQuestionNum,
  589. historyExamJson:JSON.stringify(this.questionList)
  590. }).then(res => {
  591. })
  592. }
  593. },
  594. /**
  595. * @param {Object} e单选点击
  596. */
  597. radioSelectChild(optionsId,ansIndex,bindex) {
  598. if(this.questionList[bindex].ques[ansIndex]) return;
  599. this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
  600. },
  601. /**
  602. * @param {Object} 多选点击
  603. */
  604. checkboxSelect(optionsId,bindex,index) {
  605. this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
  606. },
  607. /**
  608. * @param {Object} 多选点击
  609. */
  610. checkboxSelectChild(bindex,ansIndex,childIndex) {
  611. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
  612. },
  613. /**
  614. * 提交数据
  615. */
  616. submit() {
  617. let score = 0; //计算总分
  618. let reportStatus = 0;
  619. let number = 0;
  620. let allScore = 0;
  621. let passScore = 0;
  622. let doQuestionNum = 0;
  623. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  624. let doQuestionIds = []; //做过的题目id
  625. let rightQuestionIds = []; //做对的题目id
  626. this.questionList.forEach((item,index) => {
  627. passScore = item.passScore
  628. if(item.type == 1) {
  629. if(item.ques == item.ans) {
  630. score += item.score;
  631. number++
  632. rightQuestionIds.push(item.questionId)
  633. } else { //错误
  634. doWrongQuestionIds.push(item.questionId)
  635. }
  636. allScore += item.score
  637. if (item.ques) {
  638. doQuestionNum++;
  639. doQuestionIds.push(item.questionId)
  640. }
  641. } else if(item.type == 2) {
  642. let isRight = item.ans && item.ans.every((quesItem,quesIndex) => {
  643. if(item.ques) {
  644. return item.ques[quesIndex] == item.ans[quesIndex]
  645. } else {
  646. return false;
  647. }
  648. })
  649. if(isRight) {
  650. score += item.score;
  651. number++
  652. rightQuestionIds.push(item.questionId)
  653. } else {
  654. let checkboxScore = item.score; //获取单题总分数
  655. item.ques && item.ques.forEach((ques,quesIndex) => {
  656. //选错一个全扣
  657. if(item.ques) {
  658. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  659. checkboxScore = 0;
  660. }
  661. } else {
  662. checkboxScore = 0;
  663. }
  664. })
  665. console.log(checkboxScore)
  666. //没选错
  667. if(checkboxScore) {
  668. item.ans.forEach((ans,quesIndex) => {
  669. //漏选扣一部分
  670. if(item.ques) {
  671. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  672. checkboxScore -= item.partScore;
  673. }
  674. } else {
  675. checkboxScore = 0;
  676. }
  677. })
  678. }
  679. if(checkboxScore <= 0) { //0分
  680. item.scoreResult = 0;
  681. doWrongQuestionIds.push(item.questionId)
  682. } else { //部分分
  683. number++;
  684. item.scoreResult = checkboxScore;
  685. score += checkboxScore;
  686. rightQuestionIds.push(item.questionId)
  687. }
  688. }
  689. allScore += item.score;
  690. if (item.ques && item.ques.length) {
  691. doQuestionNum++;
  692. doQuestionIds.push(item.questionId)
  693. }
  694. } else if(item.type == 3) {
  695. if(item.ques == item.ans) {
  696. score += item.score;
  697. number++
  698. rightQuestionIds.push(item.questionId)
  699. } else {
  700. doWrongQuestionIds.push(item.questionId)
  701. }
  702. allScore += item.score;
  703. if (item.ques) {
  704. doQuestionNum++;
  705. doQuestionIds.push(item.questionId)
  706. }
  707. } else if (item.type == 4) {
  708. if (item.ques && item.ques.length) {
  709. doQuestionNum++;
  710. }
  711. } else if (item.type == 5) {
  712. if (item.ques) {
  713. doQuestionNum++;
  714. }
  715. }
  716. })
  717. //大于60分及格
  718. if(score >= passScore) {
  719. reportStatus = 1
  720. } else {
  721. reportStatus = 0
  722. }
  723. this.$api.examRecordEdit({
  724. examId:this.id,
  725. goodsId:this.goodsId,
  726. reportStatus:reportStatus,
  727. totalScore:allScore,
  728. recordId: this.recordId,
  729. rightQuestionNum:number,
  730. status:1,
  731. doQuestionIds:doQuestionIds.join(','),
  732. rightQuestionIds:rightQuestionIds.join(','),
  733. doQuestionNum: doQuestionNum,
  734. performance: score,
  735. historyExamJson:JSON.stringify(this.questionList)
  736. }).then(res => {
  737. this.isSubmit = true;
  738. if(res.data.code == 200) {
  739. uni.showToast({
  740. title: '交卷成功',
  741. duration: 2000,
  742. icon:'none'
  743. });
  744. setTimeout(() => {
  745. uni.redirectTo({
  746. url:'/pages2/bank/question_report?id='+this.recordId+'&examId='+this.id
  747. })
  748. },2000)
  749. }
  750. })
  751. },
  752. /**
  753. * @param {Object} 多选确认
  754. */
  755. checkboxSubmit(bindex) {
  756. if(this.questionList[bindex].ques) return;
  757. let arr = [];
  758. this.questionList[bindex].jsonStr.forEach(item => {
  759. if(item.checked) {
  760. arr.push(item.optionsId)
  761. }
  762. })
  763. this.$set(this.questionList[bindex],'ques',arr)
  764. },
  765. /**
  766. * @param {Object} 多选确认
  767. */
  768. checkboxSubmitChild(bindex,ansIndex) {
  769. if(this.questionList[bindex].ques[ansIndex]) return;
  770. let arr = [];
  771. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  772. if(item.checked) {
  773. arr.push(item.optionsId)
  774. }
  775. })
  776. this.$set(this.questionList[bindex].ques,ansIndex,arr)
  777. },
  778. judgeSelect(index,bindex) {
  779. if(this.questionList[bindex].ques) return;
  780. this.$set(this.questionList[bindex],'ques',index+'')
  781. },
  782. judgeSelectChild(ansindex,childindex,bindex) {
  783. if(this.questionList[bindex].ques[ansindex]) return;
  784. this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
  785. },
  786. openFooterTab() {
  787. this.show = true;
  788. },
  789. hideDialog() {
  790. this.showDialog = false
  791. },
  792. changeIndex(index) {
  793. this.current = index
  794. },
  795. swiperChange(e) {
  796. this.current = e.detail.current;
  797. },
  798. deleteImg(imgIndex,bankIndex) {
  799. this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
  800. },
  801. deleteImgChild(imgIndex,bankIndex,ansIndex) {
  802. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
  803. },
  804. chooseImg(bankindex) {
  805. uni.chooseImage({
  806. count: 1, //默认9
  807. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  808. sourceType: ['album','camera'], //从相册选择
  809. success: (res) => {
  810. let self = this;
  811. // console.log(JSON.stringify(res.tempFilePaths));
  812. let img = res.tempFilePaths[0];
  813. uni.getImageInfo({
  814. src: img,
  815. success: async res => {
  816. let canvasWidth = res.width; //图片原始长宽
  817. let canvasHeight = res.height;
  818. if (canvasWidth > 1000 || canvasHeight > 1000) {
  819. uni.compressImage({
  820. src: img,
  821. quality: 75,
  822. width: '50%',
  823. height: '50%',
  824. success: async rest => {
  825. const dir = await self.uploadFile(rest.tempFilePath, 0);
  826. this.questionList[bankindex].ansText.imageList.push(dir)
  827. }
  828. });
  829. } else {
  830. const dir = await self.uploadFile(img, 0);
  831. this.questionList[bankindex].ansText.imageList.push(dir)
  832. }
  833. }
  834. });
  835. }
  836. })
  837. },
  838. chooseImgChild(bankindex,ansindex) {
  839. uni.chooseImage({
  840. count: 1, //默认9
  841. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  842. sourceType: ['album','camera'], //从相册选择
  843. success: (res) => {
  844. let self = this;
  845. // console.log(JSON.stringify(res.tempFilePaths));
  846. let img = res.tempFilePaths[0];
  847. uni.getImageInfo({
  848. src: img,
  849. success: async res => {
  850. let canvasWidth = res.width; //图片原始长宽
  851. let canvasHeight = res.height;
  852. if (canvasWidth > 1000 || canvasHeight > 1000) {
  853. uni.compressImage({
  854. src: img,
  855. quality: 75,
  856. width: '50%',
  857. height: '50%',
  858. success: async rest => {
  859. const dir = await self.uploadFile(rest.tempFilePath, 0);
  860. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  861. }
  862. });
  863. } else {
  864. const dir = await self.uploadFile(img, 0);
  865. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  866. }
  867. }
  868. });
  869. }
  870. })
  871. },
  872. uploadFile(options, int) {
  873. var self = this;
  874. return new Promise((resolve, reject) => {
  875. var data = {
  876. imageStatus: int
  877. };
  878. self.$api.aliyunpolicy(data).then(res => {
  879. console.log(res.data,6)
  880. if(res.data.code!=200){
  881. self.$method.showToast('签名错误'+JSON.stringify(res.data))
  882. return
  883. }
  884. var ossToken = res.data.data.resultContent;
  885. if(ossToken.host==null||ossToken.host==undefined){
  886. self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
  887. return
  888. }
  889. uni.uploadFile({
  890. url: ossToken.host,
  891. name: 'file',
  892. filePath: options,
  893. fileType: 'image',
  894. header: {
  895. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  896. },
  897. formData: {
  898. key: ossToken.dir,
  899. OSSAccessKeyId: ossToken.accessid,
  900. policy: ossToken.policy,
  901. Signature: ossToken.signature,
  902. callback: ossToken.callback,
  903. success_action_status: 200
  904. },
  905. success: result => {
  906. if (result.statusCode === 200) {
  907. resolve(ossToken.dir);
  908. } else {
  909. uni.showToast({
  910. title: '上传失败',
  911. icon: 'none'
  912. });
  913. return;
  914. }
  915. },
  916. fail: error => {
  917. uni.showToast({
  918. title: '上传接口报错'+error,
  919. icon: 'none'
  920. });
  921. return;
  922. }
  923. });
  924. });
  925. });
  926. },
  927. submitAns(bankindex) {
  928. console.log(this.questionList[bankindex])
  929. if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  930. uni.showToast({
  931. title: '请输入内容或上传图片',
  932. duration: 2000,
  933. icon:'none'
  934. });
  935. return
  936. }
  937. this.$set(this.questionList[bankindex],'ques',{
  938. imageList:this.questionList[bankindex].ansText.imageList,
  939. text:this.questionList[bankindex].ansText.text,
  940. })
  941. },
  942. submitAnsChild(bankindex,ansindex) {
  943. if(!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  944. uni.showToast({
  945. title: '请输入内容或上传图片',
  946. duration: 2000,
  947. icon:'none'
  948. });
  949. return
  950. }
  951. this.$set(this.questionList[bankindex].ques,ansindex,{
  952. imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  953. text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  954. })
  955. },
  956. isRight(item,index) {
  957. //单选
  958. if(this.questionList[index].ques) {
  959. if(item.type == 1) {
  960. return this.questionList[index].ques == this.questionList[index].ans;
  961. //多选
  962. } else if(item.type == 2) {
  963. //每一项都相等
  964. return this.questionList[index].ques.every((item,i) => {
  965. console.log(item == this.questionList[index].ans[i])
  966. return item == this.questionList[index].ans[i];
  967. })
  968. //判断
  969. } else if(item.type == 3) {
  970. return this.questionList[index].ques == this.questionList[index].ans;
  971. } else {
  972. return false;
  973. }
  974. } else {
  975. return false;
  976. }
  977. },
  978. right(bankIndex,ansIndex,option) {
  979. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  980. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
  981. return true
  982. } else {
  983. return false;
  984. }
  985. } else {
  986. return false;
  987. }
  988. },
  989. wrong(bankIndex,ansIndex,option) {
  990. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  991. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) && (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1)) {
  992. return true;
  993. } else {
  994. return false;
  995. }
  996. } else {
  997. return false;
  998. }
  999. },
  1000. isWrong(item,index) {
  1001. if(this.questionList[index].ques) {
  1002. //单选
  1003. if(item.type == 1) {
  1004. return this.questionList[index].ques != this.questionList[index].ans;
  1005. //多选
  1006. } else if(item.type == 2) {
  1007. //每一项都相等
  1008. return this.questionList[index].ques.some((item,i) => {
  1009. return item != this.questionList[index].ans[i];
  1010. })
  1011. //判断
  1012. } else if(item.type == 3) {
  1013. return this.questionList[index].ques != this.questionList[index].ans;
  1014. } else {
  1015. return false;
  1016. }
  1017. } else {
  1018. return false;
  1019. }
  1020. },
  1021. tabSelect(index,bankindex) {
  1022. this.$set(this.questionList[bankindex],'current',index)
  1023. },
  1024. }
  1025. };
  1026. </script>
  1027. <style lang="scss" scoped>
  1028. .swiper {
  1029. width:100%;
  1030. height:100vh;
  1031. }
  1032. .lisSty {
  1033. margin-bottom: 16rpx;
  1034. display: flex;
  1035. .flex_auto {
  1036. flex:1;
  1037. }
  1038. }
  1039. .activeTI {
  1040. vertical-align: middle;
  1041. display: inline-block;
  1042. border: 1rpx solid #eee;
  1043. border-radius: 50rpx;
  1044. height: 48rpx;
  1045. line-height: 46rpx;
  1046. text-align: center;
  1047. width: 48rpx;
  1048. margin-right: 15rpx;
  1049. color: #666;
  1050. font-size: 30rpx;
  1051. &.right {
  1052. color:#fff;
  1053. background:green;
  1054. }
  1055. &.wrong {
  1056. color:#fff;
  1057. background:red;
  1058. }
  1059. &.checked {
  1060. color:#fff;
  1061. background:blue;
  1062. }
  1063. }
  1064. .submit_checkbox {
  1065. margin:20rpx auto;
  1066. width: 526rpx;
  1067. height: 80rpx;
  1068. background: rgba(0, 122, 255, 1);
  1069. color:#fff;
  1070. text-align: center;
  1071. line-height: 80rpx;
  1072. font-size: 30rpx;
  1073. border-radius: 40rpx;
  1074. }
  1075. .titles {
  1076. overflow: hidden;
  1077. margin-bottom: 24rpx;
  1078. }
  1079. .titBox {
  1080. padding: 41rpx 25rpx 24rpx 25rpx;
  1081. }
  1082. .tabs {
  1083. margin:10rpx;
  1084. display: flex;
  1085. .tab {
  1086. margin:0 10rpx;
  1087. width: 96rpx;
  1088. height: 48rpx;
  1089. line-height: 48rpx;
  1090. text-align: center;
  1091. color:#007AFF;
  1092. font-size: 28rpx;
  1093. border-radius: 16rpx;
  1094. &.current {
  1095. color:#fff;
  1096. background: #007AFF;
  1097. }
  1098. }
  1099. }
  1100. .ans {
  1101. margin:8rpx 8rpx 8rpx;
  1102. .ans_input {
  1103. border-radius: 16rpx;
  1104. background:#fff;
  1105. .top {
  1106. border-bottom:1rpx solid #EEEEEE;
  1107. padding: 16rpx;
  1108. display: flex;
  1109. align-items: center;
  1110. .icon {
  1111. margin-right:20rpx;
  1112. width: 40rpx;
  1113. height: 38rpx;
  1114. }
  1115. .progress {
  1116. flex:1;
  1117. }
  1118. .submit {
  1119. width: 168rpx;
  1120. height: 48rpx;
  1121. line-height: 48rpx;
  1122. text-align: center;
  1123. color:#fff;
  1124. font-size: 30rpx;
  1125. background: #007AFF;
  1126. border-radius: 24rpx;
  1127. &.disabled {
  1128. opacity: 0.6;
  1129. }
  1130. }
  1131. }
  1132. .textarea {
  1133. textarea {
  1134. width:100%;
  1135. height:287rpx;
  1136. padding:10rpx;
  1137. }
  1138. }
  1139. .imgs {
  1140. overflow: hidden;
  1141. display: flex;
  1142. width:100%;
  1143. .img {
  1144. width: 104rpx;
  1145. height: 104rpx;
  1146. border-radius: 8rpx;
  1147. position:relative;
  1148. margin:20rpx;
  1149. text {
  1150. position:absolute;
  1151. right:-15rpx;
  1152. top:-15rpx;
  1153. width:30rpx;
  1154. height:30rpx;
  1155. text-align: center;
  1156. line-height: 30rpx;
  1157. color:#fff;
  1158. background:red;
  1159. border-radius:50%;
  1160. }
  1161. image {
  1162. width:100%;
  1163. height:100%;
  1164. }
  1165. }
  1166. }
  1167. }
  1168. .ans_submit {
  1169. padding:16rpx;
  1170. border-radius: 16rpx;
  1171. background:#fff;
  1172. .imgs {
  1173. overflow: hidden;
  1174. display: flex;
  1175. width:100%;
  1176. .img {
  1177. width: 104rpx;
  1178. height: 104rpx;
  1179. border-radius: 8rpx;
  1180. position:relative;
  1181. margin:20rpx;
  1182. image {
  1183. width:100%;
  1184. height:100%;
  1185. }
  1186. }
  1187. }
  1188. }
  1189. }
  1190. .firstLetter {
  1191. display: flex;
  1192. justify-content: space-between;
  1193. align-items: center;
  1194. margin-bottom: 30rpx;
  1195. .leftLetters {
  1196. display: flex;
  1197. align-items: center;
  1198. width: 220rpx;
  1199. .btnType {
  1200. padding: 5rpx 10rpx;
  1201. border: 1rpx solid #007aff;
  1202. border-radius: 10rpx;
  1203. background-color: rgba(0, 122, 255, 0.1);
  1204. font-size: 28rpx;
  1205. color: #007aff;
  1206. margin-right: 15rpx;
  1207. }
  1208. }
  1209. }
  1210. .popupView {
  1211. height: 100%;
  1212. padding-bottom: 100rpx;
  1213. .popupTops {
  1214. height: 77rpx;
  1215. border-bottom: 1rpx solid #eee;
  1216. text-align: center;
  1217. line-height: 77rpx;
  1218. font-size: 24rpx;
  1219. color: #999;
  1220. position: relative;
  1221. .topIcon {
  1222. position: absolute;
  1223. top: 10rpx;
  1224. left: 50%;
  1225. transform: translateX(-50%);
  1226. width: 80rpx;
  1227. height: 8rpx;
  1228. background-color: #999;
  1229. border-radius: 4rpx;
  1230. }
  1231. }
  1232. .popupContent {
  1233. }
  1234. }
  1235. .pageContent {
  1236. position:relative;
  1237. background-color: #eaeef1;
  1238. height: 100%;
  1239. overflow-y: scroll;
  1240. padding-top: 8rpx;
  1241. padding-bottom: 100rpx;
  1242. }
  1243. .pad_8 {
  1244. background-color: #fff;
  1245. margin: 0rpx 8rpx 8rpx;
  1246. border-radius: 16rpx;
  1247. &.no-margin {
  1248. margin-top:-16rpx;
  1249. border-radius: 0 0 16rpx 16rpx;
  1250. }
  1251. }
  1252. .answer {
  1253. height: 80rpx;
  1254. line-height: 80rpx;
  1255. padding: 0rpx 24rpx;
  1256. display: flex;
  1257. align-items: center;
  1258. justify-content: space-between;
  1259. color: #666;
  1260. font-size: 30rpx;
  1261. }
  1262. .footer_btn {
  1263. background-color: #fff;
  1264. z-index: 10078;
  1265. position: fixed;
  1266. bottom: 0rpx;
  1267. display: flex;
  1268. align-items: center;
  1269. justify-content: space-between;
  1270. width: 100%;
  1271. height: 98rpx;
  1272. padding: 0rpx 38rpx;
  1273. border-top: 1rpx solid #eee;
  1274. .flex_center {
  1275. flex:1;
  1276. display: flex;
  1277. justify-content: center;
  1278. align-items: center;
  1279. flex-direction: column;
  1280. margin:0 200rpx;
  1281. font-size: 24rpx;
  1282. color: #999999;
  1283. .up-icon {
  1284. margin-bottom:18rpx;
  1285. width:100%;
  1286. display: flex;
  1287. justify-content: center;
  1288. image {
  1289. width:58rpx;
  1290. height:21rpx;
  1291. }
  1292. }
  1293. }
  1294. .collect {
  1295. visibility: hidden;
  1296. width:100rpx;
  1297. &.show {
  1298. visibility: visible;
  1299. }
  1300. >view {
  1301. display: flex;
  1302. flex-direction: column;
  1303. align-items: center;
  1304. justify-content: center;
  1305. image {
  1306. width:32rpx;
  1307. height:32rpx;
  1308. margin-bottom:6rpx;
  1309. }
  1310. view {
  1311. font-size: 24rpx;
  1312. color: #999999;
  1313. }
  1314. }
  1315. }
  1316. }
  1317. .boxSty {
  1318. padding: 44rpx 41rpx 0rpx;
  1319. }
  1320. .liListSty {
  1321. border:1rpx solid #EEEEEE;
  1322. width: 88rpx;
  1323. height: 88rpx;
  1324. border-radius: 32rpx;
  1325. text-align: center;
  1326. line-height: 88rpx;
  1327. color: #333;
  1328. font-size: 32rpx;
  1329. float: left;
  1330. margin: 20rpx 23rpx;
  1331. &.isRight {
  1332. border:1rpx solid #EEEEEE;
  1333. color:#fff;
  1334. background: green;
  1335. }
  1336. &.isWrong {
  1337. border:1rpx solid #EEEEEE;
  1338. color:#fff;
  1339. background: red;
  1340. }
  1341. }
  1342. .answerInfos {
  1343. padding: 25rpx 25rpx 25rpx 23rpx;
  1344. }
  1345. .answerTitle {
  1346. margin-bottom: 28rpx;
  1347. color: #666;
  1348. font-size: 30rpx;
  1349. }
  1350. .answerContent {
  1351. font-size: 30rpx;
  1352. color: #666;
  1353. }
  1354. .textChild {
  1355. display: inline-block;
  1356. vertical-align: middle;
  1357. }
  1358. .dialog {
  1359. position: fixed;
  1360. left:0;
  1361. top:0;
  1362. width:100%;
  1363. height:100%;
  1364. background-color: rgba(0,0,0,0.8);
  1365. display: flex;
  1366. flex-direction: column;
  1367. align-items: center;
  1368. justify-content: center;
  1369. z-index: 20000;
  1370. .pointer {
  1371. width:338rpx;
  1372. height:240rpx;
  1373. }
  1374. .text {
  1375. font-size: 32rpx;
  1376. color: #FFFFFF;
  1377. text-align: center;
  1378. }
  1379. .btn {
  1380. width: 242rpx;
  1381. height: 82rpx;
  1382. border: 2rpx solid #FFFFFF;
  1383. border-radius: 16rpx;
  1384. text-align: center;
  1385. line-height: 82rpx;
  1386. margin:41rpx auto;
  1387. color:#fff;
  1388. font-size: 32rpx;
  1389. }
  1390. }
  1391. </style>