questionBankExplainDetail.vue 41 KB

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