questionBankExplain.vue 40 KB

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