questionBank.vue 59 KB

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