questionBankContinue.vue 74 KB

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