1
0

examStart.vue 60 KB

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