questionBankExplainDetail.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728
  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. return item.ques[quesIndex] == item.ans[quesIndex]
  822. })
  823. if(isRight) {
  824. score += item.score;
  825. number++
  826. rightQuestionIds.push(item.questionId)
  827. } else {
  828. let checkboxScore = item.score; //获取单题总分数
  829. item.ques.forEach((ques,quesIndex) => {
  830. //选错一个全扣
  831. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  832. checkboxScore = 0;
  833. }
  834. })
  835. console.log(checkboxScore)
  836. //没选错
  837. if(checkboxScore) {
  838. item.ans.forEach((ans,quesIndex) => {
  839. //漏选扣一部分
  840. console.log(item.ques.indexOf(item.ans[quesIndex]))
  841. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  842. checkboxScore -= item.partScore;
  843. }
  844. })
  845. }
  846. if(checkboxScore <= 0) { //0分
  847. item.scoreResult = 0;
  848. doWrongQuestionIds.push(item.questionId)
  849. } else { //部分分
  850. number++;
  851. item.scoreResult = checkboxScore;
  852. score += checkboxScore;
  853. rightQuestionIds.push(item.questionId)
  854. }
  855. }
  856. allScore += item.score;
  857. if (item.ques && item.ques.length) {
  858. doQuestionNum++;
  859. doQuestionIds.push(item.questionId)
  860. }
  861. } else if(item.type == 3) {
  862. if(item.ques == item.ans) {
  863. score += item.score;
  864. number++
  865. rightQuestionIds.push(item.questionId)
  866. } else {
  867. doWrongQuestionIds.push(item.questionId)
  868. }
  869. allScore += item.score;
  870. if (item.ques) {
  871. doQuestionNum++;
  872. doQuestionIds.push(item.questionId)
  873. }
  874. } else if (item.type == 4) {
  875. if (item.ques && item.ques.length) {
  876. doQuestionNum++;
  877. }
  878. } else if (item.type == 5) {
  879. if (item.ques) {
  880. doQuestionNum++;
  881. }
  882. }
  883. })
  884. //大于60分及格
  885. if(score >= passScore) {
  886. reportStatus = 1
  887. } else {
  888. reportStatus = 0
  889. }
  890. this.$api.examRecordEdit({
  891. examId:this.id,
  892. goodsId:this.goodsId,
  893. reportStatus:reportStatus,
  894. totalScore:allScore,
  895. recordId: this.recordId,
  896. rightQuestionNum:number,
  897. status:1,
  898. doQuestionIds:doQuestionIds.join(','),
  899. rightQuestionIds:rightQuestionIds.join(','),
  900. doQuestionNum: doQuestionNum,
  901. performance: score,
  902. historyExamJson:JSON.stringify(this.questionList)
  903. }).then(res => {
  904. this.isSubmit = true;
  905. if(res.data.code == 200) {
  906. uni.showToast({
  907. title: '交卷成功',
  908. duration: 2000,
  909. icon:'none'
  910. });
  911. setTimeout(() => {
  912. uni.redirectTo({
  913. url:'/pages2/bank/question_report?id='+this.recordId+'&examId='+this.id
  914. })
  915. },2000)
  916. }
  917. })
  918. },
  919. /**
  920. * @param {Object} 多选确认
  921. */
  922. checkboxSubmit(bindex) {
  923. if(this.questionList[bindex].ques) return;
  924. let arr = [];
  925. this.questionList[bindex].jsonStr.forEach(item => {
  926. if(item.checked) {
  927. arr.push(item.optionsId)
  928. }
  929. })
  930. this.$set(this.questionList[bindex],'ques',arr)
  931. },
  932. /**
  933. * @param {Object} 多选确认
  934. */
  935. checkboxSubmitChild(bindex,ansIndex) {
  936. if(this.questionList[bindex].ques[ansIndex]) return;
  937. let arr = [];
  938. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  939. if(item.checked) {
  940. arr.push(item.optionsId)
  941. }
  942. })
  943. this.$set(this.questionList[bindex].ques,ansIndex,arr)
  944. },
  945. judgeSelect(index,bindex) {
  946. if(this.questionList[bindex].ques) return;
  947. this.$set(this.questionList[bindex],'ques',index+'')
  948. },
  949. judgeSelectChild(ansindex,childindex,bindex) {
  950. if(this.questionList[bindex].ques[ansindex]) return;
  951. this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
  952. },
  953. openFooterTab() {
  954. this.show = true;
  955. },
  956. hideDialog() {
  957. this.showDialog = false
  958. },
  959. changeIndex(index) {
  960. this.current = index
  961. },
  962. swiperChange(e) {
  963. this.current = e.detail.current;
  964. },
  965. deleteImg(imgIndex,bankIndex) {
  966. this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
  967. },
  968. deleteImgChild(imgIndex,bankIndex,ansIndex) {
  969. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
  970. },
  971. chooseImg(bankindex) {
  972. uni.chooseImage({
  973. count: 1, //默认9
  974. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  975. sourceType: ['album','camera'], //从相册选择
  976. success: (res) => {
  977. let self = this;
  978. // console.log(JSON.stringify(res.tempFilePaths));
  979. let img = res.tempFilePaths[0];
  980. uni.getImageInfo({
  981. src: img,
  982. success: async res => {
  983. let canvasWidth = res.width; //图片原始长宽
  984. let canvasHeight = res.height;
  985. if (canvasWidth > 1000 || canvasHeight > 1000) {
  986. uni.compressImage({
  987. src: img,
  988. quality: 75,
  989. width: '50%',
  990. height: '50%',
  991. success: async rest => {
  992. const dir = await self.uploadFile(rest.tempFilePath, 0);
  993. this.questionList[bankindex].ansText.imageList.push(dir)
  994. }
  995. });
  996. } else {
  997. const dir = await self.uploadFile(img, 0);
  998. this.questionList[bankindex].ansText.imageList.push(dir)
  999. }
  1000. }
  1001. });
  1002. }
  1003. })
  1004. },
  1005. chooseImgChild(bankindex,ansindex) {
  1006. uni.chooseImage({
  1007. count: 1, //默认9
  1008. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  1009. sourceType: ['album','camera'], //从相册选择
  1010. success: (res) => {
  1011. let self = this;
  1012. // console.log(JSON.stringify(res.tempFilePaths));
  1013. let img = res.tempFilePaths[0];
  1014. uni.getImageInfo({
  1015. src: img,
  1016. success: async res => {
  1017. let canvasWidth = res.width; //图片原始长宽
  1018. let canvasHeight = res.height;
  1019. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1020. uni.compressImage({
  1021. src: img,
  1022. quality: 75,
  1023. width: '50%',
  1024. height: '50%',
  1025. success: async rest => {
  1026. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1027. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  1028. }
  1029. });
  1030. } else {
  1031. const dir = await self.uploadFile(img, 0);
  1032. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  1033. }
  1034. }
  1035. });
  1036. }
  1037. })
  1038. },
  1039. uploadFile(options, int) {
  1040. var self = this;
  1041. return new Promise((resolve, reject) => {
  1042. var data = {
  1043. imageStatus: int
  1044. };
  1045. self.$api.aliyunpolicy(data).then(res => {
  1046. console.log(res.data,6)
  1047. if(res.data.code!=200){
  1048. self.$method.showToast('签名错误'+JSON.stringify(res.data))
  1049. return
  1050. }
  1051. var ossToken = res.data.data.resultContent;
  1052. if(ossToken.host==null||ossToken.host==undefined){
  1053. self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
  1054. return
  1055. }
  1056. uni.uploadFile({
  1057. url: ossToken.host,
  1058. name: 'file',
  1059. filePath: options,
  1060. fileType: 'image',
  1061. header: {
  1062. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  1063. },
  1064. formData: {
  1065. key: ossToken.dir,
  1066. OSSAccessKeyId: ossToken.accessid,
  1067. policy: ossToken.policy,
  1068. Signature: ossToken.signature,
  1069. callback: ossToken.callback,
  1070. success_action_status: 200
  1071. },
  1072. success: result => {
  1073. if (result.statusCode === 200) {
  1074. resolve(ossToken.dir);
  1075. } else {
  1076. uni.showToast({
  1077. title: '上传失败',
  1078. icon: 'none'
  1079. });
  1080. return;
  1081. }
  1082. },
  1083. fail: error => {
  1084. uni.showToast({
  1085. title: '上传接口报错'+error,
  1086. icon: 'none'
  1087. });
  1088. return;
  1089. }
  1090. });
  1091. });
  1092. });
  1093. },
  1094. submitAns(bankindex) {
  1095. console.log(this.questionList[bankindex])
  1096. if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  1097. uni.showToast({
  1098. title: '请输入内容或上传图片',
  1099. duration: 2000,
  1100. icon:'none'
  1101. });
  1102. return
  1103. }
  1104. this.$set(this.questionList[bankindex],'ques',{
  1105. imageList:this.questionList[bankindex].ansText.imageList,
  1106. text:this.questionList[bankindex].ansText.text,
  1107. })
  1108. },
  1109. submitAnsChild(bankindex,ansindex) {
  1110. if(!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  1111. uni.showToast({
  1112. title: '请输入内容或上传图片',
  1113. duration: 2000,
  1114. icon:'none'
  1115. });
  1116. return
  1117. }
  1118. this.$set(this.questionList[bankindex].ques,ansindex,{
  1119. imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  1120. text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  1121. })
  1122. },
  1123. isRight(item,index) {
  1124. //单选
  1125. if(this.questionList[index].ques) {
  1126. if(item.type == 1) {
  1127. return this.questionList[index].ques == this.questionList[index].ans;
  1128. //多选
  1129. } else if(item.type == 2) {
  1130. //每一项都相等
  1131. return this.questionList[index].ques.every((item,i) => {
  1132. console.log(item == this.questionList[index].ans[i])
  1133. return item == this.questionList[index].ans[i];
  1134. })
  1135. //判断
  1136. } else if(item.type == 3) {
  1137. return this.questionList[index].ques == this.questionList[index].ans;
  1138. } else {
  1139. return false;
  1140. }
  1141. } else {
  1142. return false;
  1143. }
  1144. },
  1145. right(bankIndex,ansIndex,option) {
  1146. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1147. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
  1148. return true
  1149. } else {
  1150. return false;
  1151. }
  1152. } else {
  1153. return false;
  1154. }
  1155. },
  1156. wrong(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. isWrong(item,index) {
  1168. if(this.questionList[index].ques) {
  1169. //单选
  1170. if(item.type == 1) {
  1171. return this.questionList[index].ques != this.questionList[index].ans;
  1172. //多选
  1173. } else if(item.type == 2) {
  1174. //每一项都相等
  1175. return this.questionList[index].ques.some((item,i) => {
  1176. return item != this.questionList[index].ans[i];
  1177. })
  1178. //判断
  1179. } else if(item.type == 3) {
  1180. return this.questionList[index].ques != this.questionList[index].ans;
  1181. } else {
  1182. return false;
  1183. }
  1184. } else {
  1185. return false;
  1186. }
  1187. },
  1188. tabSelect(index,bankindex) {
  1189. this.$set(this.questionList[bankindex],'current',index)
  1190. },
  1191. }
  1192. };
  1193. </script>
  1194. <style lang="scss" scoped>
  1195. .tabs-top {
  1196. display: flex;
  1197. justify-content: center;
  1198. margin-bottom:10rpx;
  1199. }
  1200. .swiper {
  1201. width:100%;
  1202. height:calc(100vh - 44px);
  1203. }
  1204. .lisSty {
  1205. margin-bottom: 16rpx;
  1206. display: flex;
  1207. .flex_auto {
  1208. flex:1;
  1209. }
  1210. }
  1211. .activeTI {
  1212. vertical-align: middle;
  1213. display: inline-block;
  1214. border: 1rpx solid #eee;
  1215. border-radius: 50rpx;
  1216. height: 48rpx;
  1217. line-height: 46rpx;
  1218. text-align: center;
  1219. width: 48rpx;
  1220. margin-right: 15rpx;
  1221. color: #666;
  1222. font-size: 30rpx;
  1223. &.right {
  1224. color:#fff;
  1225. background:green;
  1226. }
  1227. &.wrong {
  1228. color:#fff;
  1229. background:red;
  1230. }
  1231. &.checked {
  1232. color:#fff;
  1233. background:blue;
  1234. }
  1235. }
  1236. .submit_checkbox {
  1237. margin:20rpx auto;
  1238. width: 526rpx;
  1239. height: 80rpx;
  1240. background: rgba(0, 122, 255, 1);
  1241. color:#fff;
  1242. text-align: center;
  1243. line-height: 80rpx;
  1244. font-size: 30rpx;
  1245. border-radius: 40rpx;
  1246. }
  1247. .titles {
  1248. overflow: hidden;
  1249. margin-bottom: 24rpx;
  1250. }
  1251. .titBox {
  1252. padding: 41rpx 25rpx 24rpx 25rpx;
  1253. }
  1254. .tabs {
  1255. margin:10rpx;
  1256. display: flex;
  1257. .tab {
  1258. margin:0 10rpx;
  1259. width: 96rpx;
  1260. height: 48rpx;
  1261. line-height: 48rpx;
  1262. text-align: center;
  1263. color:#007AFF;
  1264. font-size: 28rpx;
  1265. border-radius: 16rpx;
  1266. &.current {
  1267. color:#fff;
  1268. background: #007AFF;
  1269. }
  1270. }
  1271. }
  1272. .ans {
  1273. margin:8rpx 8rpx 8rpx;
  1274. .ans_input {
  1275. border-radius: 16rpx;
  1276. background:#fff;
  1277. .top {
  1278. border-bottom:1rpx solid #EEEEEE;
  1279. padding: 16rpx;
  1280. display: flex;
  1281. align-items: center;
  1282. .icon {
  1283. margin-right:20rpx;
  1284. width: 40rpx;
  1285. height: 38rpx;
  1286. }
  1287. .progress {
  1288. flex:1;
  1289. }
  1290. .submit {
  1291. width: 168rpx;
  1292. height: 48rpx;
  1293. line-height: 48rpx;
  1294. text-align: center;
  1295. color:#fff;
  1296. font-size: 30rpx;
  1297. background: #007AFF;
  1298. border-radius: 24rpx;
  1299. &.disabled {
  1300. opacity: 0.6;
  1301. }
  1302. }
  1303. }
  1304. .textarea {
  1305. textarea {
  1306. width:100%;
  1307. height:287rpx;
  1308. padding:10rpx;
  1309. }
  1310. }
  1311. .imgs {
  1312. overflow: hidden;
  1313. display: flex;
  1314. width:100%;
  1315. .img {
  1316. width: 104rpx;
  1317. height: 104rpx;
  1318. border-radius: 8rpx;
  1319. position:relative;
  1320. margin:20rpx;
  1321. text {
  1322. position:absolute;
  1323. right:-15rpx;
  1324. top:-15rpx;
  1325. width:30rpx;
  1326. height:30rpx;
  1327. text-align: center;
  1328. line-height: 30rpx;
  1329. color:#fff;
  1330. background:red;
  1331. border-radius:50%;
  1332. }
  1333. image {
  1334. width:100%;
  1335. height:100%;
  1336. }
  1337. }
  1338. }
  1339. }
  1340. .ans_submit {
  1341. padding:16rpx;
  1342. border-radius: 16rpx;
  1343. background:#fff;
  1344. .imgs {
  1345. overflow: hidden;
  1346. display: flex;
  1347. width:100%;
  1348. .img {
  1349. width: 104rpx;
  1350. height: 104rpx;
  1351. border-radius: 8rpx;
  1352. position:relative;
  1353. margin:20rpx;
  1354. image {
  1355. width:100%;
  1356. height:100%;
  1357. }
  1358. }
  1359. }
  1360. }
  1361. }
  1362. .firstLetter {
  1363. display: flex;
  1364. justify-content: space-between;
  1365. align-items: center;
  1366. margin-bottom: 30rpx;
  1367. .leftLetters {
  1368. display: flex;
  1369. align-items: center;
  1370. width: 220rpx;
  1371. .btnType {
  1372. padding: 5rpx 10rpx;
  1373. border: 1rpx solid #007aff;
  1374. border-radius: 10rpx;
  1375. background-color: rgba(0, 122, 255, 0.1);
  1376. font-size: 28rpx;
  1377. color: #007aff;
  1378. margin-right: 15rpx;
  1379. }
  1380. }
  1381. }
  1382. .popupView {
  1383. height: 100%;
  1384. padding-bottom: 100rpx;
  1385. .popupTops {
  1386. height: 77rpx;
  1387. border-bottom: 1rpx solid #eee;
  1388. text-align: center;
  1389. line-height: 77rpx;
  1390. font-size: 24rpx;
  1391. color: #999;
  1392. position: relative;
  1393. .topIcon {
  1394. position: absolute;
  1395. top: 10rpx;
  1396. left: 50%;
  1397. transform: translateX(-50%);
  1398. width: 80rpx;
  1399. height: 8rpx;
  1400. background-color: #999;
  1401. border-radius: 4rpx;
  1402. }
  1403. }
  1404. .popupContent {
  1405. }
  1406. }
  1407. .pageContent {
  1408. position:relative;
  1409. background-color: #eaeef1;
  1410. height: 100%;
  1411. overflow-y: scroll;
  1412. padding-top: 8rpx;
  1413. padding-bottom: 100rpx;
  1414. }
  1415. .pad_8 {
  1416. background-color: #fff;
  1417. margin: 0rpx 8rpx 8rpx;
  1418. border-radius: 16rpx;
  1419. &.no-margin {
  1420. margin-top:-16rpx;
  1421. border-radius: 0 0 16rpx 16rpx;
  1422. }
  1423. }
  1424. .answer {
  1425. height: 80rpx;
  1426. line-height: 80rpx;
  1427. padding: 0rpx 24rpx;
  1428. display: flex;
  1429. align-items: center;
  1430. justify-content: space-between;
  1431. color: #666;
  1432. font-size: 30rpx;
  1433. }
  1434. .footer_btn {
  1435. background-color: #fff;
  1436. z-index: 10078;
  1437. position: fixed;
  1438. bottom: 0rpx;
  1439. display: flex;
  1440. align-items: center;
  1441. justify-content: space-between;
  1442. width: 100%;
  1443. height: 98rpx;
  1444. padding: 0rpx 38rpx;
  1445. border-top: 1rpx solid #eee;
  1446. .flex_center {
  1447. flex:1;
  1448. display: flex;
  1449. justify-content: center;
  1450. align-items: center;
  1451. flex-direction: column;
  1452. margin:0 200rpx;
  1453. font-size: 24rpx;
  1454. color: #999999;
  1455. .up-icon {
  1456. margin-bottom:18rpx;
  1457. width:100%;
  1458. display: flex;
  1459. justify-content: center;
  1460. image {
  1461. width:58rpx;
  1462. height:21rpx;
  1463. }
  1464. }
  1465. }
  1466. .collect {
  1467. visibility: hidden;
  1468. width:100rpx;
  1469. &.show {
  1470. visibility: visible;
  1471. }
  1472. >view {
  1473. display: flex;
  1474. flex-direction: column;
  1475. align-items: center;
  1476. justify-content: center;
  1477. image {
  1478. width:32rpx;
  1479. height:32rpx;
  1480. margin-bottom:6rpx;
  1481. }
  1482. view {
  1483. font-size: 24rpx;
  1484. color: #999999;
  1485. }
  1486. }
  1487. }
  1488. }
  1489. .boxSty {
  1490. padding: 44rpx 41rpx 0rpx;
  1491. }
  1492. .liListSty {
  1493. border:1rpx solid #EEEEEE;
  1494. width: 88rpx;
  1495. height: 88rpx;
  1496. border-radius: 32rpx;
  1497. text-align: center;
  1498. line-height: 88rpx;
  1499. color: #333;
  1500. font-size: 32rpx;
  1501. float: left;
  1502. margin: 20rpx 23rpx;
  1503. &.isRight {
  1504. border:1rpx solid #EEEEEE;
  1505. color:#fff;
  1506. background: green;
  1507. }
  1508. &.isWrong {
  1509. border:1rpx solid #EEEEEE;
  1510. color:#fff;
  1511. background: red;
  1512. }
  1513. }
  1514. .answerInfos {
  1515. padding: 25rpx 25rpx 25rpx 23rpx;
  1516. }
  1517. .answerTitle {
  1518. margin-bottom: 28rpx;
  1519. color: #666;
  1520. font-size: 30rpx;
  1521. }
  1522. .answerContent {
  1523. font-size: 30rpx;
  1524. color: #666;
  1525. }
  1526. .textChild {
  1527. display: inline-block;
  1528. vertical-align: middle;
  1529. }
  1530. .dialog {
  1531. position: fixed;
  1532. left:0;
  1533. top:0;
  1534. width:100%;
  1535. height:100%;
  1536. background-color: rgba(0,0,0,0.8);
  1537. display: flex;
  1538. flex-direction: column;
  1539. align-items: center;
  1540. justify-content: center;
  1541. z-index: 20000;
  1542. .pointer {
  1543. width:338rpx;
  1544. height:240rpx;
  1545. }
  1546. .text {
  1547. font-size: 32rpx;
  1548. color: #FFFFFF;
  1549. text-align: center;
  1550. }
  1551. .btn {
  1552. width: 242rpx;
  1553. height: 82rpx;
  1554. border: 2rpx solid #FFFFFF;
  1555. border-radius: 16rpx;
  1556. text-align: center;
  1557. line-height: 82rpx;
  1558. margin:41rpx auto;
  1559. color:#fff;
  1560. font-size: 32rpx;
  1561. }
  1562. }
  1563. </style>