examStart.vue 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832
  1. <template>
  2. <view class="container">
  3. <view>
  4. <!-- 提示信息弹窗 -->
  5. <uni-popup ref="message" type="message">
  6. <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
  7. </uni-popup>
  8. </view>
  9. </view>
  10. <view style="font-family: '微软雅黑', serif;
  11. font-size: 40px;
  12. color: #7f7f44;height: 30px;text-align: center;padding:20px;padding-bottom: 0;">
  13. {{examObject.examTitle}}
  14. </view>
  15. <button type="primary"
  16. style="background-color: #f0eff0; position: fixed;top: 20px;right: 20px;width: 20px;height: 20px;line-height:1;color: #000000;"
  17. @click="reload">҉</button>
  18. <uni-row>
  19. <uni-col :span="4" style="margin-top: 30px">
  20. <uni-card style="height: 85vh;">
  21. <l-divider color="#00a60d">
  22. <view style="font-size: 2vmin;">考生信息</view>
  23. </l-divider>
  24. <view
  25. style="font-family: '微软雅黑' , serif;font-size: 2vmin;color: #8c8c8c;height: 30px;text-align: center;padding:1%;">
  26. 姓名:{{user.realname}}
  27. </view>
  28. <view
  29. style="font-family: '微软雅黑', serif;font-size: 2vmin;color: #8c8c8c;height: 30px;text-align: center;padding:1%;">
  30. 考号:{{user.username}}
  31. </view>
  32. <l-divider color="#00a60d">
  33. <view style="font-size: 2vmin;">试卷名称</view>
  34. </l-divider>
  35. <radio-group>
  36. <label v-for="(item, index) in examObject.examPapersList" :key="item.value">
  37. <view>
  38. <view class="paperCss"
  39. :style="'background-color: '+(item.state === 0?'#b5aa09;':(item.state === 9?'#ececec':'#00f545'))">
  40. <view style="color: #000000;"> <strong style="font-size: 2vmin;">{{item.title}}</strong>
  41. </view>
  42. </view>
  43. </view>
  44. </label>
  45. </radio-group>
  46. <l-divider color="#b3b3b3">
  47. </l-divider>
  48. <button type="primary" style="margin-top: 10px;font-size: 2vmin;" @click="subExam">交卷</button>
  49. </uni-card>
  50. </uni-col>
  51. <uni-col :span="16" style="margin-top: 30px">
  52. <uni-card style="height: 85vh;">
  53. <scroll-view scroll-y="true" scroll-x="true" class="scroll-Y">
  54. <uni-section :title="scantron.questionIndex+'、'+scantron.questionTypeName" type="line" padding>
  55. <view v-if="scantron.questionType!==7&&scantron.questionType!==8" id="scantronNodes"
  56. style="height: 45vh;">
  57. </view>
  58. <view v-if="scantron.questionType==7||scantron.questionType==8" id="scantronNodes"
  59. style="height: 5vh;">
  60. </view>
  61. <template v-if="scantron.questionType===1||scantron.questionType===3">
  62. <view>
  63. <l-divider color="#aaaa7f">
  64. </l-divider>
  65. </view>
  66. <view>
  67. <radio-group>
  68. <label v-for="(item, index) in scantron.question.answerList" :key="item">
  69. <view>
  70. <button @click="radioAdd(item,index,scantron)"
  71. :style="'margin-top: 15px;padding-left:15px;font-size: 20px;text-align: left;background-color: '+(item.isRight?'#f9ea0d;':'#f0eff0')"><strong
  72. style="color: #0072eb;">{{item.tag+"、"}}</strong>{{item.content}}</button>
  73. </view>
  74. </label>
  75. </radio-group>
  76. </view>
  77. </template>
  78. <template v-if="scantron.questionType===2">
  79. <view>
  80. <l-divider color="#aaaa7f">
  81. </l-divider>
  82. </view>
  83. <view>
  84. <radio-group>
  85. <label v-for="(item, index) in scantron.question.answerList" :key="item.value">
  86. <view>
  87. <button @click="item.isRight=!item.isRight;radioAdd(item,index,scantron);"
  88. :style="'margin-top: 15px;padding-left:15px;font-size: 20px;text-align: left;background-color: '+(item.isRight?'#f9ea0d;':'#f0eff0')"><strong
  89. style="color: #0072eb;">{{item.tag+"、"}}</strong>{{item.content}}</button>
  90. </view>
  91. </label>
  92. </radio-group>
  93. </view>
  94. </template>
  95. <template v-if="scantron.questionType===4">
  96. <view>
  97. <l-divider color="#aaaa7f">
  98. </l-divider>
  99. </view>
  100. <view>
  101. <view>
  102. <view class="uni-textarea"
  103. style="border: #8c8c8c solid 2px;border-radius: 5px;height: 20vh;">
  104. <textarea @blur="radioAdd(null,null,scantron)"
  105. v-model="scantron.question.subjectiveAnswer"
  106. placeholder-style="color:#c7c7c7" placeholder="请输入答案" />
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <template v-if="scantron.questionType===5">
  112. <view>
  113. <l-divider color="#aaaa7f">
  114. </l-divider>
  115. </view>
  116. <view>
  117. <label v-for="(item, index) in scantron.question.answerList" :key="item.value">
  118. <view class="allceter"
  119. style="background-color: #e7f4ff; text-align: left;padding: 10px;margin-bottom: 10px;border: #2a7eeb solid 1px;border-radius: 5px;">
  120. <view style="display: inline-block;padding-left: 10px;">
  121. <strong style="font-size: 20px;color: #0072eb;">{{item.tag}}</strong>
  122. </view>
  123. <input @blur="radioAdd(item.blankcontent,item.tag,scantron)" class="uni-input"
  124. style="display: inline-block;background-color: white;" type="text"
  125. v-model="item.blankcontent" :placeholder="item.tag" />
  126. </view>
  127. </label>
  128. </view>
  129. </template>
  130. <template v-if="scantron.questionType===6">
  131. <view>
  132. <l-divider color="#aaaa7f">
  133. </l-divider>
  134. </view>
  135. <view class="" v-for="(combinationItem,index) in scantron.subQuestionList">
  136. <uni-card>
  137. <strong>{{scantron.questionIndex+'.'+combinationItem.questionIndex+'、'+combinationItem.questionTypeName}}</strong>
  138. <view :id="'combinationItemNodes'+index" style="height: 45vh;">
  139. <!-- <rich-text :nodes="combinationItem.question.content"></rich-text> -->
  140. </view>
  141. <template v-if="combinationItem.questionType===1||combinationItem.questionType===3">
  142. <view>
  143. <l-divider color="#aaaa7f">
  144. </l-divider>
  145. </view>
  146. <view>
  147. <radio-group>
  148. <label v-for="(item, index0) in combinationItem.question.answerList"
  149. :key="item">
  150. <view>
  151. <button @click="radioAdd(item,index0,scantron,combinationItem)"
  152. :style="'margin-top: 15px;padding-left:15px;font-size: 20px;text-align: left;background-color: '+(item.isRight?'#f9ea0d;':'#f0eff0')"><strong
  153. style="color: #0072eb;">{{item.tag+"、"}}</strong>{{item.content}}</button>
  154. </view>
  155. </label>
  156. </radio-group>
  157. </view>
  158. </template>
  159. <template v-if="combinationItem.questionType===2">
  160. <view>
  161. <l-divider color="#aaaa7f">
  162. </l-divider>
  163. </view>
  164. <view>
  165. <radio-group>
  166. <label v-for="(item, index) in combinationItem.question.answerList"
  167. :key="item.value">
  168. <view>
  169. <button
  170. @click="item.isRight=!item.isRight;radioAdd(item,index0,scantron,combinationItem);"
  171. :style="'margin-top: 15px;padding-left:15px;font-size: 20px;text-align: left;background-color: '+(item.isRight?'#f9ea0d;':'#f0eff0')"><strong
  172. style="color: #0072eb;">{{item.tag+"、"}}</strong>{{item.content}}</button>
  173. </view>
  174. </label>
  175. </radio-group>
  176. </view>
  177. </template>
  178. <template v-if="combinationItem.questionType===4">
  179. <view>
  180. <l-divider color="#aaaa7f">
  181. </l-divider>
  182. </view>
  183. <view>
  184. <view>
  185. <view class="uni-textarea"
  186. style="border: #8c8c8c solid 2px;border-radius: 5px;height: 20vh;">
  187. <textarea v-model="combinationItem.question.subjectiveAnswer"
  188. placeholder-style="color:#c7c7c7" placeholder="请输入答案" />
  189. </view>
  190. </view>
  191. </view>
  192. </template>
  193. <template v-if="combinationItem.questionType===5">
  194. <view>
  195. <l-divider color="#aaaa7f">
  196. </l-divider>
  197. </view>
  198. <view>
  199. <label v-for="(item, index) in combinationItem.question.answerList"
  200. :key="item.value">
  201. <view class="allceter"
  202. style="background-color: #e7f4ff; text-align: left;padding: 10px;margin-bottom: 10px;border: #2a7eeb solid 1px;border-radius: 5px;">
  203. <view style="display: inline-block;padding-left: 10px;">
  204. <strong
  205. style="font-size: 20px;color: #0072eb;">{{item.tag}}</strong>
  206. </view>
  207. <input
  208. @blur="radioAdd(item.blankcontent,item.tag,scantron,combinationItem)"
  209. class="uni-input"
  210. style="display: inline-block;background-color: white;"
  211. type="text" v-model="item.blankcontent"
  212. :placeholder="item.tag" />
  213. </view>
  214. </label>
  215. </view>
  216. </template>
  217. </uni-card>
  218. </view>
  219. </template>
  220. <template v-if="scantron.questionType===7">
  221. <button @click="restart">重置</button>
  222. <view>
  223. <l-divider color="#aaaa7f">
  224. </l-divider>
  225. </view>
  226. <view style="height: 600px;width: 800;background-color: #ffffff;">
  227. <movable-area
  228. :style="`height: 500px;width: 700px;background-color: #8c8c8c;margin: auto;background-image: url('${drag[this.scantron.questionIndex].background.url}');background-size:${drag[this.scantron.questionIndex].background.width}px ${drag[this.scantron.questionIndex].background.height}px;background-repeat: no-repeat;`">
  229. <!-- <rich-text :nodes="scantron.question.content"></rich-text> -->
  230. <!-- <img v-if="drag.background.url!==''" :style="`width:${drag.background.width} px;height:${drag.background.height} px;`" :src="drag.background.url"/> -->
  231. <template v-for="item in drag[this.scantron.questionIndex].answer">
  232. <view
  233. :style="`position: absolute;width: ${item.width}px;height: ${item.height}px;border:solid 1px black;left:${item.x}px;top:${item.y}px;`">
  234. </view>
  235. </template>
  236. <template v-for="item in drag[this.scantron.questionIndex].option">
  237. <movable-view v-if="mbvShow" :id="item.id" :disabled="!disabledDrag"
  238. :style="'width: '+item.width+'px;height: '+item.height+'px;background-color: '+item.backgroundColor+';'"
  239. direction="all" :x="item.x" :y="item.y" @mousedown="onMousedown(item)"
  240. @change="onChange">
  241. </movable-view>
  242. <movable-view v-if="!mbvShow" :id="item.id" :disabled="!disabledDrag"
  243. :style="'width: '+item.width+'px;height: '+item.height+'px;background-color: '+item.backgroundColor+';'"
  244. direction="all" :x="item.x" :y="item.y" @mousedown="onMousedown(item)"
  245. @change="onChange">
  246. </movable-view>
  247. </template>
  248. </movable-area>
  249. </view>
  250. </template>
  251. <template v-if="scantron.questionType===8">
  252. <view style="height: 5vh;">
  253. </view>
  254. <view>
  255. <l-divider color="#aaaa7f">
  256. </l-divider>
  257. </view>
  258. <view>
  259. <view
  260. style="height: 600px;width: 800px;background-color: #8c8c8c;margin: auto;padding-top: 50px;">
  261. <movable-area
  262. style="height: 550px;width: 700px;background-color: #f6f6f6;margin: auto;">
  263. <canvas canvas-id="lineCanvas" style="width: 700px; height: 500px;">
  264. <template v-for="(item,index) in connectionHtml">
  265. <view
  266. style="display: inline-block;margin-top: 30px;margin-left: 30px;margin-right: 70px;">
  267. <!-- <rich-text :nodes="item.innerHTML"></rich-text> -->
  268. <view v-for="(item0,index0) in item.children" :key="index">
  269. <view :id="'option'+index+'-'+(index0+1)"
  270. style="width: 90px;height: 100px;padding: 10px;padding-bottom:0 ;margin-bottom: 10px;border-radius: 5px;border: #007aff solid 1px;background-color: #e0eef9;overflow: hidden;">
  271. </view>
  272. </view>
  273. </view>
  274. </template>
  275. </canvas>
  276. </movable-area>
  277. </view>
  278. </view>
  279. </template>
  280. </uni-section>
  281. </scroll-view>
  282. </uni-card>
  283. </uni-col>
  284. <uni-col :span="4" style="margin-top: 30px">
  285. <uni-card style="height: 85vh;">
  286. <l-divider color="#8f960c" style="margin-top: 2%;">
  287. <view style="font-size: 1vw;">当前试卷时间</view>
  288. </l-divider>
  289. <view style="font-family: '微软雅黑', serif;color: #f90005;height: 4vh;text-align: center;padding:2%;">
  290. <strong style="font-size: 3vmin;">{{paperTime}}</strong>
  291. </view>
  292. <!-- <l-divider color="#8f960c">
  293. <view style="font-size: 2vmin;">考试时间</view>
  294. </l-divider>
  295. <view
  296. style="font-family: '微软雅黑', serif;font-size: 2vmin;color: #00aaf9;height: 30px;text-align: center;padding:10px;">
  297. 剩余:{{examTime}}
  298. </view> -->
  299. <l-divider color="#251e75">
  300. <view style="font-size: 2vmin;">答题卡</view>
  301. </l-divider>
  302. <view>
  303. <scroll-view scroll-y="true" style="height: 50vh;">
  304. <label v-for="(item, index) in examObject.answerCardList2" :key="item">
  305. <uni-section class="mb-10" :title="item.questionTypeName" type="line">
  306. <template v-for="sort in item.indexList">
  307. <view style="display: inline-block;margin-left: 5px;"
  308. @mousedown="radioScantron(sort)">
  309. <view>
  310. <button type="radio"
  311. :style="'width: 30px;height: 30px;padding:0px;color:#FFFFFF;font-size: 12px;text-align: center;background-color: '+(sort === scantron.questionIndex?'#b5aa09;':(this.examObject.userExamQuestionList[sort-1].question.isAnswer?'#18da59':'#007aff'))">{{sort}}</button>
  312. </view>
  313. <view>
  314. {{item.questionTypeName.replace("题","")}}
  315. </view>
  316. </view>
  317. </template>
  318. </uni-section>
  319. </label>
  320. </scroll-view>
  321. </view>
  322. <l-divider color="#251e75" />
  323. <view>
  324. <button type="primary" style="margin-top: 10px;font-size: 2vmin;"
  325. @click="previousQuestion">上一题</button>
  326. <button type="primary" style="margin-top: 10px;font-size: 2vmin;" @click="nextQuestion">下一题</button>
  327. </view>
  328. </uni-card>
  329. </uni-col>
  330. </uni-row>
  331. <uni-popup ref="message" type="message">
  332. <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
  333. </uni-popup>
  334. <uni-popup ref="inputDialog" type="dialog">
  335. <uni-popup-dialog ref="inputClose" title="提交试卷" @confirm="dialogInputConfirm">
  336. <view>
  337. <view>1、提交当前试卷后不可再次作答</view>
  338. <view>2、本试卷剩余时间不计入下一套</view>
  339. <view>3、最终试卷提交将结束考试</view>
  340. <view style="text-align: center;">确认提交?</view>
  341. </view>
  342. </uni-popup-dialog>
  343. </uni-popup>
  344. <uni-popup ref="cheat" type="dialog">
  345. <uni-popup-dialog style="width: 50vh;" ref="inputClose" title="作弊提醒">
  346. <view style="color: red;">
  347. <view>1、鼠标请勿点击窗口之外的地方</view>
  348. <view>2、如果不小心退出全屏,请按F11恢复到全屏</view>
  349. <view>3、鼠标多次点击窗口之外的地方将按作弊处理</view>
  350. </view>
  351. </uni-popup-dialog>
  352. </uni-popup>
  353. <uni-popup ref="answerFinal" type="dialog">
  354. <uni-popup-dialog style="width: 50vh;" ref="inputClose" title="当前已经到最后一题">
  355. <view style="color: #0b0ba5 ;">
  356. <view>请检查是否存在漏答题目,检查无误后,请点击“<strong style="font-size: 20px;color: #f00004 ;">交卷</strong>”</view>
  357. </view>
  358. </uni-popup-dialog>
  359. </uni-popup>
  360. </template>
  361. <script>
  362. import {
  363. exit,
  364. request,
  365. getExamDetail,
  366. cacheExamAnswer,
  367. getCacheAnswer,
  368. submitExamPaper,
  369. getExamQueryById
  370. } from '../../examJs/examRequest';
  371. import screenfull from "screenfull";
  372. import {
  373. redirectTo,
  374. toLogin
  375. } from '../../examJs/examRoute';
  376. import {
  377. windowState
  378. } from '../../util/examStartUtil';
  379. export default {
  380. name: "examStart",
  381. data() {
  382. return {
  383. // 所有方块============拖拽
  384. drag: [],
  385. // 拖拽元素刷新
  386. mbvShow: true,
  387. // 拖拽的方块信息
  388. dragItem: {},
  389. // 拖拽位置记录
  390. subDrag: [],
  391. // 拖拽后动作未完成禁用
  392. disabledDrag: true,
  393. // ==================================
  394. // 连线===============================
  395. // 连线题内容页面展示
  396. connectionHtml: [],
  397. // 连线题中间存储
  398. connectionInfo: [],
  399. // 连线题连线内容保存
  400. connectionContentALL: [],
  401. // 连线绘制
  402. ctx: null,
  403. // 点击过程颜色
  404. clickColor: '0px 0px 5px 2px rgba(80, 85, 83, 0.7)',
  405. // 点击结束颜色
  406. connectionColor: ['#ffaa00', '#00ff7f', '#6ca7ff', '#1d00ff', '#aa00ff', '#ffff00', '#550000', '#ff0000'],
  407. // ==============================
  408. // 所有试卷和试题
  409. examObject: {},
  410. // 当前题目
  411. examTopic: {},
  412. // 答题卡
  413. scantron: '',
  414. //选项
  415. answer: {},
  416. typeThree: '',
  417. userExamAnswers: [],
  418. user: {},
  419. // 拖动监听测试
  420. b: true,
  421. canvasWidth: 300,
  422. canvasHeight: 300,
  423. // 用户当前考试
  424. userExamPaper: {},
  425. // 倒计时实际时间
  426. examPaperTime: 0,
  427. // 除当前试卷的其他时间
  428. papersTime: 0,
  429. // 倒计时试卷显示时间
  430. paperTime: '',
  431. // 倒计时考试显示时间
  432. examTime: '',
  433. // 倒计时函数
  434. intervalId: null,
  435. // 切屏记录========================
  436. windowCheat: 0,
  437. // 切屏状态
  438. cheat: null,
  439. // 消息弹窗记录=================
  440. msgType: 'success',
  441. messageText: '这是一条成功提示',
  442. };
  443. },
  444. methods: {
  445. // 页面刷新
  446. reload() {
  447. cacheExamAnswer({
  448. 'examAnswers': this.userExamAnswers,
  449. 'userExamId': sessionStorage.getItem('examId'),
  450. 'leaveTime': this.windowCheat,
  451. 'paperId': this.userExamPaper.paperId,
  452. 'limitTime': this.userExamPaper.limitTime
  453. }).then(data => {
  454. console.log(data);
  455. window.location.reload()
  456. })
  457. },
  458. // 消息提示
  459. messageToggle(type, message) {
  460. this.msgType = type
  461. this.messageText = message
  462. this.$refs.message.open()
  463. },
  464. // 弹窗内容
  465. dialogInputConfirm(val) {
  466. this.submitExam()
  467. },
  468. // 提交试卷弹窗提示打开
  469. subExam() {
  470. this.$refs.inputDialog.open()
  471. },
  472. // 提交试卷
  473. submitExam(ins) {
  474. console.log(ins);
  475. submitExamPaper({
  476. 'examAnswers': this.userExamAnswers,
  477. 'userExamId': sessionStorage.getItem('examId'),
  478. 'paperId': this.userExamPaper.paperId,
  479. }).then(data => {
  480. if (data.data.result !== null && data.data.success) {
  481. if (ins !== 0 && ins !== 'cheat') {
  482. this.messageToggle('success', "本试卷提交成功,即将开始下一张试卷······")
  483. }
  484. this.userExamAnswers = []
  485. clearInterval(this.intervalId);
  486. this.examObject = data.data.result
  487. this.scantron = this.examObject.userExamQuestionList[0]
  488. this.userExamPaper = this.examObject.userExamPapersList[0]
  489. this.examPaperTime = this.addExamPaperTime(new Date(this.userExamPaper.systemTime),
  490. new Date(this
  491. .userExamPaper.limitTime))
  492. // 试卷计时
  493. this.papersTime = this.examPapersTime()
  494. this.intervalId = setInterval(this.updateCountDown, 1000);
  495. this.examTime = this.paperTime
  496. } else {
  497. if (ins === 'cheat') {
  498. this.messageToggle('error', "多次切屏,考试强行终止")
  499. } else if (ins !== 0) {
  500. this.messageToggle('success', "考试已结束,即将退出!")
  501. } else {
  502. this.messageToggle('warn', "时间已到,已为您自动交卷")
  503. }
  504. setTimeout(() => {
  505. screenfull.exit();
  506. window.removeEventListener('blur', this.handleBlur);
  507. window.removeEventListener('focus', this.handleFocus);
  508. exit()
  509. }, 2000)
  510. }
  511. if (data.data.result !== null && data.data.success && ins === 'cheat') {
  512. this.handleBlur(0)
  513. }
  514. })
  515. },
  516. // 重置
  517. restart() {
  518. this.disabledDrag = true
  519. this.drag[this.scantron.questionIndex].answer = []
  520. this.drag[this.scantron.questionIndex].option = []
  521. let content = this.stringToHTML(this.scantron.question.content)
  522. console.log(content);
  523. for (var i = 0; i < content.children.length; i++) {
  524. let thisTop = content.children[i].style.top.toString().replace("px", "")
  525. let thisLeft = content.children[i].style.left.toString().replace("px", "")
  526. let thisWidth = content.children[i].style.width.toString().replace("px", "")
  527. let thisHeight = content.children[i].style.height.toString().replace("px", "")
  528. let thisBackgroundColor = content.children[i].style.backgroundColor
  529. let thisInnerHTML = content.children[i].innerHTML
  530. if (content.children[i].id.includes("option")) {
  531. this.drag[this.scantron.questionIndex].option.push({
  532. id: content.children[i].id,
  533. x: Number(thisLeft),
  534. y: Number(thisTop),
  535. old: {
  536. x: 0,
  537. y: 0,
  538. ax: Number(thisLeft),
  539. by: Number(thisTop)
  540. },
  541. // 只添加一次拖拽监听
  542. b: true,
  543. width: thisWidth,
  544. height: thisHeight,
  545. backgroundColor: thisBackgroundColor,
  546. innerHTML: thisInnerHTML
  547. })
  548. }
  549. if (content.children[i].id.includes("answer")) {
  550. this.drag[this.scantron.questionIndex].answer.push({
  551. id: content.children[i].id,
  552. x: Number(thisLeft),
  553. y: Number(thisTop),
  554. old: {
  555. x: 0,
  556. y: 0
  557. },
  558. width: thisWidth,
  559. height: thisHeight,
  560. backgroundColor: thisBackgroundColor
  561. })
  562. }
  563. }
  564. },
  565. // 上一题目
  566. previousQuestion() {
  567. if (this.scantron.questionIndex > 1) {
  568. this.radioScantron(this.scantron.questionIndex - 1)
  569. }
  570. },
  571. // 下一题目
  572. nextQuestion() {
  573. if (this.scantron.questionIndex < this.examObject.userExamQuestionList.length) {
  574. // this.scantron = this.examObject.userExamQuestionList[this.scantron.questionIndex]
  575. this.radioScantron(this.scantron.questionIndex + 1)
  576. } else {
  577. this.$refs.answerFinal.open()
  578. }
  579. },
  580. // 答题卡单击题目
  581. radioScantron(value) {
  582. screenfull.request()
  583. this.scantron = this.examObject.userExamQuestionList[value - 1]
  584. if (this.scantron.questionType !== 7 && this.scantron.questionType !== 8) {
  585. document.getElementById('scantronNodes').innerHTML = this.scantron.question.content
  586. } else {
  587. console.log(this.scantron.question.content.split('%||||||||%')[0]);
  588. document.getElementById('scantronNodes').innerHTML = this.scantron.question.content.split(
  589. '%||||||||%')[0]
  590. }
  591. let combination = setInterval(() => {
  592. if (this.scantron.questionType == 6) {
  593. for (var i = 0; i < this.scantron.subQuestionList.length; i++) {
  594. if (document.getElementById('combinationItemNodes' + i) === null) {
  595. console.log("加载中");
  596. break;
  597. }
  598. document.getElementById('combinationItemNodes' + i).innerHTML = this.scantron
  599. .subQuestionList[i].question.content
  600. }
  601. clearInterval(combination);
  602. }
  603. }, 10)
  604. cacheExamAnswer({
  605. 'examAnswers': this.userExamAnswers,
  606. 'userExamId': sessionStorage.getItem('examId'),
  607. 'leaveTime': this.windowCheat,
  608. 'paperId': this.userExamPaper.paperId,
  609. 'limitTime': this.userExamPaper.limitTime
  610. })
  611. // 拖拽加载
  612. if (this.scantron.questionType == 7) {
  613. this.mbvShow = !this.mbvShow
  614. this.disabledDrag = true
  615. console.log(this.drag[8]);
  616. console.log(this.scantron.questionIndex);
  617. if (this.drag[Number(this.scantron.questionIndex)] !== undefined) {
  618. setTimeout(() => {
  619. for (var i = 0; i < this.drag[this.scantron.questionIndex].option.length; i++) {
  620. let drags = this.drag[this.scantron.questionIndex].option[i]
  621. console.log(document.getElementById(drags.id));
  622. document.getElementById(drags.id).innerHTML = drags.innerHTML
  623. }
  624. }, 10)
  625. return
  626. }
  627. this.drag[this.scantron.questionIndex] = {}
  628. this.drag[this.scantron.questionIndex].answer = []
  629. this.drag[this.scantron.questionIndex].option = []
  630. this.drag[this.scantron.questionIndex].background = {}
  631. let content = this.stringToHTML(this.scantron.question.content)
  632. for (var i = 0; i < content.children.length; i++) {
  633. let thisTop = content.children[i].style.top.toString().replace("px", "")
  634. let thisLeft = content.children[i].style.left.toString().replace("px", "")
  635. let thisWidth = content.children[i].style.width.toString().replace("px", "")
  636. let thisHeight = content.children[i].style.height.toString().replace("px", "")
  637. let thisBackgroundColor = content.children[i].style.backgroundColor
  638. let thisInnerHTML = content.children[i].innerHTML
  639. if (content.children[i].id.includes("option")) {
  640. this.drag[this.scantron.questionIndex].option.push({
  641. id: content.children[i].id,
  642. x: Number(thisLeft),
  643. y: Number(thisTop),
  644. old: {
  645. x: 0,
  646. y: 0,
  647. ax: Number(thisLeft),
  648. by: Number(thisTop)
  649. },
  650. // 只添加一次拖拽监听
  651. b: true,
  652. width: thisWidth,
  653. height: thisHeight,
  654. backgroundColor: thisBackgroundColor,
  655. innerHTML: thisInnerHTML
  656. })
  657. }
  658. if (content.children[i].id.includes("answer")) {
  659. this.drag[this.scantron.questionIndex].answer.push({
  660. id: content.children[i].id,
  661. x: Number(thisLeft),
  662. y: Number(thisTop),
  663. old: {
  664. x: 0,
  665. y: 0
  666. },
  667. width: thisWidth,
  668. height: thisHeight,
  669. backgroundColor: thisBackgroundColor
  670. })
  671. }
  672. if (content.children[i].tagName === 'IMG') {
  673. this.drag[this.scantron.questionIndex].background.url = content.children[i].src
  674. this.drag[this.scantron.questionIndex].background.width = content.children[i].style.width.toString()
  675. .replace("px", "")
  676. this.drag[this.scantron.questionIndex].background.height = content.children[i].style.height.toString()
  677. .replace("px", "")
  678. }
  679. }
  680. console.log(this.drag[this.scantron.questionIndex].option.length);
  681. setTimeout(() => {
  682. for (var i = 0; i < this.drag[this.scantron.questionIndex].option.length; i++) {
  683. let drags = this.drag[this.scantron.questionIndex].option[i]
  684. console.log(document.getElementById(drags.id));
  685. document.getElementById(drags.id).innerHTML = drags.innerHTML
  686. }
  687. }, 10)
  688. }
  689. // 连线题添加监听
  690. if (this.scantron.questionType == 8) {
  691. this.connectionHtml = []
  692. let content = this.stringToHTML(this.scantron.question.content)
  693. for (var i = 0; i < content.children.length; i++) {
  694. let child = content.children[i]
  695. for (var j = 0; j < child.children.length; j++) {
  696. if (child.children[j].id !== undefined && child.children[j].id.includes("option")) {
  697. this.connectionHtml.push(child.children[j])
  698. }
  699. }
  700. }
  701. if (this.connectionContentALL[value] === undefined) {
  702. this.connectionContentALL[value] = []
  703. }
  704. this.connectionInfo = []
  705. setTimeout(() => {
  706. // 画内容
  707. this.drawLineWriteContent()
  708. // 画缓存线
  709. this.drawLineWrite(value)
  710. }, 100)
  711. for (var i = 0; i < this.connectionHtml.length; i++) {
  712. let option = this.connectionHtml[i]
  713. for (var j = 0; j < option.children.length; j++) {
  714. let ids = "option" + i + "-" + (j + 1)
  715. if (document.getElementById(ids) === null) {
  716. setTimeout(() => {
  717. let optionCol = document.getElementById(ids)
  718. optionCol.addEventListener("mousedown", (event) => {
  719. console.log(event);
  720. let id = event.currentTarget.id
  721. console.log(id);
  722. let colId = Number(id.replace('option', '').split('-')[0])
  723. let rowId = Number(id.replace('option', '').split('-')[1])
  724. let left = event.target.offsetLeft
  725. let right = Number(event.target.offsetLeft + event.target
  726. .offsetWidth)
  727. let top = Number(event.target.offsetTop + event.target
  728. .offsetHeight / 2)
  729. if (this.connectionInfo.length === this.connectionHtml.length &&
  730. colId === 0) {
  731. this.connectionContentALL[this.scantron.questionIndex].push(this
  732. .connectionInfo)
  733. this.radioAdd(this.connectionInfo, this
  734. .connectionInfo[0].id.replace('option', '').split('-')[
  735. 1], this.scantron)
  736. this.connectionInfo = []
  737. }
  738. console.log(this.connectionContentALL);
  739. console.log(this.scantron.questionIndex);
  740. let arr = []
  741. for (var i = 0; i < this.connectionContentALL[this.scantron.questionIndex]
  742. .length; i++) {
  743. let all = this.connectionContentALL[this.scantron.questionIndex][i]
  744. if (all[0].id !== id) {
  745. arr.push(this.connectionContentALL[this.scantron.questionIndex][i])
  746. }
  747. }
  748. this.connectionContentALL[this.scantron.questionIndex] = arr
  749. let infoLength = this.connectionInfo.length
  750. if (infoLength <= this.connectionHtml.length) {
  751. if (infoLength !== 0) {
  752. if (!this.isLine(id, this.scantron.questionIndex)) {
  753. this.messageToggle('error', "这个已经连过了")
  754. this.drawLineWrite(this.scantron.questionIndex)
  755. return
  756. }
  757. let last = this.connectionInfo[infoLength -
  758. 1]
  759. let lastId = Number(last.id.replace('option', '').split(
  760. '-')[0])
  761. if (lastId + 1 === colId) {
  762. this.connectionInfo.push({
  763. 'id': id,
  764. 'left': left,
  765. 'right': right,
  766. 'top': top
  767. })
  768. }
  769. if (lastId === colId && colId !== this.connectionHtml
  770. .length - 1) {
  771. this.connectionInfo[infoLength - 1] = {
  772. 'id': id,
  773. 'left': left,
  774. 'right': right,
  775. 'top': top
  776. }
  777. document.getElementById(ids).style.boxShadow = this
  778. .clickColor
  779. if (Number(last.id.replace('option', '').split(
  780. '-')[1]) === rowId &&
  781. this.connectionInfo.length === this.connectionHtml
  782. .length) {
  783. this.connectionContentALL[this.scantron.questionIndex].push(
  784. this.connectionInfo)
  785. console.log(this.connectionContentALL[this.scantron.questionIndex]);
  786. this.radioAdd(this.connectionInfo, this
  787. .connectionInfo[0].id.replace('option', '')
  788. .split('-')[1], this.scantron)
  789. this.connectionInfo = []
  790. }
  791. } else if (colId === this.connectionHtml.length - 1) {
  792. this.connectionContentALL[this.scantron.questionIndex].push(
  793. this.connectionInfo)
  794. this.radioAdd(this.connectionInfo, this
  795. .connectionInfo[0].id.replace('option', '')
  796. .split('-')[1], this.scantron)
  797. this.connectionInfo = []
  798. }
  799. } else if (infoLength === 0) {
  800. if (colId === 0) {
  801. this.connectionInfo.push({
  802. 'id': id,
  803. 'left': left,
  804. 'right': right,
  805. 'top': top
  806. })
  807. console.log(document.getElementById(id + ''));
  808. document.getElementById(id + '').style.boxShadow = this
  809. .clickColor
  810. console.log(document.getElementById(id));
  811. }
  812. }
  813. }
  814. this.shadowClean()
  815. this.drawLineWrite(this.scantron.questionIndex)
  816. })
  817. }, 10)
  818. } else {
  819. setTimeout(() => {
  820. this.shadowClean()
  821. }, 10)
  822. }
  823. }
  824. }
  825. }
  826. },
  827. // 连线绘制
  828. drawLine(x1, y1, x2, y2, index) {
  829. this.ctx = uni.createCanvasContext('lineCanvas');
  830. this.ctx.beginPath();
  831. let color = this.connectionColor[index]
  832. if (index === -1) {
  833. color = '#000000'
  834. this.ctx.shadowColor = 'red';
  835. // 设置阴影的模糊级别
  836. this.ctx.setshadowBlur = 100;
  837. // 设置阴影的水平偏移
  838. this.ctx.shadowOffsetX = 1;
  839. // 设置阴影的垂直偏移
  840. this.ctx.shadowOffsetY = 1;
  841. } else {
  842. this.ctx.shadowColor = '#000000';
  843. this.ctx.setshadowBlur = 0;
  844. this.ctx.shadowOffsetX = 0;
  845. this.ctx.shadowOffsetY = 0;
  846. }
  847. this.ctx.setStrokeStyle(color)
  848. this.ctx.lineWidth = 3
  849. this.ctx.moveTo(x1, y1); // 开始点
  850. this.ctx.lineTo(x2, y2); // 结束点
  851. this.ctx.stroke(); // 绘制线条
  852. this.ctx.draw(true);
  853. },
  854. // 连线清理
  855. clearRect() {
  856. const canvas = uni.createCanvasContext('lineCanvas');
  857. // 使用clearRect方法清空整个画布
  858. canvas.clearRect(0, 0, 700, 500); // 这里的300x300是画布的宽高,应该与你的实际画布尺寸相匹配
  859. canvas.draw(true); // 调用draw方法将清空操作应用到画布上
  860. },
  861. // 阴影清理
  862. shadowClean() {
  863. for (var i = 0; i < this.connectionHtml.length; i++) {
  864. let option = this.connectionHtml[i]
  865. for (var j = 0; j < option.children.length; j++) {
  866. let ids = "option" + i + "-" + (j + 1)
  867. document.getElementById(ids).style.boxShadow = ''
  868. }
  869. }
  870. },
  871. isLine(id, value) {
  872. for (var i = 0; i < this.connectionContentALL[value].length; i++) {
  873. let option = this.connectionContentALL[value][i]
  874. for (var j = 0; j < option.length; j++) {
  875. let oldId = option[j].id
  876. if (oldId === id) {
  877. return false
  878. }
  879. }
  880. }
  881. return true
  882. },
  883. // 连线题画内容
  884. drawLineWriteContent() {
  885. for (var i = 0; i < this.connectionHtml.length; i++) {
  886. let option = this.connectionHtml[i]
  887. for (var j = 0; j < option.children.length; j++) {
  888. let ids = "option" + i + "-" + (j + 1)
  889. document.getElementById(ids).innerHTML = option.children[j].innerHTML
  890. }
  891. }
  892. }, // 连线画线
  893. drawLineWrite(value) {
  894. this.clearRect()
  895. if (this.connectionInfo.length >= 2) {
  896. for (var i = 0; i < this.connectionInfo.length - 1; i++) {
  897. let one = this.connectionInfo[i]
  898. let two = this.connectionInfo[i + 1]
  899. // box-shadow: ;
  900. document.getElementById(one.id).style.boxShadow = this.clickColor
  901. document.getElementById(two.id).style.boxShadow = this.clickColor
  902. this.drawLine(one.right, one.top, two.left, two.top, -1)
  903. }
  904. } else if (this.connectionInfo.length === 1) {
  905. document.getElementById(this.connectionInfo[0].id).style.boxShadow = this.clickColor
  906. }
  907. for (var i = 0; i < this.connectionContentALL[value].length; i++) {
  908. let option = this.connectionContentALL[value][i]
  909. for (var j = 0; j < option.length - 1; j++) {
  910. let one = option[j]
  911. let two = option[j + 1]
  912. document.getElementById(one.id).style.boxShadow = '0px 0px 5px 2px ' + this.connectionColor[i]
  913. document.getElementById(two.id).style.boxShadow = '0px 0px 5px 2px ' + this.connectionColor[i]
  914. this.drawLine(one.right, one.top, two.left, two.top, i)
  915. }
  916. }
  917. },
  918. // 字符转换html对象
  919. stringToHTML(str) {
  920. var dom = document.createElement('div');
  921. dom.innerHTML = str;
  922. return dom;
  923. },
  924. // 拖动位置固定
  925. tap(index, subX, subY) {
  926. let x = subX
  927. let y = subY
  928. this.drag[this.scantron.questionIndex].option[index].x = this.drag[this.scantron.questionIndex].option[index].old.x
  929. this.drag[this.scantron.questionIndex].option[index].y = this.drag[this.scantron.questionIndex].option[index].old.y
  930. this.$nextTick(function() {
  931. this.drag[this.scantron.questionIndex].option[index].x = x
  932. this.drag[this.scantron.questionIndex].option[index].y = y
  933. })
  934. },
  935. // 鼠标按下
  936. onMousedown(item) {
  937. console.log(this.drag[this.scantron.questionIndex].option.length);
  938. this.dragItem = item;
  939. },
  940. // 拖动监听
  941. onChange: function(e) {
  942. if (!this.disabledDrag) {
  943. return
  944. }
  945. let index = -1
  946. for (var j = 0; j < this.drag[this.scantron.questionIndex].option.length; j++) {
  947. let option = this.drag[this.scantron.questionIndex].option[j]
  948. if (option.id === this.dragItem.id) {
  949. index = j
  950. break;
  951. }
  952. }
  953. this.drag[this.scantron.questionIndex].option[index].old.x = e.detail.x
  954. this.drag[this.scantron.questionIndex].option[index].old.y = e.detail.y
  955. let asda = (event) => {
  956. document.removeEventListener('mouseup', asda)
  957. this.disabledDrag = false
  958. let dragOne;
  959. let bxs = true
  960. // 处理鼠标抬起事件
  961. for (var i = 0; i < this.drag[this.scantron.questionIndex].answer.length; i++) {
  962. let drag = this.drag[this.scantron.questionIndex].answer[i]
  963. let x = drag.x
  964. let y = drag.y
  965. if (
  966. (Number(this.drag[this.scantron.questionIndex].option[index].old.x) <= (Number(drag.x) + Number(
  967. drag
  968. .width))) &&
  969. (Number(this.drag[this.scantron.questionIndex].option[index].old.x) + Number(this.drag[this.scantron.questionIndex].option[index]
  970. .width)) >= drag.x &&
  971. (Number(this.drag[this.scantron.questionIndex].option[index].old.y) <= (Number(drag.y) + Number(
  972. drag
  973. .height))) &&
  974. (Number(this.drag[this.scantron.questionIndex].option[index].old.y) + Number(this.drag[this.scantron.questionIndex].option[index]
  975. .height)) >= drag.y
  976. ) {
  977. for (var p = 0; p < this.drag[this.scantron.questionIndex].answer.length; p++) {
  978. if (this.drag[this.scantron.questionIndex].answer[p].op !== undefined && this.drag[this.scantron.questionIndex].answer[p].op === index) {
  979. this.drag[this.scantron.questionIndex].answer[p].op = undefined
  980. }
  981. }
  982. if (this.drag[this.scantron.questionIndex].answer[i].op !== undefined) {
  983. this.tap(this.drag[this.scantron.questionIndex].answer[i].op, this.drag[this.scantron.questionIndex]
  984. .option[this.drag[this.scantron.questionIndex].answer[i].op].old.ax, this.drag[this.scantron.questionIndex]
  985. .option[this.drag[this.scantron.questionIndex].answer[i].op].old.by);
  986. this.drag[this.scantron.questionIndex].answer[i].op = index
  987. } else {
  988. this.drag[this.scantron.questionIndex].answer[i].op = index
  989. }
  990. this.tap(index, x, y);
  991. dragOne = drag
  992. bxs = false
  993. break;
  994. }
  995. }
  996. // console.log(this.drag[this.scantron.questionIndex].option[index]);
  997. if (bxs) {
  998. this.tap(index, this.drag[this.scantron.questionIndex].option[index].old.ax, this.drag[this.scantron.questionIndex].option[index].old.by);
  999. }
  1000. setTimeout(() => {
  1001. if (dragOne !== undefined) {
  1002. this.radioAdd(this.dragItem, dragOne.id.replace("answer", ""), this.scantron)
  1003. }
  1004. this.disabledDrag = true
  1005. }, 700)
  1006. }
  1007. // if (this.drag[this.scantron.questionIndex].option[index].b) {
  1008. // this.drag[this.scantron.questionIndex].option[index].b = false
  1009. document.addEventListener('mouseup', asda);
  1010. // }
  1011. },
  1012. //缓存答案读取
  1013. answerDisplay(data) {
  1014. this.windowCheat = Number(data.leaveTime)
  1015. this.userExamAnswers = data.examAnswers
  1016. let examAnswers = data.examAnswers
  1017. for (var i = 0; i < examAnswers.length; i++) {
  1018. let scantron = examAnswers[i]
  1019. let index = Number(scantron.index)
  1020. if (scantron.index.includes('.')) {
  1021. let parentIndex = Number(scantron.index.split('.')[0])
  1022. let childIndex = scantron.index.split('.')[1]
  1023. let childSubject = this.examObject.userExamQuestionList[parentIndex - 1].subQuestionList[
  1024. childIndex]
  1025. console.log(childSubject);
  1026. } else if (scantron.questionType === 1 || scantron.questionType === 3) {
  1027. console.log(this.examObject.userExamQuestionList[index - 1]);
  1028. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1029. this.examObject.userExamQuestionList[index - 1].question.answerList[Number(scantron.answerIndex[
  1030. 0])]
  1031. .isRight = true
  1032. } else if (scantron.questionType === 2) {
  1033. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1034. for (var j = 0; j < scantron.answerIndex.length; j++) {
  1035. this.examObject.userExamQuestionList[index - 1].question.answerList[Number(scantron
  1036. .answerIndex[j])].isRight = true
  1037. }
  1038. } else if (scantron.questionType === 4) {
  1039. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1040. this.examObject.userExamQuestionList[index - 1].question.subjectiveAnswer = scantron
  1041. .subjectiveAnswer
  1042. } else if (scantron.questionType === 5) {
  1043. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1044. let blankAnswer = JSON.parse(scantron.blankAnswer)
  1045. for (var k = 0; k < blankAnswer.length; k++) {
  1046. for (var j = 0; j < this.examObject.userExamQuestionList[index - 1].question.answerList
  1047. .length; j++) {
  1048. if (this.examObject.userExamQuestionList[index - 1].question.answerList[j].tag ===
  1049. blankAnswer[k].tag) {
  1050. this.examObject.userExamQuestionList[index - 1].question.answerList[j].blankcontent =
  1051. blankAnswer[k].content
  1052. }
  1053. }
  1054. }
  1055. } else if (scantron.questionType === 7) {
  1056. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1057. let blankAnswer = JSON.parse(scantron.blankAnswer)
  1058. for (var k = 0; k < blankAnswer.length; k++) {
  1059. for (var j = 0; j < this.examObject.userExamQuestionList[index - 1].question.answerList
  1060. .length; j++) {
  1061. if (this.examObject.userExamQuestionList[index - 1].question.answerList[j].tag ===
  1062. blankAnswer[k].tag) {
  1063. this.examObject.userExamQuestionList[index - 1].question.answerList[j].blankcontent =
  1064. blankAnswer[k].content
  1065. }
  1066. }
  1067. }
  1068. this.drag[index] = JSON.parse(scantron.coordinates)
  1069. } else if (scantron.questionType === 8) {
  1070. console.log(scantron);
  1071. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1072. let blankAnswer = JSON.parse(scantron.blankAnswer)
  1073. for (var k = 0; k < blankAnswer.length; k++) {
  1074. for (var j = 0; j < this.examObject.userExamQuestionList[index - 1].question.answerList
  1075. .length; j++) {
  1076. if (this.examObject.userExamQuestionList[index - 1].question.answerList[j].tag ===
  1077. blankAnswer[k].tag) {
  1078. this.examObject.userExamQuestionList[index - 1].question.answerList[j].blankcontent =
  1079. blankAnswer[k].content
  1080. }
  1081. }
  1082. }
  1083. this.connectionContentALL[index] = JSON.parse(scantron.coordinates)
  1084. }
  1085. }
  1086. },
  1087. // 题目做答
  1088. radioAdd(value, index, scantron, combinationItem) {
  1089. index = index + ''
  1090. let qIndex = scantron.questionIndex + ""
  1091. let arr = []
  1092. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = true
  1093. if (scantron.questionType === 1 || scantron.questionType === 3) {
  1094. for (var i = 0; i < scantron.question.answerList.length; i++) {
  1095. scantron.question.answerList[i].isRight = false
  1096. }
  1097. scantron.question.answerList[index].isRight = true
  1098. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1099. if (this.userExamAnswers[i].index !== qIndex) {
  1100. arr.push(this.userExamAnswers[i])
  1101. }
  1102. }
  1103. arr.push({
  1104. answerIndex: [index],
  1105. answers: [value.id],
  1106. index: qIndex,
  1107. questionType: scantron.questionType
  1108. })
  1109. } else if (scantron.questionType === 2) {
  1110. let b = true
  1111. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1112. if (this.userExamAnswers[i].index !== qIndex) {
  1113. arr.push(this.userExamAnswers[i])
  1114. } else {
  1115. b = false
  1116. let bc = true
  1117. let arrAnswer = []
  1118. let arrAnswerId = []
  1119. let num = this.userExamAnswers[i].answers.length;
  1120. for (var j = 0; j < num; j++) {
  1121. if (this.userExamAnswers[i].answerIndex[j] !== index) {
  1122. arrAnswer.push(this.userExamAnswers[i].answerIndex[j])
  1123. arrAnswerId.push(this.userExamAnswers[i].answers[j])
  1124. } else {
  1125. if (!value.isRight) {
  1126. bc = false
  1127. }
  1128. }
  1129. }
  1130. if (bc) {
  1131. arrAnswer.push(index)
  1132. arrAnswerId.push(value.id)
  1133. }
  1134. if (arrAnswer.length !== 0) {
  1135. arr.push({
  1136. answerIndex: arrAnswer,
  1137. answers: arrAnswerId,
  1138. index: qIndex,
  1139. questionType: scantron.questionType
  1140. })
  1141. } else {
  1142. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1143. }
  1144. }
  1145. }
  1146. if (b) {
  1147. arr.push({
  1148. answerIndex: [index],
  1149. answers: [value.id],
  1150. index: qIndex,
  1151. questionType: scantron.questionType
  1152. })
  1153. }
  1154. } else if (scantron.questionType === 4) {
  1155. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1156. if (this.userExamAnswers[i].index !== qIndex) {
  1157. arr.push(this.userExamAnswers[i])
  1158. }
  1159. }
  1160. if (scantron.question.subjectiveAnswer === null || scantron.question.subjectiveAnswer === "") {
  1161. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1162. }
  1163. arr.push({
  1164. subjectiveAnswer: scantron.question.subjectiveAnswer,
  1165. index: qIndex,
  1166. questionType: scantron.questionType
  1167. })
  1168. } else if (scantron.questionType === 5) {
  1169. if (value === undefined) {
  1170. return
  1171. }
  1172. let b = true
  1173. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1174. if (this.userExamAnswers[i].index !== qIndex) {
  1175. arr.push(this.userExamAnswers[i])
  1176. } else {
  1177. b = false
  1178. let bc = true
  1179. let arrAnswer = []
  1180. let blankAnswer = JSON.parse(this.userExamAnswers[i].blankAnswer)
  1181. let num = blankAnswer.length;
  1182. for (var j = 0; j < num; j++) {
  1183. if (blankAnswer[j].tag !== index) {
  1184. arrAnswer.push({
  1185. tag: blankAnswer[j].tag,
  1186. content: blankAnswer[j].content
  1187. })
  1188. } else {
  1189. bc = false
  1190. }
  1191. }
  1192. if (bc) {
  1193. arrAnswer.push({
  1194. tag: index,
  1195. content: value
  1196. })
  1197. }
  1198. if (arrAnswer.length !== 0) {
  1199. arr.push({
  1200. blankAnswer: JSON.stringify(arrAnswer),
  1201. index: qIndex,
  1202. questionType: scantron.questionType
  1203. })
  1204. } else {
  1205. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1206. }
  1207. }
  1208. }
  1209. if (b) {
  1210. if (value === null || value === "") {
  1211. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1212. }
  1213. arr.push({
  1214. blankAnswer: JSON.stringify([{
  1215. tag: index,
  1216. content: value
  1217. }]),
  1218. index: qIndex,
  1219. questionType: scantron.questionType
  1220. })
  1221. }
  1222. } else if (scantron.questionType === 6) {
  1223. qIndex = qIndex + "." + combinationItem.sort
  1224. if (combinationItem.questionType === 1 || combinationItem.questionType ===
  1225. 3) {
  1226. for (var j = 0; j < combinationItem.question.answerList.length; j++) {
  1227. combinationItem.question.answerList[j].isRight = false
  1228. }
  1229. combinationItem.question.answerList[index].isRight = true
  1230. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1231. if (this.userExamAnswers[j].index !== qIndex) {
  1232. arr.push(this.userExamAnswers[j])
  1233. }
  1234. }
  1235. arr.push({
  1236. answerIndex: [index],
  1237. answers: [value.id],
  1238. index: qIndex,
  1239. questionType: combinationItem.questionType
  1240. })
  1241. } else if (combinationItem.questionType === 2) {
  1242. let b = true
  1243. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1244. if (this.userExamAnswers[j].index !== qIndex) {
  1245. arr.push(this.userExamAnswers[j])
  1246. } else {
  1247. b = false
  1248. let bca = true
  1249. let arrAnswer = []
  1250. let arrAnswerId = []
  1251. let num = this.userExamAnswers[j].answers.length;
  1252. for (var k = 0; k < num; k++) {
  1253. if (this.userExamAnswers[j].answerIndex[k] !== index) {
  1254. arrAnswer.push(this.userExamAnswers[j].answerIndex[k])
  1255. arrAnswerId.push(this.userExamAnswers[j].answers[k])
  1256. } else {
  1257. if (!value.isRight) {
  1258. bca = false
  1259. }
  1260. }
  1261. }
  1262. if (bca) {
  1263. arrAnswer.push(index)
  1264. arrAnswerId.push(value.id)
  1265. }
  1266. if (arrAnswer.length !== 0) {
  1267. arr.push({
  1268. answerIndex: arrAnswer,
  1269. answers: arrAnswerId,
  1270. index: qIndex,
  1271. questionType: combinationItem.questionType
  1272. })
  1273. } else {
  1274. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question
  1275. .isAnswer =
  1276. false
  1277. }
  1278. }
  1279. }
  1280. if (b) {
  1281. arr.push({
  1282. answerIndex: [index],
  1283. answers: [value.id],
  1284. index: qIndex,
  1285. questionType: combinationItem.questionType
  1286. })
  1287. }
  1288. } else if (combinationItem.questionType === 4) {
  1289. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1290. if (this.userExamAnswers[j].index !== qIndex) {
  1291. arr.push(this.userExamAnswers[j])
  1292. }
  1293. }
  1294. if (combinationItem.question.subjectiveAnswer === null || scantron.subQuestionList[
  1295. i].question.subjectiveAnswer === "") {
  1296. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1297. }
  1298. arr.push({
  1299. subjectiveAnswer: combinationItem.question.subjectiveAnswer,
  1300. index: qIndex,
  1301. questionType: combinationItem.questionType
  1302. })
  1303. } else if (combinationItem.questionType === 5) {
  1304. if (value === undefined) {
  1305. return
  1306. }
  1307. let b = true
  1308. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1309. if (this.userExamAnswers[j].index !== qIndex) {
  1310. arr.push(this.userExamAnswers[j])
  1311. } else {
  1312. b = false
  1313. let bc = true
  1314. let arrAnswer = []
  1315. let blankAnswer = JSON.parse(this.userExamAnswers[j].blankAnswer)
  1316. let num = blankAnswer.length;
  1317. for (var q = 0; q < num; q++) {
  1318. if (blankAnswer[q].tag !== index) {
  1319. arrAnswer.push({
  1320. tag: blankAnswer[q].tag,
  1321. content: blankAnswer[q].content
  1322. })
  1323. } else {
  1324. bc = false
  1325. }
  1326. }
  1327. if (bc) {
  1328. arrAnswer.push({
  1329. tag: index,
  1330. content: value
  1331. })
  1332. }
  1333. if (arrAnswer.length !== 0) {
  1334. arr.push({
  1335. blankAnswer: JSON.stringify(arrAnswer),
  1336. index: qIndex,
  1337. questionType: scantron.subQuestionList[i].questionType
  1338. })
  1339. } else {
  1340. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question
  1341. .isAnswer = false
  1342. }
  1343. }
  1344. }
  1345. if (b) {
  1346. if (value === null || value === "") {
  1347. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1348. }
  1349. console.log(qIndex);
  1350. console.log(scantron);
  1351. console.log(this.examObject.userExamQuestionList[scantron.questionIndex - 1].subQuestionList[
  1352. Number(combinationItem.sort)]);
  1353. arr.push({
  1354. blankAnswer: JSON.stringify([{
  1355. tag: index,
  1356. content: value
  1357. }]),
  1358. index: qIndex,
  1359. questionType: scantron.subQuestionList[i].questionType
  1360. })
  1361. }
  1362. }
  1363. } else if (scantron.questionType === 7) {
  1364. if (value === undefined) {
  1365. return
  1366. }
  1367. index = (Number(index) + 1) + ""
  1368. let b = true
  1369. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1370. if (this.userExamAnswers[i].index !== qIndex) {
  1371. arr.push(this.userExamAnswers[i])
  1372. } else {
  1373. b = false
  1374. let bc = true
  1375. let arrAnswer = []
  1376. let blankAnswer = JSON.parse(this.userExamAnswers[i].blankAnswer)
  1377. let num = blankAnswer.length;
  1378. for (var j = 0; j < num; j++) {
  1379. if (blankAnswer[j].tag !== index) {
  1380. arrAnswer.push({
  1381. tag: blankAnswer[j].tag,
  1382. content: blankAnswer[j].content
  1383. })
  1384. } else {
  1385. arrAnswer.push({
  1386. tag: index,
  1387. content: value.id
  1388. })
  1389. bc = false
  1390. }
  1391. }
  1392. if (bc) {
  1393. arrAnswer.push({
  1394. tag: index,
  1395. content: value.id
  1396. })
  1397. }
  1398. if (arrAnswer.length !== 0) {
  1399. arr.push({
  1400. blankAnswer: JSON.stringify(arrAnswer),
  1401. coordinates: JSON.stringify(this.drag[qIndex]),
  1402. index: qIndex,
  1403. questionType: scantron.questionType
  1404. })
  1405. } else {
  1406. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1407. }
  1408. }
  1409. }
  1410. if (b) {
  1411. if (value === null || value === "") {
  1412. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1413. }
  1414. arr.push({
  1415. blankAnswer: JSON.stringify([{
  1416. tag: index,
  1417. content: value.id
  1418. }]),
  1419. coordinates: JSON.stringify(this.drag[qIndex]),
  1420. index: qIndex,
  1421. questionType: scantron.questionType
  1422. })
  1423. }
  1424. } else if (scantron.questionType === 8) {
  1425. console.log(this.connectionContentALL[qIndex]);
  1426. let info = value
  1427. value = ""
  1428. for (var i = 0; i < info.length; i++) {
  1429. console.log(info);
  1430. value += info[i].id.replace('option', '').split('-')[1]
  1431. }
  1432. // connectingCoordinates
  1433. if (value === undefined) {
  1434. return
  1435. }
  1436. let b = true
  1437. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1438. if (this.userExamAnswers[j].index !== qIndex) {
  1439. arr.push(this.userExamAnswers[j])
  1440. } else {
  1441. b = false
  1442. let bc = true
  1443. let arrAnswer = []
  1444. let blankAnswer = JSON.parse(this.userExamAnswers[j].blankAnswer)
  1445. let num = blankAnswer.length;
  1446. for (var q = 0; q < num; q++) {
  1447. if (blankAnswer[q].tag !== index) {
  1448. arrAnswer.push({
  1449. tag: blankAnswer[q].tag,
  1450. content: blankAnswer[q].content
  1451. })
  1452. } else {
  1453. bc = false
  1454. }
  1455. }
  1456. if (bc) {
  1457. arrAnswer.push({
  1458. tag: index,
  1459. content: value
  1460. })
  1461. }
  1462. if (arrAnswer.length !== 0) {
  1463. arr.push({
  1464. blankAnswer: JSON.stringify(arrAnswer),
  1465. index: qIndex,
  1466. coordinates: JSON.stringify(this.connectionContentALL[qIndex]),
  1467. questionType: scantron.questionType
  1468. })
  1469. } else {
  1470. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question
  1471. .isAnswer =
  1472. false
  1473. }
  1474. }
  1475. }
  1476. if (b) {
  1477. if (value === null || value === "") {
  1478. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer =
  1479. false
  1480. }
  1481. arr.push({
  1482. blankAnswer: JSON.stringify([{
  1483. tag: index,
  1484. content: value
  1485. }]),
  1486. coordinates: JSON.stringify(this.connectionContentALL[qIndex]),
  1487. index: qIndex,
  1488. questionType: scantron.questionType
  1489. })
  1490. }
  1491. }
  1492. this.userExamAnswers = arr
  1493. },
  1494. // 失去焦点时的处理函数
  1495. handleBlur(v) {
  1496. console.log("作弊监听启动:"+this.examObject.leaveOn);
  1497. if (this.examObject.leaveOn) {
  1498. if (this.windowCheat < 2 && v !== 0) {
  1499. this.$refs.cheat.open()
  1500. }
  1501. let leaveCount = this.examObject.totalLeaveTimes
  1502. let leaveTime = this.examObject.leaveTime
  1503. this.cheat = setInterval(() => {
  1504. this.windowCheat++
  1505. cacheExamAnswer({
  1506. 'examAnswers': this.userExamAnswers,
  1507. 'userExamId': sessionStorage.getItem('examId'),
  1508. 'leaveTime': this.windowCheat,
  1509. 'paperId': this.userExamPaper.paperId,
  1510. 'limitTime': this.userExamPaper.limitTime
  1511. })
  1512. clearInterval(this.cheat)
  1513. }, leaveTime * 1000)
  1514. }
  1515. },
  1516. // 获得焦点时的处理函数
  1517. handleFocus() {
  1518. if (this.examObject.leaveOn) {
  1519. clearInterval(this.cheat)
  1520. if (this.windowCheat >= leaveCount) {
  1521. this.submitExam('cheat')
  1522. }
  1523. }
  1524. },
  1525. // 时间
  1526. addExamPaperTime(systemTime, endTime) {
  1527. return (endTime.getTime() - systemTime.getTime()) / 1000
  1528. },
  1529. // 更新倒计时函数
  1530. updateCountDown() {
  1531. var distance = this.examPaperTime;
  1532. this.examPaperTime = this.examPaperTime - 1
  1533. if (distance < 0) {
  1534. clearInterval(this.intervalId);
  1535. console.log(0);
  1536. this.messageToggle('warn', "时间已到,2秒后为您自动交卷")
  1537. setTimeout(() => {
  1538. this.submitExam(0)
  1539. }, 2000)
  1540. return;
  1541. }
  1542. // 计算时分秒
  1543. var seconds = Math.floor((distance % (60)));
  1544. var minutes = Math.floor((distance % (60 * 60)) / (60));
  1545. var hours = Math.floor(distance / (60 * 60));
  1546. if (hours != 0) {
  1547. this.paperTime = hours + ":" + (minutes.toString().length == 2 ? minutes : '0' + minutes) + ":" + (
  1548. seconds.toString().length == 2 ? seconds : '0' + seconds)
  1549. } else {
  1550. this.paperTime = (minutes.toString().length == 2 ? minutes : '0' + minutes) + ":" + (seconds.toString()
  1551. .length == 2 ? seconds : '0' + seconds)
  1552. }
  1553. let examTime = this.papersTime + distance
  1554. // 计算考試时分秒
  1555. var examTimeseconds = Math.floor((examTime % (60)));
  1556. var examTimeminutes = Math.floor((examTime % (60 * 60)) / (60));
  1557. var examTimehours = Math.floor(examTime / (60 * 60));
  1558. if (examTimehours != 0) {
  1559. this.examTime = examTimehours + ":" + (examTimeminutes.toString().length == 2 ? examTimeminutes : '0' +
  1560. examTimeminutes) + ":" + (
  1561. seconds.toString().length == 2 ? examTimeseconds : '0' + examTimeseconds)
  1562. } else {
  1563. this.examTime = (examTimeminutes.toString().length == 2 ? examTimeminutes : '0' + examTimeminutes) +
  1564. ":" + (examTimeseconds.toString()
  1565. .length == 2 ? examTimeseconds : '0' + examTimeseconds)
  1566. }
  1567. },
  1568. examPapersTime() {
  1569. let list = this.examObject.examPapersList
  1570. let time = 0
  1571. for (var i = 0; i < list.length; i++) {
  1572. if (list[i].paperId !== this.userExamPaper.paperId) {
  1573. if (list[i].state === 9) {
  1574. time += list[i].paperTime * 60
  1575. }
  1576. }
  1577. }
  1578. return time
  1579. }
  1580. },
  1581. mounted() {
  1582. window.addEventListener("unload", (e) => {
  1583. e.preventDefault();
  1584. setTimeout(() => {
  1585. cacheExamAnswer({
  1586. 'examAnswers': this.userExamAnswers,
  1587. 'userExamId': sessionStorage.getItem('examId'),
  1588. 'leaveTime': this.windowCheat,
  1589. 'paperId': this.userExamPaper.paperId,
  1590. 'limitTime': this.userExamPaper.limitTime
  1591. }).then(data => {
  1592. console.log(data);
  1593. })
  1594. }, 100)
  1595. });
  1596. this.user = JSON.parse(sessionStorage.getItem("user"))
  1597. let examId = sessionStorage.getItem('examId')
  1598. getExamDetail({
  1599. 'userExamId': examId,
  1600. 't': new Date().toString()
  1601. }).then(data => {
  1602. if (data.data.code !== 200) {
  1603. sessionStorage.removeItem('examId')
  1604. toLogin()
  1605. }
  1606. this.examObject = data.data.result
  1607. this.scantron = this.examObject.userExamQuestionList[0]
  1608. this.userExamPaper = this.examObject.userExamPapersList[0]
  1609. this.examPaperTime = this.addExamPaperTime(new Date(this.userExamPaper.systemTime), new Date(this
  1610. .userExamPaper.limitTime))
  1611. // 试卷计时
  1612. this.papersTime = this.examPapersTime()
  1613. this.intervalId = setInterval(this.updateCountDown, 1000);
  1614. this.examTime = this.paperTime
  1615. // 添加切屏事件监听
  1616. if (windowState) {
  1617. window.addEventListener('blur', this.handleBlur);
  1618. window.addEventListener('focus', this.handleFocus);
  1619. }
  1620. // 获取缓存答案
  1621. getCacheAnswer({
  1622. 'userExamId': examId
  1623. }).then(answerData => {
  1624. if (answerData.data.result !== null) {
  1625. this.answerDisplay(answerData.data.result)
  1626. }
  1627. })
  1628. })
  1629. }
  1630. }
  1631. </script>
  1632. <style scoped>
  1633. .svg-container {
  1634. width: 100%;
  1635. height: 100%;
  1636. overflow: hidden;
  1637. position: runiative;
  1638. }
  1639. svg {
  1640. display: block;
  1641. width: 100%;
  1642. height: 100%;
  1643. }
  1644. .scroll-Y {
  1645. height: 80vh;
  1646. }
  1647. .allceter {
  1648. display: flex;
  1649. align-items: center;
  1650. height: 50px;
  1651. }
  1652. .scroll-view_H {
  1653. white-space: nowrap;
  1654. width: 100%;
  1655. }
  1656. .scroll-view-item {
  1657. height: 300rpx;
  1658. line-height: 300rpx;
  1659. text-align: center;
  1660. font-size: 36rpx;
  1661. }
  1662. .scroll-view-item_H {
  1663. display: inline-block;
  1664. width: 100%;
  1665. height: 300rpx;
  1666. line-height: 300rpx;
  1667. text-align: center;
  1668. font-size: 36rpx;
  1669. }
  1670. div {
  1671. margin: 0;
  1672. padding: 0;
  1673. }
  1674. /* CSS 预设*/
  1675. * {
  1676. margin: 0;
  1677. padding: 0;
  1678. }
  1679. a {
  1680. text-decoration: none;
  1681. outline: none;
  1682. }
  1683. body a {
  1684. outline: none;
  1685. blr: expression(this.onFocus=this.blur());
  1686. }
  1687. .uni-input {
  1688. padding-left: 20px;
  1689. border: 1rpx solid #5bb4ee;
  1690. height: 96rpx;
  1691. margin-left: 10px;
  1692. color: #000000;
  1693. width: 90%;
  1694. display: flex;
  1695. justify-content: center;
  1696. align-items: center;
  1697. }
  1698. img {
  1699. border: none;
  1700. }
  1701. .dialog-text {
  1702. font-size: 14px;
  1703. color: #333;
  1704. }
  1705. .paperCss {
  1706. width: 85%;
  1707. border-radius: 5px;
  1708. padding: 15px;
  1709. margin-top: 15px;
  1710. font-size: 15px;
  1711. text-align: left;
  1712. }
  1713. </style>