questionBankExplainDetail.vue 44 KB

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