questionBank.vue 39 KB

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