questionBank.vue 39 KB

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