questionBank.vue 87 KB

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