questionBank.vue 61 KB

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