questionBankExplain.vue 40 KB

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