questionBank.vue 39 KB

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