questionBank.vue 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138
  1. <template>
  2. <view class="questionBank">
  3. <uni-nav-bar
  4. class="navbar"
  5. @clickLeft="clickLeft"
  6. left-icon="back"
  7. :statusBar="true"
  8. title="试卷"
  9. ></uni-nav-bar>
  10. <swiper
  11. class="swiper"
  12. :current="current"
  13. @change="swiperChange"
  14. :interval="interval"
  15. >
  16. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  17. <view class="pageContent">
  18. <view class="pad_8 titBox">
  19. <view class="firstLetter">
  20. <view class="leftLetters">
  21. <view class="btnType">
  22. <text v-if="bank.type == 1">单选</text>
  23. <text v-if="bank.type == 2">多选</text>
  24. <text v-if="bank.type == 3">判断</text>
  25. <text v-if="bank.type == 4">案例</text>
  26. <text v-if="bank.type == 5">简答</text>
  27. </view>
  28. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  29. </view>
  30. <view style="color: #666; font-size: 28rpx">{{
  31. countdown(lastTime)
  32. }}</view>
  33. <view class="leftLetters"></view>
  34. </view>
  35. <view class="titles"
  36. ><rich-text :nodes="bank.content"></rich-text
  37. ></view>
  38. </view>
  39. <template v-if="bank.type == 1">
  40. <view class="pad_8 titBox no-margin">
  41. <view v-if="!bank.ques">
  42. <view
  43. v-for="(item, index) in bank.jsonStr"
  44. :key="index"
  45. class="lisSty"
  46. @click="radioSelect(item.optionsId, bankIndex)"
  47. >
  48. <view class="activeTI">{{ ast[index] }}</view>
  49. <view class="flex_auto">{{ item.content }}</view>
  50. </view>
  51. </view>
  52. <view v-if="bank.ques">
  53. <view
  54. v-for="(item, index) in bank.jsonStr"
  55. :key="index"
  56. class="lisSty"
  57. >
  58. <text
  59. :class="{
  60. right:
  61. item.optionsId == bank.ques ||
  62. item.optionsId == bank.ans,
  63. wrong:
  64. item.optionsId == bank.ques && bank.ques != bank.ans,
  65. }"
  66. class="activeTI"
  67. >
  68. {{ ast[index] }}
  69. </text>
  70. <view class="flex_auto">{{ item.content }}</view>
  71. </view>
  72. </view>
  73. </view>
  74. <view v-if="bank.ques">
  75. <view class="pad_8 answer">
  76. <view>正确答案:{{ ast[bank.ans - 1] }}</view>
  77. <view>我的答案:{{ ast[bank.ques - 1] }}</view>
  78. </view>
  79. <view class="pad_8 answerInfos">
  80. <view class="answerTitle">答案解析</view>
  81. <view class="answerContent"
  82. ><rich-text :nodes="bank.analysisContent"></rich-text
  83. ></view>
  84. </view>
  85. </view>
  86. </template>
  87. <template v-if="bank.type == 2">
  88. <view class="pad_8 titBox no-margin">
  89. <view v-if="!bank.ques">
  90. <view
  91. v-for="(item, index) in bank.jsonStr"
  92. :key="index"
  93. class="lisSty"
  94. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  95. >
  96. <view :class="{ checked: item.checked }" class="activeTI">{{
  97. ast[index]
  98. }}</view>
  99. <view class="flex_auto">{{ item.content }}</view>
  100. </view>
  101. </view>
  102. <view
  103. v-if="!bank.ques"
  104. class="submit_checkbox"
  105. :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
  106. @click="checkboxSubmit(bankIndex)"
  107. >确认答案</view
  108. >
  109. <view v-if="bank.ques">
  110. <view
  111. v-for="(item, index) in bank.jsonStr"
  112. :key="index"
  113. class="lisSty"
  114. >
  115. <text
  116. :class="{
  117. right:
  118. bank.ques.indexOf(item.optionsId) != -1 ||
  119. bank.ans.indexOf(item.optionsId) != -1,
  120. wrong:
  121. bank.ques.indexOf(item.optionsId) != -1 &&
  122. bank.ans.indexOf(item.optionsId) == -1,
  123. }"
  124. class="activeTI"
  125. >
  126. {{ ast[index] }}
  127. </text>
  128. <view class="flex_auto">{{ item.content }}</view>
  129. </view>
  130. </view>
  131. </view>
  132. <view v-if="bank.ques">
  133. <view class="pad_8 answer">
  134. <view>
  135. 正确答案:
  136. <text
  137. v-for="(ansItem, ansItemIndex) in bank.ans"
  138. :key="ansItemIndex"
  139. >{{ ast[ansItem - 1] }}</text
  140. >
  141. </view>
  142. <view>
  143. 我的答案:
  144. <text
  145. v-for="(quesItem, quesItemIndex) in bank.ques"
  146. :key="quesItemIndex"
  147. >{{ ast[quesItem - 1] }}</text
  148. >
  149. </view>
  150. </view>
  151. <view class="pad_8 answerInfos">
  152. <view class="answerTitle">答案解析</view>
  153. <view class="answerContent"
  154. ><rich-text :nodes="bank.analysisContent"></rich-text
  155. ></view>
  156. </view>
  157. </view>
  158. </template>
  159. <template v-if="bank.type == 3">
  160. <view class="pad_8 titBox no-margin">
  161. <view v-if="!bank.ques">
  162. <view
  163. v-for="(item, index) in judge"
  164. :key="index"
  165. class="lisSty"
  166. @click="judgeSelect(index, bankIndex)"
  167. >
  168. <view class="activeTI">{{ ast[index] }}</view>
  169. <view class="flex_auto">
  170. {{ item }}
  171. </view>
  172. </view>
  173. </view>
  174. <view v-if="bank.ques">
  175. <view
  176. v-for="(item, index) in judge"
  177. :key="index"
  178. class="lisSty"
  179. >
  180. <text
  181. :class="{
  182. right: index == bank.ques || index == bank.ans,
  183. wrong: index == bank.ques && bank.ques != bank.ans,
  184. }"
  185. class="activeTI"
  186. >
  187. {{ ast[index] }}
  188. </text>
  189. <view class="flex_auto">
  190. {{ item }}
  191. </view>
  192. </view>
  193. </view>
  194. </view>
  195. <view v-if="bank.ques">
  196. <view class="pad_8 answer">
  197. <view>正确答案:{{ ast[bank.ans] }}</view>
  198. <view>我的答案:{{ ast[bank.ques] }}</view>
  199. </view>
  200. <view class="pad_8 answerInfos">
  201. <view class="answerTitle">答案解析</view>
  202. <view class="answerContent"
  203. ><rich-text :nodes="bank.analysisContent"></rich-text
  204. ></view>
  205. </view>
  206. </view>
  207. </template>
  208. <!-- 简答题 -->
  209. <template v-if="bank.type == 5">
  210. <view class="pad_8 titBox">
  211. <view class="ans">
  212. <view
  213. class="ans_input"
  214. v-if="
  215. !bank.ques ||
  216. (!bank.ques.text && !bank.ques.imageList.length)
  217. "
  218. >
  219. <view class="top flex">
  220. <image
  221. :data-index="bankIndex"
  222. class="icon"
  223. @click="chooseImg(bankIndex)"
  224. src="/static/camera.png"
  225. mode=""
  226. ></image>
  227. <view class="progress"
  228. >{{ bank.ansText.imageList.length || "0" }}/4</view
  229. >
  230. <view
  231. class="submit"
  232. :class="{ disabled: !bank.ansText.text && hasImgs(bank) }"
  233. @click="submitAns(bankIndex)"
  234. >确认答案</view
  235. >
  236. </view>
  237. <view class="textarea">
  238. <textarea
  239. v-model="bank.ansText.text"
  240. placeholder="在此输入答案"
  241. ></textarea>
  242. </view>
  243. <view class="imgs">
  244. <view
  245. class="img"
  246. v-for="(img, imgIndex) in bank.ansText.imageList"
  247. :key="imgIndex"
  248. >
  249. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  250. <image :src="$method.splitImgHost(img, true)"></image>
  251. </view>
  252. </view>
  253. </view>
  254. <view
  255. class="ans_submit answerInfos"
  256. v-if="bank.ques.text || bank.ques.imageList.length"
  257. >
  258. <view class="answerTitle">我的答案:</view>
  259. {{ bank.ques.text }}
  260. <view class="imgs"
  261. ><image
  262. class="img"
  263. v-for="(ques, quesIndex) in bank.ques.imageList"
  264. :key="quesIndex"
  265. :src="$method.splitImgHost(ques, true)"
  266. ></image
  267. ></view>
  268. </view>
  269. </view>
  270. </view>
  271. <view
  272. v-if="bank.ques && (bank.ques.text || bank.ques.imageList.length)"
  273. >
  274. <view class="pad_8 answerInfos">
  275. <view class="answerTitle">答案解析:</view>
  276. <view class="answerContent"
  277. ><rich-text :nodes="bank.analysisContent"></rich-text
  278. ></view>
  279. </view>
  280. </view>
  281. </template>
  282. <!-- 案例题 -->
  283. <template v-if="bank.type == 4">
  284. <view class="tabs">
  285. <view
  286. class="tab"
  287. :class="{ current: tabIndex == bank.current }"
  288. :key="tabIndex"
  289. v-for="(tab, tabIndex) in bank.jsonStr"
  290. @click="tabSelect(tabIndex, bankIndex)"
  291. >
  292. 问题{{ tabIndex + 1 }}
  293. </view>
  294. </view>
  295. <view
  296. v-for="(ansItem, ansIndex) in bank.jsonStr"
  297. v-if="bank.current == ansIndex"
  298. :key="ansIndex"
  299. >
  300. <template v-if="ansItem.type == 1">
  301. <view class="pad_8 titBox">
  302. <view class="leftLetters">
  303. <view class="btnType">
  304. <text>单选</text>
  305. </view>
  306. </view>
  307. <view class="titles">
  308. <rich-text :nodes="ansItem.content"></rich-text>
  309. </view>
  310. <view v-if="!bank.ques[ansIndex]">
  311. <view
  312. v-for="(option, childIndex) in ansItem.optionsList"
  313. :key="childIndex"
  314. class="lisSty"
  315. @click="
  316. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  317. "
  318. >
  319. <view class="activeTI">{{ ast[childIndex] }}</view>
  320. <view class="flex_auto">
  321. <rich-text
  322. class="textChild"
  323. :nodes="option.content"
  324. ></rich-text>
  325. </view>
  326. </view>
  327. </view>
  328. <view v-if="bank.ques[ansIndex]">
  329. <view
  330. v-for="(option, childIndex) in ansItem.optionsList"
  331. :key="childIndex"
  332. class="lisSty"
  333. >
  334. <text
  335. :class="{
  336. right:
  337. option.optionsId == bank.ques[ansIndex] ||
  338. option.optionsId == bank.ans[ansIndex],
  339. wrong:
  340. option.optionsId == bank.ques[ansIndex] &&
  341. bank.ques[ansIndex] != bank.ans[ansIndex],
  342. }"
  343. class="activeTI"
  344. >
  345. {{ ast[childIndex] }}
  346. </text>
  347. <view class="flex_auto">
  348. <rich-text :nodes="option.content"></rich-text>
  349. </view>
  350. </view>
  351. </view>
  352. </view>
  353. <view v-if="bank.ques[ansIndex]">
  354. <view class="pad_8 answer">
  355. <view>正确答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  356. <view>我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view>
  357. </view>
  358. <view class="pad_8 answerInfos">
  359. <view class="answerTitle">答案解析</view>
  360. <view class="answerContent"
  361. ><rich-text :nodes="option.analysisContent"></rich-text
  362. ></view>
  363. </view>
  364. </view>
  365. </template>
  366. <template v-if="ansItem.type == 2">
  367. <view class="pad_8 titBox">
  368. <view class="leftLetters">
  369. <view class="btnType">
  370. <text>多选</text>
  371. </view>
  372. </view>
  373. <view class="titles">
  374. <rich-text :nodes="ansItem.content"></rich-text>
  375. </view>
  376. <view v-if="!bank.ques[ansIndex]">
  377. <view
  378. v-for="(option, childindex) in ansItem.optionsList"
  379. :key="childindex"
  380. class="lisSty"
  381. @click="
  382. checkboxSelectChild(bankIndex, ansIndex, childindex)
  383. "
  384. >
  385. <view
  386. :class="{ checked: option.checked }"
  387. class="activeTI"
  388. >{{ ast[childindex] }}</view
  389. >
  390. <view class="flex_auto">
  391. <rich-text :nodes="option.content"></rich-text>
  392. </view>
  393. </view>
  394. </view>
  395. <view
  396. v-if="!bank.ques[ansIndex]"
  397. class="submit_checkbox"
  398. :class="{
  399. disabled: !isCheckboxChecked(ansItem.optionsList),
  400. }"
  401. @click="checkboxSubmitChild(bankIndex, ansIndex)"
  402. >确认答案</view
  403. >
  404. <view v-if="bank.ques && bank.ques[ansIndex]">
  405. <view
  406. v-for="(option, childindex) in ansItem.optionsList"
  407. :key="childindex"
  408. class="lisSty"
  409. >
  410. <text
  411. :class="{
  412. right: right(bankIndex, ansIndex, option),
  413. wrong: wrong(bankIndex, ansIndex, option),
  414. }"
  415. class="activeTI"
  416. >
  417. {{ ast[childindex] }}
  418. </text>
  419. <view class="flex_auto">
  420. <rich-text :nodes="option.content"></rich-text>
  421. </view>
  422. </view>
  423. </view>
  424. </view>
  425. <view v-if="bank.ques[ansIndex]">
  426. <view class="pad_8 answer">
  427. <view>
  428. 正确答案:
  429. <text
  430. :key="ansItemIndex1"
  431. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  432. >{{ ast[ansItem1 - 1] }}</text
  433. >
  434. </view>
  435. <view>
  436. 我的答案:
  437. <text
  438. :key="quesItemIndex"
  439. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  440. >{{ ast[quesItem - 1] }}</text
  441. >
  442. </view>
  443. </view>
  444. <view class="pad_8 answerInfos">
  445. <view class="answerTitle">答案解析</view>
  446. <view class="answerContent"
  447. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  448. ></view>
  449. </view>
  450. </view>
  451. </template>
  452. <template v-if="ansItem.type == 3">
  453. <view class="pad_8 titBox">
  454. <view class="leftLetters">
  455. <view class="btnType">
  456. <text>判断</text>
  457. </view>
  458. </view>
  459. <view class="titles">
  460. <rich-text :nodes="ansItem.content"></rich-text>
  461. </view>
  462. <view v-if="!bank.ques[ansIndex]">
  463. <view
  464. v-for="(option, childindex) in judge"
  465. :key="childindex"
  466. class="lisSty"
  467. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  468. >
  469. <view class="activeTI">{{ ast[childindex] }}</view>
  470. <view class="flex_auto">
  471. {{ option }}
  472. </view>
  473. </view>
  474. </view>
  475. <view v-if="bank.ques[ansIndex]">
  476. <view
  477. v-for="(option, childindex) in judge"
  478. :key="childindex"
  479. class="lisSty"
  480. >
  481. <text
  482. :class="{
  483. right:
  484. childindex == bank.ques[ansIndex] ||
  485. childindex == bank.ans[ansIndex],
  486. wrong:
  487. childindex == bank.ques[ansIndex] &&
  488. bank.ques[ansIndex] != bank.ans[ansIndex],
  489. }"
  490. class="activeTI"
  491. >
  492. {{ ast[childindex] }}
  493. </text>
  494. <view class="flex_auto">
  495. {{ option }}
  496. </view>
  497. </view>
  498. </view>
  499. </view>
  500. <view v-if="bank.ques[ansIndex]">
  501. <view class="pad_8 answer">
  502. <view>正确答案:{{ ast[bank.ans[ansIndex]] }}</view>
  503. <view>我的答案:{{ ast[bank.ques[ansIndex]] }}</view>
  504. </view>
  505. <view class="pad_8 answerInfos">
  506. <view class="answerTitle">答案解析</view>
  507. <view class="answerContent"
  508. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  509. ></view>
  510. </view>
  511. </view>
  512. </template>
  513. <!-- 简答题 -->
  514. <template v-if="ansItem.type == 5">
  515. <view class="pad_8 titBox_title">
  516. <view class="leftLetters">
  517. <view class="btnType">
  518. <text>简答</text>
  519. </view>
  520. </view>
  521. <view class="titles">
  522. <rich-text :nodes="ansItem.content"></rich-text>
  523. </view>
  524. </view>
  525. <view class="pad_8 titBox_title">
  526. <view class="ans">
  527. <view
  528. class="ans_input"
  529. v-if="
  530. !bank.ques[ansIndex] ||
  531. (!bank.ques[ansIndex].text &&
  532. !bank.ques[ansIndex].imageList.length)
  533. "
  534. >
  535. <view class="top flex">
  536. <image
  537. class="icon"
  538. @click="chooseImgChild(bankIndex, ansIndex)"
  539. src="/static/08-10_032.jpg"
  540. mode=""
  541. ></image>
  542. <view class="progress"
  543. >{{ ansItem.ansText.imageList.length || "0" }}/4</view
  544. >
  545. <view
  546. class="submit"
  547. @click="submitAnsChild(bankIndex, ansIndex)"
  548. >确认答案</view
  549. >
  550. </view>
  551. <view class="textarea">
  552. <textarea
  553. v-model="ansItem.ansText.text"
  554. placeholder="在此输入答案"
  555. ></textarea>
  556. </view>
  557. <view class="imgs">
  558. <view
  559. class="img"
  560. :key="imgIndex"
  561. v-for="(img, imgIndex) in ansItem.ansText.imageList"
  562. >
  563. <text
  564. @click="
  565. deleteImgChild(imgIndex, bankIndex, ansIndex)
  566. "
  567. >x</text
  568. >
  569. <image :src="$method.splitImgHost(img, true)"></image>
  570. </view>
  571. </view>
  572. </view>
  573. <view
  574. class="ans_submit answerInfos"
  575. v-if="bank.ques[ansIndex]"
  576. >
  577. <view class="answerTitle">我的答案</view>
  578. {{ bank.ques[ansIndex].text }}
  579. <view class="imgs">
  580. <image
  581. class="img"
  582. :key="quesIndex"
  583. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  584. .imageList"
  585. :src="$method.splitImgHost(ques, true)"
  586. ></image>
  587. </view>
  588. </view>
  589. </view>
  590. </view>
  591. <view v-if="bank.ques[ansIndex]">
  592. <view class="pad_8 answerInfos">
  593. <view class="answerTitle">答案解析</view>
  594. <view class="answerContent"
  595. ><rich-text :nodes="ansItem.analysisContent"></rich-text
  596. ></view>
  597. </view>
  598. </view>
  599. </template>
  600. </view>
  601. </template>
  602. <view class="footer_btn">
  603. <view class="collect">
  604. <view v-if="collectList[bankIndex]">
  605. <image src="/static/icon/collected.png" mode=""></image>
  606. <view>取消收藏</view>
  607. </view>
  608. </view>
  609. <view class="flex_center" @click="openFooterTab">
  610. <view class="up-icon">
  611. <image src="/static/up.png"></image>
  612. </view>
  613. 答题卡
  614. </view>
  615. <view class="collect show" @click="pdsubmit">
  616. <view>
  617. <image src="/static/jj.png" mode=""></image>
  618. <view>交卷</view>
  619. </view>
  620. </view>
  621. </view>
  622. </view>
  623. </swiper-item>
  624. </swiper>
  625. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  626. <view class="popupView">
  627. <view class="popupTops">
  628. <view class="topIcon"></view>
  629. 点击编号即可跳转至对应题目
  630. </view>
  631. <view class="popupContent">
  632. <scroll-view scroll-y="true" style="height: 506rpx">
  633. <view class="boxSty">
  634. <view
  635. v-for="(item, index) in questionList"
  636. :key="index"
  637. @click="changeIndex(index)"
  638. :class="{
  639. isRight: isRight(item, index),
  640. isWrong: isWrong(item, index),
  641. isPart: isPart(item, index),
  642. isOver: isOver(item, index),
  643. }"
  644. class="liListSty"
  645. >
  646. {{ index + 1 }}
  647. </view>
  648. </view>
  649. </scroll-view>
  650. </view>
  651. </view>
  652. </u-popup>
  653. <view class="dialog" v-if="showDialog">
  654. <view class="text">左右滑动切换上下题</view>
  655. <view class="btn" @click="hideDialog">我知道了</view>
  656. </view>
  657. <view class="dialog-arrow" v-if="showArrow">
  658. <image class="pointer" src="/static/arrow-left.png" mode=""></image>
  659. <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
  660. <view class="btn" @click="showArrow = false">我知道了</view>
  661. </view>
  662. <view class="dialog_wrap" v-if="testOver">
  663. <view class="bg"></view>
  664. <view class="dialog">
  665. <view class="title">温馨提示</view>
  666. <view class="content">
  667. <view>您已完成所有题目,</view>
  668. <view>快去交卷吧!</view>
  669. </view>
  670. <view class="btns">
  671. <view class="btn" @click="noSubmit()">暂不交卷</view>
  672. <view class="btn active" @click="submitNow()">立即交卷</view>
  673. </view>
  674. </view>
  675. </view>
  676. <view class="dialog_wrap" v-if="isLastCount">
  677. <view class="bg"></view>
  678. <view class="dialog">
  679. <view class="title">温馨提示</view>
  680. <view class="content">
  681. <view
  682. >您当前正在测试,还剩{{ lastCount }}道题未完成,离开视为交卷</view
  683. >
  684. </view>
  685. <view class="btns">
  686. <view class="btn" @click="noLeave()">暂不离开</view>
  687. <view class="btn active" @click="leaveNow()">继续离开</view>
  688. </view>
  689. </view>
  690. </view>
  691. <u-popup
  692. v-model="showpopups"
  693. mode="center"
  694. border-radius="24"
  695. height="439rpx"
  696. width="640rpx"
  697. :mask-close-able="false"
  698. >
  699. <view class="popboxs">
  700. <view class="classTops">温馨提示</view>
  701. <view class="textStys">
  702. {{
  703. cgType === 7
  704. ? "您还未交卷,确定结束做题吗?"
  705. : cgType === 8
  706. ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
  707. : cgType === 6
  708. ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
  709. : cgType == 9
  710. ? `您已完成所有题目,快去交卷吧!`
  711. : ""
  712. }}
  713. </view>
  714. <view class="classFootsty" v-if="cgType === 6">
  715. <view class="btnsty btns1" @click="submit">立即交卷</view>
  716. <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
  717. </view>
  718. <view class="classFootsty" v-if="cgType === 7">
  719. <view class="btnsty btns1" @click="showpopups = false">下次继续</view>
  720. <view class="btnsty btns2" @click="backPages">结束做题</view>
  721. </view>
  722. <view class="classFootsty" v-if="cgType === 8">
  723. <view class="btnsty btns1" @click="leaveNow()">下次继续</view>
  724. <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
  725. </view>
  726. <view class="classFootsty" v-if="cgType === 9">
  727. <view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
  728. <view class="btnsty btns2" @click="submit">立即交卷</view>
  729. </view>
  730. </view>
  731. </u-popup>
  732. <u-mask :show="photoPopup">
  733. <!-- 播放前拍照start -->
  734. <view
  735. v-if="photoPopup"
  736. :mask-close-able="false"
  737. style="bottom: 0; position: fixed; width: 100%; z-index: 999"
  738. >
  739. <view class="photoBox">
  740. <view class="photoTop">
  741. <view class="sqzz" v-if="false"
  742. ><u-icon
  743. name="close"
  744. color="#333333"
  745. size="30"
  746. @click="closePhoto"
  747. ></u-icon
  748. ></view>
  749. <view class="centersq">请正视手机屏幕</view>
  750. <view class="sqzz"></view>
  751. </view>
  752. <view class="photoCenter">
  753. <view
  754. style="width: 100%; height: 979rpx; position: fixed"
  755. v-if="photoPopup && isTaking"
  756. >
  757. <camera
  758. device-position="front"
  759. flash="off"
  760. @error="error"
  761. style="width: 100%; height: 100%"
  762. ></camera>
  763. </view>
  764. <view class="custom" v-if="!isTaking"
  765. ><image :src="avatarUrl" mode=""></image
  766. ></view>
  767. </view>
  768. <view class="photoBoxbtns">
  769. <view class="btnResult" v-if="isTaking" @click="takePhoto"
  770. >拍照</view
  771. >
  772. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  773. <view class="btnResult" v-if="!isTaking" @click="submitPhoto"
  774. >确认</view
  775. >
  776. </view>
  777. </view>
  778. </view>
  779. </u-mask>
  780. </view>
  781. </template>
  782. <script>
  783. export default {
  784. data() {
  785. return {
  786. photoPopup: false,
  787. showpopups: false,
  788. id: "",
  789. current: 0,
  790. questionList: [],
  791. ast: ["A", "B", "C", "D", "E", "F", "G"],
  792. judge: ["错误", "正确"],
  793. ans: [],
  794. ques: [],
  795. show: false,
  796. showDialog: false,
  797. bankList: [],
  798. collectList: [],
  799. goodsId: "",
  800. recordId: "",
  801. isSubmit: false,
  802. lastTime: 0, //剩余考试时长
  803. allTimes: 0, //总考试时长
  804. timer: null,
  805. wrongList: [],
  806. bankType: 0, //试卷类型
  807. needBack: false, //是否是考试
  808. testOver: false,
  809. isLastCount: false, //是否有未答题目
  810. lastCount: 0, //剩余没有回答的题目数
  811. chapterId: 0,
  812. moduleId: 0,
  813. showArrow: false, //退出提示
  814. isFromVideo: "",
  815. gradeId: "",
  816. courseId: 0,
  817. cgType: 0, //对应设计稿弹窗编码,
  818. avatarUrl: "",
  819. ossAvatarUrl: "",
  820. goodsDetail: {},
  821. isTakePhoto: false,
  822. orderGoodsId: 0,
  823. isTaking: true, //是否正在拍照
  824. needPhoto: false, //是否需要拍照
  825. };
  826. },
  827. async onLoad(option) {
  828. this.id = option.id;
  829. this.goodsId = option.goodsid;
  830. this.chapterId = option.chapterId;
  831. this.courseId = option.courseId;
  832. this.moduleId = option.moduleId;
  833. this.isFromVideo = option.isFromVideo || "";
  834. this.gradeId = option.gradeId || "";
  835. this.orderGoodsId = Number(option.orderGoodsId);
  836. let isBack = option.isback;
  837. let showDialog = uni.getStorageSync("showDialog");
  838. if (showDialog) {
  839. this.showDialog = false;
  840. } else {
  841. this.showDialog = true;
  842. uni.setStorageSync("showDialog", "1");
  843. }
  844. //考试时候用手势或者返回键 被迫返回做题
  845. if (isBack) {
  846. console.log(getApp());
  847. let app = getApp();
  848. let globalData = app.globalData;
  849. for (var k in globalData.bankData) {
  850. this[k] = globalData.bankData[k];
  851. }
  852. this.showArrow = true;
  853. //需要拍没拍过直接弹出摄像头
  854. if (this.needPhoto && !this.isTakePhoto) {
  855. this.photoPopup = true;
  856. this.isTaking = true;
  857. this.avatarUrl = "";
  858. } else {
  859. //不需要拍照
  860. if (this.lastTime) {
  861. this.timer = setInterval(() => {
  862. if (this.lastTime <= 0) {
  863. clearInterval(this.timer);
  864. uni.showToast({
  865. icon: "none",
  866. mask: true,
  867. title: "考试时间已到,系统将自动交卷",
  868. duration: 10000,
  869. });
  870. this.submit();
  871. return;
  872. }
  873. this.lastTime--;
  874. }, 1000);
  875. }
  876. }
  877. } else {
  878. await this.getGoodsDetail();
  879. this.goodsQuestionList();
  880. this.bankExam();
  881. }
  882. },
  883. onUnload() {
  884. if (this.isSubmit) {
  885. clearInterval(this.timer);
  886. return;
  887. }
  888. if (this.needPhoto && !this.isTakePhoto) {
  889. return;
  890. }
  891. //考试试卷 阻止ios手势返回,自动跳回答题页
  892. if (this.needBack) {
  893. let app = getApp();
  894. app.globalData.bankData = this.$data;
  895. clearInterval(this.timer);
  896. uni.navigateTo({
  897. url:
  898. "/pages2/class/questionBank?id=" +
  899. this.id +
  900. "&goodsid=" +
  901. this.goodsId +
  902. "&isback=true&orderGoodsId=" +
  903. this.orderGoodsId,
  904. });
  905. } else {
  906. //点击返回按钮确认允许退出,交卷
  907. clearInterval(this.timer);
  908. this.examRecordEdit();
  909. }
  910. },
  911. methods: {
  912. getGoodsDetail() {
  913. return new Promise((resolve) => {
  914. let self = this;
  915. this.$api.goodsDetail(this.goodsId).then((res) => {
  916. self.goodsDetail = res.data.data;
  917. if (self.goodsDetail.goodsPhotoExamConfig) {
  918. let goodsPhotoExamConfig = JSON.parse(
  919. self.goodsDetail.goodsPhotoExamConfig
  920. );
  921. if (goodsPhotoExamConfig.photograph > 0) {
  922. self.needPhoto = true;
  923. }
  924. }
  925. resolve();
  926. });
  927. });
  928. },
  929. reTake() {
  930. this.isTaking = true;
  931. },
  932. postStudyRecord() {
  933. let self = this;
  934. let data = {
  935. photo: self.ossAvatarUrl,
  936. recordId: self.recordId,
  937. };
  938. console.log(data, "拍照提交");
  939. this.$api.studyExamPhotoRecord(data).then((res) => {
  940. console.log(res, "拍照提交结果");
  941. if (res.data.code != 200) {
  942. uni.showToast({
  943. icon: "none",
  944. mask: true,
  945. title: res.data.msg,
  946. duration: 10000,
  947. });
  948. return;
  949. }
  950. self.ossAvatarUrl = "";
  951. self.isTakePhoto = true;
  952. //拍照
  953. if (this.lastTime) {
  954. this.timer = setInterval(() => {
  955. if (this.lastTime <= 0) {
  956. clearInterval(this.timer);
  957. uni.showToast({
  958. icon: "none",
  959. mask: true,
  960. title: "考试时间已到,系统将自动交卷",
  961. duration: 10000,
  962. });
  963. this.submit();
  964. return;
  965. }
  966. this.lastTime--;
  967. }, 1000);
  968. }
  969. });
  970. },
  971. uploadFile(options, int) {
  972. var self = this;
  973. return new Promise((resolve, reject) => {
  974. var data = {
  975. imageStatus: int,
  976. gradeId: this.gradeId,
  977. };
  978. self.$api.aliyunpolicy(data).then((res) => {
  979. if (res.data.code != 200) {
  980. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  981. return;
  982. }
  983. var ossToken = res.data.data.resultContent;
  984. if (ossToken.host == null || ossToken.host == undefined) {
  985. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  986. return;
  987. }
  988. uni.uploadFile({
  989. url: ossToken.host,
  990. name: "file",
  991. filePath: options,
  992. fileType: "image",
  993. header: {
  994. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  995. },
  996. formData: {
  997. key: ossToken.dir,
  998. OSSAccessKeyId: ossToken.accessid,
  999. policy: ossToken.policy,
  1000. Signature: ossToken.signature,
  1001. callback: ossToken.callback,
  1002. success_action_status: 200,
  1003. },
  1004. success: (result) => {
  1005. if (result.statusCode === 200) {
  1006. self.ossAvatarUrl = ossToken.dir;
  1007. resolve(ossToken.dir);
  1008. } else {
  1009. uni.showToast({
  1010. title: "上传失败",
  1011. icon: "none",
  1012. });
  1013. return;
  1014. }
  1015. },
  1016. fail: (error) => {
  1017. uni.showToast({
  1018. title: "上传接口报错" + error,
  1019. icon: "none",
  1020. });
  1021. return;
  1022. },
  1023. });
  1024. });
  1025. });
  1026. },
  1027. imageInfos() {
  1028. var self = this;
  1029. return new Promise((resolve, reject) => {
  1030. uni.getImageInfo({
  1031. src: self.avatarUrl,
  1032. success: async (res) => {
  1033. let canvasWidth = res.width; //图片原始长宽
  1034. let canvasHeight = res.height;
  1035. if (canvasWidth > 2000 || canvasHeight > 2000) {
  1036. uni.compressImage({
  1037. src: self.avatarUrl,
  1038. quality: 75,
  1039. width: "35%",
  1040. height: "35%",
  1041. success: async (rest) => {
  1042. const waitUpload = await self.uploadFile(
  1043. rest.tempFilePath,
  1044. 0
  1045. );
  1046. resolve(waitUpload);
  1047. },
  1048. });
  1049. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  1050. uni.compressImage({
  1051. src: self.avatarUrl,
  1052. quality: 75,
  1053. width: "50%",
  1054. height: "50%",
  1055. success: async (rest) => {
  1056. const waitUpload = await self.uploadFile(
  1057. rest.tempFilePath,
  1058. 0
  1059. );
  1060. resolve(waitUpload);
  1061. },
  1062. });
  1063. } else {
  1064. console.log("无需压缩");
  1065. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  1066. resolve(waitUpload);
  1067. }
  1068. },
  1069. });
  1070. });
  1071. },
  1072. /**
  1073. * 人脸匹配
  1074. */
  1075. faceRecognition() {
  1076. return new Promise((resolve) => {
  1077. let fileSystem = uni.getFileSystemManager();
  1078. fileSystem.readFile({
  1079. filePath: `${this.avatarUrl}`,
  1080. encoding: "base64",
  1081. position: 0,
  1082. success: (res) => {
  1083. console.log(res);
  1084. let base64 = "data:image/jpg;base64," + res.data;
  1085. this.$api
  1086. .faceCertificationCompareFace({
  1087. imageA: base64,
  1088. orderGoodsId: this.orderGoodsId,
  1089. gradeId: this.gradeId,
  1090. })
  1091. .then((res) => {
  1092. console.log(res, "res");
  1093. resolve(res.data.data);
  1094. });
  1095. },
  1096. fail(err) {
  1097. console.error(err, "err");
  1098. },
  1099. });
  1100. });
  1101. },
  1102. async submitPhoto() {
  1103. let compareFaceData = await this.faceRecognition();
  1104. console.log(compareFaceData, "compareFaceData");
  1105. if (compareFaceData == 0) {
  1106. uni.showToast({
  1107. title: "人脸匹配不通过,请重新拍照上传",
  1108. icon: "none",
  1109. duration: 2000,
  1110. });
  1111. setTimeout(() => {
  1112. this.uploadLock = false;
  1113. this.openPhoto();
  1114. }, 2000);
  1115. return;
  1116. }
  1117. if (compareFaceData >= 80) {
  1118. const waitYS = await this.imageInfos();
  1119. this.postStudyRecord(); //提交记录
  1120. this.photoPopup = false;
  1121. }
  1122. },
  1123. //确认拍照
  1124. takePhoto() {
  1125. var self = this;
  1126. const ctx = uni.createCameraContext();
  1127. ctx.takePhoto({
  1128. quality: "high",
  1129. success: (res) => {
  1130. console.log(res.tempImagePath);
  1131. self.avatarUrl = res.tempImagePath;
  1132. // self.submitPhoto();
  1133. this.isTaking = false;
  1134. // self.photoPopup = false;
  1135. },
  1136. fail: (err) => {
  1137. console.log(err);
  1138. },
  1139. });
  1140. },
  1141. /**
  1142. * 是否有上传图片
  1143. */
  1144. hasImgs(bank) {
  1145. return bank.ansText.imageList.length == 0;
  1146. },
  1147. /**
  1148. * 获取试卷类型2考试,1练习
  1149. */
  1150. bankExam() {
  1151. this.$api.bankExam(this.id).then((res) => {
  1152. this.bankType = res.data.data.doType;
  1153. if (this.bankType == 2) {
  1154. this.needBack = true;
  1155. }
  1156. });
  1157. },
  1158. /**
  1159. * 点击后退按钮
  1160. */
  1161. clickLeft() {
  1162. //需要拍照没有拍直接返回
  1163. if (this.needPhoto && !this.isTakePhoto) {
  1164. this.isSubmit = true;
  1165. uni.navigateBack({
  1166. delta: 1,
  1167. });
  1168. return;
  1169. }
  1170. if (this.bankType == 1) {
  1171. let ansCount = this.questionOverNum(); //已答题数
  1172. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1173. //所有题目答完
  1174. if (this.lastCount == 0) {
  1175. // this.testOver = true;
  1176. this.cgType = 7;
  1177. //未答完
  1178. } else {
  1179. this.cgType = 8;
  1180. // this.isLastCount = true;
  1181. }
  1182. this.showpopups = true;
  1183. } else if (this.bankType == 2) {
  1184. let ansCount = this.questionOverNum(); //已答题数
  1185. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1186. //所有题目答完
  1187. if (this.lastCount == 0) {
  1188. this.testOver = true;
  1189. //未答完
  1190. } else {
  1191. this.isLastCount = true;
  1192. }
  1193. }
  1194. },
  1195. /**
  1196. * 返回上一页
  1197. */
  1198. backPages() {
  1199. this.needBack = false;
  1200. uni.navigateBack({
  1201. delta: 1,
  1202. });
  1203. },
  1204. /**
  1205. * 获取已经回答的题目数
  1206. * hasSpecail (是否包含简答和案例)
  1207. */
  1208. questionOverNum(hasSpecail) {
  1209. let count = 0;
  1210. this.questionList.forEach((item) => {
  1211. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1212. if (item.ques) {
  1213. count++;
  1214. }
  1215. } else if (item.type == 4) {
  1216. //案例题
  1217. if (hasSpecail) {
  1218. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1219. if (
  1220. jsonItem.type == 1 ||
  1221. jsonItem.type == 2 ||
  1222. jsonItem.type == 3
  1223. ) {
  1224. if (item.ques[indexs]) {
  1225. return true;
  1226. } else {
  1227. return false;
  1228. }
  1229. } else if (jsonItem.type == 5) {
  1230. console.log(jsonItem, 111);
  1231. if (
  1232. item.ques[indexs] &&
  1233. (item.ques[indexs].text.length ||
  1234. item.ques[indexs].imageList.length)
  1235. ) {
  1236. return true;
  1237. } else {
  1238. return false;
  1239. }
  1240. }
  1241. });
  1242. if (isOver) {
  1243. count++;
  1244. console.log(item, 444);
  1245. }
  1246. }
  1247. } else if (item.type == 5) {
  1248. //简答题
  1249. if (hasSpecail) {
  1250. if (
  1251. item.ques &&
  1252. (item.ques.text.length || item.ques.imageList.length)
  1253. ) {
  1254. count++;
  1255. }
  1256. }
  1257. }
  1258. });
  1259. return count;
  1260. },
  1261. /**
  1262. * 是否做完所有题目
  1263. */
  1264. isDoOver() {
  1265. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1266. if (this.questionList.length == questionOverNum) {
  1267. //全部做完弹窗
  1268. this.cgType = 9;
  1269. this.showpopups = true;
  1270. }
  1271. },
  1272. /**
  1273. * 暂不交卷
  1274. */
  1275. noSubmit() {
  1276. //设为允许退出页面
  1277. this.needBack = false;
  1278. uni.navigateBack({
  1279. delta: 1,
  1280. });
  1281. },
  1282. /**
  1283. * 不离开
  1284. */
  1285. noLeave() {
  1286. this.isLastCount = false;
  1287. },
  1288. /**
  1289. * 立即离开并交卷
  1290. */
  1291. leaveNow() {
  1292. this.isSubmit = true;
  1293. uni.navigateBack({
  1294. delta: 1,
  1295. });
  1296. //需要拍照没有拍,返回不扣次数
  1297. if (this.needPhoto && !this.isTakePhoto) {
  1298. return;
  1299. }
  1300. let score = 0; //计算总分
  1301. let reportStatus = 0;
  1302. let number = 0;
  1303. let doQuestionIds = []; //做过的题目id
  1304. let doQuestionNum = 0; //做过的题目数量
  1305. let passScore = 0;
  1306. let allScore = 0; //总分
  1307. this.questionList.forEach((item, index) => {
  1308. passScore = item.passScore;
  1309. if (item.type == 1) {
  1310. if (item.ques == item.ans) {
  1311. item.scoreResult = item.score;
  1312. score += item.score;
  1313. number++;
  1314. } else {
  1315. item.scoreResult = 0;
  1316. }
  1317. if (item.ques) {
  1318. doQuestionNum++;
  1319. doQuestionIds.push(item.questionId);
  1320. }
  1321. allScore += item.score;
  1322. } else if (item.type == 2) {
  1323. let isRight =
  1324. item.ques &&
  1325. item.ques.every((quesItem, quesIndex) => {
  1326. return item.ques[quesIndex] == item.ans[quesIndex];
  1327. });
  1328. if (isRight) {
  1329. //全对
  1330. item.scoreResult = item.score;
  1331. score += item.score;
  1332. number++;
  1333. } else {
  1334. let checkboxScore = item.score; //获取单题总分数
  1335. item.ques &&
  1336. item.ques.forEach((ques, quesIndex) => {
  1337. //选错一个全扣
  1338. if (item.ques) {
  1339. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1340. checkboxScore = 0;
  1341. }
  1342. } else {
  1343. checkboxScore = 0;
  1344. }
  1345. });
  1346. //没选错
  1347. if (checkboxScore) {
  1348. checkboxScore = 0;
  1349. item.ans.forEach((ans, quesIndex) => {
  1350. //漏选扣一部分,对n题给n X partScore 分
  1351. if (item.ques) {
  1352. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1353. checkboxScore += item.partScore;
  1354. }
  1355. } else {
  1356. checkboxScore = 0;
  1357. }
  1358. });
  1359. }
  1360. if (checkboxScore <= 0) {
  1361. item.scoreResult = 0;
  1362. } else {
  1363. item.scoreResult = checkboxScore;
  1364. }
  1365. score += checkboxScore;
  1366. }
  1367. if (item.ques && item.ques.length) {
  1368. doQuestionNum++;
  1369. doQuestionIds.push(item.questionId);
  1370. }
  1371. allScore += item.score;
  1372. } else if (item.type == 3) {
  1373. if (item.ques == item.ans) {
  1374. item.scoreResult = item.score;
  1375. score += item.score;
  1376. number++;
  1377. } else {
  1378. item.scoreResult = 0;
  1379. }
  1380. if (item.ques) {
  1381. doQuestionNum++;
  1382. doQuestionIds.push(item.questionId);
  1383. }
  1384. allScore += item.score;
  1385. } else {
  1386. allScore += item.score;
  1387. }
  1388. });
  1389. if (score >= passScore) {
  1390. reportStatus = 1;
  1391. } else {
  1392. reportStatus = 0;
  1393. }
  1394. this.$api
  1395. .bankRecordEdit({
  1396. chapterId: this.chapterId || 0,
  1397. moduleId: this.moduleId || 0,
  1398. examId: this.id,
  1399. goodsId: this.goodsId,
  1400. orderGoodsId: this.orderGoodsId,
  1401. recordId: this.recordId,
  1402. courseId: this.courseId,
  1403. reportStatus: reportStatus,
  1404. rightQuestionNum: number,
  1405. doQuestionNum: doQuestionNum,
  1406. status: 1,
  1407. doQuestionIds: doQuestionIds.join(","),
  1408. gradeId: this.gradeId,
  1409. performance: score,
  1410. totalScore: allScore,
  1411. // examTime: parseInt(this.allTimes),
  1412. // doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1413. // historyExamJson: JSON.stringify(this.questionList)
  1414. })
  1415. .then((res) => {});
  1416. },
  1417. /**
  1418. * 立即交卷
  1419. */
  1420. submitNow() {
  1421. this.showpopups = false;
  1422. this.needBack = false;
  1423. this.submit();
  1424. },
  1425. /**
  1426. * 离开页面统计回答正确题数
  1427. */
  1428. examRecordEdit() {
  1429. if (!this.isSubmit) {
  1430. let number = 0;
  1431. let score = 0;
  1432. let doQuestionNum = 0;
  1433. let reportStatus = 0;
  1434. this.questionList.forEach((item, index) => {
  1435. if (item.type == 1) {
  1436. if (item.ques == item.ans) {
  1437. score += item.score;
  1438. number++;
  1439. }
  1440. if (item.ques) {
  1441. doQuestionNum++;
  1442. }
  1443. } else if (item.type == 2) {
  1444. let isRight =
  1445. item.ques &&
  1446. item.ques.every((quesItem, quesIndex) => {
  1447. return item.ques[quesIndex] == item.ans[quesIndex];
  1448. });
  1449. if (isRight) {
  1450. score += item.score;
  1451. number++;
  1452. } else {
  1453. let checkboxScore = item.score; //获取单题总分数
  1454. item.ques.forEach((ques, quesIndex) => {
  1455. //选错一个全扣
  1456. if (item.ques) {
  1457. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1458. checkboxScore = 0;
  1459. }
  1460. } else {
  1461. checkboxScore = 0;
  1462. }
  1463. });
  1464. //没选错
  1465. if (checkboxScore) {
  1466. item.ans.forEach((ans, quesIndex) => {
  1467. //漏选扣一部分
  1468. if (item.ques) {
  1469. if (item.ques.indexOf(item.ans[quesIndex]) == -1) {
  1470. checkboxScore = item.partScore;
  1471. }
  1472. } else {
  1473. checkboxScore = 0;
  1474. }
  1475. });
  1476. }
  1477. if (checkboxScore <= 0) {
  1478. item.scoreResult = 0;
  1479. } else {
  1480. item.scoreResult = checkboxScore;
  1481. score += checkboxScore;
  1482. // number++;
  1483. }
  1484. }
  1485. if (item.ques && item.ques.length) {
  1486. doQuestionNum++;
  1487. }
  1488. } else if (item.type == 3) {
  1489. if (item.ques == item.ans) {
  1490. score += item.score;
  1491. number++;
  1492. }
  1493. if (item.ques) {
  1494. doQuestionNum++;
  1495. }
  1496. } else if (item == 4) {
  1497. if (item.ques.length) {
  1498. doQuestionNum++;
  1499. }
  1500. } else if (item.type == 5) {
  1501. if (item.ques) {
  1502. doQuestionNum++;
  1503. }
  1504. }
  1505. });
  1506. if (score >= 60) {
  1507. reportStatus = 1;
  1508. }
  1509. this.$api
  1510. .bankRecordEdit({
  1511. chapterId: this.chapterId || 0,
  1512. moduleId: this.moduleId || 0,
  1513. gradeId: this.gradeId,
  1514. examId: this.id,
  1515. courseId: this.courseId,
  1516. orderGoodsId: this.orderGoodsId,
  1517. goodsId: this.goodsId,
  1518. recordId: this.recordId,
  1519. performance: score,
  1520. reportStatus: reportStatus,
  1521. status: 1,
  1522. // historyExamJson: JSON.stringify(this.questionList)
  1523. })
  1524. .then((res) => {});
  1525. }
  1526. },
  1527. /**
  1528. * @param {Object} second倒计时过滤器
  1529. */
  1530. countdown(second) {
  1531. if (second) {
  1532. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  1533. let m = parseInt((second / 60) % 60); // 计算分数
  1534. let s = parseInt(second % 60); // 计算当前秒数
  1535. if (h < 10) h = "0" + h;
  1536. if (m < 10) m = "0" + m;
  1537. if (s < 10) s = "0" + s;
  1538. return h + ":" + m + ":" + s;
  1539. } else {
  1540. return "";
  1541. }
  1542. },
  1543. /**
  1544. * 请求题目列表
  1545. */
  1546. goodsQuestionList() {
  1547. this.$api
  1548. .goodsQuestionList({
  1549. examId: this.id,
  1550. })
  1551. .then(async (res) => {
  1552. if (!res.data.data.length) {
  1553. this.hideDialog();
  1554. uni.showModal({
  1555. showCancel: false,
  1556. content: "该试卷暂无题目",
  1557. success: function (k) {
  1558. if (k.confirm) {
  1559. uni.navigateBack();
  1560. }
  1561. },
  1562. });
  1563. return;
  1564. }
  1565. this.allTimes = res.data.data[0].answerTime * 60;
  1566. this.lastTime =
  1567. res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
  1568. res.data.data.forEach((item, index) => {
  1569. if (typeof item.jsonStr == "string") {
  1570. item.jsonStr = JSON.parse(item.jsonStr);
  1571. if (item.type == 2) {
  1572. //多选
  1573. item.jsonStr.forEach((str) => {
  1574. str.optionsId = "" + str.optionsId;
  1575. });
  1576. let arr = item.answerQuestion.split(",");
  1577. arr.forEach((a, i) => {
  1578. arr[i] = "" + a;
  1579. });
  1580. item.ans = arr;
  1581. item.analysisContent &&
  1582. (item.analysisContent = item.analysisContent.replace(
  1583. /<img/gi,
  1584. '<img style="max-width:100%;"'
  1585. ));
  1586. item.content &&
  1587. (item.content = item.content.replace(
  1588. /<img/gi,
  1589. '<img style="max-width:100%;"'
  1590. ));
  1591. return;
  1592. } else if (item.type == 5) {
  1593. //简答题
  1594. item.ansText = {
  1595. text: "",
  1596. imageList: [],
  1597. };
  1598. item.ques = {
  1599. text: "",
  1600. imageList: [],
  1601. };
  1602. item.analysisContent &&
  1603. (item.analysisContent = item.analysisContent.replace(
  1604. /<img/gi,
  1605. '<img style="max-width:100%;"'
  1606. ));
  1607. item.content &&
  1608. (item.content = item.content.replace(
  1609. /<img/gi,
  1610. '<img style="max-width:100%;"'
  1611. ));
  1612. } else if (item.type == 4) {
  1613. //案例题
  1614. console.log(item.jsonStr);
  1615. item.ques = [];
  1616. item.current = 0;
  1617. let ansArr = [];
  1618. item.jsonStr.forEach((json, index) => {
  1619. if (json.type == 1) {
  1620. ansArr[index] = json.answerQuestion;
  1621. json.content &&
  1622. (json.content = json.content.replace(
  1623. /<img/gi,
  1624. '<img style="max-width:100%;"'
  1625. ));
  1626. } else if (json.type == 2) {
  1627. json.optionsList.forEach((str) => {
  1628. str.optionsId = "" + str.optionsId;
  1629. });
  1630. let arr = json.answerQuestion.split(",");
  1631. arr.forEach((a, i) => {
  1632. arr[i] = "" + a;
  1633. });
  1634. ansArr[index] = arr;
  1635. json.content &&
  1636. (json.content = json.content.replace(
  1637. /<img/gi,
  1638. '<img style="max-width:100%;"'
  1639. ));
  1640. } else if (json.type == 3) {
  1641. ansArr[index] = json.answerQuestion;
  1642. json.content &&
  1643. (json.content = json.content.replace(
  1644. /<img/gi,
  1645. '<img style="max-width:100%;"'
  1646. ));
  1647. } else if (json.type == 5) {
  1648. ansArr[index] = {
  1649. text: "",
  1650. imageList: [],
  1651. };
  1652. json.ansText = {
  1653. text: "",
  1654. imageList: [],
  1655. };
  1656. json.content &&
  1657. (json.content = json.content.replace(
  1658. /<img/gi,
  1659. '<img style="max-width:100%;"'
  1660. ));
  1661. }
  1662. });
  1663. item.analysisContent &&
  1664. (item.analysisContent = item.analysisContent.replace(
  1665. /<img/gi,
  1666. '<img style="max-width:100%;"'
  1667. ));
  1668. item.content &&
  1669. (item.content = item.content.replace(
  1670. /<img/gi,
  1671. '<img style="max-width:100%;"'
  1672. ));
  1673. item.ans = ansArr;
  1674. return;
  1675. }
  1676. item.content &&
  1677. (item.content = item.content.replace(
  1678. /<img/gi,
  1679. '<img style="max-width:100%;"'
  1680. ));
  1681. item.ans = item.answerQuestion;
  1682. }
  1683. });
  1684. this.questionList = res.data.data;
  1685. this.lastCount = this.questionList.length;
  1686. await this.examRecord();
  1687. });
  1688. },
  1689. /**
  1690. * 记录总题数,获取recordId
  1691. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1692. */
  1693. examRecord(hasSpecial) {
  1694. return new Promise((resolve) => {
  1695. let self = this;
  1696. let questionList = 0;
  1697. // if(!hasSpecial) {
  1698. this.questionList.forEach((item, index) => {
  1699. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1700. questionList++;
  1701. }
  1702. });
  1703. // } else {
  1704. // questionList = this.questionList.length;
  1705. // }
  1706. this.$api
  1707. .bankRecord({
  1708. chapterExamId: this.chapterId || 0,
  1709. moduleExamId: this.moduleId || 0,
  1710. examId: this.id,
  1711. goodsId: this.goodsId,
  1712. orderGoodsId: this.orderGoodsId,
  1713. gradeId: this.gradeId,
  1714. totalQuestionNum: questionList,
  1715. allQuestionNum: this.questionList.length,
  1716. })
  1717. .then((res) => {
  1718. this.recordId = res.data.data;
  1719. if (self.needPhoto) {
  1720. self.photoPopup = true; //拍照
  1721. this.isTaking = true;
  1722. } else {
  1723. if (this.lastTime) {
  1724. this.timer = setInterval(() => {
  1725. if (this.lastTime <= 0) {
  1726. clearInterval(this.timer);
  1727. uni.showToast({
  1728. icon: "none",
  1729. mask: true,
  1730. title: "考试时间已到,系统将自动交卷",
  1731. duration: 10000,
  1732. });
  1733. this.submit();
  1734. return;
  1735. }
  1736. this.lastTime--;
  1737. }, 1000);
  1738. }
  1739. resolve();
  1740. }
  1741. });
  1742. });
  1743. },
  1744. /**
  1745. * @param {Object} e单选点击
  1746. */
  1747. radioSelect(optionsId, bindex) {
  1748. if (this.questionList[bindex].ques) return;
  1749. this.$set(this.questionList[bindex], "ques", optionsId);
  1750. this.isDoOver();
  1751. },
  1752. /**
  1753. * @param {Object} e案例单选点击
  1754. */
  1755. radioSelectChild(optionsId, ansIndex, bindex) {
  1756. if (this.questionList[bindex].ques[ansIndex]) return;
  1757. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1758. this.isDoOver();
  1759. },
  1760. /**
  1761. * @param {Object} 多选点击
  1762. */
  1763. checkboxSelect(optionsId, bindex, index) {
  1764. this.$set(
  1765. this.questionList[bindex].jsonStr[index],
  1766. "checked",
  1767. !this.questionList[bindex].jsonStr[index].checked
  1768. );
  1769. },
  1770. /**
  1771. * @param {Object} 案例多选点击
  1772. */
  1773. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1774. this.$set(
  1775. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  1776. "checked",
  1777. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1778. .checked
  1779. );
  1780. },
  1781. isCheckboxChecked(arr) {
  1782. return arr.some((item) => {
  1783. if (item.checked) {
  1784. return true;
  1785. }
  1786. });
  1787. },
  1788. /**
  1789. * @param {Object} 多选确认
  1790. */
  1791. checkboxSubmit(bindex) {
  1792. if (this.questionList[bindex].ques) return;
  1793. let arr = [];
  1794. this.questionList[bindex].jsonStr.forEach((item) => {
  1795. if (item.checked) {
  1796. arr.push(item.optionsId);
  1797. }
  1798. });
  1799. if (!arr.length) {
  1800. uni.showToast({
  1801. title: "请选择答案",
  1802. icon: "none",
  1803. });
  1804. return;
  1805. }
  1806. this.$set(this.questionList[bindex], "ques", arr);
  1807. this.isDoOver();
  1808. let isWrong = this.questionList[bindex].ques.some(
  1809. (quesItem, quesIndex) => {
  1810. return (
  1811. this.questionList[bindex].ques[quesIndex] !=
  1812. this.questionList[bindex].ans[quesIndex]
  1813. );
  1814. }
  1815. );
  1816. },
  1817. /**
  1818. * @param {Object} 案例多选确认
  1819. */
  1820. checkboxSubmitChild(bindex, ansIndex) {
  1821. if (this.questionList[bindex].ques[ansIndex]) return;
  1822. let arr = [];
  1823. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1824. (item) => {
  1825. if (item.checked) {
  1826. arr.push(item.optionsId);
  1827. }
  1828. }
  1829. );
  1830. if (!arr.length) {
  1831. uni.showToast({
  1832. title: "请选择答案",
  1833. icon: "none",
  1834. });
  1835. return;
  1836. }
  1837. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1838. this.isDoOver();
  1839. },
  1840. /**
  1841. * @param {Object} index
  1842. * @param {Object} bindex
  1843. * 判断题
  1844. */
  1845. judgeSelect(index, bindex) {
  1846. if (this.questionList[bindex].ques) return;
  1847. this.$set(this.questionList[bindex], "ques", index + "");
  1848. this.isDoOver();
  1849. },
  1850. /**
  1851. * @param {Object} ansindex
  1852. * @param {Object} childindex
  1853. * @param {Object} bindex
  1854. * 案例判断题
  1855. */
  1856. judgeSelectChild(ansindex, childindex, bindex) {
  1857. if (this.questionList[bindex].ques[ansindex]) return;
  1858. this.$set(this.questionList[bindex].ques, ansindex, childindex + "");
  1859. this.isDoOver();
  1860. },
  1861. openFooterTab() {
  1862. this.show = true;
  1863. },
  1864. hideDialog() {
  1865. this.showDialog = false;
  1866. },
  1867. changeIndex(index) {
  1868. this.current = index;
  1869. },
  1870. swiperChange(e) {
  1871. this.current = e.detail.current;
  1872. },
  1873. pdsubmit() {
  1874. let ansCount = this.questionOverNum(true); //已答题数
  1875. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1876. //没有答完
  1877. if (this.lastCount !== 0) {
  1878. this.cgType = 6;
  1879. this.showpopups = true;
  1880. return;
  1881. }
  1882. if (this.bankType == 2) {
  1883. if (this.lastTime > 0) {
  1884. let lastTime = this.countdown(this.lastTime);
  1885. uni.showModal({
  1886. title: "提示",
  1887. content: `时间还剩余${lastTime},确定交卷吗?`,
  1888. confirmText: "交卷",
  1889. cancelText: "继续答题",
  1890. success: (res) => {
  1891. if (res.confirm) {
  1892. //确定
  1893. this.submit();
  1894. } else {
  1895. //取消
  1896. }
  1897. },
  1898. });
  1899. return;
  1900. }
  1901. }
  1902. this.submit();
  1903. },
  1904. /**
  1905. * 交卷
  1906. */
  1907. submit() {
  1908. let score = 0; //计算总分
  1909. let reportStatus = 0;
  1910. let number = 0; //做对的题目数量
  1911. let doQuestionNum = 0; //做过的题目数量
  1912. let allScore = 0; //总分
  1913. let passScore = 0;
  1914. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1915. let doQuestionIds = []; //做过的题目id
  1916. let rightQuestionIds = []; //做对的题目id
  1917. this.questionList.forEach((item, index) => {
  1918. passScore = item.passScore;
  1919. if (item.type == 1) {
  1920. //正确
  1921. if (item.ques == item.ans) {
  1922. item.scoreResult = item.score;
  1923. score += item.score;
  1924. number++;
  1925. rightQuestionIds.push(item.questionId);
  1926. } else {
  1927. //错误
  1928. item.scoreResult = 0;
  1929. doWrongQuestionIds.push(item.questionId);
  1930. }
  1931. allScore += item.score;
  1932. if (item.ques) {
  1933. doQuestionNum++;
  1934. doQuestionIds.push(item.questionId);
  1935. }
  1936. } else if (item.type == 2) {
  1937. let isRight =
  1938. item.ans &&
  1939. item.ans.every((quesItem, quesIndex) => {
  1940. if (item.ques) {
  1941. return item.ques[quesIndex] == item.ans[quesIndex];
  1942. } else {
  1943. return false;
  1944. }
  1945. });
  1946. if (isRight) {
  1947. score += item.score;
  1948. number++;
  1949. item.scoreResult = item.score;
  1950. rightQuestionIds.push(item.questionId);
  1951. } else {
  1952. let checkboxScore = item.score; //获取单题总分数
  1953. item.ques &&
  1954. item.ques.forEach((ques, quesIndex) => {
  1955. //选错一个全扣
  1956. if (item.ques) {
  1957. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1958. checkboxScore = 0;
  1959. }
  1960. } else {
  1961. checkboxScore = 0;
  1962. }
  1963. });
  1964. console.log(checkboxScore);
  1965. //没选错
  1966. if (checkboxScore) {
  1967. checkboxScore = 0;
  1968. item.ans.forEach((ans, quesIndex) => {
  1969. //漏选扣一部分,对n题给n X partScore 分
  1970. if (item.ques) {
  1971. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1972. checkboxScore += item.partScore;
  1973. }
  1974. } else {
  1975. checkboxScore = 0;
  1976. }
  1977. });
  1978. }
  1979. if (checkboxScore <= 0) {
  1980. //0分
  1981. item.scoreResult = 0;
  1982. doWrongQuestionIds.push(item.questionId);
  1983. } else {
  1984. //部分分
  1985. // number++;
  1986. doWrongQuestionIds.push(item.questionId);
  1987. item.scoreResult = checkboxScore;
  1988. score += checkboxScore;
  1989. // rightQuestionIds.push(item.questionId)
  1990. }
  1991. }
  1992. allScore += item.score;
  1993. if (item.ques && item.ques.length) {
  1994. doQuestionNum++;
  1995. doQuestionIds.push(item.questionId);
  1996. }
  1997. } else if (item.type == 3) {
  1998. if (item.ques == item.ans) {
  1999. item.scoreResult = item.score;
  2000. score += item.score;
  2001. number++;
  2002. rightQuestionIds.push(item.questionId);
  2003. } else {
  2004. item.scoreResult = 0;
  2005. doWrongQuestionIds.push(item.questionId);
  2006. }
  2007. allScore += item.score;
  2008. if (item.ques) {
  2009. doQuestionNum++;
  2010. doQuestionIds.push(item.questionId);
  2011. }
  2012. } else if (item.type == 4) {
  2013. allScore += item.score;
  2014. if (item.ques && item.ques.length) {
  2015. doQuestionNum++;
  2016. doQuestionIds.push(item.questionId);
  2017. }
  2018. } else if (item.type == 5) {
  2019. allScore += item.score;
  2020. if (item.ques && (item.ques.imageList || item.ques.text)) {
  2021. doQuestionNum++;
  2022. doQuestionIds.push(item.questionId);
  2023. }
  2024. }
  2025. });
  2026. //大于分及格
  2027. if (score >= passScore) {
  2028. reportStatus = 1;
  2029. } else {
  2030. reportStatus = 0;
  2031. }
  2032. clearInterval(this.timer);
  2033. //交卷
  2034. this.$api
  2035. .bankRecordEdit({
  2036. moduleId: this.moduleId || 0,
  2037. chapterId: this.chapterId || 0,
  2038. gradeId: this.gradeId,
  2039. examId: this.id,
  2040. goodsId: this.goodsId,
  2041. orderGoodsId: this.orderGoodsId,
  2042. reportStatus: reportStatus,
  2043. recordId: this.recordId,
  2044. courseId: this.courseId,
  2045. rightQuestionNum: number,
  2046. status: 1,
  2047. doQuestionIds: doQuestionIds.join(","),
  2048. // rightQuestionIds:rightQuestionIds.join(','),
  2049. // doQuestionNum: doQuestionNum,
  2050. performance: score,
  2051. totalScore: allScore,
  2052. // examTime: parseInt(this.allTimes),
  2053. // doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  2054. // historyExamJson: JSON.stringify(this.questionList)
  2055. })
  2056. .then((res) => {
  2057. this.isSubmit = true;
  2058. if (res.data.code == 200) {
  2059. uni.showToast({
  2060. title: "交卷成功",
  2061. duration: 1000,
  2062. mask: true,
  2063. icon: "none",
  2064. });
  2065. setTimeout(() => {
  2066. uni.redirectTo({
  2067. url:
  2068. "/pages2/class/question_report?rightQuestionNum=" +
  2069. number +
  2070. "&doWrongQuestionNum=" +
  2071. doWrongQuestionIds.length +
  2072. "&score=" +
  2073. score +
  2074. "&totalScore=" +
  2075. allScore +
  2076. "&reportStatus=" +
  2077. reportStatus,
  2078. });
  2079. }, 1000);
  2080. }
  2081. });
  2082. },
  2083. /**
  2084. * @param {Object} imgIndex
  2085. * @param {Object} bankIndex
  2086. * 删除简答图片
  2087. */
  2088. deleteImg(imgIndex, bankIndex) {
  2089. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  2090. },
  2091. /**
  2092. * @param {Object} imgIndex
  2093. * @param {Object} bankIndex
  2094. * @param {Object} ansIndex
  2095. * 删除案例题简答图片
  2096. */
  2097. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  2098. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  2099. imgIndex,
  2100. 1
  2101. );
  2102. },
  2103. /**
  2104. * @param {Object} bankindex
  2105. * 选择上传图片
  2106. */
  2107. chooseImg(bankindex) {
  2108. if (
  2109. this.questionList[bankindex] &&
  2110. this.questionList[bankindex].ansText &&
  2111. this.questionList[bankindex].ansText.imageList.length >= 4
  2112. ) {
  2113. uni.showToast({
  2114. icon: "none",
  2115. title: "最多选择4张",
  2116. });
  2117. return;
  2118. }
  2119. uni.chooseImage({
  2120. count: 1, //默认9
  2121. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  2122. sourceType: ["album", "camera"], //从相册选择
  2123. success: (res) => {
  2124. let self = this;
  2125. // console.log(JSON.stringify(res.tempFilePaths));
  2126. let img = res.tempFilePaths[0];
  2127. uni.getImageInfo({
  2128. src: img,
  2129. success: async (res) => {
  2130. let canvasWidth = res.width; //图片原始长宽
  2131. let canvasHeight = res.height;
  2132. if (canvasWidth > 1000 || canvasHeight > 1000) {
  2133. uni.compressImage({
  2134. src: img,
  2135. quality: 75,
  2136. width: "50%",
  2137. height: "50%",
  2138. success: async (rest) => {
  2139. const dir = await self.uploadFile(rest.tempFilePath, 0);
  2140. this.questionList[bankindex].ansText.imageList.push(dir);
  2141. },
  2142. });
  2143. } else {
  2144. const dir = await self.uploadFile(img, 0);
  2145. this.questionList[bankindex].ansText.imageList.push(dir);
  2146. }
  2147. },
  2148. });
  2149. },
  2150. });
  2151. },
  2152. /**
  2153. * @param {Object} bankindex
  2154. * @param {Object} ansindex
  2155. * 案例题选择上传图片
  2156. */
  2157. chooseImgChild(bankindex, ansindex) {
  2158. uni.chooseImage({
  2159. count: 1, //默认9
  2160. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  2161. sourceType: ["album", "camera"], //从相册选择
  2162. success: (res) => {
  2163. let self = this;
  2164. // console.log(JSON.stringify(res.tempFilePaths));
  2165. let img = res.tempFilePaths[0];
  2166. uni.getImageInfo({
  2167. src: img,
  2168. success: async (res) => {
  2169. let canvasWidth = res.width; //图片原始长宽
  2170. let canvasHeight = res.height;
  2171. if (canvasWidth > 1000 || canvasHeight > 1000) {
  2172. uni.compressImage({
  2173. src: img,
  2174. quality: 75,
  2175. width: "50%",
  2176. height: "50%",
  2177. success: async (rest) => {
  2178. const dir = await self.uploadFile(rest.tempFilePath, 0);
  2179. this.questionList[bankindex].jsonStr[
  2180. ansindex
  2181. ].ansText.imageList.push(dir);
  2182. },
  2183. });
  2184. } else {
  2185. const dir = await self.uploadFile(img, 0);
  2186. this.questionList[bankindex].jsonStr[
  2187. ansindex
  2188. ].ansText.imageList.push(dir);
  2189. }
  2190. },
  2191. });
  2192. },
  2193. });
  2194. },
  2195. /**
  2196. * @param {Object} type
  2197. * @param {Object} bankindex
  2198. * 简答题答案确认
  2199. */
  2200. submitAns(bankindex) {
  2201. console.log(this.questionList[bankindex]);
  2202. if (
  2203. !this.questionList[bankindex].ansText.text &&
  2204. !this.questionList[bankindex].ansText.imageList.length
  2205. ) {
  2206. uni.showToast({
  2207. title: "请输入内容或上传图片",
  2208. duration: 2000,
  2209. icon: "none",
  2210. });
  2211. return;
  2212. }
  2213. this.$set(this.questionList[bankindex], "ques", {
  2214. imageList: this.questionList[bankindex].ansText.imageList,
  2215. text: this.questionList[bankindex].ansText.text,
  2216. });
  2217. this.isDoOver();
  2218. },
  2219. /**
  2220. * @param {Object} bankindex
  2221. * @param {Object} ansindex
  2222. * 案例题简答答案确认
  2223. */
  2224. submitAnsChild(bankindex, ansindex) {
  2225. if (
  2226. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  2227. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  2228. ) {
  2229. uni.showToast({
  2230. title: "请输入内容或上传图片",
  2231. duration: 2000,
  2232. icon: "none",
  2233. });
  2234. return;
  2235. }
  2236. this.$set(this.questionList[bankindex].ques, ansindex, {
  2237. imageList:
  2238. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  2239. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  2240. });
  2241. this.isDoOver();
  2242. },
  2243. isRight(item, index) {
  2244. //单选
  2245. if (this.questionList[index].ques) {
  2246. if (item.type == 1) {
  2247. return this.questionList[index].ques == this.questionList[index].ans;
  2248. //多选
  2249. } else if (item.type == 2) {
  2250. //每一项都相等
  2251. return this.questionList[index].ans.every((item, i) => {
  2252. return item == this.questionList[index].ques[i];
  2253. });
  2254. //判断
  2255. } else if (item.type == 3) {
  2256. return this.questionList[index].ques == this.questionList[index].ans;
  2257. // } else if (item.type == 5) {
  2258. // if(this.questionList[index].ques.text){
  2259. // return true
  2260. // }else{
  2261. // return false
  2262. // }
  2263. } else {
  2264. return false;
  2265. }
  2266. } else {
  2267. return false;
  2268. }
  2269. },
  2270. right(bankIndex, ansIndex, option) {
  2271. if (
  2272. this.questionList[bankIndex].ques[ansIndex] &&
  2273. this.questionList[bankIndex].ans[ansIndex]
  2274. ) {
  2275. if (
  2276. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2277. option.optionsId
  2278. ) != -1 ||
  2279. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2280. option.optionsId
  2281. ) != -1
  2282. ) {
  2283. return true;
  2284. } else {
  2285. return false;
  2286. }
  2287. } else {
  2288. return false;
  2289. }
  2290. },
  2291. wrong(bankIndex, ansIndex, option) {
  2292. if (
  2293. this.questionList[bankIndex].ques[ansIndex] &&
  2294. this.questionList[bankIndex].ans[ansIndex]
  2295. ) {
  2296. if (
  2297. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2298. option.optionsId
  2299. ) != -1 &&
  2300. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2301. option.optionsId
  2302. ) == -1
  2303. ) {
  2304. return true;
  2305. } else {
  2306. return false;
  2307. }
  2308. } else {
  2309. return false;
  2310. }
  2311. },
  2312. isWrong(item, index) {
  2313. if (this.questionList[index].ques) {
  2314. //单选
  2315. if (item.type == 1) {
  2316. return this.questionList[index].ques != this.questionList[index].ans;
  2317. //多选
  2318. } else if (item.type == 2) {
  2319. //每一项都相等
  2320. return this.questionList[index].ques.some((item, i) => {
  2321. return this.questionList[index].ans.indexOf(item) == -1;
  2322. });
  2323. //判断
  2324. } else if (item.type == 3) {
  2325. return this.questionList[index].ques != this.questionList[index].ans;
  2326. } else {
  2327. return false;
  2328. }
  2329. } else {
  2330. return false;
  2331. }
  2332. },
  2333. isPart(item, index) {
  2334. if (this.questionList[index].ques) {
  2335. if (item.type == 2) {
  2336. let isWrong = this.questionList[index].ques.some((item, i) => {
  2337. return this.questionList[index].ans.indexOf(item) == -1;
  2338. });
  2339. let isRight = this.questionList[index].ans.every((item, i) => {
  2340. return item == this.questionList[index].ques[i];
  2341. });
  2342. if (!isRight && !isWrong) {
  2343. return true;
  2344. }
  2345. }
  2346. } else {
  2347. return false;
  2348. }
  2349. },
  2350. isOver(item, index) {
  2351. if (this.questionList[index].ques) {
  2352. if (item.type == 4) {
  2353. //案例题
  2354. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  2355. if (
  2356. jsonItem.type == 1 ||
  2357. jsonItem.type == 2 ||
  2358. jsonItem.type == 3
  2359. ) {
  2360. if (item.ques[indexs]) {
  2361. return true;
  2362. } else {
  2363. return false;
  2364. }
  2365. } else if (jsonItem.type == 5) {
  2366. if (
  2367. item.ques[indexs] &&
  2368. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  2369. ) {
  2370. console.log("chil");
  2371. return true;
  2372. } else {
  2373. return false;
  2374. }
  2375. }
  2376. });
  2377. if (isOver) {
  2378. return true;
  2379. } else {
  2380. return false;
  2381. }
  2382. } else if (item.type == 5) {
  2383. //简答题
  2384. //每一项都相等
  2385. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  2386. return true;
  2387. }
  2388. //判断
  2389. } else {
  2390. return false;
  2391. }
  2392. } else {
  2393. return false;
  2394. }
  2395. },
  2396. tabSelect(index, bankindex) {
  2397. this.$set(this.questionList[bankindex], "current", index);
  2398. },
  2399. },
  2400. };
  2401. </script>
  2402. <style lang="scss" scoped>
  2403. .photoBox {
  2404. background-color: #ffffff;
  2405. border-radius: 32px 32px 0px 0px;
  2406. .photoTop {
  2407. height: 74upx;
  2408. display: flex;
  2409. align-items: center;
  2410. justify-content: space-between;
  2411. padding: 0upx 38upx;
  2412. .sqzz {
  2413. width: 28upx;
  2414. height: 28upx;
  2415. display: flex;
  2416. align-items: center;
  2417. justify-content: center;
  2418. }
  2419. .centersq {
  2420. color: #333;
  2421. font-size: 30upx;
  2422. font-weight: 500;
  2423. }
  2424. }
  2425. .photoCenter {
  2426. width: 750upx;
  2427. height: 979upx;
  2428. position: relative;
  2429. .custom {
  2430. width: 750upx;
  2431. height: 979upx;
  2432. position: absolute;
  2433. z-index: 1000;
  2434. top: 0;
  2435. left: 0;
  2436. image {
  2437. width: 100%;
  2438. height: 100%;
  2439. }
  2440. }
  2441. }
  2442. .photoBoxbtns {
  2443. display: flex;
  2444. .btnResult {
  2445. height: 100rpx;
  2446. width: 100%;
  2447. background-color: #07c160;
  2448. text-align: center;
  2449. line-height: 100upx;
  2450. color: #fff;
  2451. font-size: 32upx;
  2452. font-weight: bold;
  2453. }
  2454. }
  2455. }
  2456. .navbar {
  2457. position: relative;
  2458. z-index: 20000;
  2459. }
  2460. .questionBank {
  2461. width: 100%;
  2462. height: 100vh;
  2463. display: flex;
  2464. flex-direction: column;
  2465. }
  2466. .swiper {
  2467. width: 100%;
  2468. flex: 1;
  2469. }
  2470. .lisSty {
  2471. margin-bottom: 16rpx;
  2472. display: flex;
  2473. .flex_auto {
  2474. flex: 1;
  2475. }
  2476. }
  2477. .activeTI {
  2478. vertical-align: middle;
  2479. display: inline-block;
  2480. border: 1rpx solid #eee;
  2481. border-radius: 50rpx;
  2482. height: 48rpx;
  2483. line-height: 46rpx;
  2484. text-align: center;
  2485. width: 48rpx;
  2486. margin-right: 15rpx;
  2487. color: #666;
  2488. font-size: 30rpx;
  2489. &.right {
  2490. color: #fff;
  2491. background: #36c75a;
  2492. }
  2493. &.wrong {
  2494. color: #fff;
  2495. background: #ff3b30;
  2496. }
  2497. &.checked {
  2498. color: #fff;
  2499. background: #007aff;
  2500. }
  2501. }
  2502. .submit_checkbox {
  2503. position: fixed;
  2504. left: 0;
  2505. right: 0;
  2506. bottom: 120rpx;
  2507. margin: 20rpx auto;
  2508. width: 526rpx;
  2509. height: 80rpx;
  2510. background: rgba(0, 122, 255, 1);
  2511. color: #fff;
  2512. text-align: center;
  2513. line-height: 80rpx;
  2514. font-size: 30rpx;
  2515. border-radius: 40rpx;
  2516. &.disabled {
  2517. opacity: 0.6;
  2518. }
  2519. }
  2520. .titles {
  2521. overflow: hidden;
  2522. margin-bottom: 24rpx;
  2523. }
  2524. .titBox {
  2525. padding: 41rpx 25rpx 24rpx 25rpx;
  2526. }
  2527. .titBox_title {
  2528. padding: 21rpx;
  2529. }
  2530. .tabs {
  2531. margin: 10rpx;
  2532. display: flex;
  2533. .tab {
  2534. margin: 0 4rpx;
  2535. padding: 10rpx 13rpx;
  2536. text-align: center;
  2537. color: #007aff;
  2538. font-size: 28rpx;
  2539. border-radius: 16rpx;
  2540. background: #fff;
  2541. &.current {
  2542. color: #fff;
  2543. background: #007aff;
  2544. }
  2545. }
  2546. }
  2547. .ans {
  2548. margin: 8rpx 8rpx 8rpx;
  2549. .ans_input {
  2550. border-radius: 16rpx;
  2551. background: #fff;
  2552. .top {
  2553. border-bottom: 1rpx solid #eeeeee;
  2554. padding: 16rpx;
  2555. display: flex;
  2556. align-items: center;
  2557. .icon {
  2558. margin-right: 20rpx;
  2559. width: 40rpx;
  2560. height: 38rpx;
  2561. }
  2562. .progress {
  2563. flex: 1;
  2564. }
  2565. .submit {
  2566. width: 168rpx;
  2567. height: 48rpx;
  2568. line-height: 48rpx;
  2569. text-align: center;
  2570. color: #fff;
  2571. font-size: 30rpx;
  2572. background: #007aff;
  2573. border-radius: 24rpx;
  2574. &.disabled {
  2575. opacity: 0.6;
  2576. }
  2577. }
  2578. }
  2579. .textarea {
  2580. textarea {
  2581. width: 100%;
  2582. height: 287rpx;
  2583. padding: 10rpx;
  2584. }
  2585. }
  2586. .imgs {
  2587. overflow: hidden;
  2588. display: flex;
  2589. width: 100%;
  2590. .img {
  2591. width: 104rpx;
  2592. height: 104rpx;
  2593. border-radius: 8rpx;
  2594. position: relative;
  2595. margin: 20rpx;
  2596. text {
  2597. position: absolute;
  2598. right: -15rpx;
  2599. top: -15rpx;
  2600. width: 30rpx;
  2601. height: 30rpx;
  2602. text-align: center;
  2603. line-height: 30rpx;
  2604. color: #fff;
  2605. background: #ff3b30;
  2606. border-radius: 50%;
  2607. }
  2608. image {
  2609. width: 100%;
  2610. height: 100%;
  2611. }
  2612. }
  2613. }
  2614. }
  2615. .ans_submit {
  2616. padding: 16rpx;
  2617. border-radius: 16rpx;
  2618. background: #fff;
  2619. .imgs {
  2620. overflow: hidden;
  2621. display: flex;
  2622. width: 100%;
  2623. .img {
  2624. width: 104rpx;
  2625. height: 104rpx;
  2626. border-radius: 8rpx;
  2627. position: relative;
  2628. margin: 20rpx;
  2629. image {
  2630. width: 100%;
  2631. height: 100%;
  2632. }
  2633. }
  2634. }
  2635. }
  2636. }
  2637. .leftLetters {
  2638. display: flex;
  2639. align-items: center;
  2640. width: 220rpx;
  2641. .btnType {
  2642. padding: 5rpx 10rpx;
  2643. border: 1rpx solid #007aff;
  2644. border-radius: 10rpx;
  2645. background-color: rgba(0, 122, 255, 0.1);
  2646. font-size: 28rpx;
  2647. color: #007aff;
  2648. margin-right: 15rpx;
  2649. }
  2650. }
  2651. .firstLetter {
  2652. display: flex;
  2653. justify-content: space-between;
  2654. align-items: center;
  2655. margin-bottom: 30rpx;
  2656. }
  2657. .popupView {
  2658. height: 100%;
  2659. padding-bottom: 100rpx;
  2660. .popupTops {
  2661. height: 77rpx;
  2662. border-bottom: 1rpx solid #eee;
  2663. text-align: center;
  2664. line-height: 77rpx;
  2665. font-size: 24rpx;
  2666. color: #999;
  2667. position: relative;
  2668. .topIcon {
  2669. position: absolute;
  2670. top: 10rpx;
  2671. left: 50%;
  2672. transform: translateX(-50%);
  2673. width: 80rpx;
  2674. height: 8rpx;
  2675. background-color: #999;
  2676. border-radius: 4rpx;
  2677. }
  2678. }
  2679. .popupContent {
  2680. }
  2681. }
  2682. .pageContent {
  2683. position: relative;
  2684. background-color: #eaeef1;
  2685. height: 100%;
  2686. padding-top: 8rpx;
  2687. padding-bottom: 100rpx;
  2688. overflow-y: scroll;
  2689. }
  2690. .pad_8 {
  2691. background-color: #fff;
  2692. margin: 0rpx 8rpx 8rpx;
  2693. border-radius: 16rpx;
  2694. &.no-margin {
  2695. margin-top: -16rpx;
  2696. border-radius: 0 0 16rpx 16rpx;
  2697. }
  2698. }
  2699. .answer {
  2700. height: 80rpx;
  2701. line-height: 80rpx;
  2702. padding: 0rpx 24rpx;
  2703. display: flex;
  2704. align-items: center;
  2705. justify-content: space-between;
  2706. color: #666;
  2707. font-size: 30rpx;
  2708. }
  2709. .footer_btn {
  2710. background-color: #fff;
  2711. z-index: 10078;
  2712. position: fixed;
  2713. bottom: 0rpx;
  2714. display: flex;
  2715. align-items: center;
  2716. justify-content: space-between;
  2717. width: 100%;
  2718. height: 98rpx;
  2719. padding: 0rpx 38rpx;
  2720. border-top: 1rpx solid #eee;
  2721. .flex_center {
  2722. flex: 1;
  2723. display: flex;
  2724. justify-content: center;
  2725. align-items: center;
  2726. flex-direction: column;
  2727. margin: 0 200rpx;
  2728. font-size: 24rpx;
  2729. color: #999999;
  2730. .up-icon {
  2731. margin-bottom: 18rpx;
  2732. width: 100%;
  2733. display: flex;
  2734. justify-content: center;
  2735. image {
  2736. width: 58rpx;
  2737. height: 21rpx;
  2738. }
  2739. }
  2740. }
  2741. .collect {
  2742. visibility: hidden;
  2743. width: 100rpx;
  2744. &.show {
  2745. visibility: visible;
  2746. }
  2747. > view {
  2748. display: flex;
  2749. flex-direction: column;
  2750. align-items: center;
  2751. justify-content: center;
  2752. image {
  2753. width: 32rpx;
  2754. height: 32rpx;
  2755. margin-bottom: 6rpx;
  2756. }
  2757. view {
  2758. font-size: 24rpx;
  2759. color: #999999;
  2760. }
  2761. }
  2762. }
  2763. }
  2764. .boxSty {
  2765. padding: 44rpx 41rpx 0rpx;
  2766. }
  2767. .liListSty {
  2768. border: 1rpx solid #eeeeee;
  2769. width: 88rpx;
  2770. height: 88rpx;
  2771. border-radius: 32rpx;
  2772. text-align: center;
  2773. line-height: 88rpx;
  2774. color: #333;
  2775. font-size: 32rpx;
  2776. float: left;
  2777. margin: 20rpx 23rpx;
  2778. &.isRight {
  2779. border: 1rpx solid #eeeeee;
  2780. color: #fff;
  2781. background: #36c75a;
  2782. }
  2783. &.isWrong {
  2784. border: 1rpx solid #eeeeee;
  2785. color: #fff;
  2786. background: #ff3b30;
  2787. }
  2788. &.isPart {
  2789. border: 1rpx solid #eeeeee;
  2790. color: #fff;
  2791. background: #FFC53D;
  2792. }
  2793. &.isOver {
  2794. border: 1rpx solid #eeeeee;
  2795. color: #fff;
  2796. background: blue;
  2797. }
  2798. }
  2799. .answerInfos {
  2800. padding: 25rpx 25rpx 25rpx 23rpx;
  2801. }
  2802. .answerTitle {
  2803. margin-bottom: 28rpx;
  2804. color: #666;
  2805. font-size: 30rpx;
  2806. }
  2807. .answerContent {
  2808. font-size: 30rpx;
  2809. color: #666;
  2810. }
  2811. .textChild {
  2812. display: inline-block;
  2813. vertical-align: middle;
  2814. }
  2815. .dialog {
  2816. position: fixed;
  2817. left: 0;
  2818. top: 0;
  2819. width: 100%;
  2820. height: 100%;
  2821. background-color: rgba(0, 0, 0, 0.8);
  2822. display: flex;
  2823. flex-direction: column;
  2824. align-items: center;
  2825. justify-content: center;
  2826. z-index: 20000;
  2827. .text {
  2828. font-size: 32rpx;
  2829. color: #ffffff;
  2830. text-align: center;
  2831. }
  2832. .btn {
  2833. width: 242rpx;
  2834. height: 82rpx;
  2835. border: 2rpx solid #ffffff;
  2836. border-radius: 16rpx;
  2837. text-align: center;
  2838. line-height: 82rpx;
  2839. margin: 41rpx auto;
  2840. color: #fff;
  2841. font-size: 32rpx;
  2842. }
  2843. }
  2844. .dialog-arrow {
  2845. padding-top: 124rpx;
  2846. position: fixed;
  2847. left: 0;
  2848. top: 0;
  2849. width: 100%;
  2850. height: 100%;
  2851. background-color: rgba(0, 0, 0, 0.8);
  2852. z-index: 20000;
  2853. .pointer {
  2854. margin-left: 87rpx;
  2855. display: block;
  2856. width: 95rpx;
  2857. height: 98rpx;
  2858. }
  2859. .text {
  2860. padding-left: 177rpx;
  2861. font-size: 32rpx;
  2862. color: #ffffff;
  2863. }
  2864. .btn {
  2865. width: 242rpx;
  2866. height: 82rpx;
  2867. border: 2rpx solid #ffffff;
  2868. border-radius: 16rpx;
  2869. text-align: center;
  2870. line-height: 82rpx;
  2871. margin: 500rpx auto 0;
  2872. color: #fff;
  2873. font-size: 32rpx;
  2874. }
  2875. }
  2876. .dialog_wrap {
  2877. position: fixed;
  2878. left: 0;
  2879. top: 0;
  2880. width: 100%;
  2881. height: 100%;
  2882. z-index: 9999999999;
  2883. .bg {
  2884. background: rgba(0, 0, 0, 0.3);
  2885. position: absolute;
  2886. left: 0;
  2887. top: 0;
  2888. width: 100%;
  2889. height: 100%;
  2890. }
  2891. .dialog {
  2892. position: absolute;
  2893. left: 50%;
  2894. top: 50%;
  2895. transform: translate3D(-50%, -50%, 0);
  2896. width: 640rpx;
  2897. height: 439rpx;
  2898. background: #ffffff;
  2899. border-radius: 24rpx;
  2900. .title {
  2901. font-size: 30rpx;
  2902. font-weight: bold;
  2903. color: #333333;
  2904. line-height: 48rpx;
  2905. text-align: center;
  2906. margin-top: 40rpx;
  2907. }
  2908. .content {
  2909. margin: 35rpx 35rpx 0;
  2910. font-size: 30rpx;
  2911. color: #666666;
  2912. line-height: 48rpx;
  2913. }
  2914. .btns {
  2915. margin-top: 35rpx;
  2916. display: flex;
  2917. align-items: center;
  2918. justify-content: center;
  2919. .btn {
  2920. width: 200rpx;
  2921. height: 80rpx;
  2922. line-height: 80rpx;
  2923. text-align: center;
  2924. background: #f5f5f5;
  2925. border-radius: 40rpx;
  2926. font-size: 30rpx;
  2927. color: rgba(0, 122, 255, 1);
  2928. background: #f5f5f5;
  2929. margin: 0 20rpx;
  2930. &.active {
  2931. color: #f5f5f5;
  2932. background: rgba(0, 122, 255, 1);
  2933. }
  2934. }
  2935. }
  2936. }
  2937. }
  2938. .popboxs {
  2939. width: 100%;
  2940. height: 100%;
  2941. display: flex;
  2942. flex-direction: column;
  2943. align-items: center;
  2944. }
  2945. .classTops {
  2946. flex-shrink: 0;
  2947. padding: 39rpx 0rpx 4rpx;
  2948. font-weight: bold;
  2949. color: #333;
  2950. font-size: 30rpx;
  2951. }
  2952. .textStys {
  2953. width: 100%;
  2954. flex: 1;
  2955. padding: 36rpx;
  2956. }
  2957. .classFootsty {
  2958. flex-shrink: 0;
  2959. display: flex;
  2960. align-items: center;
  2961. justify-content: center;
  2962. padding: 10rpx 0rpx 40rpx;
  2963. .btnsty {
  2964. width: 200rpx;
  2965. height: 80rpx;
  2966. border-radius: 40rpx;
  2967. font-weight: bold;
  2968. font-size: 30rpx;
  2969. text-align: center;
  2970. line-height: 80rpx;
  2971. }
  2972. .btns1 {
  2973. background-color: #f5f5f5;
  2974. color: #007aff;
  2975. }
  2976. .btns2 {
  2977. margin-left: 40rpx;
  2978. background-color: #007aff;
  2979. color: #ffffff;
  2980. }
  2981. }
  2982. </style>