questionBank.vue 54 KB

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