index.vue 88 KB

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