gateHome.home.jsp 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156
  1. <%@ page import="ss.WebC" %>
  2. <html>
  3. <head>
  4. <title>${sessionScope.projectUrlDesc}</title>
  5. <%-- 先去掉,应该没用到。Lin
  6. <wd:write type="skin" t="dialog" />
  7. <wd:write type="skin" t="menu" />
  8. --%>
  9. <skin.ss file="/ss/gate"/>
  10. <js.ss file="/ss/appauthority.js"/>
  11. <js.ss file="/ss/qrcode/qrcode.js"/>
  12. <js.ss file="/ss/qrcode/jquery.qrcode.js"/>
  13. <%-- 先去掉,应该没用到。Lin
  14. <script type="text/javascript" src="mobile/js/iscroll.js"></script>
  15. --%>
  16. <js.ss file="/ss/touch.min.js"/>
  17. </head>
  18. <style>
  19. *{
  20. margin: 0px;
  21. padding: 0px;
  22. }
  23. body{
  24. width: 100%;
  25. height: 100%;
  26. }
  27. #ascrail2009{
  28. display:none!important;
  29. }
  30. video {
  31. position: fixed;
  32. max-width: 100%;
  33. min-height: 100%;
  34. height: auto;
  35. width: 100%;
  36. object-fit:fill;
  37. z-index: -999;
  38. }
  39. .login-pageBackground {
  40. background:none!important;
  41. }
  42. input::-webkit-input-placeholder{
  43. color:#fff!important;
  44. }
  45. .content-largeText td{
  46. width: 410px;
  47. padding-left: 60px;
  48. }
  49. .selectedStyle{
  50. width: 388px;
  51. margin: 1px 0px 0px 1px;
  52. font-family: Microsoft YaHei;
  53. padding: 0px 0 0 5px;
  54. line-height: 40px;
  55. height: 50px;
  56. border: 2px solid #cccccc;
  57. border-radius: 2px;
  58. appearance: none;
  59. font-size:36px ;
  60. -moz-appearance: none;
  61. -webkit-appearance: none;
  62. background: url("/skin/easy/image/dialog-select-icon.png") no-repeat 360px 18px;
  63. overflow:auto !important;
  64. }
  65. .selectedStyle option{
  66. font-size:30px !important;
  67. }
  68. select::-webkit-scrollbar {
  69. cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
  70. width: 8px;
  71. }
  72. select::-webkit-scrollbar-track {
  73. background-color: none;
  74. border-radius: 5px;
  75. cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
  76. }
  77. select::-webkit-scrollbar-thumb {
  78. background: #b7b7b7;
  79. cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
  80. border-radius: 5px;
  81. }
  82. </style>
  83. <body style="margin:0px;padding:0px;" id="body">
  84. <input name="sbbs" type="hidden" value='dm'/> <%-- ='4OBKLLHDgszyEqmf5vFmuw=='。改为 .场地号。Lin --%>
  85. <input name="sbmc" type="hidden" />
  86. <video id="videoID" class="lj" muted autoplay="autoplay" loop="loop" style="display:block;overflow: hidden;">
  87. <source src="/skin/easy/hugeLogo.mov" > <%-- ="${sessionScope['XMMC']}/video/logo/hugeLogo.mov"。Lin --%>
  88. </video>
  89. <div class="login-pageBackground" style="display: flex;justify-content: center;align-items: center;">
  90. <div id="zzc" style="position: absolute;width: 100%;height: 100%;background: #888; z-index: 10000;opacity: 0;display: none;"></div>
  91. <%--显示时间--%>
  92. <div id="getDateInfo" class="getDateInfo lj">
  93. <span></span><span></span>
  94. </div>
  95. <div id="ryxx" style="width:800px; height:450px; display:none;position: absolute;color:black;border:1px white solid;border-radius:5px;background:#fff;z-index: 99999;">
  96. <div style="display:flex;width:680px;margin-left:60px;margin-top:61px;padding-bottom: 50px; border-bottom: 1px solid #cccccc;">
  97. <div>
  98. <input type="hidden" name="ryid" value="${ryid}" class="input-text input-number" />
  99. <img id="zjz" src="" onerror="this.src='/skin/easy/image/default-photo.png'" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius: 2px;"></img> <%-- ='${sessionScope["XMMC"]}/theme/EasyUses/image/default-photo.png'"。Lin --%>
  100. </div>
  101. <table class='xm content-largeText' style="color:#000;">
  102. <tr>
  103. <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="xm"></span></td>
  104. </tr>
  105. <tr>
  106. <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="bj" ></span></td>
  107. </tr>
  108. <tr>
  109. <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="xh" ></span></td>
  110. </tr>
  111. <tr>
  112. <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;">
  113. <span id="lxlb" class="content-largeWarningText" style="vertical-align: top;"></span>
  114. <span id="lxlbts" class="content-largeWarningText" style="display:none;vertical-align: top;">
  115. <img src="/skin/easy/image/warning.gif" style=" width: 60px;height: 60px;top: -2px;position: relative; "/> <%-- ="${sessionScope['XMMC']}/theme/EasyUses/image/warning.gif"。Lin --%>
  116. </span>
  117. </td>
  118. </tr>
  119. </table>
  120. </div>
  121. <div style="width: 100%;padding-top: 30px;text-align: center;">
  122. <input type="button" class="bottom-button " value="离校" id="leave" />
  123. <input type="button" class="bottom-button " value="返校" id="back" />
  124. <input type="button" class="bottom-button " value="取消" id="cancle" />
  125. </div>
  126. </div>
  127. <%--预约来访--%>
  128. <div id="yylf" style=" width:800px; height:385px; display:none;position: absolute;color:black;border:1px white solid;border-radius:5px;background:#fff;z-index: 99999;">
  129. <div style="display:flex;width:690px;margin-left:55px;margin-top:25px;padding-bottom: 50px; border-bottom: 1px solid #cccccc;">
  130. <table class='content-largeText' style="line-height: 50px;">
  131. <tr>
  132. <th>姓名</th>
  133. <td><span id="yylfxm" name="xm" ></span></td>
  134. </tr>
  135. <tr>
  136. <th>身份证号</th>
  137. <td><span id="yylfsfzh" name="sfzh" ></span></td>
  138. </tr>
  139. <tr>
  140. <th>人数</th>
  141. <td><span id="yylfrs" name="rs" ></span></td>
  142. </tr>
  143. <tr>
  144. <th>预约时间</th>
  145. <td><span id="yylfyysj" name="yysj" format="yyyy-MM-dd HH:mm:ss" miniDate="false"></span></td> <%-- 等 新UI 弄好了再改。Lin --%>
  146. </tr>
  147. </table>
  148. </div>
  149. <div style="width: 100%;padding-top: 25px;text-align: center;">
  150. <%-- 去掉,移到录入来访信息界面了 -- "确定" 按钮改为 "进入" 了。Lin
  151. <in@put type="button" class="bottom-button " value="进入" id="yylf_come" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
  152. --%>
  153. <input type="button" class="bottom-button " value="离开" id="yylf_leave" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
  154. <input type="button" class="bottom-button " value="取消" id="yylf_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
  155. </div>
  156. </div>
  157. <%--来访信息--%>
  158. <div id="lfxx" style=" display:none;width: 640px; height: 560px; position: absolute; color: black; border: 1px white solid; border-radius: 5px;background: #fff;padding: 50px 40px 28px 40px;z-index: 99999;">
  159. <div style="display: flex; width: 100%;padding-bottom: 50px;border-bottom: 1px solid #cccccc;justify-content: flex-end;">
  160. <table class='content-largeText' style="width:100%; line-height: 52px;">
  161. <tr>
  162. <th>姓名</th>
  163. <td><input id="jfxm" name="xm"/></td>
  164. </tr>
  165. <tr>
  166. <th>性别</th>
  167. <td>
  168. <input id="jfxbm" name="xbm" type="hidden" />
  169. <objp.ss name="xbm" cb="xb" inp="true"/>
  170. </td>
  171. </tr>
  172. <tr>
  173. <th>身份证号</th>
  174. <td><input id="jfsfzh" name="sfzh"/></td>
  175. </tr>
  176. <tr>
  177. <th>接访部门</th>
  178. <td>
  179. <input id="jfbmid" name="jfbmid" type="hidden"/>
  180. <objp.ss name="jfbmid" cb="jfbm" inp="true"/>
  181. </td>
  182. </tr>
  183. <tr>
  184. <th>接访班级</th>
  185. <td>
  186. <input id="jfbjid" name="jfbjid" type="hidden" />
  187. <objp.ss name="jfbjid" cb="jfbj" inp="true"/>
  188. </td>
  189. </tr>
  190. <tr>
  191. <th>接访人</th>
  192. <td>
  193. <div id="jfr-div">
  194. <div class="input-div input-s">
  195. <input name="jfryid" id="jfryid" type="hidden"/>
  196. <input name="jfryna" id="jfryna" style="margin: 0;"/>
  197. <span id="jfryid_button" class="smallButton icon-down" style="top: 5px !important;" onselectstart="return false;"></span>
  198. </div>
  199. <div id="jfryid_option" class="popup-div hLine-highlightBlod objectPickerOption scrollbar" style="display:none;max-height: 250px;z-index: 10000;" onselectstart="return false;">
  200. </div>
  201. </div>
  202. </td>
  203. </tr>
  204. <tr>
  205. <th>事由</th>
  206. <td>
  207. <textarea id="jfsy" class="smallScrollbar" style="overflow:hidden;padding-left: 5px;margin-left:-5px;position: absolute;resize: none;margin-top: 2px;height: 51px !important;width: 401px !important;z-index: 1;background: white;"></textarea>
  208. <script type="text/javascript" charset="utf-8">
  209. wd.edit.initGrowHigh('jfsy','null',{},null,false);
  210. </script>
  211. <span></span>
  212. <input id="syid" name="syid" type="hidden"/>
  213. <objp.ss name="syid" cb="lfsy" inp="true" add="true"/>
  214. </td>
  215. </tr>
  216. <tr>
  217. <th>人数</th>
  218. <td>
  219. <input id="jfrs" name="rs" value= "1" oninput="value=value.replace(/[^\d]/g,'')"/>
  220. </td>
  221. </tr>
  222. </table>
  223. </div>
  224. <div style="width:100%;padding-top:25px;text-align:center;">
  225. <%-- "确定" 改为 "进入",去掉后面的来访者离校的办理界面里的 "进入" 按钮(只有 "离开" 按钮) -- 填写来访信息时,就进入(增加写 来访.接访开始时间)。Lin
  226. <in@put id="lfqd" type="button" class="bottom-button " value="确定" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" /> --%>
  227. <input id="lfqd" type="button" class="bottom-button " value="进入" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
  228. <input type="button" class="bottom-button " value="取消" id="jf_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
  229. </div>
  230. </div>
  231. <div id="scannerDiv" style="opacity: 0;">
  232. <input id="scanner"/>
  233. </div>
  234. <%--录入人员--%>
  235. <div id="lrry" class="lj" style="display:none;position: absolute;bottom: 28px;left:50%;margin-left:-365px; font-family: 'SIL Hei';color:#6c9ed7;line-height:18px;font-size:20px;">
  236. <table class='xm' style="color:#000;">
  237. <tr>
  238. <td>
  239. <input type="text" tabindex="1" name="sfzh" id="sfzh" placeholder="身份证号/学号" style="margin-right:18px;font-size: 20px; width:389px; height: 43px;color: #ffffff;border:1px solid #dae6eb;padding:10px 0 13px 19px;opacity: 0.65;" />
  240. </td>
  241. <td style="text-align: center;">
  242. <input type="button" class="mobileLogin-button" style="outline:#6c9ed7;position: absolute;width: 90px; height: 43px; background: transparent;color: #ffffff; border: 1px solid #dae6eb; font-size: 20px;opacity: 0.65;border-radius: 3px;" value="确定" id="qd" />
  243. </td>
  244. <td style="text-align: center;padding-left: 100px;">
  245. <input type="button" class="mobileLogin-button" style="outline:#6c9ed7;position: absolute;width: 90px; height: 43px; background: transparent;color: #ffffff; border: 1px solid #dae6eb; font-size: 20px;opacity: 0.65;border-radius: 3px;" value="清除" id="qc" />
  246. </td>
  247. </tr>
  248. </table>
  249. </div>
  250. <div id="ryxxlb" style="color:black;z-index:-1;"></div>
  251. <div id="jcjllb" style="width: 800px;height: calc(100% - 60px);position: absolute;color:black;z-index:-1;display: grid;align-content: center;overflow-y: auto;overflow-x: hidden;display: block;color: black;right: 30px;"></div>
  252. <div id="SFrefresh" style=" width:460px; height:245px; display:none;position: absolute;color:black;border:1px white solid;border-radius:5px;background:#fff;bottom: 29px;right: 29px;z-index: 99999;">
  253. <div class='content-largeText' style="width: 420px;display:flex;margin-left:20px;margin-top:25px;align-items: center;justify-content: center;height: 120px; border-bottom: 1px solid #cccccc;">
  254. 是否重启?
  255. </div>
  256. <div style="width: 100%;padding-top: 25px;text-align: center;">
  257. <input type="button" class="bottom-button " value="是" id="SFrefresh_qr" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
  258. <input type="button" class="bottom-button " value="否" id="SFrefresh_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
  259. </div>
  260. </div>
  261. <div class="bottomright" id="qrcodeBox" style="z-index: -2; display:block;">
  262. <%--默认图片--%>
  263. <!-- <equal.ss val='${empty sessionScope.ssUser}' val2="true"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
  264. <div id="login-before" style="width:110px;height:144px;background:rgba(255,255,255,0.4);border-radius:2px;margin-bottom: -7px; ">
  265. <img src='/skin/easy/image/default-photo.png' style="margin:20px 23px 7px 23px;width:64px;height:88px;"/> <%-- ='${sessionScope["XMMC"]}/theme/EasyUses/image/default-photo.png'。Lin --%>
  266. <div class="xx">
  267. <div class="qrcode-text " style="color: #000;" >未登录</div>
  268. </div>
  269. </div>
  270. </equal.ss> -->
  271. <%--未登录显示二维码--%>
  272. <equal.ss val='${empty sessionScope.ssUser}' val2="true"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
  273. <!-- style="display: none;" -->
  274. <div id="login-qrcode">
  275. <div style="height: 30px;">
  276. <span class="qrcode-text">扫一扫登录</span>
  277. </div>
  278. <div id="qrcode" style="width:110px;height:110px;z-index: 9999 !important;border: 5px solid #FFF;margin-bottom: -7px;">
  279. <div class='qrcode'> </div>
  280. </div>
  281. </div>
  282. </equal.ss>
  283. <div style="display: none;position:absolute;z-index:11111;" id="confirm-qrcode">
  284. <div style="height: 30px;">
  285. <span class="qrcode-text">扫一扫</span>
  286. </div>
  287. <div id="qrcode-confirm" style="width:110px;height:110px;z-index: 9999 !important;border: 5px solid #FFF;margin-bottom: -7px;">
  288. <div class='qrcode-confirm'> </div>
  289. </div>
  290. </div>
  291. <%--已登录显示头像,点击头像退出登录--%>
  292. <equal.ss val='${empty sessionScope.ssUser}' val2="false"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
  293. <!-- <div id="login-after" class="lj" style="width:110px;height:144px;background:rgba(255,255,255,0.4);border-radius:2px;margin-bottom: -7px; ">
  294. <img onclick="clearInterval(zmxxhq);window.location=&quot;<serv.ss name='gateExit'/>&quot;;"
  295. onerror="this.src='/skin/easy/image/default-photo.png'" style="margin: 10px 23px 7px 23px;width:64px;height:88px;"
  296. src="<serv.ss name='dlByHttp' parm='{path:"${sessionScope.ssUser.zjzwj}"}'/>"/>
  297. <div class="xx">
  298. <div class="qrcode-text" style="color: #000;">${sessionScope.ssUser.xm}</div> <%-- ['env.ry'].。Lin --%>
  299. <div class="qrcode-text" style="color: #000;">${sessionScope.ssUser.ryh}</div> <%-- ['env.ry'].。Lin --%>
  300. </div>
  301. </div> -->
  302. <div class="userInfo xx lj" onclick="clearInterval(zmxxhq);window.location=&quot;<serv.ss name='gateExit'/>&quot;;">
  303. <span>${sessionScope.ssUser.xm}</span>
  304. <span>${sessionScope.ssUser.ryh}</span>
  305. </div>
  306. </equal.ss>
  307. </div>
  308. </div>
  309. <equal.ss val='${empty sessionScope.ssUser}' val2="false"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
  310. <script type="text/javascript">
  311. var ryInfo = "${sessionScope.ssUser}"; <%-- ['env.ry']}。Lin --%>
  312. </script>
  313. </equal.ss>
  314. <script>
  315. function login() {
  316. var sbbs = $("input[name=sbbs]").val();
  317. var sbmc = $("input[name=sbmc]").val();
  318. $.post("<serv.ss name='runGateLoginByQrcode'/>", { // :'scanGateLoginSuccess'。Lin
  319. sbbs: sbbs,
  320. sbmc: sbmc
  321. }, function(result) {
  322. if(result.code != 1) {
  323. wd.display.alert(result.msg);
  324. } else {
  325. window.location.href = "/gateHome.jsp"; //? = "/"。临时改,为了测试。Lin
  326. }
  327. }, "json")
  328. }
  329. function utf16to8(str) {
  330. var out, i, len, c;
  331. out = "";
  332. len = str.length;
  333. for(i = 0; i < len; i++) {
  334. c = str.charCodeAt(i);
  335. if((c >= 0x0001) && (c <= 0x007F)) {
  336. out += str.charAt(i);
  337. } else if(c > 0x07FF) {
  338. out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
  339. out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
  340. out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
  341. } else {
  342. out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
  343. out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
  344. }
  345. }
  346. return out;
  347. }
  348. function qrcode() {
  349. $.ajax({
  350. type: "post",
  351. url: "<serv.ss name='wrQrcodeLoginKey'/>", // :'getPrivateKey'。Lin
  352. async: true,
  353. dataType: "json",
  354. success: function(data) {
  355. var sbbs = $("input[name='sbbs']").val();
  356. var json = {
  357. ss:2, // 增加,2 = gate login。Lin
  358. k: data.k, // ATR_keyByQrcodeLoginName = "k"。Lin
  359. d: sbbs
  360. };
  361. /* 改,ss:xx,yy:"zz",...。Lin
  362. qrCodeGenerate(".qrcode", "@hdGl" + JSON.stringify(json) + "@", 110, 110, "canvas");
  363. */
  364. var jsonStr = JSON.stringify(json);
  365. qrCodeGenerate(".qrcode", "ss:2,k:\""+ data.k +"\",d:\""+ sbbs +"\"", 110, 110, "canvas");
  366. }
  367. });
  368. }
  369. function qrCodeGenerate(ele, text, width, height, render) {
  370. var option = {
  371. render: "canvas",
  372. text: text,
  373. width: width || "200",
  374. height: height || "200",
  375. correctLevel: QRErrorCorrectLevel.M
  376. };
  377. $(ele).empty()
  378. $(ele).qrcode(option);
  379. }
  380. var stop = 2 * 60 * 1000; //两分钟后停止
  381. var begin;
  382. var end;
  383. function getLoginStatus() {
  384. //end = new Date().getTime();
  385. //if ((end - begin) > stop) {
  386. // stopInterval();
  387. // return;
  388. //}
  389. var sbbs = $("input[name=sbbs]").val();
  390. if(!sbbs)return;
  391. $.ajax({
  392. type: "post",
  393. url:"<serv.ss name='ifWrQrcodeLoginParmBySess' parm='{type:"gate"}'/>", // :'resetCookie',。Lin
  394. async: true,
  395. data:{sbbs:sbbs},
  396. dataType: "json",
  397. success: function(data) {
  398. if(data.code == 200 && window.loginStatus == '0') {
  399. stopInterval();
  400. //$("input[name='mm']").val("");
  401. //$("form[name='Form1'").submit();
  402. login();
  403. }
  404. if(data.code == 1) {
  405. stopInterval();
  406. var url = "<%=WebC.PPATH_errMsg%>?msg="+ data.msg; // = "/wd/page/rs.jsp?msg=" +。Lin
  407. var title = "提示";
  408. wd.display.showComponent({
  409. show: ["wdDialog"],
  410. hide: [],
  411. url: url,
  412. title: title,
  413. width: 500,
  414. high: 300,
  415. form: ""
  416. })
  417. } else if(data.code == 0) {
  418. console.log(data.msg);
  419. } else if(data.msg) {
  420. wd.display.alert(data.msg)
  421. }
  422. }
  423. });
  424. }
  425. var getLoginInterval;
  426. if(window.loginStatus == '0') {
  427. startInterval();
  428. }
  429. function startInterval() {
  430. qrcode();
  431. //$("#qrcodeBox").css("display", "block");
  432. //$("#trianglebottomright").css("display", "none");
  433. begin = new Date().getTime();
  434. if(!getLoginInterval) {
  435. getLoginInterval = setInterval(getLoginStatus, 3 * 1000);
  436. }
  437. }
  438. function stopInterval() {
  439. $("#qrcodeBox").css("display", "none");
  440. clearInterval(getLoginInterval);
  441. getLoginInterval = null;
  442. }
  443. $(function() {
  444. try {
  445. if(beacon && beacon.getComputerName) {
  446. $("input[name=sbmc]").val(beacon.getComputerName());
  447. }
  448. if(beacon && beacon.getMacAddress) {
  449. $("input[name=sbbs]").val(beacon.getMacAddress());
  450. }
  451. } catch(err) {
  452. console.log(err);
  453. }
  454. })
  455. </script>
  456. </body>
  457. <script type="text/javascript">
  458. /**
  459. *
  460. * 原来下面全部JS为拼音缩写而且无注解
  461. * 注解都是之后非作者补充的,可能有不正确
  462. *
  463. */
  464. var qrcodestr = '';
  465. var direction;
  466. var mjdid = '';
  467. var sfzh = '';
  468. var lfid = '';
  469. var globalJfryna = '';
  470. var globalJfryid = '';
  471. $(function(){
  472. try{
  473. lf_jfr_cx(false,false);
  474. /* 改,直接用页面写死的 sbbs(<input name="sbbs") -- 因抛出错误 "beacon is not defined",后面的程序被越过。Lin
  475. getMjdid(beacon.getMacAddress());
  476. */ getMjdid($("input[name=sbbs]").val());
  477. // bindMwid(); // 再去掉,没用到,也不用 < 打开 gateHome.home.jsp 时,写到 门禁点.门卫ID。此时,写入的 .门卫ID 为空(还没登录) < 也不能每次换班都写。Lin
  478. if(!beacon || !beacon.initIdcardDevice()){
  479. alert("初始化失败。检查是否安装驱动")
  480. }
  481. ///
  482. }catch(err){
  483. console.log(err);
  484. }
  485. /**
  486. * 接访人na
  487. */
  488. $('#jfryna').blur(function(){
  489. $('#jfryna').val(globalJfryna);
  490. $('#jfryid').val(globalJfryid);
  491. });
  492. /**
  493. * 接访人na
  494. */
  495. $('#jfryna').on('input',function(){
  496. if($('#jfryna').val() == ''){
  497. $('#jfryid_option').hide();
  498. return;
  499. }
  500. lf_jfr_cx(true,true);
  501. $('#jfryid_option').show();
  502. });
  503. $('#jfryid_option').on('click','.popupList',function(){
  504. var ryid = $(this).attr('value');
  505. var xm = $(this).text();
  506. $('#jfryna').val(xm);
  507. $('#jfryid').val(ryid).change();
  508. $('#jfryid_option').hide();
  509. });
  510. $('#jfryid').change(function(){
  511. var jfryid = $(this).val();
  512. if(jfryid == ''){
  513. globalJfryid = '';
  514. globalJfryna = '';
  515. return;
  516. }
  517. if(globalJfryid == jfryid){
  518. return;
  519. }
  520. globalJfryid = jfryid;
  521. globalJfryna = $('#jfryna').val();
  522. $.ajax({
  523. type: "post",
  524. /* 改,把参数统一移到 data:{} 里。Lin
  525. url: '@service{name:"lf_bjbm_cx"}@&ryid=' + jfryid,
  526. */
  527. url: "<serv.ss name='gate_selBmAndBjByRyid'/>",
  528. data: {
  529. ryid: jfryid,
  530. },
  531. async: true,
  532. dataType: "json",
  533. success: function(data) {
  534. console.log(data);
  535. if (data.error == '1') {
  536. wd.display.alert(data.msg);
  537. } else {
  538. wd.edit.objectPicker.getInstance("jfbmid").initValue(data.bmid,{triggerChange:false});
  539. wd.edit.objectPicker.getInstance("jfbjid").initValue(data.bjid,{triggerChange:false});
  540. }
  541. }
  542. });
  543. });
  544. $('#jfryna').focus(function(){
  545. if($('#jfryna').val() == ''){
  546. return;
  547. }
  548. lf_jfr_cx(true,true);
  549. $('#jfryid_option').show();
  550. });
  551. $('#jfr-div').click(function(){
  552. return false;
  553. });
  554. $('#jfryid_button').click(function(){
  555. $('.popup-div:not(#jfryid_option)').hide();
  556. if($('#jfryid_option').is(':hidden')){
  557. lf_jfr_cx(true,false);
  558. }
  559. $('#jfryid_option').toggle();
  560. });
  561. setInterval(function(){
  562. $.ajax({
  563. type: "post",
  564. url: '@service{name:"wd.probe"}@',
  565. async: true,
  566. dataType: "json",
  567. success: function(data) {
  568. console.log(data);
  569. }
  570. });
  571. }, 1000 * 600);
  572. $('#zzc').click(function(){
  573. return false;
  574. });
  575. $('#SFrefresh_qr').click(function(){
  576. window.location.reload();
  577. });
  578. $('#SFrefresh_cancle').click(function(){
  579. $('#SFrefresh').hide();
  580. $('#zzc').hide();
  581. $('.lj').css('filter','blur(0px)');
  582. return false;
  583. });
  584. var refresh;
  585. $('#login-after').mousedown(function(e){
  586. // if('IMG' == $(e.target).prop('tagName')){
  587. // console.log("长按头像不触发刷新");
  588. // return;
  589. // }
  590. refresh = setInterval(function(){
  591. $('#SFrefresh').show();
  592. clearInterval(refresh);
  593. $('#zzc').show();
  594. $('.lj').css('filter','blur(20px)');
  595. }, 2000);
  596. return false;
  597. });
  598. $('#login-after').mouseup(function(){
  599. console.log("清除定时器");
  600. clearInterval(refresh);
  601. return false;
  602. });
  603. $('#login-after').mouseout(function(){
  604. console.log("清除定时器");
  605. clearInterval(refresh);
  606. });
  607. $('#login-before').mousedown(function(e){
  608. refresh = setInterval(function(){
  609. $('#SFrefresh').show();
  610. clearInterval(refresh);
  611. $('.lj').css('filter','blur(20px)');
  612. }, 2000);
  613. return false;
  614. });
  615. $('#login-before').mouseup(function(){
  616. console.log("清除定时器");
  617. clearInterval(refresh);
  618. return false;
  619. });
  620. $('#login-before').mouseout(function(){
  621. console.log("清除定时器");
  622. clearInterval(refresh);
  623. });
  624. $('#login-before').click(function(){
  625. $(this).hide();
  626. $('#login-qrcode').show();
  627. /// 临时增加,模拟 APP/小程序 扫码确认???Lin
  628. /* 去掉,来真的了。Lin
  629. $.ajax({
  630. type: "post",
  631. url: "<serv.ss name='gateLoginByQrcode'/>",
  632. async: true,
  633. dataType: "json",
  634. success: function(data) {
  635. }
  636. });
  637. */
  638. ///
  639. return false;
  640. });
  641. var lrryClose;
  642. var lrryCloseTime = 60 * 1000;
  643. $(document).on('mousedown',function(e){
  644. if($(e.target).parents('#jcjllb').length == 0){
  645. if(e.target.id == "jcjllb"){
  646. return;
  647. }
  648. if($(e.target).parents('.ryxxlb-child').length>0||e.target.className.indexOf("ryxxlb-child")>-1){
  649. if($(e.target).parents('.ryxxlb-child').length>0){
  650. $(e.target).parents('.ryxxlb-child').remove();
  651. }
  652. if(e.target.className.indexOf("ryxxlb-child")>-1){
  653. $(e.target).remove();
  654. }
  655. return;
  656. }
  657. clearTimeout(hideJcjllb);
  658. isDrag = false;
  659. handleHide("jcjllb");
  660. if(lrryClose){
  661. clearInterval(lrryClose);
  662. lrryClose = setInterval(function(){
  663. hideLrry();
  664. }, lrryCloseTime);
  665. }
  666. }
  667. });
  668. $(document).on('keydown mousemove',function(){
  669. if(lrryClose){
  670. clearInterval(lrryClose);
  671. lrryClose = setInterval(function(){
  672. hideLrry();
  673. }, lrryCloseTime);
  674. }
  675. });
  676. $('#qc').click(function(){
  677. $('#sfzh').val('');
  678. });
  679. $('body').click(function(e){
  680. e.stopPropagation();
  681. $('#jfryid_option').hide();
  682. if($(e.target).parents('#lrry').length > 0){
  683. return false;
  684. }
  685. if($('#zzc').is(':visible')){
  686. return false;
  687. }
  688. if(!isDrag){//如果是拖动就不触发
  689. $('#lrry').stop(true).fadeToggle(function(){
  690. if($('#lrry').is(':visible')){
  691. var zIndex = Number($("#jcjllb").css("z-index"))<0?2:Number($("#jcjllb").css("z-index"))+1;
  692. $("#lrry").css("z-index",zIndex);
  693. $("#sfzh").focus();
  694. console.log('设置定时器');
  695. clearInterval(lrryClose);
  696. lrryClose = setInterval(function(){
  697. console.log('定时器运行');
  698. hideLrry();
  699. }, lrryCloseTime);
  700. }else{
  701. $("#scanner").val("");
  702. $("#scanner").focus();
  703. clearInterval(lrryClose);
  704. lrryClose = null;
  705. }
  706. });
  707. }
  708. });
  709. $('#jf_cancle').click(function() {
  710. handleHide("lfxx");
  711. $('#lrry').show()
  712. return false;
  713. });
  714. $('#syid').change(function(){
  715. $('#jfsy').val($('#objectPickergrowheightsyid').val());
  716. $('[name="jfsy"]').val($('#objectPickergrowheightsyid')[0].srcText);
  717. });
  718. $('#yylf_come').click(function(){
  719. createLfJcjl(11);
  720. handleHide("yylf")
  721. return false;
  722. });
  723. $('#yylf_leave').click(function(){
  724. createLfJcjl(51);
  725. handleHide("yylf");
  726. return false;
  727. });
  728. $('#yylf_cancle').click(function() {
  729. handleHide("yylf");
  730. $('#lrry').show();
  731. /*$('#yylf').hide();
  732. $('#zzc').hide();
  733. $('.lj').css('filter','blur(0px)');*/
  734. return false;
  735. });
  736. $('#lfqd').click(function(){
  737. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  738. wd.display.alert("请先登录!");
  739. return false;
  740. }
  741. var jfsfzh = $('#jfsfzh').val();
  742. var jfxm = $('#jfxm').val();
  743. var jfxbm = $('#jfxbm').val();
  744. var jfbmid = $('#jfbmid').val();
  745. var jfbjid = $('#jfbjid').val();
  746. var jfryid = $('#jfryid').val();
  747. var rs = $('#jfrs').val();
  748. if(jfxm == '' || jfxbm == '' || jfryid == ''){
  749. wd.display.alert("请补全信息");
  750. return false;
  751. }
  752. if(jfsfzh != '' && jfsfzh.length != 15 && jfsfzh.length != 18){
  753. wd.display.alert("请输入正确的身份证号!");
  754. return false;
  755. }
  756. $.ajax({
  757. type: "post",
  758. url: "<serv.ss name='gate_insTempLf'/>", // :"lf_zj"。Lin
  759. async: true,
  760. dataType: "json",
  761. data:{
  762. sfzh:jfsfzh,
  763. xm:jfxm,
  764. xbm:jfxbm,
  765. jfbmid:jfbmid,
  766. jfbjid:jfbjid,
  767. jfryid:jfryid,
  768. sy:$('[name="jfsy"]').val(),
  769. syid:$('#syid').val(),
  770. mjdid:mjdid,
  771. mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
  772. rs:rs
  773. },
  774. success: function(data) {
  775. console.log(data);
  776. wd.display.alert(data.msg);
  777. handleHide("lfxx");
  778. /*
  779. $('#lfxx').hide();
  780. $('#zzc').hide();
  781. $('.lj').css('filter','blur(0px)');
  782. lfxxClear();*/
  783. }
  784. });
  785. return false;
  786. });
  787. $('#jfsfzh').blur(function(){
  788. $(this).val($(this).val().replace(/\s+/g,""));
  789. });
  790. $('#jfxm').blur(function(){
  791. $(this).val($(this).val().replace(/\s+/g,""));
  792. });
  793. $('#qd').click(function(){
  794. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  795. wd.display.alert("请先登录!");
  796. return;
  797. }
  798. sfzh = $('#sfzh').val();
  799. if(sfzh == ''){
  800. wd.display.alert("请输入身份证号或学号!");
  801. return;
  802. }
  803. $.ajax({
  804. type: "post",
  805. <%-- 改,sfzh 用 data{sfzh:sfzh} 去传输。Lin
  806. url: '@service{name:"jcjl_lfx_zjhcx"}@&sfzh=' + sfzh,
  807. --%>
  808. url: "<serv.ss name='gate_initMpByKey'/>",
  809. data: {
  810. sfzh:sfzh
  811. },
  812. async: true,
  813. dataType: "json",
  814. success: function(data) {
  815. console.log(data);
  816. if (data.error == '1') {
  817. wd.display.alert(data.msg);
  818. $('#jfsfzh').val(sfzh);
  819. if(sfzh.length == 15){
  820. wd.edit.objectPicker.getInstance("xbm").initValue(sfzh.substring(14,15)%2==0?2:1);
  821. }
  822. if(sfzh.length == 18){
  823. wd.edit.objectPicker.getInstance("xbm").initValue(sfzh.substring(16,17)%2==0?2:1);
  824. }
  825. sfzh = '';
  826. handleShow("lfxx");
  827. } else {
  828. if(data.lb == 0){
  829. <%-- 改。Lin
  830. $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
  831. $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
  832. $('#xm').text(data.xm == null ? '' : data.xm);
  833. $('#xh').text(data.ryh == null ? '' : data.ryh);
  834. $('#bj').text(data.bjmc == null ? '' : data.bjmc);
  835. $('#lxlb').text(data.lxlb == null ? '' : data.lxlb);
  836. $('#lxlbts').hide();
  837. if(data.lxlb == '请假' && data.ylkcs >= data.zdlkcs){
  838. $('#lxlb').text('次数已超出('+ data.ylkcs +')');
  839. $('#lxlbts').show();
  840. }
  841. $('#ryxx').show();
  842. $('#zzc').show();
  843. $('.lj').css('filter','blur(20px)');
  844. //bug
  845. $("#ryxx").height("450px");
  846. $("#cancle").show();
  847. $('#leave').show();
  848. $('#back').show();
  849. $("#ryxx").removeClass("mainState-green").removeClass("mainState-orange");
  850. }else{
  851. $('#lfxx').hide();
  852. handleShow("yylf");
  853. $('#yylfxm').text(data.xm);
  854. $('#yylfsfzh').text(data.ryh);
  855. $('#yylfrs').text(data.rs);
  856. $('#yylfyysj').text(new Date(data.yysj).toLocaleString('chinese', { hour12: false }).replace(/\//g,'-'));
  857. lfid = data.ryid;
  858. }
  859. }
  860. }
  861. });
  862. });
  863. $('#cancle').click(function(){
  864. handleHide("ryxx");
  865. $('#lrry').show();
  866. /*
  867. $('#ryxx').hide();
  868. sfzh = '';
  869. $('#zzc').hide();
  870. $('.lj').css('filter','blur(0px)');
  871. $("#scanner").focus();
  872. $("#confirm-qrcode").hide();*/
  873. return false;
  874. });
  875. $('#back').click(function(){
  876. createJcjl(11);
  877. handleHide("ryxx");
  878. /*
  879. $('#ryxx').hide();
  880. sfzh = '';
  881. $('#zzc').hide();
  882. $('.lj').css('filter','blur(0px)');*/
  883. return false;
  884. });
  885. $('#leave').click(function(){
  886. createJcjl(51);
  887. handleHide("ryxx");
  888. /*$('#ryxx').hide();
  889. sfzh = '';
  890. $('#zzc').hide();
  891. $('.lj').css('filter','blur(0px)');*/
  892. return false;
  893. });
  894. $('#ryxxlb').on('click','.ryxxlb-child',function(){
  895. $(this).remove();
  896. });
  897. });
  898. /**
  899. * 根据设备标识查询mjdid
  900. */
  901. function getMjdid(sbbs){
  902. console.log(sbbs);
  903. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  904. wd.display.alert("请先登录!");
  905. return;
  906. }
  907. $.ajax({
  908. type: "post",
  909. url: "<serv.ss name='gate_selMjdidBySbbs'/>", // :"mjd_mjdid_cx"。Lin
  910. async: true,
  911. dataType: "json",
  912. data:{
  913. sbbs:sbbs
  914. },
  915. success: function(data) {
  916. console.log(data);
  917. if (data.error == '1') {
  918. wd.display.alert(data.msg);
  919. mjdid = '';
  920. } else {
  921. console.log(data.mjdid);
  922. mjdid = data.mjdid;
  923. }
  924. }
  925. });
  926. }
  927. /**
  928. * 离返校学员信息增加
  929. */
  930. function createJcjl(jcfx){
  931. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  932. wd.display.alert("请先登录!");
  933. return;
  934. }
  935. var url = '';
  936. /* 改,把参数统一移到 data:{} 里。Lin
  937. if(sfzh == ''){
  938. url = '@service{name:"jcjl_lfx_zj"}@&code=' + qrcodestr;
  939. }else{
  940. url = '@service{name:"jcjl_lfx_zj"}@&sfzh=' + sfzh
  941. }
  942. */ url = "<serv.ss name='gate_insJcjlByMp'/>";
  943. $.ajax({
  944. type: "post",
  945. url: url,
  946. data:{
  947. /// 增加,把上面写在 URL 里的参数统一移到这。Lin
  948. code: qrcodestr,
  949. sfzh: sfzh,
  950. ///
  951. jcfx:jcfx,
  952. mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
  953. mjdid:mjdid
  954. },
  955. async: true,
  956. dataType: "json",
  957. success: function(data) {
  958. console.log(data);
  959. wd.display.alert(data.msg);
  960. }
  961. });
  962. }
  963. /**
  964. * 来访进出记录增加
  965. * @param {Object} jcfx
  966. */
  967. function createLfJcjl(jcfx){
  968. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  969. wd.display.alert("请先登录!");
  970. return;
  971. }
  972. $.ajax({
  973. type: "post",
  974. url: "<serv.ss name='gate_updTempLfByExit'/>", // :"jcjl_lf_zj"。Lin
  975. data:{
  976. jcfxm:jcfx,
  977. mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
  978. mjdid:mjdid,
  979. dxid:lfid
  980. },
  981. async: true,
  982. dataType: "json",
  983. success: function(data) {
  984. console.log(data);
  985. wd.display.alert(data.msg);
  986. }
  987. });
  988. }
  989. //扫描抢输入事件,监听到扫描枪输入后会调用
  990. function onScanInput(str) {
  991. console.log(str.toLowerCase());
  992. if(str.indexOf("@entrance@")>-1||str.indexOf("@exit@")>-1){
  993. //带有前缀的扫码器
  994. if(str.match(/@entrance@/)){
  995. direction = "entrance";
  996. str = str.split("@entrance@")[1];
  997. }else if(str.match(/@exit@/)){
  998. direction = "exit";
  999. str = str.split("@exit@")[1];
  1000. }else{
  1001. $("#scanner").val("");
  1002. return;
  1003. }
  1004. }else{
  1005. //没有前缀的扫码器
  1006. //@hdO{n:"ry",k:"a5c8247c075141279dbd853bbf741853"}@
  1007. if(str.length != 50&&str.split(".")[1].length !=35){
  1008. $("#scanner").val("");
  1009. return;
  1010. }
  1011. direction=null;
  1012. }
  1013. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1014. wd.display.alert("请先登录!");
  1015. $("#scanner").val("");
  1016. return;
  1017. }
  1018. var hdObj = eval('('+str.substr(4,str.length - 5)+')');
  1019. if(hdObj.n != 'ry'){
  1020. $("#scanner").val("");
  1021. return;
  1022. }
  1023. str = hdObj.k;
  1024. clearTimeout(hideRyxxTimeout);
  1025. if(direction){
  1026. $.ajax({
  1027. type: "post",
  1028. url: '@service{name:"jcjl_lfx_cx_sg"}@&code=' + str.toLowerCase(),
  1029. async: true,
  1030. dataType: "json",
  1031. data:{direction:direction,mjdid:mjdid},
  1032. success: function(data) {
  1033. console.log(data);
  1034. if (data.error == '1') {
  1035. wd.display.alert(data.msg)
  1036. } else {
  1037. //qrcodestr = str.toLowerCase();
  1038. qrcodestr = data.yhid;
  1039. sfzh = '';
  1040. <%-- 改。Lin
  1041. $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
  1042. $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
  1043. $('#xm').text(data.xm == null ? '' : data.xm);
  1044. $('#xh').text(data.ryh == null ? '' : data.ryh);
  1045. $('#bj').text(data.bjmc == null ? '' : data.bjmc);
  1046. if(direction == 'entrance'){
  1047. $("#ryxx").addClass("mainState-green").removeClass("mainState-orange");
  1048. // $('#lxlb').text("进校:"+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
  1049. $('#lxlb').text(""+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
  1050. }else{
  1051. $("#ryxx").addClass("mainState-orange").removeClass("mainState-green");
  1052. // $('#lxlb').text("离校:"+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
  1053. $('#lxlb').text(""+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
  1054. }
  1055. $('#lxlbts').hide();
  1056. if(data.lxlb == '请假'){
  1057. var outnumber=false;
  1058. if(direction == 'entrance'){
  1059. outnumber=data.ylkcs > data.zdlkcs;
  1060. }else{
  1061. outnumber=data.ylkcs >= data.zdlkcs;
  1062. }
  1063. if(outnumber){
  1064. $('#lxlb').text('次数已超出('+ data.ylkcs +')');
  1065. $('#lxlbts').show();
  1066. }
  1067. }
  1068. $('#zzc').show();
  1069. $('.lj').css('filter','blur(20px)');
  1070. if(data.warn){
  1071. //要显示二维码给保安扫
  1072. showRyxx({k:data.randomKey,d:$("input[name='sbbs']").val()});
  1073. }else{
  1074. showRyxx();
  1075. }
  1076. }
  1077. }
  1078. });
  1079. }else{
  1080. $("#ryxx").removeClass("mainState-green").removeClass("mainState-orange");
  1081. $.ajax({
  1082. type: "post",
  1083. url: '@service{name:"jcjl_lfx_cx"}@&code=' + str.toLowerCase(),
  1084. async: true,
  1085. dataType: "json",
  1086. success: function(data) {
  1087. console.log(data);
  1088. if (data.error == '1') {
  1089. wd.display.alert(data.msg)
  1090. } else {
  1091. //qrcodestr = str.toLowerCase();
  1092. qrcodestr = data.yhid;
  1093. sfzh = '';
  1094. <%-- 改。Lin
  1095. $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
  1096. $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
  1097. $('#xm').text(data.xm == null ? '' : data.xm);
  1098. $('#xh').text(data.ryh == null ? '' : data.ryh);
  1099. $('#bj').text(data.bjmc == null ? '' : data.bjmc);
  1100. $('#lxlb').text(data.lxlb == null ? '' : data.lxlb);
  1101. $('#lxlbts').hide();
  1102. if(data.lxlb == '请假' && data.ylkcs >= data.zdlkcs){
  1103. $('#lxlb').text('次数已超出('+ data.ylkcs +')');
  1104. $('#lxlbts').show();
  1105. }
  1106. showRyxx();
  1107. $('#zzc').show();
  1108. $('.lj').css('filter','blur(20px)');
  1109. }
  1110. }
  1111. });
  1112. }
  1113. }
  1114. var lxConfirmInterval;
  1115. var hideRyxxTimeout;
  1116. /**
  1117. * 获取轮询结果
  1118. * @param {Object} k
  1119. */
  1120. function jcjl_getScanResult(k){
  1121. $.ajax({
  1122. type: "post",
  1123. url: '@service{name:"jcjl_getScanResult"}@',
  1124. async: true,
  1125. dataType: "json",
  1126. data:{
  1127. privateKey:k
  1128. },
  1129. success: function(data) {
  1130. if(data.status){
  1131. clearInterval(lxConfirmInterval);
  1132. alert(data.msg);
  1133. handleHide("ryxx");
  1134. }
  1135. }
  1136. });
  1137. }
  1138. /**
  1139. * 移除标识
  1140. * @param {Object} k
  1141. */
  1142. function removePrivateKey(k){
  1143. $.ajax({
  1144. type: "post",
  1145. url: '@service{name:"jcjl_removeScanConfirmMap"}@',
  1146. async: true,
  1147. dataType: "json",
  1148. data:{
  1149. privateKey:k
  1150. },
  1151. success: function(data) {
  1152. if(data.status){
  1153. }
  1154. }
  1155. })
  1156. }
  1157. function showRyxx(data){
  1158. $("#confirm-qrcode").hide();
  1159. handleShow("ryxx");
  1160. if(data){
  1161. $("#ryxx").height("339px");
  1162. $("#cancle").hide();
  1163. $('#leave').hide();
  1164. $('#back').hide();
  1165. $("#qrcodeBox").css("z-index",Number($("#jcjllb").css("z-index"))+1);
  1166. qrCodeGenerate(".qrcode-confirm", "@hdGc" + JSON.stringify(data) + "@", 110, 110, "canvas");
  1167. $("#confirm-qrcode").show();
  1168. lxConfirmInterval = setInterval(function(){
  1169. jcjl_getScanResult(data.k);
  1170. },500);
  1171. }else{
  1172. if(direction){
  1173. $("#ryxx").height("339px");
  1174. $('#leave').hide();
  1175. $('#back').hide();
  1176. $("#cancle").hide();
  1177. if(direction == "entrance"){
  1178. createJcjl(11);
  1179. }else{
  1180. createJcjl(51);
  1181. }
  1182. }else{
  1183. $("#ryxx").height("450px");
  1184. $("#cancle").val("取消").show();
  1185. $('#leave').show();
  1186. $('#back').show();
  1187. }
  1188. }
  1189. $("#zzc").click(function(){
  1190. if(data){
  1191. clearInterval(lxConfirmInterval);
  1192. removePrivateKey(data.k);
  1193. }
  1194. handleHide("ryxx");
  1195. });
  1196. hideRyxxTimeout = setTimeout(function(){
  1197. handleHide("ryxx");
  1198. },1000 * 20)
  1199. }
  1200. function hideLrry(){
  1201. $('#lrry').stop(true).fadeOut();
  1202. /* 先去掉,if(lrryClose) 会抛出错误 ReferenceError: lrryClose is not defined,导致不执行后面的语句。Lin
  1203. * clearInterval(lrryClose) 在调用 hideLrry() 前都有调用
  1204. * lrryClose 会被马上赋值:lrryClose = setInterval(function(){hideLrry();}, lrryCloseTime);
  1205. */
  1206. if(lrryClose){
  1207. clearInterval(lrryClose);
  1208. lrryClose = null;
  1209. }
  1210. /* */
  1211. $("#scanner").val("");
  1212. $("#scanner").focus();
  1213. }
  1214. var y = 0;
  1215. /**
  1216. * 根据设备标识获取进出记录
  1217. */
  1218. function showJcjllb(){
  1219. $("#lrry").hide();
  1220. $("#scanner").focus();
  1221. //下拉
  1222. $.ajax({
  1223. type: "post",
  1224. url: '@service{name:"getJcjlBySbbs"}@',
  1225. async: true,
  1226. dataType: "json",
  1227. data:{
  1228. sbbs:beacon.getMacAddress(),
  1229. },
  1230. success: function(data) {
  1231. handleShow("jcjllb");
  1232. if(data.length>0&&$("#ryxx").is(":hidden")){
  1233. $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))+1);
  1234. }
  1235. for(var i=startrn;i<data.length&&i<endrn;i++){
  1236. jcjlEmpty = false;
  1237. var jcjl = data[i];
  1238. var mainState="";
  1239. if(jcjl.jcfxm == 11){
  1240. mainState = "mainState-green";
  1241. }else if(jcjl.jcfxm == 51){
  1242. mainState = "mainState-orange";
  1243. }else if(jcjl.jcfxm == 81){
  1244. mainState = "mainState-inportantrRed";
  1245. }else{
  1246. mainState = "mainState-orange";
  1247. }
  1248. var html = '<div class="jcjllb-child '+mainState+'" style="width:99%; height:350px;position: relative;border:1px white solid;border-radius:5px;background:#fff;'+($(".jcjllb-child").length > 0?"margin-bottom:25px;":"")+'">'
  1249. + '<div style="display:flex;width:680px;margin-left:60px;margin-top:61px;padding-bottom: 50px;">'
  1250. + '<div>'
  1251. + '<input type="hidden" name="ryid" value="'+ jcjl.ryid +'" class="input-text input-number" />';
  1252. if(jcjl.zjzwj){
  1253. <%-- 改。Lin
  1254. html += '<img id="zjz" src="@service{name:"getData"}@&path='+ jcjl.zjzwj +'" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius:3px;"></img>'; --%>
  1255. html += '<img id="zjz" src="/service?ssServ=dlByHttp&path="'+ jcjl.zjzwj +'" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius:3px;"></img>';
  1256. }else{
  1257. <%-- 改。Lin
  1258. html += '<img id="zjz" src="${sessionScope["XMMC"]}/theme/EasyUses/image/default-photo.png" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius:3px;"></img>'; --%>
  1259. html += '<img id="zjz" src="/skin/easy/image/default-photo.png" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius:3px;"></img>';
  1260. }
  1261. html += '</div>'
  1262. + '<table class="xm content-largeText" style="color:#000;">';
  1263. if(jcjl.xm != null){
  1264. html += '<tr>'
  1265. + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> ';
  1266. if(jcjl.dxm&&jcjl.dxm == 'lf'){
  1267. html+= '<span id="xm">'+ jcjl.xm +'(来访)</span> '
  1268. + '</td>'
  1269. + '</tr>';
  1270. }else{
  1271. html += '<span id="xm">'+ jcjl.xm +'</span> '
  1272. + '</td>'
  1273. + '</tr>';
  1274. }
  1275. }
  1276. if(jcjl.bjmc != null){
  1277. html += '<tr>'
  1278. + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> '
  1279. + '<span id="bj" >'+ jcjl.bjmc +'</span> '
  1280. + '</td>'
  1281. + '</tr>';
  1282. }
  1283. if(jcjl.jcsj != null){
  1284. html += '<tr>'
  1285. + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;">'
  1286. + '<span id="xh" >'+ new Date(jcjl.jcsj).format("yyyy-MM-dd hh:mm:ss") +'</span> '
  1287. + '</td>'
  1288. + '</tr>';
  1289. }
  1290. html += '<tr>'
  1291. + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> ';
  1292. //1 请假
  1293. //51 走读
  1294. //91 无原由
  1295. //所有拒绝的进出记录显示为无原由
  1296. if(jcjl.jcfxm == 81){
  1297. html+='<span class="content-largeWarningText" style="vertical-align: top;">不允许离校</span> ';
  1298. }else{
  1299. if(jcjl.lkyym == 1){//请假
  1300. html += '<span class="content-largeWarningText" style="vertical-align: top;color:black;">请假</span>';
  1301. }else if (jcjl.lkyym == 51){
  1302. html+='<span class="content-largeWarningText" style="vertical-align: top;color:black;">走读生</span> ';
  1303. }else{//无原有
  1304. html+='<span class="content-largeWarningText" style="vertical-align: top;">无原由</span> ';
  1305. }
  1306. if(jcjl.tw != null){
  1307. if(jcjl.tw < 37.3){
  1308. html += '<span class="content-largeWarningText" style="color:black;">'+ jcjl.tw +'℃</span>';
  1309. }else{
  1310. html += '<span class="content-largeWarningText" style="color:red;">'+ jcjl.tw +'℃</span>';
  1311. }
  1312. }
  1313. }
  1314. html += '</td></tr>';
  1315. html += '</table>'
  1316. + '</div> '
  1317. + '</div>';
  1318. $('#jcjllb').prepend(html);
  1319. if(startrn==0){
  1320. $('#jcjllb').scrollTop($('#jcjllb')[0].scrollHeight);
  1321. }
  1322. }
  1323. if(data.length>endrn){
  1324. startrn += endrn;
  1325. }else{
  1326. startrn += data.length;
  1327. }
  1328. endrn+=10;
  1329. clearTimeout(hideJcjllb);
  1330. hideJcjllb = setTimeout(function(){
  1331. //取消虚化
  1332. // handleHide("jcjllb");
  1333. },1000 * 20);
  1334. }
  1335. });
  1336. }
  1337. var isDrag = false;
  1338. $(function(e) {
  1339. stylesheetData.ryxxlb_left = $("#ryxxlb").css("left");
  1340. stylesheetData.ryxx_right = $("#ryxx").css("right");
  1341. stylesheetData.lfxx_right = $("#lfxx").css("right");
  1342. stylesheetData.yylf_right = $("#yylf").css("right");
  1343. //2020-12-17添加分辨率兼容的事件
  1344. if (screen.width == 1280&&screen.height == 960){
  1345. // $("#videoID").css({"max-width":"none","width":"1706","margin-left":"-194px"});
  1346. $("#videoID").css({"max-width":"none","width":"1920","margin-left":"-320px"});
  1347. $("#lrry").css("left","55%");
  1348. }
  1349. //2020-10-29添加下滑的事件
  1350. $("#jcjllb").on('touchstart',function(e){
  1351. y = e.originalEvent.touches["0"].screenY;
  1352. });
  1353. $("#jcjllb").on('touchend',function(e){
  1354. e.stopPropagation();
  1355. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1356. return;
  1357. }
  1358. if(e.originalEvent.changedTouches["0"].screenY>y){
  1359. showJcjllb()
  1360. }
  1361. });
  1362. $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))-1);
  1363. touch.on('#jcjllb', 'touchend', function (e) {
  1364. e.stopPropagation();
  1365. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1366. return;
  1367. }
  1368. if(e.y>y){
  1369. isDrag = true;
  1370. showJcjllb()
  1371. }else{
  1372. isDrag = false;
  1373. }
  1374. });
  1375. document.onmousedown = function(e) {
  1376. var nextTime = new Date().getTime();
  1377. lastTime = nextTime;
  1378. /*
  1379. var nextTime = new Date().getTime();
  1380. var code = e.which;
  1381. var char = String.fromCharCode(code);
  1382. if (codeString == "") {
  1383. codeString += char;
  1384. } else if (nextTime - lastTime <= 30) {
  1385. codeString += char;
  1386. }
  1387. lastTime = nextTime;*/
  1388. };
  1389. touch.on('#jcjllb', 'touchstart', function (event) {
  1390. y = event.y;
  1391. });
  1392. getDatesInfo()
  1393. var codeString = "";
  1394. //定时器每隔200ms 清空codeString
  1395. /*var scanTimeer = setInterval(function() {
  1396. var now = new Date().getTime();
  1397. if (now - lastTime > 200) {
  1398. if (codeString.length > 0) {
  1399. onScanInput(codeString.replace(/\s+/g,""));
  1400. }
  1401. codeString = "";
  1402. }
  1403. }, 200);*/
  1404. var scanTimeer = setInterval(function() {
  1405. var now = new Date().getTime();
  1406. if (now - lastTime > 500) {
  1407. if ($("#scanner").val().length > 0) {
  1408. onScanInput($("#scanner").val().replace(/\s+/g,""));
  1409. $("#scanner").val("");
  1410. }
  1411. //codeString = "";
  1412. }
  1413. }, 500);
  1414. var lastTime;
  1415. var caseFormat = false;
  1416. document.onkeydown = function(e) {
  1417. var nextTime= new Date().getTime();
  1418. lastTime = nextTime;
  1419. /*var code = e.which;
  1420. var char = String.fromCharCode(code);
  1421. if (codeString == "") {
  1422. codeString += char;
  1423. } else if (nextTime - lastTime <= 30) {
  1424. codeString += char;
  1425. }
  1426. lastTime = nextTime;*/
  1427. };
  1428. $("#scanner").focus();
  1429. window.onbeforeunload= function(event) {
  1430. if(!beacon){
  1431. return;
  1432. }
  1433. beacon.shutDownIdcardDevice();
  1434. }
  1435. });
  1436. /**
  1437. * 显示时间
  1438. */
  1439. function getDatesInfo() {
  1440. var date=new Date();
  1441. var dates=date.getDate(),month=date.getMonth()+1,hours=date.getHours(),seconds=date.getMinutes(),year=date.getFullYear();
  1442. if(hours<10){
  1443. hours="0"+hours
  1444. }
  1445. if(seconds<10){
  1446. seconds="0"+seconds;
  1447. }
  1448. $("#getDateInfo").children("span")[0].innerHTML= year+"/" + month + "/" + dates;
  1449. $("#getDateInfo").children("span")[1].innerHTML = "" + hours + ":" + seconds;
  1450. }
  1451. setInterval(function () {
  1452. getDatesInfo()
  1453. },1000)
  1454. /**
  1455. *
  1456. * 未知功能
  1457. */
  1458. top.changeIdcard = function(idCardInfo){
  1459. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1460. wd.display.alert("请先登录!");
  1461. return;
  1462. }
  1463. idCardInfo = JSON.parse(idCardInfo);
  1464. var idCardNo = idCardInfo.sfzh;
  1465. console.log(idCardNo);
  1466. $.ajax({
  1467. type: "post",
  1468. url: '@service{name:"lf_yyxx_cx"}@',
  1469. async: true,
  1470. dataType: "json",
  1471. data:{
  1472. sfzh:idCardNo,
  1473. },
  1474. success: function(data) {
  1475. console.log(data);
  1476. if (data.error == '1') {
  1477. wd.display.alert(data.msg);
  1478. $('#yylf').hide();
  1479. handleShow("lfxx");
  1480. $('#jfsfzh').val(idCardNo);
  1481. $('#jfxm').val(idCardInfo.xm.replace(/\s+/g,""));
  1482. if(idCardNo.length == 15){
  1483. wd.edit.objectPicker.getInstance("xbm").initValue(idCardNo.substring(14,15)%2==0?2:1);
  1484. }else{
  1485. wd.edit.objectPicker.getInstance("xbm").initValue(idCardNo.substring(16,17)%2==0?2:1);
  1486. }
  1487. } else {
  1488. $('#lfxx').hide();
  1489. $('#yylf').show();
  1490. $('#yylfxm').text(idCardInfo.xm.replace(/\s+/g,""));
  1491. $('#yylfsfzh').text(idCardNo);
  1492. $('#yylfrs').text(data.rs);
  1493. $('#yylfyysj').text(new Date(data.yysj).toLocaleString('chinese', { hour12: false }).replace(/\//g,'-'));
  1494. lfid = data.lfid;
  1495. $('#zzc').show();
  1496. $('.lj').css('filter','blur(20px)');
  1497. }
  1498. }
  1499. });
  1500. }
  1501. /**
  1502. *
  1503. * 接访人查询
  1504. * @param {Object} isjfr
  1505. * @param {Object} usexm 搜索姓名
  1506. */
  1507. function lf_jfr_cx(isjfr,usexm){
  1508. var jfbmid = $('#jfbmid').val();
  1509. var jfbjid = $('#jfbjid').val();
  1510. var jfryna = $('#jfryna').val();
  1511. $.ajax({
  1512. url: "<serv.ss name='gate_selRyOptByBjidOrBmid'/>", // :"lf_jfr_cx"。Lin
  1513. type: 'post',
  1514. dataType: 'json',
  1515. data: {
  1516. bmid: jfbmid,
  1517. bjid: jfbjid,
  1518. xm: usexm ? jfryna : ''
  1519. },
  1520. success: function(data) {
  1521. console.log(data);
  1522. /// 增加,显示错误信息。Lin
  1523. if (data.error == '1') {
  1524. wd.display.alert(data.msg);
  1525. return;
  1526. }
  1527. ///
  1528. $('#jfryid_option').empty();
  1529. $('#jfryid_option').append('<div class="popupList" status="noitem" checkstate="unselected" value=""></div>');
  1530. for(var i = 0; i < data.length; i++){
  1531. $('#jfryid_option').append('<div class="popupList" status="people" value="'+ data[i].ryid +'" index="'+ i +'" checkstate="unselected">'+ data[i].xm +'</div>');
  1532. }
  1533. if(!isjfr){
  1534. $('#jfryna').val('');
  1535. $('#jfryid').val('');
  1536. globalJfryna = '';
  1537. globalJfryid = '';
  1538. }
  1539. }
  1540. });
  1541. }
  1542. wd.edit.objectPicker.getInstance("jfbmid").onchange = function(){
  1543. lf_jfr_cx(false,false);
  1544. }
  1545. wd.edit.objectPicker.getInstance("jfbjid").onchange = function(){
  1546. lf_jfr_cx(false,false);
  1547. }
  1548. function lfxxClear(){
  1549. $('jfsfzh').val('');
  1550. $('#jfxm').val('');
  1551. wd.edit.objectPicker.getInstance("jfbmid").initValue();
  1552. wd.edit.objectPicker.getInstance("xbm").initValue();
  1553. wd.edit.objectPicker.getInstance("jfbjid").initValue();
  1554. wd.edit.objectPicker.getInstance("syid").initValue();
  1555. $('#jfrs').val('1');
  1556. }
  1557. var jcjlcxsj;
  1558. var dsscjcjl;
  1559. var isProcessingBatch = false; // 全局锁,防止批量处理时重复调用
  1560. var cardHideTimer = null; // 卡片隐藏定时器
  1561. var hasCards = false; // 是否有卡片显示
  1562. /**
  1563. * 有gate2的情况下:不显示历史进出记录;gate1在左边,gata2右边
  1564. * 有gata1的情况下:历史进出记录列表在右边
  1565. *
  1566. * @return {[type]} [description]
  1567. */
  1568. var stylesheetData = {};
  1569. function handleShow(type){
  1570. $('.lj').css('filter','blur(20px)');
  1571. if(type == "ryxx"){
  1572. $('#ryxx').show();
  1573. handleHide("lfxx");
  1574. handleHide("yylf");
  1575. if($(".ryxxlb-child").length>0){
  1576. handleHide("jcjllb");
  1577. $("#ryxxlb").css("left","30px");
  1578. $("#ryxx").css("right","30px");
  1579. }else if($(".jcjllb-child").length>0){
  1580. $("#ryxx").css("left","30px");
  1581. }else{
  1582. $("#ryxx").css("left","");
  1583. $("#ryxx").css("right",stylesheetData.ryxx_right);
  1584. }
  1585. }else if(type == "ryxxlb"){
  1586. if($("#ryxx").is(":visible")){
  1587. $("#ryxxlb").css("left","30px");
  1588. $("#ryxx").css("right","30px");
  1589. }else if($("#lfxx").is(":visible")){
  1590. $("#ryxxlb").css("left","30px");
  1591. $("#lfxx").css("right","30px");
  1592. }else if($("#yylf").is(":visible")){
  1593. $("#ryxxlb").css("left","30px");
  1594. $("#yylf").css("right","30px");
  1595. }else if($(".jcjllb-child").length>0){
  1596. $("#ryxxlb").css("left","30px");
  1597. }else{
  1598. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1599. }
  1600. }else if(type == "jcjllb"){
  1601. //ryxxlb左移
  1602. $("#ryxxlb").css("left","30px");
  1603. }else if(type == "lfxx"){
  1604. $('#zzc').show();
  1605. $('#lfxx').show();
  1606. handleHide("ryxx");
  1607. handleHide("yylf");
  1608. handleHide("jcjllb");
  1609. if($(".ryxxlb-child").length>0){
  1610. $("#ryxxlb").css("left","30px");
  1611. $("#lfxx").css("right","30px");
  1612. }else if($(".jcjllb-child").length>0){
  1613. $("#lfxx").css("left","30px");
  1614. }else{
  1615. $("#lfxx").css("right",stylesheetData.lfxx_right);
  1616. $("#lfxx").css("left","");
  1617. }
  1618. }else if(type == "yylf"){
  1619. $('#yylf').show();
  1620. $('#zzc').show();
  1621. handleHide("ryxx");
  1622. handleHide("lfxx");
  1623. handleHide("jcjllb");
  1624. if($(".ryxxlb-child").length>0){
  1625. $("#ryxxlb").css("left","30px");
  1626. $("#yylf").css("right","30px");
  1627. }else if($(".jcjllb-child").length>0){
  1628. $("#yylf").css("left","30px");
  1629. }else{
  1630. $("#yylf").css("right",stylesheetData.yylf_right);
  1631. $("#yylf").css("left","");
  1632. }
  1633. }
  1634. }
  1635. var startrn = 0;
  1636. var endrn = 10;
  1637. var hideJcjllb;
  1638. var jcjlEmpty = true;
  1639. setInterval(function(){
  1640. if($("#ryxx").is(":hidden")&&jcjlEmpty&&$(".ryxxlb-child").length == 0&&$("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")){
  1641. $('.lj').css('filter','blur(0px)');
  1642. }
  1643. },50);
  1644. /**
  1645. * 主要用来去掉虚化的背景
  1646. * @param {[type]} flag [description]
  1647. * @return {[type]} [description]
  1648. */
  1649. function handleHide(type){
  1650. if(type == "ryxx"){
  1651. $('#ryxx').hide();
  1652. sfzh = '';
  1653. $("#scanner").focus();
  1654. $("#confirm-qrcode").hide();
  1655. $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))+1);
  1656. if($(".ryxxlb-child").length>0){
  1657. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1658. }else if($("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")&&jcjlEmpty){
  1659. $('#zzc').hide();
  1660. $('.lj').css('filter','blur(0px)');
  1661. }
  1662. }else if(type == "ryxxlb"){
  1663. // 清除10秒自动隐藏的定时器
  1664. if(cardHideTimer){
  1665. clearTimeout(cardHideTimer);
  1666. cardHideTimer = null;
  1667. }
  1668. // 手动关闭所有卡片
  1669. var $container = $('#ryxxlb');
  1670. var $allCards = $container.find('.ryxxlb-child');
  1671. if($allCards.length > 0){
  1672. $allCards.addClass('fade-out');
  1673. setTimeout(function(){
  1674. $allCards.remove();
  1675. }, 400);
  1676. }
  1677. // 恢复视频播放
  1678. if(hasCards){
  1679. var $video = $('#videoID');
  1680. if($video.length > 0){
  1681. $video[0].play();
  1682. hasCards = false;
  1683. console.log("▶️ 手动关闭卡片,恢复视频播放");
  1684. }
  1685. }
  1686. if($("#ryxx").is(":visible")){
  1687. $("#ryxx").css("right",stylesheetData.ryxx_right);
  1688. }else if($("#lfxx").is(":visible")){
  1689. $("#lfxx").css("right",stylesheetData.lfxx_right);
  1690. }else if($("#yylf").is(":visible")){
  1691. $("#yylf").css("right",stylesheetData.lfxx_right);
  1692. }else if (jcjlEmpty){
  1693. $('.lj').css('filter','blur(0px)');
  1694. }
  1695. }else if(type == "jcjllb"){
  1696. if($(".ryxxlb-child").length == 0&&$("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")){
  1697. $('.lj').css('filter','blur(0px)');
  1698. }
  1699. $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))-1);
  1700. $("#jcjllb").empty();
  1701. jcjlEmpty = true;
  1702. startrn = 0;
  1703. endrn = 10;
  1704. if($("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")){
  1705. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1706. }
  1707. }else if(type == "lfxx"){
  1708. $('#lfxx').hide();
  1709. if($(".ryxxlb-child").length>0){
  1710. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1711. }else if($("#ryxx").is(":hidden")&&$("#yylf").is(":hidden")&&jcjlEmpty){
  1712. $('.lj').css('filter','blur(0px)');
  1713. $('#zzc').hide();
  1714. }
  1715. lfxxClear();
  1716. }else if(type == "yylf"){
  1717. $('#yylf').hide();
  1718. if($(".ryxxlb-child").length>0){
  1719. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1720. }else if($("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")&&jcjlEmpty){
  1721. $('.lj').css('filter','blur(0px)');
  1722. $('#zzc').hide();
  1723. }
  1724. }
  1725. }
  1726. /**
  1727. * 获取闸门进出记录+显示 (三区域版本 - 支持批量处理)
  1728. */
  1729. function getAutodoorInfo(){
  1730. // 如果正在处理批量数据,跳过本次请求
  1731. if(isProcessingBatch){
  1732. console.log("⏸️ 正在处理批量数据,跳过本次请求");
  1733. return;
  1734. }
  1735. $.ajax({
  1736. url: "<serv.ss name='gate_selIoHstByTime'/>", // :"jcjl_zm_cx"。Lin
  1737. type: 'post',
  1738. dataType: 'json',
  1739. data: {
  1740. mjdid: mjdid,
  1741. jcjlcxsj: jcjlcxsj
  1742. },
  1743. success: function(data) {
  1744. if(data.length == 0) return;
  1745. handleShow("ryxxlb");
  1746. console.log("📥 进出记录:",data)
  1747. $("#ryxxlb").css("z-index",Number($("#jcjllb").css("z-index"))+1);
  1748. $('.lj').css('filter','blur(20px)');
  1749. // 设置处理标志
  1750. isProcessingBatch = true;
  1751. // 批量处理数据,带延迟动画
  1752. processRecordsBatch(data, 0);
  1753. }
  1754. });
  1755. }
  1756. /**
  1757. * 批量处理记录 (递归方式,带动画延迟)
  1758. * @param records 记录数组
  1759. * @param index 当前处理索引
  1760. */
  1761. function processRecordsBatch(records, index){
  1762. if(index >= records.length){
  1763. // 所有记录处理完毕,延迟释放锁(等待最后一张卡片动画完成)
  1764. setTimeout(function(){
  1765. isProcessingBatch = false;
  1766. console.log("✅ 批量处理完成,释放锁");
  1767. // 注意: 10秒倒计时已经在pushCardToThreeAreas中每次推送时自动重置
  1768. }, 1000);
  1769. return;
  1770. }
  1771. // 第一张卡片时暂停视频
  1772. if(index == 0 && !hasCards){
  1773. pauseVideo();
  1774. }
  1775. var jcjl = records[index];
  1776. // 判断进出类型
  1777. var cardType = getCardType(jcjl);
  1778. // 生成卡片HTML
  1779. var html = buildCardHtml(jcjl, cardType);
  1780. // 执行三区域推送逻辑
  1781. pushCardToThreeAreas(html, cardType);
  1782. console.log("🎬 处理第 " + (index + 1) + "/" + records.length + " 条: " + jcjl.xm + " (" + cardType + ")");
  1783. // 更新查询时间戳 (最后一条)
  1784. if(index == records.length - 1){
  1785. jcjlcxsj = new Date(jcjl.jcsj);
  1786. jcjlcxsj.setTime(jcjlcxsj.getTime() + 1000);
  1787. jcjlcxsj = jcjlcxsj.toLocaleString('chinese', { hour12: false }).replace(/\//g,'-');
  1788. console.log("🕐 更新时间戳:", jcjlcxsj);
  1789. }
  1790. // 递归处理下一条 (延迟1200ms,确保动画完整播放)
  1791. // 动画时长: 淡入50ms + 滑动800ms + 淡出400ms = 1250ms
  1792. if(index < records.length - 1){
  1793. setTimeout(function(){
  1794. processRecordsBatch(records, index + 1);
  1795. }, 1200);
  1796. }
  1797. }
  1798. /**
  1799. * 判断卡片类型
  1800. * @param jcjl 进出记录对象
  1801. * @return 'enter' | 'leave' | 'vacation'
  1802. */
  1803. function getCardType(jcjl){
  1804. // jcfxm=11 进入
  1805. if(jcjl.jcfxm == 11){
  1806. return 'enter';
  1807. }
  1808. // jcfxm=51 且 lkyym=1 请假离校
  1809. if(jcjl.jcfxm == 51 && jcjl.lkyym == 1){
  1810. return 'vacation';
  1811. }
  1812. // jcfxm=51 且 (lkyym=51 或 lkyym=91) 离校
  1813. if(jcjl.jcfxm == 51 && (jcjl.lkyym == 51 || jcjl.lkyym == 91)){
  1814. return 'leave';
  1815. }
  1816. // 默认为离校
  1817. return 'leave';
  1818. }
  1819. /**
  1820. * 生成卡片HTML
  1821. * @param jcjl 进出记录对象
  1822. * @param cardType 卡片类型
  1823. * @return HTML字符串
  1824. */
  1825. function buildCardHtml(jcjl, cardType){
  1826. // 根据类型设置颜色和状态文本
  1827. var mainState = '';
  1828. var statusText = '';
  1829. var statusClass = '';
  1830. if(cardType == 'enter'){
  1831. mainState = 'mainState-blue'; // 蓝色 - 进校
  1832. statusText = '进校';
  1833. statusClass = 'status-enter';
  1834. }else if(cardType == 'leave'){
  1835. mainState = 'mainState-green'; // 绿色 - 离校
  1836. statusText = '离校';
  1837. statusClass = 'status-leave';
  1838. }else if(cardType == 'vacation'){
  1839. mainState = 'mainState-orange'; // 橙色 - 请假
  1840. statusText = '请假'; // 改为"请假"而不是"请假离校"
  1841. statusClass = 'status-vacation';
  1842. }
  1843. var html = '<div class="ryxxlb-child '+mainState+'" data-type="'+cardType+'" style="border:1px white solid;border-radius:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:40px 30px;">'
  1844. + '<input type="hidden" name="ryid" value="'+ jcjl.ryid +'" />';
  1845. // 照片 (尺寸由CSS根据位置类控制)
  1846. if(jcjl.zjzwj){
  1847. html += '<img class="card-photo" src="/service?ssServ=dlByHttp&path='+ jcjl.zjzwj +'" style="border: 2px solid #cccccc;border-radius:8px;margin-bottom:30px;transition:all 0.8s cubic-bezier(0.4,0,0.2,1);" onerror="this.src=\'/skin/easy/image/default-photo.png\'"/>';
  1848. }else{
  1849. html += '<img class="card-photo" src="/skin/easy/image/default-photo.png" style="border: 2px solid #cccccc;border-radius:8px;margin-bottom:30px;transition:all 0.8s cubic-bezier(0.4,0,0.2,1);"/>';
  1850. }
  1851. // 名字+班级 (两端对齐 - 使用弹性盒布局)
  1852. html += '<div class="name-class-container" style="width:100%;display:flex;justify-content:space-between;margin-bottom:20px;font-weight:bold;color:#000;transition:all 0.8s cubic-bezier(0.4,0,0.2,1);">';
  1853. if(jcjl.xm != null){
  1854. html += '<span class="name-text">'+ jcjl.xm +'</span>';
  1855. }
  1856. if(jcjl.bjmc != null){
  1857. html += '<span class="class-text">'+ jcjl.bjmc +'</span>';
  1858. }
  1859. html += '</div>';
  1860. // 状态 (颜色由CSS类控制)
  1861. html += '<div class="status-text '+statusClass+'" style="font-weight:bold;border-radius:8px;transition:all 0.8s cubic-bezier(0.4,0,0.2,1);">'+ statusText +'</div>';
  1862. html += '</div>';
  1863. return html;
  1864. }
  1865. /**
  1866. * 视频播放控制 - 有卡片时暂停,10秒无新卡片后恢复
  1867. */
  1868. function pauseVideo(){
  1869. var $video = $('#videoID');
  1870. if($video.length > 0){
  1871. $video[0].pause();
  1872. hasCards = true;
  1873. console.log("⏸️ 视频暂停");
  1874. }
  1875. }
  1876. function resumeVideoAfterDelay(){
  1877. // 清除之前的定时器
  1878. if(cardHideTimer){
  1879. clearTimeout(cardHideTimer);
  1880. }
  1881. // 10秒后隐藏卡片并恢复视频
  1882. cardHideTimer = setTimeout(function(){
  1883. var $container = $('#ryxxlb');
  1884. var $allCards = $container.find('.ryxxlb-child');
  1885. if($allCards.length > 0){
  1886. console.log("🎬 10秒无新卡片,隐藏所有卡片并恢复视频");
  1887. // 隐藏所有卡片
  1888. $allCards.addClass('fade-out');
  1889. setTimeout(function(){
  1890. $allCards.remove();
  1891. $('.lj').css('filter','none'); // 恢复背景清晰度
  1892. }, 400);
  1893. // 恢复视频播放
  1894. var $video = $('#videoID');
  1895. if($video.length > 0){
  1896. $video[0].play();
  1897. hasCards = false;
  1898. console.log("▶️ 视频恢复播放");
  1899. }
  1900. }
  1901. }, 10000);
  1902. }
  1903. /**
  1904. * 三区域推送逻辑 (Grid布局版 - 固定位置平滑移动)
  1905. * @param html 卡片HTML
  1906. * @param cardType 卡片类型 ('enter'|'leave'|'vacation')
  1907. */
  1908. function pushCardToThreeAreas(html, newCardType){
  1909. var $container = $('#ryxxlb');
  1910. var $leftCard = $container.find('.ryxxlb-child-left');
  1911. var $centerCard = $container.find('.ryxxlb-child-center');
  1912. var $rightCard = $container.find('.ryxxlb-child-right');
  1913. var $newCard = $(html);
  1914. // 每次推送新卡片时,重置10秒自动隐藏计时器
  1915. resumeVideoAfterDelay();
  1916. // 如果没有中间卡片,直接放中间
  1917. if($centerCard.length == 0){
  1918. $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
  1919. $container.append($newCard);
  1920. setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
  1921. return;
  1922. }
  1923. // 获取当前中间卡片的类型
  1924. var currentCenterType = $centerCard.attr('data-type');
  1925. // 根据【当前中间卡片】的类型决定推送方向 (不管新卡片是什么)
  1926. if(currentCenterType == 'enter'){
  1927. // 当前中间是进校 → 往左推
  1928. var $allCards = $container.find('.ryxxlb-child');
  1929. // 只有当已经有3张卡片时,才删除最左边的
  1930. if($allCards.length >= 3 && $leftCard.length > 0){
  1931. console.log("🗑️ 删除最左边卡片,当前总数:", $allCards.length);
  1932. $leftCard.addClass('fade-out');
  1933. setTimeout(function(){ $leftCard.remove(); }, 400);
  1934. }
  1935. // 当前中间移到左边
  1936. $centerCard.removeClass('ryxxlb-child-center')
  1937. .addClass('ryxxlb-child-left');
  1938. // 新卡片淡入中间
  1939. $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
  1940. $container.append($newCard);
  1941. setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
  1942. }else{
  1943. // 当前中间是离校/请假 → 往右推
  1944. var $allCards = $container.find('.ryxxlb-child');
  1945. // 只有当已经有3张卡片时,才删除最右边的
  1946. if($allCards.length >= 3 && $rightCard.length > 0){
  1947. console.log("🗑️ 删除最右边卡片,当前总数:", $allCards.length);
  1948. $rightCard.addClass('fade-out');
  1949. setTimeout(function(){ $rightCard.remove(); }, 400);
  1950. }
  1951. // 当前中间移到右边
  1952. $centerCard.removeClass('ryxxlb-child-center')
  1953. .addClass('ryxxlb-child-right');
  1954. // 新卡片淡入中间
  1955. $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
  1956. $container.append($newCard);
  1957. setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
  1958. }
  1959. }
  1960. var zmxxhq;
  1961. if(${not empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1962. // 防止重复启动定时器
  1963. if(zmxxhq) clearInterval(zmxxhq);
  1964. zmxxhq = setInterval(getAutodoorInfo,1000);
  1965. console.log("闸门信息获取定时器已启动, ID:", zmxxhq);
  1966. }
  1967. /**
  1968. * 绑定门卫id
  1969. */
  1970. /* 再去掉,没用到,也不用 < 打开 gateHome.home.jsp 时,写到 门禁点.门卫ID。此时,写入的 .门卫ID 为空(还没登录) < 也不能每次换班都写。Lin
  1971. function bindMwid(){
  1972. $.ajax({
  1973. url: "<serv.ss name='gate_bindMwidByMjd'/>", // :"mjd_bind_mwid"。Lin
  1974. type: 'post',
  1975. dataType: 'json',
  1976. data: {
  1977. /// * 改,直接用页面写死的 sbbs(<input name="sbbs") -- 因抛出错误 "beacon is not defined",后面的程序被越过。Lin
  1978. // sbbs: beacon.getMacAddress(),
  1979. /// *
  1980. sbbs: $("input[name=sbbs]").val(),
  1981. mwid: "$@{sessionScope.ssUser.ryid}" // ['env.ry'].。Lin
  1982. },
  1983. success: function(data) {
  1984. }
  1985. });
  1986. }
  1987. */
  1988. /**
  1989. * 检查session是否有效
  1990. */
  1991. if(${not empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1992. setInterval(function(){
  1993. $.ajax({
  1994. url: "<serv.ss name='gate_chkSess'/>", // :"mjd_check_session"。Lin
  1995. type: 'post',
  1996. dataType: 'json',
  1997. success: function(data) {
  1998. if(data.isvalid == '0'){
  1999. window.location.href = "/";
  2000. }
  2001. }
  2002. });
  2003. },1000 * 10);
  2004. }
  2005. </script>
  2006. </html>