questionBank.vue 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415
  1. <template>
  2. <view class="questionBank">
  3. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" ref="navbar" :statusBar="true" title="试卷"></uni-nav-bar>
  4. <swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
  5. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  6. <view class="pageContent">
  7. <view class="pad_8 titBox">
  8. <view class="firstLetter">
  9. <view class="leftLetters">
  10. <view class="btnType">
  11. <text v-if="bank.type == 1">单选</text>
  12. <text v-if="bank.type == 2">多选</text>
  13. <text v-if="bank.type == 3">判断</text>
  14. <text v-if="bank.type == 4">案例</text>
  15. <text v-if="bank.type == 5">简答</text>
  16. </view>
  17. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  18. </view>
  19. <view style="color: #666;font-size: 28rpx;">{{ countdown(lastTime) }}</view>
  20. <view class="leftLetters"></view>
  21. </view>
  22. <view class="titles"><rich-text :nodes="bank.content"></rich-text></view>
  23. </view>
  24. <template v-if="bank.type == 1">
  25. <view class="pad_8 titBox no-margin">
  26. <view v-if="!bank.ques">
  27. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId, bankIndex)">
  28. <view class="activeTI">{{ ast[index] }}</view>
  29. <view class="flex_auto">{{ item.content }}</view>
  30. </view>
  31. </view>
  32. <view v-if="bank.ques">
  33. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  34. <text
  35. :class="{ right: item.optionsId == bank.ques || item.optionsId == bank.ans, wrong: item.optionsId == bank.ques && bank.ques != bank.ans }"
  36. class="activeTI"
  37. >
  38. {{ ast[index] }}
  39. </text>
  40. <view class="flex_auto">{{ item.content }}</view>
  41. </view>
  42. </view>
  43. <view v-if="bank.ques">
  44. <view class="pad_8 answer">
  45. <view>正确答案:{{ ast[bank.ans - 1] }}</view>
  46. <view>我的答案:{{ ast[bank.ques - 1] }}</view>
  47. </view>
  48. <view class="pad_8 answerInfos">
  49. <view class="answerTitle">答案解析</view>
  50. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <template v-if="bank.type == 2">
  56. <view class="pad_8 titBox no-margin">
  57. <view v-if="!bank.ques">
  58. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId, bankIndex, index)">
  59. <view :class="{ checked: item.checked }" class="activeTI">{{ ast[index] }}</view>
  60. <view class="flex_auto">{{ item.content }}</view>
  61. </view>
  62. </view>
  63. <view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">确认答案</view>
  64. <view v-if="bank.ques">
  65. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  66. <text
  67. :class="{
  68. right: bank.ques.indexOf(item.optionsId) != -1 || bank.ans.indexOf(item.optionsId) != -1,
  69. wrong: bank.ques.indexOf(item.optionsId) != -1 && bank.ans.indexOf(item.optionsId) == -1
  70. }"
  71. class="activeTI"
  72. >
  73. {{ ast[index] }}
  74. </text>
  75. <view class="flex_auto">{{ item.content }}</view>
  76. </view>
  77. </view>
  78. <view v-if="bank.ques">
  79. <view class="pad_8 answer">
  80. <view>
  81. 正确答案:
  82. <text v-for="(ansItem,ansIndex) in bank.ans" :key="ansIndex">{{ ast[ansItem - 1] }}</text>
  83. </view>
  84. <view>
  85. 我的答案:
  86. <text v-for="(quesItem,quesIndex) in bank.ques" :key="quesIndex">{{ ast[quesItem - 1] }}</text>
  87. </view>
  88. </view>
  89. <view class="pad_8 answerInfos">
  90. <view class="answerTitle">答案解析</view>
  91. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <template v-if="bank.type == 3">
  97. <view class="pad_8 titBox no-margin">
  98. <view v-if="!bank.ques">
  99. <view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index, bankIndex)">
  100. <view class="activeTI">{{ ast[index] }}</view>
  101. {{ item }}
  102. </view>
  103. </view>
  104. <view v-if="bank.ques">
  105. <view v-for="(item, index) in judge" :key="index" class="lisSty">
  106. <text :class="{ right: index == bank.ques || index == bank.ans, wrong: index == bank.ques && bank.ques != bank.ans }" class="activeTI">
  107. {{ ast[index] }}
  108. </text>
  109. {{ item }}
  110. </view>
  111. </view>
  112. <view v-if="bank.ques">
  113. <view class="pad_8 answer">
  114. <view>正确答案:{{ ast[bank.ans] }}</view>
  115. <view>我的答案:{{ ast[bank.ques] }}</view>
  116. </view>
  117. <view class="pad_8 answerInfos">
  118. <view class="answerTitle">答案解析</view>
  119. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  120. </view>
  121. </view>
  122. </view>
  123. </template>
  124. <!-- 简答题 -->
  125. <template v-if="bank.type == 5">
  126. <view class="pad_8 titBox">
  127. <view class="ans">
  128. <view class="ans_input" v-if="!bank.ques || (!bank.ques.imageList.length && !bank.ques.text)">
  129. <view class="top flex">
  130. <image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
  131. <view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
  132. <view class="submit" :class="{disabled:!bank.ansText.text && hasImgs(bank)}" @click="submitAns(bankIndex)">确认答案</view>
  133. </view>
  134. <view class="textarea"><textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea></view>
  135. <view class="imgs">
  136. <view class="img" v-for="(img, imgIndex) in bank.ansText.imageList" :key="imgIndex">
  137. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  138. <image :src="$method.splitImgHost(img, true)"></image>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="ans_submit answerInfos" v-if="bank.ques.imageList.length || bank.ques.text">
  143. <view class="answerTitle">我的答案:</view>
  144. {{ bank.ques.text }}
  145. <view class="imgs"><image class="img" :key="quesIndex" v-for="(ques,quesIndex) in bank.ques.imageList" :src="$method.splitImgHost(ques, true)"></image></view>
  146. </view>
  147. </view>
  148. <view v-if="bank.ques.imageList.length || bank.ques.text">
  149. <view class="pad_8 answerInfos">
  150. <view class="answerTitle">答案解析:</view>
  151. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  152. </view>
  153. </view>
  154. </view>
  155. </template>
  156. <!-- 案例题 -->
  157. <template v-if="bank.type == 4">
  158. <view class="pad_8 titBox">
  159. <view class="tabs">
  160. <view
  161. class="tab"
  162. :class="{ current: tabIndex == bank.current }"
  163. :key="tabIndex"
  164. v-for="(tab, tabIndex) in bank.jsonStr"
  165. @click="tabSelect(tabIndex, bankIndex)"
  166. >
  167. 问题{{ tabIndex }}
  168. </view>
  169. </view>
  170. <view v-for="(ansItem, ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
  171. <view class="titles"><rich-text :nodes="ansItem.content"></rich-text></view>
  172. <template v-if="ansItem.type == 1">
  173. <view v-if="!bank.ques[ansIndex]">
  174. <view
  175. v-for="(option, childIndex) in ansItem.optionsList"
  176. :key="childIndex"
  177. class="lisSty"
  178. @click="radioSelectChild(option.optionsId, ansIndex, bankIndex)"
  179. >
  180. <view class="activeTI">{{ ast[childIndex] }}</view>
  181. <rich-text class="textChild" :nodes="option.content"></rich-text>
  182. </view>
  183. </view>
  184. <view v-if="bank.ques[ansIndex]">
  185. <view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty">
  186. <text
  187. :class="{
  188. right: option.optionsId == bank.ques[ansIndex] || option.optionsId == bank.ans[ansIndex],
  189. wrong: option.optionsId == bank.ques[ansIndex] && bank.ques[ansIndex] != bank.ans[ansIndex]
  190. }"
  191. class="activeTI"
  192. >
  193. {{ ast[childIndex] }}
  194. </text>
  195. <rich-text :nodes="option.content"></rich-text>
  196. </view>
  197. </view>
  198. <view v-if="bank.ques[ansIndex]">
  199. <view class="pad_8 answer">
  200. <view>正确答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  201. <view>我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view>
  202. </view>
  203. <view class="pad_8 answerInfos">
  204. <view class="answerTitle">答案解析</view>
  205. <view class="answerContent"><rich-text :nodes="option.analysisContent"></rich-text></view>
  206. </view>
  207. </view>
  208. </template>
  209. <template v-if="ansItem.type == 2">
  210. <view v-if="!bank.ques[ansIndex]">
  211. <view
  212. v-for="(option, childindex) in ansItem.optionsList"
  213. :key="childindex"
  214. class="lisSty"
  215. @click="checkboxSelectChild(bankIndex, ansIndex, childindex)"
  216. >
  217. <view :class="{ checked: option.checked }" class="activeTI">{{ ast[childindex] }}</view>
  218. <rich-text :nodes="option.content"></rich-text>
  219. </view>
  220. </view>
  221. <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex, ansIndex)">确认答案</view>
  222. <view v-if="bank.ques && bank.ques[ansIndex]">
  223. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
  224. <text :class="{ right: right(bankIndex, ansIndex, option), wrong: wrong(bankIndex, ansIndex, option) }" class="activeTI">
  225. {{ ast[childindex] }}
  226. </text>
  227. <rich-text :nodes="option.content"></rich-text>
  228. </view>
  229. </view>
  230. <view v-if="bank.ques[ansIndex]">
  231. <view class="pad_8 answer">
  232. <view>
  233. 正确答案:
  234. <text :key="ansItemIndex1" v-for="(ansItem1,ansItemIndex1) in bank.ans[ansIndex]">{{ ast[ansItem1 - 1] }}</text>
  235. </view>
  236. <view>
  237. 我的答案:
  238. <text :key="quesItemIndex" v-for="(quesItem,quesItemIndex) in bank.ques[ansIndex]">{{ ast[quesItem - 1] }}</text>
  239. </view>
  240. </view>
  241. <view class="pad_8 answerInfos">
  242. <view class="answerTitle">答案解析</view>
  243. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  244. </view>
  245. </view>
  246. </template>
  247. <template v-if="ansItem.type == 3">
  248. <view v-if="!bank.ques[ansIndex]">
  249. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex, childindex, bankIndex)">
  250. <view class="activeTI">{{ ast[childindex] }}</view>
  251. {{ option }}
  252. </view>
  253. </view>
  254. <view v-if="bank.ques[ansIndex]">
  255. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
  256. <text
  257. :class="{
  258. right: childindex == bank.ques[ansIndex] || childindex == bank.ans[ansIndex],
  259. wrong: childindex == bank.ques[ansIndex] && bank.ques[ansIndex] != bank.ans[ansIndex]
  260. }"
  261. class="activeTI"
  262. >
  263. {{ ast[childindex] }}
  264. </text>
  265. {{ option }}
  266. </view>
  267. </view>
  268. <view v-if="bank.ques[ansIndex]">
  269. <view class="pad_8 answer">
  270. <view>正确答案:{{ ast[bank.ans[ansIndex]] }}</view>
  271. <view>我的答案:{{ ast[bank.ques[ansIndex]] }}</view>
  272. </view>
  273. <view class="pad_8 answerInfos">
  274. <view class="answerTitle">答案解析</view>
  275. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  276. </view>
  277. </view>
  278. </template>
  279. <!-- 简答题 -->
  280. <template v-if="ansItem.type == 5">
  281. <view class="ans">
  282. <view class="ans_input" v-if="!bank.ques[ansIndex] || (!bank.ques[ansIndex].text && !bank.ques[ansIndex].imageList.length)">
  283. <view class="top flex">
  284. <image class="icon" @click="chooseImgChild(bankIndex, ansIndex)" src="/static/camera.png" mode=""></image>
  285. <view class="progress">{{ansItem.ansText.imageList.length || '0'}}/4</view>
  286. <view class="submit" :class="{disabled:!ansItem.ansText.text && hasImgs(ansItem)}" @click="submitAnsChild(bankIndex, ansIndex)">确认答案</view>
  287. </view>
  288. <view class="textarea"><textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea></view>
  289. <view class="imgs">
  290. <view class="img" v-for="(img, imgIndex) in ansItem.ansText.imageList" :key="imgIndex">
  291. <text @click="deleteImgChild(imgIndex, bankIndex, ansIndex)">x</text>
  292. <image :src="$method.splitImgHost(img, true)"></image>
  293. </view>
  294. </view>
  295. </view>
  296. <view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] || bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text">
  297. <view class="answerTitle">我的答案</view>
  298. {{ bank.ques[ansIndex].text || ''}}
  299. <view class="imgs">
  300. <image class="img" v-for="(ques,quesIndex) in bank.ques[ansIndex].imageList" :key="quesIndex" :src="$method.splitImgHost(ques, true)"></image>
  301. </view>
  302. </view>
  303. </view>
  304. <view v-if="bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text">
  305. <view class="pad_8 answerInfos">
  306. <view class="answerTitle">答案解析</view>
  307. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  308. </view>
  309. </view>
  310. </template>
  311. </view>
  312. </view>
  313. </template>
  314. <view class="footer_btn">
  315. <view class="collect" :class="{ show: goodsId && !isFromVideo ? true : false }" @click="collect(collectList[bankIndex], bankIndex)">
  316. <view v-if="collectList[bankIndex]">
  317. <image src="/static/icon/collected.png" mode=""></image>
  318. <view>取消收藏</view>
  319. </view>
  320. <view v-if="!collectList[bankIndex]">
  321. <image src="/static/icon/collect.png" mode=""></image>
  322. <view>收藏</view>
  323. </view>
  324. </view>
  325. <view class="flex_center" @click="openFooterTab">
  326. <view class="up-icon">
  327. <image src="/static/up.png"></image>
  328. </view>
  329. 答题卡
  330. </view>
  331. <view class="collect show" @click="pdsubmit">
  332. <view>
  333. <image src="/static/jj.png" mode=""></image>
  334. <view>交卷</view>
  335. </view>
  336. </view>
  337. </view>
  338. </view>
  339. </swiper-item>
  340. </swiper>
  341. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  342. <view class="popupView">
  343. <view class="popupTops">
  344. <view class="topIcon"></view>
  345. 点击编号即可跳转至对应题目
  346. </view>
  347. <view class="popupContent">
  348. <scroll-view scroll-y="true" style="height: 506rpx;">
  349. <view class="boxSty">
  350. <view
  351. v-for="(item, index) in questionList"
  352. :key="index"
  353. @click="changeIndex(index)"
  354. :class="{ isRight: isRight(item, index), isWrong: isWrong(item, index) }"
  355. class="liListSty"
  356. >
  357. {{ index + 1 }}
  358. </view>
  359. </view>
  360. </scroll-view>
  361. </view>
  362. </view>
  363. </u-popup>
  364. <view class="dialog" v-if="showDialog">
  365. <image class="pointer" src="/static/pointer.png" mode=""></image>
  366. <view class="text">左右滑动切换上下题</view>
  367. <view class="btn" @click="showDialog = false">我知道了</view>
  368. </view>
  369. <view class="dialog-arrow" v-if="showArrow">
  370. <image class="pointer" src="/static/arrow-left.png" mode=""></image>
  371. <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
  372. <view class="btn" @click="showArrow = false">我知道了</view>
  373. </view>
  374. <view class="dialog_wrap" v-if="testOver">
  375. <view class="bg"></view>
  376. <view class="dialog">
  377. <view class="title">温馨提示</view>
  378. <view class="content">
  379. <view>您已完成所有题目,</view>
  380. <view>快去交卷吧!</view>
  381. </view>
  382. <view class="btns">
  383. <view class="btn" @click="noSubmit()">暂不交卷</view>
  384. <view class="btn active" @click="submitNow()">立即交卷</view>
  385. </view>
  386. </view>
  387. </view>
  388. <view class="dialog_wrap" v-if="isLastCount">
  389. <view class="bg"></view>
  390. <view class="dialog">
  391. <view class="title">温馨提示</view>
  392. <view class="content">
  393. <view>您当前正在测试,还剩{{ lastCount }}道题未完成,离开视为交卷</view>
  394. </view>
  395. <view class="btns">
  396. <view class="btn" @click="noLeave()">暂不离开</view>
  397. <view class="btn active" @click="leaveNow()">继续离开</view>
  398. </view>
  399. </view>
  400. </view>
  401. <u-popup v-model="showpopups" mode="center" border-radius="24" height="439rpx" width="640rpx" :mask-close-able="false">
  402. <view class="popboxs">
  403. <view class="classTops">温馨提示</view>
  404. <view class="textStys">
  405. {{
  406. cgType === 7
  407. ? '您还未交卷,确定结束做题吗?'
  408. : cgType === 8
  409. ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
  410. : cgType === 6
  411. ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
  412. : ''
  413. }}
  414. </view>
  415. <view class="classFootsty" v-if="cgType === 6">
  416. <view class="btnsty btns1" @click="submit">立即交卷</view>
  417. <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
  418. </view>
  419. <view class="classFootsty" v-if="cgType === 7">
  420. <view class="btnsty btns1" @click="showpopups = false">下次继续</view>
  421. <view class="btnsty btns2" @click="backPages">结束做题</view>
  422. </view>
  423. <view class="classFootsty" v-if="cgType === 8">
  424. <view class="btnsty btns1" @click="backPages()">下次继续</view>
  425. <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
  426. </view>
  427. </view>
  428. </u-popup>
  429. </view>
  430. </template>
  431. <script>
  432. export default {
  433. data() {
  434. return {
  435. showpopups: false,
  436. id: '',
  437. current: 0,
  438. questionList: [],
  439. ast: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
  440. judge: ['错误', '正确'],
  441. ans: [],
  442. ques: [],
  443. show: false,
  444. showDialog: false,
  445. bankList: [],
  446. collectList: [],
  447. goodsId: '',
  448. recordId: '',
  449. isSubmit: false,
  450. lastTime: 0, //剩余考试时长
  451. allTimes: 0, //总考试时长
  452. timer: null,
  453. wrongList: [],
  454. bankType: 0, //试卷类型
  455. needBack: false, //是否是考试
  456. testOver: false,
  457. isLastCount: false, //是否有未答题目
  458. lastCount: 0, //剩余没有回答的题目数
  459. chapterId: 0,
  460. moduleId: 0,
  461. showArrow:false, //退出提示
  462. isFromVideo:'',
  463. gradeId:'',
  464. cgType: 0 //对应设计稿弹窗编码
  465. };
  466. },
  467. async onLoad(option) {
  468. this.current = +option.current || 0
  469. this.id = option.id;
  470. this.goodsId = option.goodsid;
  471. this.chapterId = option.chapterId;
  472. this.moduleId = option.moduleId;
  473. this.isFromVideo = option.isFromVideo||'';
  474. this.gradeId = option.gradeId || '';
  475. let isBack = option.isback;
  476. let showDialog = uni.getStorageSync('showDialog');
  477. if(showDialog) {
  478. this.showDialog = false;
  479. } else {
  480. this.showDialog = true;
  481. uni.setStorageSync('showDialog','1');
  482. }
  483. //考试被迫返回
  484. if (isBack) {
  485. let app = getApp();
  486. let globalData = app.globalData;
  487. for (var k in globalData.bankData) {
  488. this[k] = globalData.bankData[k];
  489. }
  490. this.showArrow = true;
  491. this.timer = setInterval(() => {
  492. if (this.lastTime <= 0) {
  493. clearInterval(this.timer);
  494. uni.showToast({
  495. icon:'none',
  496. mask:true,
  497. title:'考试时间到,自动交卷',
  498. duration:10000
  499. })
  500. this.submit();
  501. return;
  502. }
  503. this.lastTime--;
  504. }, 1000);
  505. } else {
  506. //进入页面
  507. await this.bankExam();
  508. this.goodsQuestionList();
  509. }
  510. },
  511. onUnload() {
  512. if (this.isSubmit) {
  513. clearInterval(this.timer)
  514. return;
  515. }
  516. //考试试卷 阻止ios手势返回,自动跳回答题页
  517. if (this.needBack) {
  518. let app = getApp();
  519. app.globalData.bankData = this.$data;
  520. clearInterval(this.timer);
  521. uni.navigateTo({
  522. url: '/pages2/bank/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
  523. });
  524. } else {
  525. //点击返回按钮确认允许退出,记录答题记录
  526. clearInterval(this.timer)
  527. this.examRecordEdit();
  528. }
  529. },
  530. methods: {
  531. /**
  532. * 是否有上传图片
  533. */
  534. hasImgs(bank) {
  535. return bank.ansText.imageList.length == 0;
  536. },
  537. /**
  538. * 获取试卷类型2考试,1练习
  539. */
  540. bankExam() {
  541. return new Promise(resolve => {
  542. this.$api.bankExam(this.id).then(res => {
  543. this.bankType = res.data.data.doType;
  544. if (this.bankType == 2) {
  545. this.needBack = true;
  546. }
  547. resolve()
  548. });
  549. })
  550. },
  551. /**
  552. * 点击后退按钮
  553. */
  554. clickLeft() {
  555. if (this.bankType == 1) {
  556. let ansCount = this.questionOverNum(true); //已答题数
  557. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  558. //所有题目答完
  559. if (this.lastCount == 0) {
  560. // this.testOver = true;
  561. this.cgType = 7;
  562. //未答完
  563. } else {
  564. this.cgType = 8;
  565. // this.isLastCount = true;
  566. }
  567. this.showpopups = true;
  568. } else if (this.bankType == 2) {
  569. let ansCount = this.questionOverNum(true); //已答题数
  570. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  571. //所有题目答完
  572. if (this.lastCount == 0) {
  573. this.testOver = true;
  574. //未答完
  575. } else {
  576. this.isLastCount = true;
  577. }
  578. }
  579. },
  580. /**
  581. * 返回上一页
  582. */
  583. backPages() {
  584. this.needBack = false;
  585. uni.navigateBack({
  586. delta: 1
  587. });
  588. },
  589. /**
  590. * 获取已经回答的题目数
  591. * hasSpecail (是否包含简答和案例)
  592. */
  593. questionOverNum(hasSpecail) {
  594. let count = 0;
  595. this.questionList.forEach(item => {
  596. if (item.type == 1 || item.type == 2 || item.type == 3) {
  597. if (item.ques) {
  598. count++;
  599. }
  600. } else if (item.type == 4) {
  601. //案例题
  602. if(hasSpecail) {
  603. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  604. if (jsonItem.type == 1 || jsonItem.type == 2 || jsonItem.type == 3) {
  605. if (item.ques[indexs]) {
  606. return true;
  607. } else {
  608. return false;
  609. }
  610. } else if (jsonItem.type == 5) {
  611. if (item.ques[indexs] && (item.ques[indexs].text.length || item.ques[indexs].imageList.length)) {
  612. return true;
  613. } else {
  614. return false;
  615. }
  616. }
  617. });
  618. if (isOver) {
  619. count++;
  620. console.log(item, 444);
  621. }
  622. }
  623. } else if (item.type == 5) {
  624. //简答题
  625. if(hasSpecail) {
  626. if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
  627. count++;
  628. }
  629. }
  630. }
  631. });
  632. return count;
  633. },
  634. /**
  635. * 暂不交卷
  636. */
  637. noSubmit() {
  638. //设为允许退出页面
  639. this.needBack = false;
  640. uni.navigateBack({
  641. delta: 1
  642. });
  643. },
  644. /**
  645. * 不离开
  646. */
  647. noLeave() {
  648. this.isLastCount = false;
  649. },
  650. /**
  651. * 立即离开并交卷
  652. */
  653. leaveNow() {
  654. this.needBack = false;
  655. this.isSubmit = true;
  656. uni.navigateBack({
  657. delta: 1
  658. });
  659. let score = 0; //计算总分
  660. let reportStatus = 0;
  661. let number = 0; //做对的题目数量
  662. let doQuestionNum = 0; //做过的题目数量
  663. let allScore = 0; //总分
  664. let passScore = 0;
  665. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  666. let doQuestionIds = []; //做过的题目id
  667. let rightQuestionIds = []; //做对的题目id
  668. this.questionList.forEach((item, index) => {
  669. // passScore = item.passScore
  670. if (item.type == 1) {
  671. //正确
  672. if (item.ques == item.ans) {
  673. item.scoreResult = item.score;
  674. score += item.score;
  675. number++;
  676. rightQuestionIds.push(item.questionId)
  677. } else { //错误
  678. item.scoreResult = 0;
  679. doWrongQuestionIds.push(item.questionId)
  680. }
  681. allScore += item.score;
  682. if (item.ques) {
  683. doQuestionNum++;
  684. doQuestionIds.push(item.questionId)
  685. }
  686. } else if (item.type == 2) {
  687. let isRight =
  688. item.ans &&
  689. item.ans.every((quesItem, quesIndex) => {
  690. if(item.ques) {
  691. return item.ques[quesIndex] == item.ans[quesIndex];
  692. } else {
  693. return false;
  694. }
  695. });
  696. if (isRight) {
  697. score += item.score;
  698. number++;
  699. item.scoreResult = item.score;
  700. rightQuestionIds.push(item.questionId)
  701. } else {
  702. let checkboxScore = item.score; //获取单题总分数
  703. item.ques && item.ques.forEach((ques,quesIndex) => {
  704. //选错一个全扣
  705. if(item.ques) {
  706. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  707. checkboxScore = 0;
  708. }
  709. } else {
  710. checkboxScore = 0;
  711. }
  712. })
  713. console.log(checkboxScore)
  714. //没选错
  715. if(checkboxScore) {
  716. item.ans.forEach((ans,quesIndex) => {
  717. //漏选扣一部分
  718. if(item.ques) {
  719. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  720. checkboxScore -= item.partScore;
  721. }
  722. } else {
  723. checkboxScore = 0;
  724. }
  725. })
  726. }
  727. if(checkboxScore <= 0) { //0分
  728. item.scoreResult = 0;
  729. doWrongQuestionIds.push(item.questionId)
  730. } else { //部分分
  731. number++;
  732. item.scoreResult = checkboxScore;
  733. score += checkboxScore;
  734. rightQuestionIds.push(item.questionId)
  735. }
  736. }
  737. allScore += item.score;
  738. if (item.ques && item.ques.length) {
  739. doQuestionNum++;
  740. doQuestionIds.push(item.questionId)
  741. }
  742. } else if (item.type == 3) {
  743. if (item.ques == item.ans) {
  744. item.scoreResult = item.score;
  745. score += item.score;
  746. number++;
  747. rightQuestionIds.push(item.questionId)
  748. } else {
  749. item.scoreResult = 0;
  750. doWrongQuestionIds.push(item.questionId)
  751. }
  752. allScore += item.score;
  753. if (item.ques) {
  754. doQuestionNum++;
  755. doQuestionIds.push(item.questionId)
  756. }
  757. } else if (item.type == 4) {
  758. if (item.ques && item.ques.length) {
  759. doQuestionNum++;
  760. }
  761. } else if (item.type == 5) {
  762. if (item.ques) {
  763. doQuestionNum++;
  764. }
  765. }
  766. });
  767. //大于60分及格
  768. if(score >= 60) {
  769. reportStatus = 1
  770. } else {
  771. reportStatus = 0
  772. }
  773. //交卷
  774. this.$api
  775. .examRecordEdit({
  776. examId: this.id,
  777. goodsId: this.goodsId,
  778. reportStatus:reportStatus,
  779. recordId: this.recordId,
  780. rightQuestionNum: number,
  781. status: 1,
  782. moduleExamId:this.moduleId || 0,
  783. chapterExamId:this.chapterId || 0,
  784. doQuestionIds:doQuestionIds.join(','),
  785. rightQuestionIds:rightQuestionIds.join(','),
  786. doQuestionNum: doQuestionNum,
  787. performance: score,
  788. totalScore: allScore,
  789. examTime: parseInt(this.allTimes),
  790. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  791. historyExamJson: JSON.stringify(this.questionList)
  792. })
  793. .then(res => {
  794. this.isSubmit = true;
  795. if (res.data.code == 200) {
  796. }
  797. });
  798. //错题集id提交(客观题)
  799. this.$api.examWrongRecord({
  800. moduleExamId:this.moduleId || 0,
  801. chapterExamId:this.chapterId || 0,
  802. examId: this.id,
  803. goodsId: this.goodsId,
  804. questionIds: doWrongQuestionIds,
  805. recordId: this.recordId
  806. }).then(res => {
  807. });
  808. },
  809. /**
  810. * 立即交卷
  811. */
  812. submitNow() {
  813. this.showpopups = false;
  814. this.needBack = false;
  815. this.submit();
  816. },
  817. /**
  818. * 离开页面统计回答正确题数
  819. */
  820. examRecordEdit() {
  821. if (!this.isSubmit) {
  822. let number = 0;
  823. let score = 0;
  824. let doQuestionNum = 0;
  825. this.questionList.forEach((item, index) => {
  826. if (item.type == 1) {
  827. if (item.ques == item.ans) {
  828. score += item.score;
  829. number++;
  830. }
  831. if (item.ques) {
  832. doQuestionNum++;
  833. }
  834. } else if (item.type == 2) {
  835. let isRight =
  836. item.ans &&
  837. item.ans.every((quesItem, quesIndex) => {
  838. if(item.ques) {
  839. return item.ques[quesIndex] == item.ans[quesIndex];
  840. } else {
  841. return false;
  842. }
  843. });
  844. if (isRight) {
  845. score += item.score;
  846. number++;
  847. } else {
  848. let checkboxScore = item.score; //获取单题总分数
  849. item.ques && item.ques.forEach((ques,quesIndex) => {
  850. //选错一个全扣
  851. if(item.ques) {
  852. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  853. checkboxScore = 0;
  854. }
  855. } else {
  856. checkboxScore = 0;
  857. }
  858. })
  859. console.log(checkboxScore)
  860. //没选错
  861. if(checkboxScore) {
  862. item.ans.forEach((ans,quesIndex) => {
  863. //漏选扣一部分
  864. if(item.ques) {
  865. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  866. checkboxScore -= item.partScore;
  867. }
  868. } else {
  869. checkboxScore = 0;
  870. }
  871. })
  872. }
  873. if(checkboxScore <= 0) { //0分
  874. } else { //部分分
  875. number++;
  876. score += checkboxScore;
  877. }
  878. }
  879. if (item.ques && item.ques.length) {
  880. doQuestionNum++;
  881. }
  882. } else if (item.type == 3) {
  883. if (item.ques == item.ans) {
  884. score += item.score;
  885. number++;
  886. }
  887. if (item.ques) {
  888. doQuestionNum++;
  889. }
  890. } else if (item == 4) {
  891. if (item.ques.length) {
  892. doQuestionNum++;
  893. }
  894. } else if (item.type == 5) {
  895. if (item.ques) {
  896. doQuestionNum++;
  897. }
  898. }
  899. });
  900. this.$api
  901. .examRecordEdit({
  902. examId: this.id,
  903. goodsId: this.goodsId,
  904. recordId: this.recordId,
  905. rightQuestionNum: number,
  906. moduleExamId:this.moduleId || 0,
  907. chapterExamId:this.chapterId || 0,
  908. status: 0,
  909. doQuestionNum: doQuestionNum,
  910. historyExamJson: JSON.stringify(this.questionList)
  911. })
  912. .then(res => {});
  913. }
  914. },
  915. /**
  916. * 记录总题数
  917. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  918. */
  919. examRecord(hasSpecial) {
  920. let questionList = 0;
  921. if(!hasSpecial) {
  922. this.questionList.forEach((item, index) => {
  923. if(item.type == 1 || item.type == 2 || item.type == 3) {
  924. questionList++;
  925. }
  926. })
  927. } else {
  928. questionList = this.questionList.length;
  929. }
  930. this.$api
  931. .examRecord({
  932. chapterExamId: this.chapterId || 0,
  933. moduleExamId: this.moduleId || 0,
  934. examId: this.id,
  935. goodsId: this.goodsId,
  936. totalQuestionNum: questionList
  937. })
  938. .then(res => {
  939. this.recordId = res.data.data;
  940. //获取recordId 初始化先提交题目 以防突然下次继续做题退出报错
  941. if(this.bankType == 1) {
  942. this.examRecordEdit();
  943. }
  944. });
  945. },
  946. /**
  947. * @param {Object} second倒计时过滤器
  948. */
  949. countdown(second) {
  950. if (second) {
  951. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  952. let m = parseInt((second / 60) % 60); // 计算分数
  953. let s = parseInt(second % 60); // 计算当前秒数
  954. if (h < 10) h = '0' + h;
  955. if (m < 10) m = '0' + m;
  956. if (s < 10) s = '0' + s;
  957. return h + ':' + m + ':' + s;
  958. } else {
  959. return '';
  960. }
  961. },
  962. /**
  963. * 请求题目列表
  964. */
  965. goodsQuestionList() {
  966. this.$api
  967. .goodsQuestionList({
  968. examId: this.id
  969. })
  970. .then(res => {
  971. if (!res.data.data.length) {
  972. this.hideDialog();
  973. uni.showModal({
  974. showCancel: false,
  975. content: '该试卷暂无题目',
  976. success: function(k) {
  977. if (k.confirm) {
  978. uni.navigateBack();
  979. }
  980. }
  981. });
  982. return;
  983. }
  984. this.allTimes = res.data.data[0].answerTime * 60;
  985. this.lastTime = res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
  986. //考试时间到了自动交卷
  987. if (this.lastTime) {
  988. this.timer = setInterval(() => {
  989. if (this.lastTime <= 0) {
  990. clearInterval(this.timer);
  991. uni.showToast({
  992. icon:'none',
  993. mask:true,
  994. title:'考试时间到,自动交卷',
  995. duration:10000
  996. })
  997. this.submit();
  998. return;
  999. }
  1000. this.lastTime--;
  1001. }, 1000);
  1002. } else {
  1003. }
  1004. res.data.data.forEach((item, index) => {
  1005. if (typeof item.jsonStr == 'string') {
  1006. item.jsonStr = JSON.parse(item.jsonStr);
  1007. if (item.type == 2) {
  1008. //多选
  1009. item.jsonStr.forEach(str => {
  1010. str.optionsId = '' + str.optionsId;
  1011. });
  1012. let arr = item.answerQuestion.split(',');
  1013. arr.forEach((a, i) => {
  1014. arr[i] = '' + a;
  1015. });
  1016. item.ans = arr;
  1017. return;
  1018. } else if (item.type == 5) {
  1019. //简答题
  1020. item.ansText = {
  1021. text: '',
  1022. imageList: []
  1023. };
  1024. item.ques = {
  1025. text: '',
  1026. imageList: []
  1027. }
  1028. } else if (item.type == 4) {
  1029. //案例题
  1030. console.log(item.jsonStr);
  1031. item.ques = [];
  1032. item.current = 0;
  1033. let ansArr = [];
  1034. item.jsonStr.forEach((json, index) => {
  1035. if (json.type == 1) {
  1036. ansArr[index] = json.answerQuestion;
  1037. } else if (json.type == 2) {
  1038. json.optionsList.forEach(str => {
  1039. str.optionsId = '' + str.optionsId;
  1040. });
  1041. let arr = json.answerQuestion.split(',');
  1042. arr.forEach((a, i) => {
  1043. arr[i] = '' + a;
  1044. });
  1045. ansArr[index] = arr;
  1046. } else if (json.type == 3) {
  1047. ansArr[index] = json.answerQuestion;
  1048. } else if (json.type == 5) {
  1049. ansArr[index] = {
  1050. text: '',
  1051. imageList: []
  1052. };
  1053. json.ansText = {
  1054. text: '',
  1055. imageList: []
  1056. };
  1057. }
  1058. });
  1059. item.ans = ansArr;
  1060. return;
  1061. }
  1062. item.ans = item.answerQuestion;
  1063. }
  1064. });
  1065. this.questionList = res.data.data;
  1066. this.lastCount = this.questionList.length;
  1067. this.examRecord();
  1068. this.getCollectInfo(this.current);
  1069. });
  1070. },
  1071. /**
  1072. * @param {Object} e单选点击
  1073. */
  1074. radioSelect(optionsId, bindex) {
  1075. if (this.questionList[bindex].ques) return;
  1076. this.$set(this.questionList[bindex], 'ques', optionsId);
  1077. // 回答错误
  1078. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1079. this.$api
  1080. .examWrongRecord({
  1081. examId: this.id,
  1082. goodsId: this.goodsId,
  1083. moduleExamId:this.moduleId || 0,
  1084. chapterExamId:this.chapterId || 0,
  1085. questionIds: [this.questionList[bindex].questionId],
  1086. recordId: this.recordId
  1087. })
  1088. .then(res => {});
  1089. } else {
  1090. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1091. // if(question) {
  1092. // this.$api.wrongRecordDelete({
  1093. // "examId": +this.id,
  1094. // "goodsId": +this.goodsId,
  1095. // "questionId": this.questionList[bindex].questionId,
  1096. // }).then(res => {
  1097. // })
  1098. // }
  1099. }
  1100. },
  1101. /**
  1102. * @param {Object} e案例单选点击
  1103. */
  1104. radioSelectChild(optionsId, ansIndex, bindex) {
  1105. if (this.questionList[bindex].ques[ansIndex]) return;
  1106. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1107. },
  1108. /**
  1109. * @param {Object} 多选点击
  1110. */
  1111. checkboxSelect(optionsId, bindex, index) {
  1112. this.$set(this.questionList[bindex].jsonStr[index], 'checked', !this.questionList[bindex].jsonStr[index].checked);
  1113. },
  1114. /**
  1115. * @param {Object} 案例多选点击
  1116. */
  1117. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1118. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex], 'checked', !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked);
  1119. },
  1120. /**
  1121. * @param {Object} 多选确认
  1122. */
  1123. checkboxSubmit(bindex) {
  1124. if (this.questionList[bindex].ques) return;
  1125. let arr = [];
  1126. this.questionList[bindex].jsonStr.forEach(item => {
  1127. if (item.checked) {
  1128. arr.push(item.optionsId);
  1129. }
  1130. });
  1131. this.$set(this.questionList[bindex], 'ques', arr);
  1132. let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
  1133. return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
  1134. });
  1135. // 回答错误
  1136. if (isWrong) {
  1137. this.$api
  1138. .examWrongRecord({
  1139. examId: this.id,
  1140. goodsId: this.goodsId,
  1141. moduleExamId:this.moduleId || 0,
  1142. chapterExamId:this.chapterId || 0,
  1143. questionIds: [this.questionList[bindex].questionId],
  1144. recordId: this.recordId
  1145. })
  1146. .then(res => {});
  1147. } else {
  1148. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1149. // if(question) {
  1150. // this.$api.wrongRecordDelete({
  1151. // "examId": +this.id,
  1152. // "goodsId": +this.goodsId,
  1153. // "questionId": this.questionList[bindex].questionId,
  1154. // }).then(res => {
  1155. // })
  1156. // }
  1157. }
  1158. },
  1159. /**
  1160. * @param {Object} 案例多选确认
  1161. */
  1162. checkboxSubmitChild(bindex, ansIndex) {
  1163. if (this.questionList[bindex].ques[ansIndex]) return;
  1164. let arr = [];
  1165. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  1166. if (item.checked) {
  1167. arr.push(item.optionsId);
  1168. }
  1169. });
  1170. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1171. },
  1172. /**
  1173. * @param {Object} index
  1174. * @param {Object} bindex
  1175. * 判断题
  1176. */
  1177. judgeSelect(index, bindex) {
  1178. if (this.questionList[bindex].ques) return;
  1179. this.$set(this.questionList[bindex], 'ques', index + '');
  1180. // 回答错误
  1181. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1182. this.$api
  1183. .examWrongRecord({
  1184. examId: this.id,
  1185. goodsId: this.goodsId,
  1186. moduleExamId:this.moduleId || 0,
  1187. chapterExamId:this.chapterId || 0,
  1188. questionIds:[this.questionList[bindex].questionId],
  1189. recordId: this.recordId
  1190. })
  1191. .then(res => {});
  1192. } else {
  1193. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1194. // if(question) {
  1195. // this.$api.wrongRecordDelete({
  1196. // "examId": +this.id,
  1197. // "goodsId": +this.goodsId,
  1198. // "questionId": this.questionList[bindex].questionId,
  1199. // }).then(res => {
  1200. // })
  1201. // }
  1202. }
  1203. },
  1204. /**
  1205. * @param {Object} ansindex
  1206. * @param {Object} childindex
  1207. * @param {Object} bindex
  1208. * 案例判断题
  1209. */
  1210. judgeSelectChild(ansindex, childindex, bindex) {
  1211. if (this.questionList[bindex].ques[ansindex]) return;
  1212. this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
  1213. },
  1214. openFooterTab() {
  1215. this.show = true;
  1216. },
  1217. changeIndex(index) {
  1218. this.current = index;
  1219. },
  1220. swiperChange(e) {
  1221. this.current = e.detail.current;
  1222. this.getCollectInfo(this.current);
  1223. },
  1224. /**
  1225. * @param {Object} current
  1226. * 获取收藏信息
  1227. */
  1228. getCollectInfo(current) {
  1229. this.$api
  1230. .getCollectInfo({
  1231. examId: this.id,
  1232. questionId: this.questionList[current].questionId,
  1233. goodsId: this.goodsId
  1234. })
  1235. .then(res => {
  1236. if (res.data.code == 500) {
  1237. this.$set(this.collectList, current, false);
  1238. } else if (res.data.code == 200) {
  1239. this.$set(this.collectList, current, res.data.data);
  1240. }
  1241. });
  1242. },
  1243. pdsubmit() {
  1244. // if (this.bankType == 1) {
  1245. let ansCount = this.questionOverNum(true); //已答题数
  1246. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1247. //没有答完
  1248. if (this.lastCount !== 0) {
  1249. this.cgType = 6;
  1250. this.showpopups = true;
  1251. return;
  1252. }
  1253. // }
  1254. if(this.bankType == 2) {
  1255. if(this.lastTime > 0) {
  1256. let lastTime = this.countdown(this.lastTime)
  1257. uni.showModal({
  1258. title:'提示',
  1259. content:`时间还剩余${lastTime},确定交卷吗?`,
  1260. confirmText:'交卷',
  1261. cancelText:'继续答题',
  1262. success:(res) => {
  1263. if(res.confirm) { //确定
  1264. this.submit();
  1265. } else { //取消
  1266. }
  1267. }
  1268. })
  1269. return;
  1270. }
  1271. }
  1272. this.submit();
  1273. },
  1274. /**
  1275. * 交卷
  1276. */
  1277. submit() {
  1278. let score = 0; //计算总分
  1279. let reportStatus = 0;
  1280. let number = 0; //做对的题目数量
  1281. let doQuestionNum = 0; //做过的题目数量
  1282. let allScore = 0; //总分
  1283. let passScore = 0;
  1284. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1285. let doQuestionIds = []; //做过的题目id
  1286. let rightQuestionIds = []; //做对的题目id
  1287. this.questionList.forEach((item, index) => {
  1288. passScore = item.passScore
  1289. if (item.type == 1) {
  1290. //正确
  1291. if (item.ques == item.ans) {
  1292. item.scoreResult = item.score;
  1293. score += item.score;
  1294. number++;
  1295. rightQuestionIds.push(item.questionId)
  1296. } else { //错误
  1297. item.scoreResult = 0;
  1298. doWrongQuestionIds.push(item.questionId)
  1299. }
  1300. allScore += item.score;
  1301. if (item.ques) {
  1302. doQuestionNum++;
  1303. doQuestionIds.push(item.questionId)
  1304. }
  1305. } else if (item.type == 2) {
  1306. let isRight =
  1307. item.ans &&
  1308. item.ans.every((quesItem, quesIndex) => {
  1309. if(item.ques) {
  1310. return item.ques[quesIndex] == item.ans[quesIndex];
  1311. } else {
  1312. return false;
  1313. }
  1314. });
  1315. if (isRight) {
  1316. score += item.score;
  1317. number++;
  1318. item.scoreResult = item.score;
  1319. rightQuestionIds.push(item.questionId)
  1320. } else {
  1321. let checkboxScore = item.score; //获取单题总分数
  1322. item.ques && item.ques.forEach((ques,quesIndex) => {
  1323. //选错一个全扣
  1324. if(item.ques) {
  1325. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1326. checkboxScore = 0;
  1327. }
  1328. } else {
  1329. checkboxScore = 0;
  1330. }
  1331. })
  1332. console.log(checkboxScore)
  1333. //没选错
  1334. if(checkboxScore) {
  1335. item.ans.forEach((ans,quesIndex) => {
  1336. //漏选扣一部分
  1337. if(item.ques) {
  1338. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  1339. checkboxScore -= item.partScore;
  1340. }
  1341. } else {
  1342. checkboxScore = 0;
  1343. }
  1344. })
  1345. }
  1346. if(checkboxScore <= 0) { //0分
  1347. item.scoreResult = 0;
  1348. doWrongQuestionIds.push(item.questionId)
  1349. } else { //部分分
  1350. number++;
  1351. item.scoreResult = checkboxScore;
  1352. score += checkboxScore;
  1353. rightQuestionIds.push(item.questionId)
  1354. }
  1355. }
  1356. allScore += item.score;
  1357. if (item.ques && item.ques.length) {
  1358. doQuestionNum++;
  1359. doQuestionIds.push(item.questionId)
  1360. }
  1361. } else if (item.type == 3) {
  1362. if (item.ques == item.ans) {
  1363. item.scoreResult = item.score;
  1364. score += item.score;
  1365. number++;
  1366. rightQuestionIds.push(item.questionId)
  1367. } else {
  1368. item.scoreResult = 0;
  1369. doWrongQuestionIds.push(item.questionId)
  1370. }
  1371. allScore += item.score;
  1372. if (item.ques) {
  1373. doQuestionNum++;
  1374. doQuestionIds.push(item.questionId)
  1375. }
  1376. } else if (item.type == 4) {
  1377. if (item.ques && item.ques.length) {
  1378. doQuestionNum++;
  1379. }
  1380. } else if (item.type == 5) {
  1381. if (item.ques) {
  1382. doQuestionNum++;
  1383. }
  1384. }
  1385. });
  1386. //大于及格
  1387. if(score >= passScore) {
  1388. reportStatus = 1
  1389. } else {
  1390. reportStatus = 0
  1391. }
  1392. //交卷
  1393. this.$api
  1394. .examRecordEdit({
  1395. examId: this.id,
  1396. goodsId: this.goodsId,
  1397. reportStatus:reportStatus,
  1398. recordId: this.recordId,
  1399. rightQuestionNum: number,
  1400. status: 1,
  1401. moduleExamId:this.moduleId || 0,
  1402. chapterExamId:this.chapterId || 0,
  1403. doQuestionIds:doQuestionIds.join(','),
  1404. rightQuestionIds:rightQuestionIds.join(','),
  1405. doQuestionNum: doQuestionNum,
  1406. performance: score,
  1407. totalScore: allScore,
  1408. examTime: parseInt(this.allTimes),
  1409. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1410. historyExamJson: JSON.stringify(this.questionList)
  1411. })
  1412. .then(res => {
  1413. this.isSubmit = true;
  1414. if (res.data.code == 200) {
  1415. uni.showToast({
  1416. title: '交卷成功',
  1417. duration: 1000,
  1418. icon: 'none'
  1419. });
  1420. setTimeout(() => {
  1421. uni.redirectTo({
  1422. url: '/pages2/bank/question_report?examId='+this.id+'&id=' + this.recordId
  1423. });
  1424. }, 1000);
  1425. }
  1426. });
  1427. //错题集id提交(客观题)
  1428. this.$api.examWrongRecord({
  1429. examId: this.id,
  1430. goodsId: this.goodsId,
  1431. questionIds: doWrongQuestionIds,
  1432. recordId: this.recordId
  1433. }).then(res => {
  1434. });
  1435. },
  1436. /**
  1437. * @param {Object} state
  1438. * @param {Object} index
  1439. * 收藏
  1440. */
  1441. collect(state, index) {
  1442. if (!state) {
  1443. this.$api
  1444. .collectQuestion({
  1445. examId: this.id,
  1446. questionId: this.questionList[index].questionId,
  1447. goodsId: this.goodsId || ''
  1448. })
  1449. .then(res => {
  1450. if (res.data.code == 200) {
  1451. this.$set(this.collectList, index, true);
  1452. uni.showToast({
  1453. title: '收藏成功',
  1454. duration: 2000,
  1455. icon: 'none'
  1456. });
  1457. this.getCollectInfo(index)
  1458. }
  1459. });
  1460. } else {
  1461. this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
  1462. if (res.data.code == 200) {
  1463. this.$set(this.collectList, index, false);
  1464. uni.showToast({
  1465. title: '取消收藏成功',
  1466. duration: 2000,
  1467. icon: 'none'
  1468. });
  1469. }
  1470. });
  1471. }
  1472. return;
  1473. },
  1474. /**
  1475. * @param {Object} imgIndex
  1476. * @param {Object} bankIndex
  1477. * 删除简答图片
  1478. */
  1479. deleteImg(imgIndex, bankIndex) {
  1480. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1481. },
  1482. /**
  1483. * @param {Object} imgIndex
  1484. * @param {Object} bankIndex
  1485. * @param {Object} ansIndex
  1486. * 删除案例题简答图片
  1487. */
  1488. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1489. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex, 1);
  1490. },
  1491. /**
  1492. * @param {Object} bankindex
  1493. * 选择上传图片
  1494. */
  1495. chooseImg(bankindex) {
  1496. if(this.questionList[bankindex] && this.questionList[bankindex].ansText && this.questionList[bankindex].ansText.imageList.length >= 4) {
  1497. uni.showToast({
  1498. icon:'none',
  1499. title:'最多选择4张'
  1500. })
  1501. return;
  1502. }
  1503. uni.chooseImage({
  1504. count: 1, //默认9
  1505. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  1506. sourceType: ['album', 'camera'], //从相册选择
  1507. success: res => {
  1508. let self = this;
  1509. // console.log(JSON.stringify(res.tempFilePaths));
  1510. let img = res.tempFilePaths[0];
  1511. uni.getImageInfo({
  1512. src: img,
  1513. success: async res => {
  1514. let canvasWidth = res.width; //图片原始长宽
  1515. let canvasHeight = res.height;
  1516. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1517. uni.compressImage({
  1518. src: img,
  1519. quality: 75,
  1520. width: '50%',
  1521. height: '50%',
  1522. success: async rest => {
  1523. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1524. this.questionList[bankindex].ansText.imageList.push(dir);
  1525. }
  1526. });
  1527. } else {
  1528. const dir = await self.uploadFile(img, 0);
  1529. this.questionList[bankindex].ansText.imageList.push(dir);
  1530. }
  1531. }
  1532. });
  1533. }
  1534. });
  1535. },
  1536. /**
  1537. * @param {Object} bankindex
  1538. * @param {Object} ansindex
  1539. * 案例题选择上传图片
  1540. */
  1541. chooseImgChild(bankindex, ansindex) {
  1542. if(this.questionList[bankindex].jsonStr[ansindex] && this.questionList[bankindex].jsonStr[ansindex].ansText && this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length >= 4) {
  1543. uni.showToast({
  1544. icon:'none',
  1545. title:'最多选择4张'
  1546. })
  1547. return;
  1548. }
  1549. uni.chooseImage({
  1550. count: 1, //默认9
  1551. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  1552. sourceType: ['album', 'camera'], //从相册选择
  1553. success: res => {
  1554. let self = this;
  1555. // console.log(JSON.stringify(res.tempFilePaths));
  1556. let img = res.tempFilePaths[0];
  1557. uni.getImageInfo({
  1558. src: img,
  1559. success: async res => {
  1560. let canvasWidth = res.width; //图片原始长宽
  1561. let canvasHeight = res.height;
  1562. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1563. uni.compressImage({
  1564. src: img,
  1565. quality: 75,
  1566. width: '50%',
  1567. height: '50%',
  1568. success: async rest => {
  1569. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1570. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir);
  1571. }
  1572. });
  1573. } else {
  1574. const dir = await self.uploadFile(img, 0);
  1575. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir);
  1576. }
  1577. }
  1578. });
  1579. }
  1580. });
  1581. },
  1582. uploadFile(options, int) {
  1583. var self = this;
  1584. return new Promise((resolve, reject) => {
  1585. var data = {
  1586. imageStatus: int
  1587. };
  1588. self.$api.aliyunpolicy(data).then(res => {
  1589. console.log(res.data, 6);
  1590. if (res.data.code != 200) {
  1591. self.$method.showToast('签名错误' + JSON.stringify(res.data));
  1592. return;
  1593. }
  1594. var ossToken = res.data.data.resultContent;
  1595. if (ossToken.host == null || ossToken.host == undefined) {
  1596. self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
  1597. return;
  1598. }
  1599. uni.uploadFile({
  1600. url: ossToken.host,
  1601. name: 'file',
  1602. filePath: options,
  1603. fileType: 'image',
  1604. header: {
  1605. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  1606. },
  1607. formData: {
  1608. key: ossToken.dir,
  1609. OSSAccessKeyId: ossToken.accessid,
  1610. policy: ossToken.policy,
  1611. Signature: ossToken.signature,
  1612. callback: ossToken.callback,
  1613. success_action_status: 200
  1614. },
  1615. success: result => {
  1616. if (result.statusCode === 200) {
  1617. resolve(ossToken.dir);
  1618. } else {
  1619. uni.showToast({
  1620. title: '上传失败',
  1621. icon: 'none'
  1622. });
  1623. return;
  1624. }
  1625. },
  1626. fail: error => {
  1627. uni.showToast({
  1628. title: '上传接口报错' + error,
  1629. icon: 'none'
  1630. });
  1631. return;
  1632. }
  1633. });
  1634. });
  1635. });
  1636. },
  1637. /**
  1638. * @param {Object} type
  1639. * @param {Object} bankindex
  1640. * 简答题答案确认
  1641. */
  1642. submitAns(bankindex) {
  1643. console.log(this.questionList[bankindex]);
  1644. if (!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  1645. uni.showToast({
  1646. title: '请输入内容或上传图片',
  1647. duration: 2000,
  1648. icon: 'none'
  1649. });
  1650. return;
  1651. }
  1652. this.$set(this.questionList[bankindex], 'ques', {
  1653. imageList: this.questionList[bankindex].ansText.imageList || [],
  1654. text: this.questionList[bankindex].ansText.text || ''
  1655. });
  1656. },
  1657. /**
  1658. * @param {Object} bankindex
  1659. * @param {Object} ansindex
  1660. * 案例题简答答案确认
  1661. */
  1662. submitAnsChild(bankindex, ansindex) {
  1663. if (!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  1664. uni.showToast({
  1665. title: '请输入内容或上传图片',
  1666. duration: 2000,
  1667. icon: 'none'
  1668. });
  1669. return;
  1670. }
  1671. this.$set(this.questionList[bankindex].ques, ansindex, {
  1672. imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList || [],
  1673. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || ''
  1674. });
  1675. },
  1676. isRight(item, index) {
  1677. //单选
  1678. if (this.questionList[index].ques) {
  1679. if (item.type == 1) {
  1680. return this.questionList[index].ques == this.questionList[index].ans;
  1681. //多选
  1682. } else if (item.type == 2) {
  1683. //每一项都相等
  1684. return this.questionList[index].ques.every((item, i) => {
  1685. return item == this.questionList[index].ans[i];
  1686. });
  1687. //判断
  1688. } else if (item.type == 3) {
  1689. return this.questionList[index].ques == this.questionList[index].ans;
  1690. // } else if (item.type == 5) {
  1691. // if(this.questionList[index].ques.text){
  1692. // return true
  1693. // }else{
  1694. // return false
  1695. // }
  1696. } else {
  1697. return false;
  1698. }
  1699. } else {
  1700. return false;
  1701. }
  1702. },
  1703. right(bankIndex, ansIndex, option) {
  1704. if (this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1705. if (this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 || this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1) {
  1706. return true;
  1707. } else {
  1708. return false;
  1709. }
  1710. } else {
  1711. return false;
  1712. }
  1713. },
  1714. wrong(bankIndex, ansIndex, option) {
  1715. if (this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1716. if (this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 && this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1) {
  1717. return true;
  1718. } else {
  1719. return false;
  1720. }
  1721. } else {
  1722. return false;
  1723. }
  1724. },
  1725. isWrong(item, index) {
  1726. if (this.questionList[index].ques) {
  1727. //单选
  1728. if (item.type == 1) {
  1729. return this.questionList[index].ques != this.questionList[index].ans;
  1730. //多选
  1731. } else if (item.type == 2) {
  1732. //每一项都相等
  1733. return this.questionList[index].ques.some((item, index) => {
  1734. return item != this.questionList[index].ans;
  1735. });
  1736. //判断
  1737. } else if (item.type == 3) {
  1738. return this.questionList[index].ques != this.questionList[index].ans;
  1739. } else {
  1740. return false;
  1741. }
  1742. } else {
  1743. return false;
  1744. }
  1745. },
  1746. tabSelect(index, bankindex) {
  1747. this.$set(this.questionList[bankindex], 'current', index);
  1748. }
  1749. }
  1750. };
  1751. </script>
  1752. <style lang="scss" scoped>
  1753. .questionBank {
  1754. width:100%;
  1755. height:100vh;
  1756. display: flex;
  1757. flex-direction: column;
  1758. }
  1759. .swiper {
  1760. width: 100%;
  1761. flex:1;
  1762. }
  1763. .lisSty {
  1764. margin-bottom: 16rpx;
  1765. display: flex;
  1766. .flex_auto {
  1767. flex: 1;
  1768. }
  1769. }
  1770. .activeTI {
  1771. vertical-align: middle;
  1772. display: inline-block;
  1773. border: 1rpx solid #eee;
  1774. border-radius: 50rpx;
  1775. height: 48rpx;
  1776. line-height: 46rpx;
  1777. text-align: center;
  1778. width: 48rpx;
  1779. margin-right: 15rpx;
  1780. color: #666;
  1781. font-size: 30rpx;
  1782. &.right {
  1783. color: #fff;
  1784. background: green;
  1785. }
  1786. &.wrong {
  1787. color: #fff;
  1788. background: red;
  1789. }
  1790. &.checked {
  1791. color: #fff;
  1792. background: blue;
  1793. }
  1794. }
  1795. .submit_checkbox {
  1796. margin: 20rpx auto;
  1797. width: 526rpx;
  1798. height: 80rpx;
  1799. background: rgba(0, 122, 255, 1);
  1800. color: #fff;
  1801. text-align: center;
  1802. line-height: 80rpx;
  1803. font-size: 30rpx;
  1804. border-radius: 40rpx;
  1805. }
  1806. .titles {
  1807. overflow: hidden;
  1808. margin-bottom: 24rpx;
  1809. }
  1810. .titBox {
  1811. padding: 41rpx 25rpx 24rpx 25rpx;
  1812. }
  1813. .tabs {
  1814. margin: 10rpx;
  1815. display: flex;
  1816. .tab {
  1817. margin: 0 10rpx;
  1818. width: 96rpx;
  1819. height: 48rpx;
  1820. line-height: 48rpx;
  1821. text-align: center;
  1822. color: #007aff;
  1823. font-size: 28rpx;
  1824. border-radius: 16rpx;
  1825. &.current {
  1826. color: #fff;
  1827. background: #007aff;
  1828. }
  1829. }
  1830. }
  1831. .ans {
  1832. margin: 8rpx 8rpx 8rpx;
  1833. .ans_input {
  1834. border-radius: 16rpx;
  1835. background: #fff;
  1836. .top {
  1837. border-bottom: 1rpx solid #eeeeee;
  1838. padding: 16rpx;
  1839. display: flex;
  1840. align-items: center;
  1841. .icon {
  1842. margin-right: 20rpx;
  1843. width: 40rpx;
  1844. height: 38rpx;
  1845. }
  1846. .progress {
  1847. flex: 1;
  1848. }
  1849. .submit {
  1850. width: 168rpx;
  1851. height: 48rpx;
  1852. line-height: 48rpx;
  1853. text-align: center;
  1854. color: #fff;
  1855. font-size: 30rpx;
  1856. background: #007aff;
  1857. border-radius: 24rpx;
  1858. &.disabled {
  1859. opacity: 0.6;
  1860. }
  1861. }
  1862. }
  1863. .textarea {
  1864. textarea {
  1865. width: 100%;
  1866. height: 287rpx;
  1867. padding: 10rpx;
  1868. }
  1869. }
  1870. .imgs {
  1871. overflow: hidden;
  1872. display: flex;
  1873. width: 100%;
  1874. .img {
  1875. width: 104rpx;
  1876. height: 104rpx;
  1877. border-radius: 8rpx;
  1878. position: relative;
  1879. margin: 20rpx;
  1880. text {
  1881. position: absolute;
  1882. right: -15rpx;
  1883. top: -15rpx;
  1884. width: 30rpx;
  1885. height: 30rpx;
  1886. text-align: center;
  1887. line-height: 30rpx;
  1888. color: #fff;
  1889. background: red;
  1890. border-radius: 50%;
  1891. }
  1892. image {
  1893. width: 100%;
  1894. height: 100%;
  1895. }
  1896. }
  1897. }
  1898. }
  1899. .ans_submit {
  1900. padding: 16rpx;
  1901. border-radius: 16rpx;
  1902. background: #fff;
  1903. .imgs {
  1904. overflow: hidden;
  1905. display: flex;
  1906. width: 100%;
  1907. .img {
  1908. width: 104rpx;
  1909. height: 104rpx;
  1910. border-radius: 8rpx;
  1911. position: relative;
  1912. margin: 20rpx;
  1913. image {
  1914. width: 100%;
  1915. height: 100%;
  1916. }
  1917. }
  1918. }
  1919. }
  1920. }
  1921. .firstLetter {
  1922. display: flex;
  1923. justify-content: space-between;
  1924. align-items: center;
  1925. margin-bottom: 30rpx;
  1926. .leftLetters {
  1927. display: flex;
  1928. align-items: center;
  1929. width: 220rpx;
  1930. .btnType {
  1931. padding: 5rpx 10rpx;
  1932. border: 1rpx solid #007aff;
  1933. border-radius: 10rpx;
  1934. background-color: rgba(0, 122, 255, 0.1);
  1935. font-size: 28rpx;
  1936. color: #007aff;
  1937. margin-right: 15rpx;
  1938. }
  1939. }
  1940. }
  1941. .popupView {
  1942. height: 100%;
  1943. padding-bottom: 100rpx;
  1944. .popupTops {
  1945. height: 77rpx;
  1946. border-bottom: 1rpx solid #eee;
  1947. text-align: center;
  1948. line-height: 77rpx;
  1949. font-size: 24rpx;
  1950. color: #999;
  1951. position: relative;
  1952. .topIcon {
  1953. position: absolute;
  1954. top: 10rpx;
  1955. left: 50%;
  1956. transform: translateX(-50%);
  1957. width: 80rpx;
  1958. height: 8rpx;
  1959. background-color: #999;
  1960. border-radius: 4rpx;
  1961. }
  1962. }
  1963. .popupContent {
  1964. }
  1965. }
  1966. .pageContent {
  1967. position: relative;
  1968. background-color: #eaeef1;
  1969. height: 100%;
  1970. padding-top: 8rpx;
  1971. padding-bottom: 100rpx;
  1972. overflow-y: scroll;
  1973. }
  1974. .pad_8 {
  1975. background-color: #fff;
  1976. margin: 0rpx 8rpx 8rpx;
  1977. border-radius: 16rpx;
  1978. &.no-margin {
  1979. margin-top:-16rpx;
  1980. border-radius: 0 0 16rpx 16rpx;
  1981. }
  1982. }
  1983. .answer {
  1984. height: 80rpx;
  1985. line-height: 80rpx;
  1986. padding: 0rpx 24rpx;
  1987. display: flex;
  1988. align-items: center;
  1989. justify-content: space-between;
  1990. color: #666;
  1991. font-size: 30rpx;
  1992. }
  1993. .footer_btn {
  1994. background-color: #fff;
  1995. z-index: 10078;
  1996. position: fixed;
  1997. bottom: 0rpx;
  1998. display: flex;
  1999. align-items: center;
  2000. justify-content: space-between;
  2001. width: 100%;
  2002. height: 98rpx;
  2003. padding: 0rpx 38rpx;
  2004. border-top: 1rpx solid #eee;
  2005. .flex_center {
  2006. flex:1;
  2007. display: flex;
  2008. justify-content: center;
  2009. align-items: center;
  2010. flex-direction: column;
  2011. margin:0 200rpx;
  2012. font-size: 24rpx;
  2013. color: #999999;
  2014. .up-icon {
  2015. margin-bottom:18rpx;
  2016. width:100%;
  2017. display: flex;
  2018. justify-content: center;
  2019. image {
  2020. width:58rpx;
  2021. height:21rpx;
  2022. }
  2023. }
  2024. }
  2025. .collect {
  2026. visibility: hidden;
  2027. width:100rpx;
  2028. &.show {
  2029. visibility: visible;
  2030. }
  2031. >view {
  2032. display: flex;
  2033. flex-direction: column;
  2034. align-items: center;
  2035. justify-content: center;
  2036. image {
  2037. width:32rpx;
  2038. height:32rpx;
  2039. margin-bottom:6rpx;
  2040. }
  2041. view {
  2042. font-size: 24rpx;
  2043. color: #999999;
  2044. }
  2045. }
  2046. }
  2047. }
  2048. .boxSty {
  2049. padding: 44rpx 41rpx 0rpx;
  2050. }
  2051. .liListSty {
  2052. border: 1rpx solid #eeeeee;
  2053. width: 88rpx;
  2054. height: 88rpx;
  2055. border-radius: 32rpx;
  2056. text-align: center;
  2057. line-height: 88rpx;
  2058. color: #333;
  2059. font-size: 32rpx;
  2060. float: left;
  2061. margin: 20rpx 23rpx;
  2062. &.isRight {
  2063. border: 1rpx solid #eeeeee;
  2064. color: #fff;
  2065. background: green;
  2066. }
  2067. &.isWrong {
  2068. border: 1rpx solid #eeeeee;
  2069. color: #fff;
  2070. background: red;
  2071. }
  2072. }
  2073. .answerInfos {
  2074. padding: 25rpx 25rpx 25rpx 23rpx;
  2075. }
  2076. .answerTitle {
  2077. margin-bottom: 28rpx;
  2078. color: #666;
  2079. font-size: 30rpx;
  2080. }
  2081. .answerContent {
  2082. font-size: 30rpx;
  2083. color: #666;
  2084. }
  2085. .textChild {
  2086. display: inline-block;
  2087. vertical-align: middle;
  2088. }
  2089. .dialog {
  2090. position: fixed;
  2091. left: 0;
  2092. top: 0;
  2093. width: 100%;
  2094. height: 100%;
  2095. background-color: rgba(0, 0, 0, 0.8);
  2096. display: flex;
  2097. flex-direction: column;
  2098. align-items: center;
  2099. justify-content: center;
  2100. z-index: 20000;
  2101. .pointer {
  2102. width:338rpx;
  2103. height:240rpx;
  2104. }
  2105. .text {
  2106. font-size: 32rpx;
  2107. color: #ffffff;
  2108. text-align: center;
  2109. }
  2110. .btn {
  2111. width: 242rpx;
  2112. height: 82rpx;
  2113. border: 2rpx solid #ffffff;
  2114. border-radius: 16rpx;
  2115. text-align: center;
  2116. line-height: 82rpx;
  2117. margin: 41rpx auto;
  2118. color: #fff;
  2119. font-size: 32rpx;
  2120. }
  2121. }
  2122. .dialog-arrow {
  2123. padding-top:124rpx;
  2124. position: fixed;
  2125. left: 0;
  2126. top: 0;
  2127. width: 100%;
  2128. height: 100%;
  2129. background-color: rgba(0, 0, 0, 0.8);
  2130. z-index: 20000;
  2131. .pointer {
  2132. margin-left:87rpx;
  2133. display: block;
  2134. width:95rpx;
  2135. height:98rpx;
  2136. }
  2137. .text {
  2138. padding-left:177rpx;
  2139. font-size: 32rpx;
  2140. color: #ffffff;
  2141. }
  2142. .btn {
  2143. width: 242rpx;
  2144. height: 82rpx;
  2145. border: 2rpx solid #ffffff;
  2146. border-radius: 16rpx;
  2147. text-align: center;
  2148. line-height: 82rpx;
  2149. margin: 500rpx auto 0;
  2150. color: #fff;
  2151. font-size: 32rpx;
  2152. }
  2153. }
  2154. .dialog_wrap {
  2155. position: fixed;
  2156. left: 0;
  2157. top: 0;
  2158. width: 100%;
  2159. height: 100%;
  2160. z-index: 9999999999;
  2161. .bg {
  2162. background: rgba(0, 0, 0, 0.3);
  2163. position: absolute;
  2164. left: 0;
  2165. top: 0;
  2166. width: 100%;
  2167. height: 100%;
  2168. }
  2169. .dialog {
  2170. position: absolute;
  2171. left: 50%;
  2172. top: 50%;
  2173. transform: translate3D(-50%, -50%, 0);
  2174. width: 640rpx;
  2175. height: 439rpx;
  2176. background: #ffffff;
  2177. border-radius: 24rpx;
  2178. .title {
  2179. font-size: 30rpx;
  2180. font-weight: bold;
  2181. color: #333333;
  2182. line-height: 48rpx;
  2183. text-align: center;
  2184. margin-top: 40rpx;
  2185. }
  2186. .content {
  2187. margin: 35rpx 35rpx 0;
  2188. font-size: 30rpx;
  2189. color: #666666;
  2190. line-height: 48rpx;
  2191. }
  2192. .btns {
  2193. margin-top: 35rpx;
  2194. display: flex;
  2195. align-items: center;
  2196. justify-content: center;
  2197. .btn {
  2198. width: 200rpx;
  2199. height: 80rpx;
  2200. line-height: 80rpx;
  2201. text-align: center;
  2202. background: #f5f5f5;
  2203. border-radius: 40rpx;
  2204. font-size: 30rpx;
  2205. color: rgba(0, 122, 255, 1);
  2206. background: #f5f5f5;
  2207. margin: 0 20rpx;
  2208. &.active {
  2209. color: #f5f5f5;
  2210. background: rgba(0, 122, 255, 1);
  2211. }
  2212. }
  2213. }
  2214. }
  2215. }
  2216. .popboxs {
  2217. width: 100%;
  2218. height: 100%;
  2219. display: flex;
  2220. flex-direction: column;
  2221. align-items: center;
  2222. }
  2223. .classTops {
  2224. flex-shrink: 0;
  2225. padding: 39rpx 0rpx 4rpx;
  2226. font-weight: bold;
  2227. color: #333;
  2228. font-size: 30rpx;
  2229. }
  2230. .textStys {
  2231. width: 100%;
  2232. flex: 1;
  2233. padding: 36rpx;
  2234. }
  2235. .classFootsty {
  2236. flex-shrink: 0;
  2237. display: flex;
  2238. align-items: center;
  2239. justify-content: center;
  2240. padding: 10rpx 0rpx 40rpx;
  2241. .btnsty {
  2242. width: 200rpx;
  2243. height: 80rpx;
  2244. border-radius: 40rpx;
  2245. font-weight: bold;
  2246. font-size: 30rpx;
  2247. text-align: center;
  2248. line-height: 80rpx;
  2249. }
  2250. .btns1 {
  2251. background-color: #f5f5f5;
  2252. color: #007aff;
  2253. }
  2254. .btns2 {
  2255. margin-left: 40rpx;
  2256. background-color: #007aff;
  2257. color: #ffffff;
  2258. }
  2259. }
  2260. </style>