| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156 |
- <%@ page import="ss.WebC" %>
- <html>
- <head>
- <title>${sessionScope.projectUrlDesc}</title>
- <%-- 先去掉,应该没用到。Lin
- <wd:write type="skin" t="dialog" />
- <wd:write type="skin" t="menu" />
- --%>
- <skin.ss file="/ss/gate"/>
- <js.ss file="/ss/appauthority.js"/>
- <js.ss file="/ss/qrcode/qrcode.js"/>
- <js.ss file="/ss/qrcode/jquery.qrcode.js"/>
- <%-- 先去掉,应该没用到。Lin
- <script type="text/javascript" src="mobile/js/iscroll.js"></script>
- --%>
- <js.ss file="/ss/touch.min.js"/>
- </head>
- <style>
- *{
- margin: 0px;
- padding: 0px;
- }
- body{
- width: 100%;
- height: 100%;
- }
- #ascrail2009{
- display:none!important;
- }
- video {
- position: fixed;
- max-width: 100%;
- min-height: 100%;
- height: auto;
- width: 100%;
- object-fit:fill;
- z-index: -999;
- }
- .login-pageBackground {
- background:none!important;
- }
- input::-webkit-input-placeholder{
- color:#fff!important;
- }
- .content-largeText td{
- width: 410px;
- padding-left: 60px;
- }
- .selectedStyle{
- width: 388px;
- margin: 1px 0px 0px 1px;
- font-family: Microsoft YaHei;
- padding: 0px 0 0 5px;
- line-height: 40px;
- height: 50px;
- border: 2px solid #cccccc;
- border-radius: 2px;
- appearance: none;
- font-size:36px ;
- -moz-appearance: none;
- -webkit-appearance: none;
- background: url("/skin/easy/image/dialog-select-icon.png") no-repeat 360px 18px;
- overflow:auto !important;
- }
- .selectedStyle option{
- font-size:30px !important;
- }
- select::-webkit-scrollbar {
- cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
- width: 8px;
- }
- select::-webkit-scrollbar-track {
- background-color: none;
- border-radius: 5px;
- cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
- }
- select::-webkit-scrollbar-thumb {
- background: #b7b7b7;
- cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
- border-radius: 5px;
- }
-
- </style>
- <body style="margin:0px;padding:0px;" id="body">
- <input name="sbbs" type="hidden" value='dm'/> <%-- ='4OBKLLHDgszyEqmf5vFmuw=='。改为 .场地号。Lin --%>
- <input name="sbmc" type="hidden" />
- <video id="videoID" class="lj" muted autoplay="autoplay" loop="loop" style="display:block;overflow: hidden;">
- <source src="/skin/easy/hugeLogo.mov" > <%-- ="${sessionScope['XMMC']}/video/logo/hugeLogo.mov"。Lin --%>
- </video>
- <div class="login-pageBackground" style="display: flex;justify-content: center;align-items: center;">
- <div id="zzc" style="position: absolute;width: 100%;height: 100%;background: #888; z-index: 10000;opacity: 0;display: none;"></div>
- <%--显示时间--%>
- <div id="getDateInfo" class="getDateInfo lj">
- <span></span><span></span>
- </div>
- <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;">
- <div style="display:flex;width:680px;margin-left:60px;margin-top:61px;padding-bottom: 50px; border-bottom: 1px solid #cccccc;">
- <div>
- <input type="hidden" name="ryid" value="${ryid}" class="input-text input-number" />
- <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 --%>
- </div>
- <table class='xm content-largeText' style="color:#000;">
- <tr>
- <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="xm"></span></td>
- </tr>
- <tr>
- <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="bj" ></span></td>
- </tr>
- <tr>
- <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="xh" ></span></td>
- </tr>
- <tr>
- <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;">
- <span id="lxlb" class="content-largeWarningText" style="vertical-align: top;"></span>
- <span id="lxlbts" class="content-largeWarningText" style="display:none;vertical-align: top;">
- <img src="/skin/easy/image/warning.gif" style=" width: 60px;height: 60px;top: -2px;position: relative; "/> <%-- ="${sessionScope['XMMC']}/theme/EasyUses/image/warning.gif"。Lin --%>
- </span>
- </td>
- </tr>
- </table>
- </div>
- <div style="width: 100%;padding-top: 30px;text-align: center;">
- <input type="button" class="bottom-button " value="离校" id="leave" />
- <input type="button" class="bottom-button " value="返校" id="back" />
- <input type="button" class="bottom-button " value="取消" id="cancle" />
- </div>
- </div>
- <%--预约来访--%>
- <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;">
- <div style="display:flex;width:690px;margin-left:55px;margin-top:25px;padding-bottom: 50px; border-bottom: 1px solid #cccccc;">
- <table class='content-largeText' style="line-height: 50px;">
- <tr>
- <th>姓名</th>
- <td><span id="yylfxm" name="xm" ></span></td>
- </tr>
- <tr>
- <th>身份证号</th>
- <td><span id="yylfsfzh" name="sfzh" ></span></td>
- </tr>
- <tr>
- <th>人数</th>
- <td><span id="yylfrs" name="rs" ></span></td>
- </tr>
- <tr>
- <th>预约时间</th>
- <td><span id="yylfyysj" name="yysj" format="yyyy-MM-dd HH:mm:ss" miniDate="false"></span></td> <%-- 等 新UI 弄好了再改。Lin --%>
- </tr>
- </table>
- </div>
- <div style="width: 100%;padding-top: 25px;text-align: center;">
- <%-- 去掉,移到录入来访信息界面了 -- "确定" 按钮改为 "进入" 了。Lin
- <in@put type="button" class="bottom-button " value="进入" id="yylf_come" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
- --%>
- <input type="button" class="bottom-button " value="离开" id="yylf_leave" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
- <input type="button" class="bottom-button " value="取消" id="yylf_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
- </div>
- </div>
- <%--来访信息--%>
- <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;">
- <div style="display: flex; width: 100%;padding-bottom: 50px;border-bottom: 1px solid #cccccc;justify-content: flex-end;">
- <table class='content-largeText' style="width:100%; line-height: 52px;">
- <tr>
- <th>姓名</th>
- <td><input id="jfxm" name="xm"/></td>
- </tr>
- <tr>
- <th>性别</th>
- <td>
- <input id="jfxbm" name="xbm" type="hidden" />
- <objp.ss name="xbm" cb="xb" inp="true"/>
- </td>
- </tr>
- <tr>
- <th>身份证号</th>
- <td><input id="jfsfzh" name="sfzh"/></td>
- </tr>
- <tr>
- <th>接访部门</th>
- <td>
- <input id="jfbmid" name="jfbmid" type="hidden"/>
- <objp.ss name="jfbmid" cb="jfbm" inp="true"/>
- </td>
- </tr>
- <tr>
- <th>接访班级</th>
- <td>
- <input id="jfbjid" name="jfbjid" type="hidden" />
- <objp.ss name="jfbjid" cb="jfbj" inp="true"/>
- </td>
- </tr>
- <tr>
- <th>接访人</th>
- <td>
- <div id="jfr-div">
- <div class="input-div input-s">
- <input name="jfryid" id="jfryid" type="hidden"/>
- <input name="jfryna" id="jfryna" style="margin: 0;"/>
- <span id="jfryid_button" class="smallButton icon-down" style="top: 5px !important;" onselectstart="return false;"></span>
- </div>
- <div id="jfryid_option" class="popup-div hLine-highlightBlod objectPickerOption scrollbar" style="display:none;max-height: 250px;z-index: 10000;" onselectstart="return false;">
- </div>
- </div>
- </td>
- </tr>
- <tr>
- <th>事由</th>
- <td>
- <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>
- <script type="text/javascript" charset="utf-8">
- wd.edit.initGrowHigh('jfsy','null',{},null,false);
- </script>
- <span></span>
- <input id="syid" name="syid" type="hidden"/>
- <objp.ss name="syid" cb="lfsy" inp="true" add="true"/>
- </td>
- </tr>
- <tr>
- <th>人数</th>
- <td>
- <input id="jfrs" name="rs" value= "1" oninput="value=value.replace(/[^\d]/g,'')"/>
- </td>
- </tr>
- </table>
- </div>
- <div style="width:100%;padding-top:25px;text-align:center;">
- <%-- "确定" 改为 "进入",去掉后面的来访者离校的办理界面里的 "进入" 按钮(只有 "离开" 按钮) -- 填写来访信息时,就进入(增加写 来访.接访开始时间)。Lin
- <in@put id="lfqd" type="button" class="bottom-button " value="确定" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" /> --%>
- <input id="lfqd" type="button" class="bottom-button " value="进入" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
- <input type="button" class="bottom-button " value="取消" id="jf_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
- </div>
- </div>
- <div id="scannerDiv" style="opacity: 0;">
- <input id="scanner"/>
- </div>
- <%--录入人员--%>
- <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;">
- <table class='xm' style="color:#000;">
- <tr>
- <td>
- <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;" />
- </td>
- <td style="text-align: center;">
- <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" />
- </td>
- <td style="text-align: center;padding-left: 100px;">
- <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" />
- </td>
- </tr>
- </table>
- </div>
- <div id="ryxxlb" style="color:black;z-index:-1;"></div>
- <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>
- <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;">
- <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;">
- 是否重启?
- </div>
- <div style="width: 100%;padding-top: 25px;text-align: center;">
- <input type="button" class="bottom-button " value="是" id="SFrefresh_qr" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
- <input type="button" class="bottom-button " value="否" id="SFrefresh_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
- </div>
- </div>
-
- <div class="bottomright" id="qrcodeBox" style="z-index: -2; display:block;">
- <%--默认图片--%>
- <!-- <equal.ss val='${empty sessionScope.ssUser}' val2="true"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
- <div id="login-before" style="width:110px;height:144px;background:rgba(255,255,255,0.4);border-radius:2px;margin-bottom: -7px; ">
- <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 --%>
- <div class="xx">
- <div class="qrcode-text " style="color: #000;" >未登录</div>
- </div>
- </div>
- </equal.ss> -->
- <%--未登录显示二维码--%>
- <equal.ss val='${empty sessionScope.ssUser}' val2="true"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
- <!-- style="display: none;" -->
- <div id="login-qrcode">
- <div style="height: 30px;">
- <span class="qrcode-text">扫一扫登录</span>
- </div>
- <div id="qrcode" style="width:110px;height:110px;z-index: 9999 !important;border: 5px solid #FFF;margin-bottom: -7px;">
- <div class='qrcode'> </div>
- </div>
- </div>
- </equal.ss>
- <div style="display: none;position:absolute;z-index:11111;" id="confirm-qrcode">
- <div style="height: 30px;">
- <span class="qrcode-text">扫一扫</span>
- </div>
- <div id="qrcode-confirm" style="width:110px;height:110px;z-index: 9999 !important;border: 5px solid #FFF;margin-bottom: -7px;">
- <div class='qrcode-confirm'> </div>
- </div>
- </div>
- <%--已登录显示头像,点击头像退出登录--%>
- <equal.ss val='${empty sessionScope.ssUser}' val2="false"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
- <!-- <div id="login-after" class="lj" style="width:110px;height:144px;background:rgba(255,255,255,0.4);border-radius:2px;margin-bottom: -7px; ">
- <img onclick="clearInterval(zmxxhq);window.location="<serv.ss name='gateExit'/>";"
- onerror="this.src='/skin/easy/image/default-photo.png'" style="margin: 10px 23px 7px 23px;width:64px;height:88px;"
- src="<serv.ss name='dlByHttp' parm='{path:"${sessionScope.ssUser.zjzwj}"}'/>"/>
- <div class="xx">
- <div class="qrcode-text" style="color: #000;">${sessionScope.ssUser.xm}</div> <%-- ['env.ry'].。Lin --%>
- <div class="qrcode-text" style="color: #000;">${sessionScope.ssUser.ryh}</div> <%-- ['env.ry'].。Lin --%>
- </div>
- </div> -->
-
- <div class="userInfo xx lj" onclick="clearInterval(zmxxhq);window.location="<serv.ss name='gateExit'/>";">
- <span>${sessionScope.ssUser.xm}</span>
- <span>${sessionScope.ssUser.ryh}</span>
- </div>
- </equal.ss>
- </div>
- </div>
- <equal.ss val='${empty sessionScope.ssUser}' val2="false"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
- <script type="text/javascript">
- var ryInfo = "${sessionScope.ssUser}"; <%-- ['env.ry']}。Lin --%>
- </script>
- </equal.ss>
- <script>
- function login() {
- var sbbs = $("input[name=sbbs]").val();
- var sbmc = $("input[name=sbmc]").val();
- $.post("<serv.ss name='runGateLoginByQrcode'/>", { // :'scanGateLoginSuccess'。Lin
- sbbs: sbbs,
- sbmc: sbmc
- }, function(result) {
- if(result.code != 1) {
- wd.display.alert(result.msg);
- } else {
- window.location.href = "/gateHome.jsp"; //? = "/"。临时改,为了测试。Lin
- }
- }, "json")
- }
- function utf16to8(str) {
- var out, i, len, c;
- out = "";
- len = str.length;
- for(i = 0; i < len; i++) {
- c = str.charCodeAt(i);
- if((c >= 0x0001) && (c <= 0x007F)) {
- out += str.charAt(i);
- } else if(c > 0x07FF) {
- out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
- out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
- out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
- } else {
- out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
- out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
- }
- }
- return out;
- }
- function qrcode() {
- $.ajax({
- type: "post",
- url: "<serv.ss name='wrQrcodeLoginKey'/>", // :'getPrivateKey'。Lin
- async: true,
- dataType: "json",
- success: function(data) {
- var sbbs = $("input[name='sbbs']").val();
- var json = {
- ss:2, // 增加,2 = gate login。Lin
- k: data.k, // ATR_keyByQrcodeLoginName = "k"。Lin
- d: sbbs
- };
- /* 改,ss:xx,yy:"zz",...。Lin
- qrCodeGenerate(".qrcode", "@hdGl" + JSON.stringify(json) + "@", 110, 110, "canvas");
- */
- var jsonStr = JSON.stringify(json);
-
- qrCodeGenerate(".qrcode", "ss:2,k:\""+ data.k +"\",d:\""+ sbbs +"\"", 110, 110, "canvas");
- }
- });
- }
- function qrCodeGenerate(ele, text, width, height, render) {
- var option = {
- render: "canvas",
- text: text,
- width: width || "200",
- height: height || "200",
- correctLevel: QRErrorCorrectLevel.M
- };
- $(ele).empty()
- $(ele).qrcode(option);
- }
- var stop = 2 * 60 * 1000; //两分钟后停止
- var begin;
- var end;
- function getLoginStatus() {
- //end = new Date().getTime();
- //if ((end - begin) > stop) {
- // stopInterval();
- // return;
- //}
- var sbbs = $("input[name=sbbs]").val();
- if(!sbbs)return;
- $.ajax({
- type: "post",
- url:"<serv.ss name='ifWrQrcodeLoginParmBySess' parm='{type:"gate"}'/>", // :'resetCookie',。Lin
- async: true,
- data:{sbbs:sbbs},
- dataType: "json",
- success: function(data) {
- if(data.code == 200 && window.loginStatus == '0') {
- stopInterval();
- //$("input[name='mm']").val("");
- //$("form[name='Form1'").submit();
- login();
- }
- if(data.code == 1) {
- stopInterval();
- var url = "<%=WebC.PPATH_errMsg%>?msg="+ data.msg; // = "/wd/page/rs.jsp?msg=" +。Lin
- var title = "提示";
- wd.display.showComponent({
- show: ["wdDialog"],
- hide: [],
- url: url,
- title: title,
- width: 500,
- high: 300,
- form: ""
- })
- } else if(data.code == 0) {
- console.log(data.msg);
- } else if(data.msg) {
- wd.display.alert(data.msg)
- }
- }
- });
- }
- var getLoginInterval;
- if(window.loginStatus == '0') {
- startInterval();
- }
- function startInterval() {
- qrcode();
- //$("#qrcodeBox").css("display", "block");
- //$("#trianglebottomright").css("display", "none");
- begin = new Date().getTime();
- if(!getLoginInterval) {
- getLoginInterval = setInterval(getLoginStatus, 3 * 1000);
- }
- }
- function stopInterval() {
- $("#qrcodeBox").css("display", "none");
- clearInterval(getLoginInterval);
- getLoginInterval = null;
- }
- $(function() {
- try {
- if(beacon && beacon.getComputerName) {
- $("input[name=sbmc]").val(beacon.getComputerName());
- }
- if(beacon && beacon.getMacAddress) {
- $("input[name=sbbs]").val(beacon.getMacAddress());
- }
- } catch(err) {
- console.log(err);
- }
- })
- </script>
- </body>
- <script type="text/javascript">
- /**
- *
- * 原来下面全部JS为拼音缩写而且无注解
- * 注解都是之后非作者补充的,可能有不正确
- *
- */
- var qrcodestr = '';
- var direction;
- var mjdid = '';
- var sfzh = '';
- var lfid = '';
- var globalJfryna = '';
- var globalJfryid = '';
- $(function(){
- try{
- lf_jfr_cx(false,false);
- /* 改,直接用页面写死的 sbbs(<input name="sbbs") -- 因抛出错误 "beacon is not defined",后面的程序被越过。Lin
- getMjdid(beacon.getMacAddress());
- */ getMjdid($("input[name=sbbs]").val());
- // bindMwid(); // 再去掉,没用到,也不用 < 打开 gateHome.home.jsp 时,写到 门禁点.门卫ID。此时,写入的 .门卫ID 为空(还没登录) < 也不能每次换班都写。Lin
- if(!beacon || !beacon.initIdcardDevice()){
- alert("初始化失败。检查是否安装驱动")
- }
- ///
- }catch(err){
- console.log(err);
- }
- /**
- * 接访人na
- */
- $('#jfryna').blur(function(){
- $('#jfryna').val(globalJfryna);
- $('#jfryid').val(globalJfryid);
- });
- /**
- * 接访人na
- */
- $('#jfryna').on('input',function(){
- if($('#jfryna').val() == ''){
- $('#jfryid_option').hide();
- return;
- }
- lf_jfr_cx(true,true);
- $('#jfryid_option').show();
- });
- $('#jfryid_option').on('click','.popupList',function(){
- var ryid = $(this).attr('value');
- var xm = $(this).text();
- $('#jfryna').val(xm);
- $('#jfryid').val(ryid).change();
- $('#jfryid_option').hide();
- });
- $('#jfryid').change(function(){
- var jfryid = $(this).val();
- if(jfryid == ''){
- globalJfryid = '';
- globalJfryna = '';
- return;
- }
- if(globalJfryid == jfryid){
- return;
- }
- globalJfryid = jfryid;
- globalJfryna = $('#jfryna').val();
- $.ajax({
- type: "post",
- /* 改,把参数统一移到 data:{} 里。Lin
- url: '@service{name:"lf_bjbm_cx"}@&ryid=' + jfryid,
- */
- url: "<serv.ss name='gate_selBmAndBjByRyid'/>",
- data: {
- ryid: jfryid,
- },
- async: true,
- dataType: "json",
- success: function(data) {
- console.log(data);
- if (data.error == '1') {
- wd.display.alert(data.msg);
- } else {
- wd.edit.objectPicker.getInstance("jfbmid").initValue(data.bmid,{triggerChange:false});
- wd.edit.objectPicker.getInstance("jfbjid").initValue(data.bjid,{triggerChange:false});
- }
- }
- });
- });
- $('#jfryna').focus(function(){
- if($('#jfryna').val() == ''){
- return;
- }
- lf_jfr_cx(true,true);
- $('#jfryid_option').show();
- });
- $('#jfr-div').click(function(){
- return false;
- });
- $('#jfryid_button').click(function(){
- $('.popup-div:not(#jfryid_option)').hide();
- if($('#jfryid_option').is(':hidden')){
- lf_jfr_cx(true,false);
- }
- $('#jfryid_option').toggle();
- });
- setInterval(function(){
- $.ajax({
- type: "post",
- url: '@service{name:"wd.probe"}@',
- async: true,
- dataType: "json",
- success: function(data) {
- console.log(data);
- }
- });
- }, 1000 * 600);
- $('#zzc').click(function(){
- return false;
- });
- $('#SFrefresh_qr').click(function(){
- window.location.reload();
- });
- $('#SFrefresh_cancle').click(function(){
- $('#SFrefresh').hide();
- $('#zzc').hide();
- $('.lj').css('filter','blur(0px)');
- return false;
- });
- var refresh;
- $('#login-after').mousedown(function(e){
- // if('IMG' == $(e.target).prop('tagName')){
- // console.log("长按头像不触发刷新");
- // return;
- // }
- refresh = setInterval(function(){
- $('#SFrefresh').show();
- clearInterval(refresh);
- $('#zzc').show();
- $('.lj').css('filter','blur(20px)');
- }, 2000);
- return false;
- });
- $('#login-after').mouseup(function(){
- console.log("清除定时器");
- clearInterval(refresh);
- return false;
- });
- $('#login-after').mouseout(function(){
- console.log("清除定时器");
- clearInterval(refresh);
- });
- $('#login-before').mousedown(function(e){
- refresh = setInterval(function(){
- $('#SFrefresh').show();
- clearInterval(refresh);
- $('.lj').css('filter','blur(20px)');
- }, 2000);
- return false;
- });
- $('#login-before').mouseup(function(){
- console.log("清除定时器");
- clearInterval(refresh);
- return false;
- });
- $('#login-before').mouseout(function(){
- console.log("清除定时器");
- clearInterval(refresh);
- });
- $('#login-before').click(function(){
- $(this).hide();
- $('#login-qrcode').show();
- /// 临时增加,模拟 APP/小程序 扫码确认???Lin
- /* 去掉,来真的了。Lin
- $.ajax({
- type: "post",
- url: "<serv.ss name='gateLoginByQrcode'/>",
- async: true,
- dataType: "json",
- success: function(data) {
- }
- });
- */
- ///
- return false;
- });
- var lrryClose;
- var lrryCloseTime = 60 * 1000;
- $(document).on('mousedown',function(e){
- if($(e.target).parents('#jcjllb').length == 0){
- if(e.target.id == "jcjllb"){
- return;
- }
- if($(e.target).parents('.ryxxlb-child').length>0||e.target.className.indexOf("ryxxlb-child")>-1){
- if($(e.target).parents('.ryxxlb-child').length>0){
- $(e.target).parents('.ryxxlb-child').remove();
- }
- if(e.target.className.indexOf("ryxxlb-child")>-1){
- $(e.target).remove();
- }
- return;
- }
- clearTimeout(hideJcjllb);
- isDrag = false;
- handleHide("jcjllb");
- if(lrryClose){
- clearInterval(lrryClose);
- lrryClose = setInterval(function(){
- hideLrry();
- }, lrryCloseTime);
- }
- }
- });
- $(document).on('keydown mousemove',function(){
- if(lrryClose){
- clearInterval(lrryClose);
- lrryClose = setInterval(function(){
- hideLrry();
- }, lrryCloseTime);
- }
- });
- $('#qc').click(function(){
- $('#sfzh').val('');
- });
- $('body').click(function(e){
- e.stopPropagation();
- $('#jfryid_option').hide();
- if($(e.target).parents('#lrry').length > 0){
- return false;
- }
- if($('#zzc').is(':visible')){
- return false;
- }
- if(!isDrag){//如果是拖动就不触发
- $('#lrry').stop(true).fadeToggle(function(){
- if($('#lrry').is(':visible')){
- var zIndex = Number($("#jcjllb").css("z-index"))<0?2:Number($("#jcjllb").css("z-index"))+1;
- $("#lrry").css("z-index",zIndex);
- $("#sfzh").focus();
- console.log('设置定时器');
- clearInterval(lrryClose);
- lrryClose = setInterval(function(){
- console.log('定时器运行');
- hideLrry();
- }, lrryCloseTime);
- }else{
- $("#scanner").val("");
- $("#scanner").focus();
- clearInterval(lrryClose);
- lrryClose = null;
- }
- });
- }
- });
- $('#jf_cancle').click(function() {
- handleHide("lfxx");
- $('#lrry').show()
- return false;
- });
- $('#syid').change(function(){
- $('#jfsy').val($('#objectPickergrowheightsyid').val());
- $('[name="jfsy"]').val($('#objectPickergrowheightsyid')[0].srcText);
- });
- $('#yylf_come').click(function(){
- createLfJcjl(11);
- handleHide("yylf")
- return false;
- });
- $('#yylf_leave').click(function(){
- createLfJcjl(51);
- handleHide("yylf");
- return false;
- });
- $('#yylf_cancle').click(function() {
- handleHide("yylf");
- $('#lrry').show();
- /*$('#yylf').hide();
- $('#zzc').hide();
- $('.lj').css('filter','blur(0px)');*/
- return false;
- });
- $('#lfqd').click(function(){
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- wd.display.alert("请先登录!");
- return false;
- }
- var jfsfzh = $('#jfsfzh').val();
- var jfxm = $('#jfxm').val();
- var jfxbm = $('#jfxbm').val();
- var jfbmid = $('#jfbmid').val();
- var jfbjid = $('#jfbjid').val();
- var jfryid = $('#jfryid').val();
- var rs = $('#jfrs').val();
- if(jfxm == '' || jfxbm == '' || jfryid == ''){
- wd.display.alert("请补全信息");
- return false;
- }
- if(jfsfzh != '' && jfsfzh.length != 15 && jfsfzh.length != 18){
- wd.display.alert("请输入正确的身份证号!");
- return false;
- }
- $.ajax({
- type: "post",
- url: "<serv.ss name='gate_insTempLf'/>", // :"lf_zj"。Lin
- async: true,
- dataType: "json",
- data:{
- sfzh:jfsfzh,
- xm:jfxm,
- xbm:jfxbm,
- jfbmid:jfbmid,
- jfbjid:jfbjid,
- jfryid:jfryid,
- sy:$('[name="jfsy"]').val(),
- syid:$('#syid').val(),
- mjdid:mjdid,
- mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
- rs:rs
- },
- success: function(data) {
- console.log(data);
- wd.display.alert(data.msg);
- handleHide("lfxx");
- /*
- $('#lfxx').hide();
- $('#zzc').hide();
- $('.lj').css('filter','blur(0px)');
- lfxxClear();*/
- }
- });
- return false;
- });
- $('#jfsfzh').blur(function(){
- $(this).val($(this).val().replace(/\s+/g,""));
- });
- $('#jfxm').blur(function(){
- $(this).val($(this).val().replace(/\s+/g,""));
- });
- $('#qd').click(function(){
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- wd.display.alert("请先登录!");
- return;
- }
- sfzh = $('#sfzh').val();
- if(sfzh == ''){
- wd.display.alert("请输入身份证号或学号!");
- return;
- }
- $.ajax({
- type: "post",
- <%-- 改,sfzh 用 data{sfzh:sfzh} 去传输。Lin
- url: '@service{name:"jcjl_lfx_zjhcx"}@&sfzh=' + sfzh,
- --%>
- url: "<serv.ss name='gate_initMpByKey'/>",
- data: {
- sfzh:sfzh
- },
- async: true,
- dataType: "json",
- success: function(data) {
- console.log(data);
- if (data.error == '1') {
- wd.display.alert(data.msg);
- $('#jfsfzh').val(sfzh);
- if(sfzh.length == 15){
- wd.edit.objectPicker.getInstance("xbm").initValue(sfzh.substring(14,15)%2==0?2:1);
- }
- if(sfzh.length == 18){
- wd.edit.objectPicker.getInstance("xbm").initValue(sfzh.substring(16,17)%2==0?2:1);
- }
- sfzh = '';
- handleShow("lfxx");
- } else {
- if(data.lb == 0){
- <%-- 改。Lin
- $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
- $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
- $('#xm').text(data.xm == null ? '' : data.xm);
- $('#xh').text(data.ryh == null ? '' : data.ryh);
- $('#bj').text(data.bjmc == null ? '' : data.bjmc);
- $('#lxlb').text(data.lxlb == null ? '' : data.lxlb);
- $('#lxlbts').hide();
- if(data.lxlb == '请假' && data.ylkcs >= data.zdlkcs){
- $('#lxlb').text('次数已超出('+ data.ylkcs +')');
- $('#lxlbts').show();
- }
- $('#ryxx').show();
- $('#zzc').show();
- $('.lj').css('filter','blur(20px)');
- //bug
- $("#ryxx").height("450px");
- $("#cancle").show();
- $('#leave').show();
- $('#back').show();
- $("#ryxx").removeClass("mainState-green").removeClass("mainState-orange");
- }else{
- $('#lfxx').hide();
- handleShow("yylf");
- $('#yylfxm').text(data.xm);
- $('#yylfsfzh').text(data.ryh);
- $('#yylfrs').text(data.rs);
- $('#yylfyysj').text(new Date(data.yysj).toLocaleString('chinese', { hour12: false }).replace(/\//g,'-'));
- lfid = data.ryid;
- }
- }
- }
- });
- });
- $('#cancle').click(function(){
- handleHide("ryxx");
- $('#lrry').show();
- /*
- $('#ryxx').hide();
- sfzh = '';
- $('#zzc').hide();
- $('.lj').css('filter','blur(0px)');
- $("#scanner").focus();
- $("#confirm-qrcode").hide();*/
- return false;
- });
- $('#back').click(function(){
- createJcjl(11);
- handleHide("ryxx");
- /*
- $('#ryxx').hide();
- sfzh = '';
- $('#zzc').hide();
- $('.lj').css('filter','blur(0px)');*/
- return false;
- });
- $('#leave').click(function(){
- createJcjl(51);
- handleHide("ryxx");
- /*$('#ryxx').hide();
- sfzh = '';
- $('#zzc').hide();
- $('.lj').css('filter','blur(0px)');*/
- return false;
- });
- $('#ryxxlb').on('click','.ryxxlb-child',function(){
- $(this).remove();
- });
- });
- /**
- * 根据设备标识查询mjdid
- */
- function getMjdid(sbbs){
- console.log(sbbs);
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- wd.display.alert("请先登录!");
- return;
- }
- $.ajax({
- type: "post",
- url: "<serv.ss name='gate_selMjdidBySbbs'/>", // :"mjd_mjdid_cx"。Lin
- async: true,
- dataType: "json",
- data:{
- sbbs:sbbs
- },
- success: function(data) {
- console.log(data);
- if (data.error == '1') {
- wd.display.alert(data.msg);
- mjdid = '';
- } else {
- console.log(data.mjdid);
- mjdid = data.mjdid;
- }
- }
- });
- }
- /**
- * 离返校学员信息增加
- */
- function createJcjl(jcfx){
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- wd.display.alert("请先登录!");
- return;
- }
- var url = '';
- /* 改,把参数统一移到 data:{} 里。Lin
- if(sfzh == ''){
- url = '@service{name:"jcjl_lfx_zj"}@&code=' + qrcodestr;
- }else{
- url = '@service{name:"jcjl_lfx_zj"}@&sfzh=' + sfzh
- }
- */ url = "<serv.ss name='gate_insJcjlByMp'/>";
- $.ajax({
- type: "post",
- url: url,
- data:{
- /// 增加,把上面写在 URL 里的参数统一移到这。Lin
- code: qrcodestr,
- sfzh: sfzh,
- ///
- jcfx:jcfx,
- mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
- mjdid:mjdid
- },
- async: true,
- dataType: "json",
- success: function(data) {
- console.log(data);
- wd.display.alert(data.msg);
- }
- });
- }
- /**
- * 来访进出记录增加
- * @param {Object} jcfx
- */
- function createLfJcjl(jcfx){
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- wd.display.alert("请先登录!");
- return;
- }
- $.ajax({
- type: "post",
- url: "<serv.ss name='gate_updTempLfByExit'/>", // :"jcjl_lf_zj"。Lin
- data:{
- jcfxm:jcfx,
- mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
- mjdid:mjdid,
- dxid:lfid
- },
- async: true,
- dataType: "json",
- success: function(data) {
- console.log(data);
- wd.display.alert(data.msg);
- }
- });
- }
- //扫描抢输入事件,监听到扫描枪输入后会调用
- function onScanInput(str) {
- console.log(str.toLowerCase());
- if(str.indexOf("@entrance@")>-1||str.indexOf("@exit@")>-1){
- //带有前缀的扫码器
- if(str.match(/@entrance@/)){
- direction = "entrance";
- str = str.split("@entrance@")[1];
- }else if(str.match(/@exit@/)){
- direction = "exit";
- str = str.split("@exit@")[1];
- }else{
- $("#scanner").val("");
- return;
- }
- }else{
- //没有前缀的扫码器
- //@hdO{n:"ry",k:"a5c8247c075141279dbd853bbf741853"}@
- if(str.length != 50&&str.split(".")[1].length !=35){
- $("#scanner").val("");
- return;
- }
- direction=null;
- }
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- wd.display.alert("请先登录!");
- $("#scanner").val("");
- return;
- }
- var hdObj = eval('('+str.substr(4,str.length - 5)+')');
- if(hdObj.n != 'ry'){
- $("#scanner").val("");
- return;
- }
- str = hdObj.k;
- clearTimeout(hideRyxxTimeout);
- if(direction){
- $.ajax({
- type: "post",
- url: '@service{name:"jcjl_lfx_cx_sg"}@&code=' + str.toLowerCase(),
- async: true,
- dataType: "json",
- data:{direction:direction,mjdid:mjdid},
- success: function(data) {
- console.log(data);
- if (data.error == '1') {
- wd.display.alert(data.msg)
- } else {
- //qrcodestr = str.toLowerCase();
- qrcodestr = data.yhid;
- sfzh = '';
- <%-- 改。Lin
- $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
- $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
- $('#xm').text(data.xm == null ? '' : data.xm);
- $('#xh').text(data.ryh == null ? '' : data.ryh);
- $('#bj').text(data.bjmc == null ? '' : data.bjmc);
- if(direction == 'entrance'){
- $("#ryxx").addClass("mainState-green").removeClass("mainState-orange");
- // $('#lxlb').text("进校:"+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
- $('#lxlb').text(""+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
- }else{
- $("#ryxx").addClass("mainState-orange").removeClass("mainState-green");
- // $('#lxlb').text("离校:"+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
- $('#lxlb').text(""+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
- }
- $('#lxlbts').hide();
- if(data.lxlb == '请假'){
- var outnumber=false;
- if(direction == 'entrance'){
- outnumber=data.ylkcs > data.zdlkcs;
- }else{
- outnumber=data.ylkcs >= data.zdlkcs;
- }
- if(outnumber){
- $('#lxlb').text('次数已超出('+ data.ylkcs +')');
- $('#lxlbts').show();
- }
- }
- $('#zzc').show();
- $('.lj').css('filter','blur(20px)');
- if(data.warn){
- //要显示二维码给保安扫
- showRyxx({k:data.randomKey,d:$("input[name='sbbs']").val()});
- }else{
- showRyxx();
- }
- }
- }
- });
- }else{
- $("#ryxx").removeClass("mainState-green").removeClass("mainState-orange");
- $.ajax({
- type: "post",
- url: '@service{name:"jcjl_lfx_cx"}@&code=' + str.toLowerCase(),
- async: true,
- dataType: "json",
- success: function(data) {
- console.log(data);
- if (data.error == '1') {
- wd.display.alert(data.msg)
- } else {
- //qrcodestr = str.toLowerCase();
- qrcodestr = data.yhid;
- sfzh = '';
- <%-- 改。Lin
- $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
- $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
- $('#xm').text(data.xm == null ? '' : data.xm);
- $('#xh').text(data.ryh == null ? '' : data.ryh);
- $('#bj').text(data.bjmc == null ? '' : data.bjmc);
- $('#lxlb').text(data.lxlb == null ? '' : data.lxlb);
- $('#lxlbts').hide();
- if(data.lxlb == '请假' && data.ylkcs >= data.zdlkcs){
- $('#lxlb').text('次数已超出('+ data.ylkcs +')');
- $('#lxlbts').show();
- }
- showRyxx();
- $('#zzc').show();
- $('.lj').css('filter','blur(20px)');
- }
- }
- });
- }
- }
- var lxConfirmInterval;
- var hideRyxxTimeout;
- /**
- * 获取轮询结果
- * @param {Object} k
- */
- function jcjl_getScanResult(k){
- $.ajax({
- type: "post",
- url: '@service{name:"jcjl_getScanResult"}@',
- async: true,
- dataType: "json",
- data:{
- privateKey:k
- },
- success: function(data) {
- if(data.status){
- clearInterval(lxConfirmInterval);
- alert(data.msg);
- handleHide("ryxx");
- }
- }
- });
- }
- /**
- * 移除标识
- * @param {Object} k
- */
- function removePrivateKey(k){
- $.ajax({
- type: "post",
- url: '@service{name:"jcjl_removeScanConfirmMap"}@',
- async: true,
- dataType: "json",
- data:{
- privateKey:k
- },
- success: function(data) {
- if(data.status){
- }
- }
- })
- }
- function showRyxx(data){
- $("#confirm-qrcode").hide();
- handleShow("ryxx");
- if(data){
- $("#ryxx").height("339px");
- $("#cancle").hide();
- $('#leave').hide();
- $('#back').hide();
- $("#qrcodeBox").css("z-index",Number($("#jcjllb").css("z-index"))+1);
- qrCodeGenerate(".qrcode-confirm", "@hdGc" + JSON.stringify(data) + "@", 110, 110, "canvas");
- $("#confirm-qrcode").show();
- lxConfirmInterval = setInterval(function(){
- jcjl_getScanResult(data.k);
- },500);
- }else{
- if(direction){
- $("#ryxx").height("339px");
- $('#leave').hide();
- $('#back').hide();
- $("#cancle").hide();
- if(direction == "entrance"){
- createJcjl(11);
- }else{
- createJcjl(51);
- }
- }else{
- $("#ryxx").height("450px");
- $("#cancle").val("取消").show();
- $('#leave').show();
- $('#back').show();
- }
- }
- $("#zzc").click(function(){
- if(data){
- clearInterval(lxConfirmInterval);
- removePrivateKey(data.k);
- }
- handleHide("ryxx");
- });
- hideRyxxTimeout = setTimeout(function(){
- handleHide("ryxx");
- },1000 * 20)
- }
- function hideLrry(){
- $('#lrry').stop(true).fadeOut();
- /* 先去掉,if(lrryClose) 会抛出错误 ReferenceError: lrryClose is not defined,导致不执行后面的语句。Lin
- * clearInterval(lrryClose) 在调用 hideLrry() 前都有调用
- * lrryClose 会被马上赋值:lrryClose = setInterval(function(){hideLrry();}, lrryCloseTime);
- */
- if(lrryClose){
- clearInterval(lrryClose);
- lrryClose = null;
- }
- /* */
- $("#scanner").val("");
- $("#scanner").focus();
- }
- var y = 0;
- /**
- * 根据设备标识获取进出记录
- */
- function showJcjllb(){
- $("#lrry").hide();
- $("#scanner").focus();
- //下拉
- $.ajax({
- type: "post",
- url: '@service{name:"getJcjlBySbbs"}@',
- async: true,
- dataType: "json",
- data:{
- sbbs:beacon.getMacAddress(),
- },
- success: function(data) {
- handleShow("jcjllb");
- if(data.length>0&&$("#ryxx").is(":hidden")){
- $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))+1);
- }
- for(var i=startrn;i<data.length&&i<endrn;i++){
- jcjlEmpty = false;
- var jcjl = data[i];
- var mainState="";
- if(jcjl.jcfxm == 11){
- mainState = "mainState-green";
- }else if(jcjl.jcfxm == 51){
- mainState = "mainState-orange";
- }else if(jcjl.jcfxm == 81){
- mainState = "mainState-inportantrRed";
- }else{
- mainState = "mainState-orange";
- }
- 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;":"")+'">'
- + '<div style="display:flex;width:680px;margin-left:60px;margin-top:61px;padding-bottom: 50px;">'
- + '<div>'
- + '<input type="hidden" name="ryid" value="'+ jcjl.ryid +'" class="input-text input-number" />';
- if(jcjl.zjzwj){
- <%-- 改。Lin
- 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>'; --%>
- 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>';
- }else{
- <%-- 改。Lin
- 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>'; --%>
- 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>';
- }
- html += '</div>'
- + '<table class="xm content-largeText" style="color:#000;">';
- if(jcjl.xm != null){
- html += '<tr>'
- + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> ';
- if(jcjl.dxm&&jcjl.dxm == 'lf'){
- html+= '<span id="xm">'+ jcjl.xm +'(来访)</span> '
- + '</td>'
- + '</tr>';
- }else{
- html += '<span id="xm">'+ jcjl.xm +'</span> '
- + '</td>'
- + '</tr>';
- }
- }
- if(jcjl.bjmc != null){
- html += '<tr>'
- + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> '
- + '<span id="bj" >'+ jcjl.bjmc +'</span> '
- + '</td>'
- + '</tr>';
- }
- if(jcjl.jcsj != null){
- html += '<tr>'
- + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;">'
- + '<span id="xh" >'+ new Date(jcjl.jcsj).format("yyyy-MM-dd hh:mm:ss") +'</span> '
- + '</td>'
- + '</tr>';
- }
- html += '<tr>'
- + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> ';
- //1 请假
- //51 走读
- //91 无原由
- //所有拒绝的进出记录显示为无原由
- if(jcjl.jcfxm == 81){
- html+='<span class="content-largeWarningText" style="vertical-align: top;">不允许离校</span> ';
- }else{
- if(jcjl.lkyym == 1){//请假
- html += '<span class="content-largeWarningText" style="vertical-align: top;color:black;">请假</span>';
- }else if (jcjl.lkyym == 51){
- html+='<span class="content-largeWarningText" style="vertical-align: top;color:black;">走读生</span> ';
- }else{//无原有
- html+='<span class="content-largeWarningText" style="vertical-align: top;">无原由</span> ';
- }
- if(jcjl.tw != null){
- if(jcjl.tw < 37.3){
- html += '<span class="content-largeWarningText" style="color:black;">'+ jcjl.tw +'℃</span>';
- }else{
- html += '<span class="content-largeWarningText" style="color:red;">'+ jcjl.tw +'℃</span>';
- }
- }
- }
- html += '</td></tr>';
- html += '</table>'
- + '</div> '
- + '</div>';
- $('#jcjllb').prepend(html);
- if(startrn==0){
- $('#jcjllb').scrollTop($('#jcjllb')[0].scrollHeight);
- }
- }
- if(data.length>endrn){
- startrn += endrn;
- }else{
- startrn += data.length;
- }
- endrn+=10;
- clearTimeout(hideJcjllb);
- hideJcjllb = setTimeout(function(){
- //取消虚化
- // handleHide("jcjllb");
- },1000 * 20);
- }
- });
- }
- var isDrag = false;
- $(function(e) {
- stylesheetData.ryxxlb_left = $("#ryxxlb").css("left");
- stylesheetData.ryxx_right = $("#ryxx").css("right");
- stylesheetData.lfxx_right = $("#lfxx").css("right");
- stylesheetData.yylf_right = $("#yylf").css("right");
- //2020-12-17添加分辨率兼容的事件
- if (screen.width == 1280&&screen.height == 960){
- // $("#videoID").css({"max-width":"none","width":"1706","margin-left":"-194px"});
- $("#videoID").css({"max-width":"none","width":"1920","margin-left":"-320px"});
- $("#lrry").css("left","55%");
- }
- //2020-10-29添加下滑的事件
- $("#jcjllb").on('touchstart',function(e){
- y = e.originalEvent.touches["0"].screenY;
- });
- $("#jcjllb").on('touchend',function(e){
- e.stopPropagation();
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- return;
- }
- if(e.originalEvent.changedTouches["0"].screenY>y){
- showJcjllb()
- }
- });
- $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))-1);
- touch.on('#jcjllb', 'touchend', function (e) {
- e.stopPropagation();
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- return;
- }
- if(e.y>y){
- isDrag = true;
- showJcjllb()
- }else{
- isDrag = false;
- }
- });
- document.onmousedown = function(e) {
- var nextTime = new Date().getTime();
- lastTime = nextTime;
- /*
- var nextTime = new Date().getTime();
- var code = e.which;
- var char = String.fromCharCode(code);
- if (codeString == "") {
- codeString += char;
- } else if (nextTime - lastTime <= 30) {
- codeString += char;
- }
- lastTime = nextTime;*/
- };
- touch.on('#jcjllb', 'touchstart', function (event) {
- y = event.y;
- });
- getDatesInfo()
- var codeString = "";
- //定时器每隔200ms 清空codeString
- /*var scanTimeer = setInterval(function() {
- var now = new Date().getTime();
- if (now - lastTime > 200) {
- if (codeString.length > 0) {
- onScanInput(codeString.replace(/\s+/g,""));
- }
- codeString = "";
- }
- }, 200);*/
- var scanTimeer = setInterval(function() {
- var now = new Date().getTime();
- if (now - lastTime > 500) {
- if ($("#scanner").val().length > 0) {
- onScanInput($("#scanner").val().replace(/\s+/g,""));
- $("#scanner").val("");
- }
- //codeString = "";
- }
- }, 500);
- var lastTime;
- var caseFormat = false;
- document.onkeydown = function(e) {
- var nextTime= new Date().getTime();
- lastTime = nextTime;
- /*var code = e.which;
- var char = String.fromCharCode(code);
- if (codeString == "") {
- codeString += char;
- } else if (nextTime - lastTime <= 30) {
- codeString += char;
- }
- lastTime = nextTime;*/
- };
- $("#scanner").focus();
- window.onbeforeunload= function(event) {
- if(!beacon){
- return;
- }
- beacon.shutDownIdcardDevice();
- }
- });
- /**
- * 显示时间
- */
- function getDatesInfo() {
- var date=new Date();
- var dates=date.getDate(),month=date.getMonth()+1,hours=date.getHours(),seconds=date.getMinutes(),year=date.getFullYear();
- if(hours<10){
- hours="0"+hours
- }
- if(seconds<10){
- seconds="0"+seconds;
- }
- $("#getDateInfo").children("span")[0].innerHTML= year+"/" + month + "/" + dates;
- $("#getDateInfo").children("span")[1].innerHTML = "" + hours + ":" + seconds;
- }
- setInterval(function () {
- getDatesInfo()
- },1000)
- /**
- *
- * 未知功能
- */
- top.changeIdcard = function(idCardInfo){
- if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- wd.display.alert("请先登录!");
- return;
- }
- idCardInfo = JSON.parse(idCardInfo);
- var idCardNo = idCardInfo.sfzh;
- console.log(idCardNo);
- $.ajax({
- type: "post",
- url: '@service{name:"lf_yyxx_cx"}@',
- async: true,
- dataType: "json",
- data:{
- sfzh:idCardNo,
- },
- success: function(data) {
- console.log(data);
- if (data.error == '1') {
- wd.display.alert(data.msg);
- $('#yylf').hide();
- handleShow("lfxx");
- $('#jfsfzh').val(idCardNo);
- $('#jfxm').val(idCardInfo.xm.replace(/\s+/g,""));
- if(idCardNo.length == 15){
- wd.edit.objectPicker.getInstance("xbm").initValue(idCardNo.substring(14,15)%2==0?2:1);
- }else{
- wd.edit.objectPicker.getInstance("xbm").initValue(idCardNo.substring(16,17)%2==0?2:1);
- }
- } else {
- $('#lfxx').hide();
- $('#yylf').show();
- $('#yylfxm').text(idCardInfo.xm.replace(/\s+/g,""));
- $('#yylfsfzh').text(idCardNo);
- $('#yylfrs').text(data.rs);
- $('#yylfyysj').text(new Date(data.yysj).toLocaleString('chinese', { hour12: false }).replace(/\//g,'-'));
- lfid = data.lfid;
- $('#zzc').show();
- $('.lj').css('filter','blur(20px)');
- }
- }
- });
- }
- /**
- *
- * 接访人查询
- * @param {Object} isjfr
- * @param {Object} usexm 搜索姓名
- */
- function lf_jfr_cx(isjfr,usexm){
- var jfbmid = $('#jfbmid').val();
- var jfbjid = $('#jfbjid').val();
- var jfryna = $('#jfryna').val();
- $.ajax({
- url: "<serv.ss name='gate_selRyOptByBjidOrBmid'/>", // :"lf_jfr_cx"。Lin
- type: 'post',
- dataType: 'json',
- data: {
- bmid: jfbmid,
- bjid: jfbjid,
- xm: usexm ? jfryna : ''
- },
- success: function(data) {
- console.log(data);
- /// 增加,显示错误信息。Lin
- if (data.error == '1') {
- wd.display.alert(data.msg);
- return;
- }
- ///
- $('#jfryid_option').empty();
- $('#jfryid_option').append('<div class="popupList" status="noitem" checkstate="unselected" value=""></div>');
- for(var i = 0; i < data.length; i++){
- $('#jfryid_option').append('<div class="popupList" status="people" value="'+ data[i].ryid +'" index="'+ i +'" checkstate="unselected">'+ data[i].xm +'</div>');
- }
- if(!isjfr){
- $('#jfryna').val('');
- $('#jfryid').val('');
- globalJfryna = '';
- globalJfryid = '';
- }
- }
- });
- }
- wd.edit.objectPicker.getInstance("jfbmid").onchange = function(){
- lf_jfr_cx(false,false);
- }
- wd.edit.objectPicker.getInstance("jfbjid").onchange = function(){
- lf_jfr_cx(false,false);
- }
- function lfxxClear(){
- $('jfsfzh').val('');
- $('#jfxm').val('');
- wd.edit.objectPicker.getInstance("jfbmid").initValue();
- wd.edit.objectPicker.getInstance("xbm").initValue();
- wd.edit.objectPicker.getInstance("jfbjid").initValue();
- wd.edit.objectPicker.getInstance("syid").initValue();
- $('#jfrs').val('1');
- }
- var jcjlcxsj;
- var dsscjcjl;
- var isProcessingBatch = false; // 全局锁,防止批量处理时重复调用
- var cardHideTimer = null; // 卡片隐藏定时器
- var hasCards = false; // 是否有卡片显示
- /**
- * 有gate2的情况下:不显示历史进出记录;gate1在左边,gata2右边
- * 有gata1的情况下:历史进出记录列表在右边
- *
- * @return {[type]} [description]
- */
- var stylesheetData = {};
- function handleShow(type){
- $('.lj').css('filter','blur(20px)');
- if(type == "ryxx"){
- $('#ryxx').show();
- handleHide("lfxx");
- handleHide("yylf");
- if($(".ryxxlb-child").length>0){
- handleHide("jcjllb");
- $("#ryxxlb").css("left","30px");
- $("#ryxx").css("right","30px");
- }else if($(".jcjllb-child").length>0){
- $("#ryxx").css("left","30px");
- }else{
- $("#ryxx").css("left","");
- $("#ryxx").css("right",stylesheetData.ryxx_right);
- }
- }else if(type == "ryxxlb"){
- if($("#ryxx").is(":visible")){
- $("#ryxxlb").css("left","30px");
- $("#ryxx").css("right","30px");
- }else if($("#lfxx").is(":visible")){
- $("#ryxxlb").css("left","30px");
- $("#lfxx").css("right","30px");
- }else if($("#yylf").is(":visible")){
- $("#ryxxlb").css("left","30px");
- $("#yylf").css("right","30px");
- }else if($(".jcjllb-child").length>0){
- $("#ryxxlb").css("left","30px");
- }else{
- $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
- }
- }else if(type == "jcjllb"){
- //ryxxlb左移
- $("#ryxxlb").css("left","30px");
- }else if(type == "lfxx"){
- $('#zzc').show();
- $('#lfxx').show();
- handleHide("ryxx");
- handleHide("yylf");
- handleHide("jcjllb");
- if($(".ryxxlb-child").length>0){
- $("#ryxxlb").css("left","30px");
- $("#lfxx").css("right","30px");
- }else if($(".jcjllb-child").length>0){
- $("#lfxx").css("left","30px");
- }else{
- $("#lfxx").css("right",stylesheetData.lfxx_right);
- $("#lfxx").css("left","");
- }
- }else if(type == "yylf"){
- $('#yylf').show();
- $('#zzc').show();
- handleHide("ryxx");
- handleHide("lfxx");
- handleHide("jcjllb");
- if($(".ryxxlb-child").length>0){
- $("#ryxxlb").css("left","30px");
- $("#yylf").css("right","30px");
- }else if($(".jcjllb-child").length>0){
- $("#yylf").css("left","30px");
- }else{
- $("#yylf").css("right",stylesheetData.yylf_right);
- $("#yylf").css("left","");
- }
- }
- }
- var startrn = 0;
- var endrn = 10;
- var hideJcjllb;
- var jcjlEmpty = true;
- setInterval(function(){
- if($("#ryxx").is(":hidden")&&jcjlEmpty&&$(".ryxxlb-child").length == 0&&$("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")){
- $('.lj').css('filter','blur(0px)');
- }
- },50);
- /**
- * 主要用来去掉虚化的背景
- * @param {[type]} flag [description]
- * @return {[type]} [description]
- */
- function handleHide(type){
- if(type == "ryxx"){
- $('#ryxx').hide();
- sfzh = '';
- $("#scanner").focus();
- $("#confirm-qrcode").hide();
- $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))+1);
- if($(".ryxxlb-child").length>0){
- $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
- }else if($("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")&&jcjlEmpty){
- $('#zzc').hide();
- $('.lj').css('filter','blur(0px)');
- }
- }else if(type == "ryxxlb"){
- // 清除10秒自动隐藏的定时器
- if(cardHideTimer){
- clearTimeout(cardHideTimer);
- cardHideTimer = null;
- }
- // 手动关闭所有卡片
- var $container = $('#ryxxlb');
- var $allCards = $container.find('.ryxxlb-child');
- if($allCards.length > 0){
- $allCards.addClass('fade-out');
- setTimeout(function(){
- $allCards.remove();
- }, 400);
- }
- // 恢复视频播放
- if(hasCards){
- var $video = $('#videoID');
- if($video.length > 0){
- $video[0].play();
- hasCards = false;
- console.log("▶️ 手动关闭卡片,恢复视频播放");
- }
- }
- if($("#ryxx").is(":visible")){
- $("#ryxx").css("right",stylesheetData.ryxx_right);
- }else if($("#lfxx").is(":visible")){
- $("#lfxx").css("right",stylesheetData.lfxx_right);
- }else if($("#yylf").is(":visible")){
- $("#yylf").css("right",stylesheetData.lfxx_right);
- }else if (jcjlEmpty){
- $('.lj').css('filter','blur(0px)');
- }
- }else if(type == "jcjllb"){
- if($(".ryxxlb-child").length == 0&&$("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")){
- $('.lj').css('filter','blur(0px)');
- }
- $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))-1);
- $("#jcjllb").empty();
- jcjlEmpty = true;
- startrn = 0;
- endrn = 10;
- if($("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")){
- $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
- }
- }else if(type == "lfxx"){
- $('#lfxx').hide();
- if($(".ryxxlb-child").length>0){
- $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
- }else if($("#ryxx").is(":hidden")&&$("#yylf").is(":hidden")&&jcjlEmpty){
- $('.lj').css('filter','blur(0px)');
- $('#zzc').hide();
- }
- lfxxClear();
- }else if(type == "yylf"){
- $('#yylf').hide();
- if($(".ryxxlb-child").length>0){
- $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
- }else if($("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")&&jcjlEmpty){
- $('.lj').css('filter','blur(0px)');
- $('#zzc').hide();
- }
- }
- }
- /**
- * 获取闸门进出记录+显示 (三区域版本 - 支持批量处理)
- */
- function getAutodoorInfo(){
- // 如果正在处理批量数据,跳过本次请求
- if(isProcessingBatch){
- console.log("⏸️ 正在处理批量数据,跳过本次请求");
- return;
- }
- $.ajax({
- url: "<serv.ss name='gate_selIoHstByTime'/>", // :"jcjl_zm_cx"。Lin
- type: 'post',
- dataType: 'json',
- data: {
- mjdid: mjdid,
- jcjlcxsj: jcjlcxsj
- },
- success: function(data) {
- if(data.length == 0) return;
- handleShow("ryxxlb");
- console.log("📥 进出记录:",data)
- $("#ryxxlb").css("z-index",Number($("#jcjllb").css("z-index"))+1);
- $('.lj').css('filter','blur(20px)');
- // 设置处理标志
- isProcessingBatch = true;
- // 批量处理数据,带延迟动画
- processRecordsBatch(data, 0);
- }
- });
- }
- /**
- * 批量处理记录 (递归方式,带动画延迟)
- * @param records 记录数组
- * @param index 当前处理索引
- */
- function processRecordsBatch(records, index){
- if(index >= records.length){
- // 所有记录处理完毕,延迟释放锁(等待最后一张卡片动画完成)
- setTimeout(function(){
- isProcessingBatch = false;
- console.log("✅ 批量处理完成,释放锁");
- // 注意: 10秒倒计时已经在pushCardToThreeAreas中每次推送时自动重置
- }, 1000);
- return;
- }
- // 第一张卡片时暂停视频
- if(index == 0 && !hasCards){
- pauseVideo();
- }
- var jcjl = records[index];
- // 判断进出类型
- var cardType = getCardType(jcjl);
- // 生成卡片HTML
- var html = buildCardHtml(jcjl, cardType);
- // 执行三区域推送逻辑
- pushCardToThreeAreas(html, cardType);
- console.log("🎬 处理第 " + (index + 1) + "/" + records.length + " 条: " + jcjl.xm + " (" + cardType + ")");
- // 更新查询时间戳 (最后一条)
- if(index == records.length - 1){
- jcjlcxsj = new Date(jcjl.jcsj);
- jcjlcxsj.setTime(jcjlcxsj.getTime() + 1000);
- jcjlcxsj = jcjlcxsj.toLocaleString('chinese', { hour12: false }).replace(/\//g,'-');
- console.log("🕐 更新时间戳:", jcjlcxsj);
- }
- // 递归处理下一条 (延迟1200ms,确保动画完整播放)
- // 动画时长: 淡入50ms + 滑动800ms + 淡出400ms = 1250ms
- if(index < records.length - 1){
- setTimeout(function(){
- processRecordsBatch(records, index + 1);
- }, 1200);
- }
- }
- /**
- * 判断卡片类型
- * @param jcjl 进出记录对象
- * @return 'enter' | 'leave' | 'vacation'
- */
- function getCardType(jcjl){
- // jcfxm=11 进入
- if(jcjl.jcfxm == 11){
- return 'enter';
- }
- // jcfxm=51 且 lkyym=1 请假离校
- if(jcjl.jcfxm == 51 && jcjl.lkyym == 1){
- return 'vacation';
- }
- // jcfxm=51 且 (lkyym=51 或 lkyym=91) 离校
- if(jcjl.jcfxm == 51 && (jcjl.lkyym == 51 || jcjl.lkyym == 91)){
- return 'leave';
- }
- // 默认为离校
- return 'leave';
- }
- /**
- * 生成卡片HTML
- * @param jcjl 进出记录对象
- * @param cardType 卡片类型
- * @return HTML字符串
- */
- function buildCardHtml(jcjl, cardType){
- // 根据类型设置颜色和状态文本
- var mainState = '';
- var statusText = '';
- var statusClass = '';
- if(cardType == 'enter'){
- mainState = 'mainState-blue'; // 蓝色 - 进校
- statusText = '进校';
- statusClass = 'status-enter';
- }else if(cardType == 'leave'){
- mainState = 'mainState-green'; // 绿色 - 离校
- statusText = '离校';
- statusClass = 'status-leave';
- }else if(cardType == 'vacation'){
- mainState = 'mainState-orange'; // 橙色 - 请假
- statusText = '请假'; // 改为"请假"而不是"请假离校"
- statusClass = 'status-vacation';
- }
- 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;">'
- + '<input type="hidden" name="ryid" value="'+ jcjl.ryid +'" />';
- // 照片 (尺寸由CSS根据位置类控制)
- if(jcjl.zjzwj){
- 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\'"/>';
- }else{
- 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);"/>';
- }
- // 名字+班级 (两端对齐 - 使用弹性盒布局)
- 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);">';
- if(jcjl.xm != null){
- html += '<span class="name-text">'+ jcjl.xm +'</span>';
- }
- if(jcjl.bjmc != null){
- html += '<span class="class-text">'+ jcjl.bjmc +'</span>';
- }
- html += '</div>';
- // 状态 (颜色由CSS类控制)
- 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>';
- html += '</div>';
- return html;
- }
- /**
- * 视频播放控制 - 有卡片时暂停,10秒无新卡片后恢复
- */
- function pauseVideo(){
- var $video = $('#videoID');
- if($video.length > 0){
- $video[0].pause();
- hasCards = true;
- console.log("⏸️ 视频暂停");
- }
- }
- function resumeVideoAfterDelay(){
- // 清除之前的定时器
- if(cardHideTimer){
- clearTimeout(cardHideTimer);
- }
- // 10秒后隐藏卡片并恢复视频
- cardHideTimer = setTimeout(function(){
- var $container = $('#ryxxlb');
- var $allCards = $container.find('.ryxxlb-child');
- if($allCards.length > 0){
- console.log("🎬 10秒无新卡片,隐藏所有卡片并恢复视频");
- // 隐藏所有卡片
- $allCards.addClass('fade-out');
- setTimeout(function(){
- $allCards.remove();
- $('.lj').css('filter','none'); // 恢复背景清晰度
- }, 400);
- // 恢复视频播放
- var $video = $('#videoID');
- if($video.length > 0){
- $video[0].play();
- hasCards = false;
- console.log("▶️ 视频恢复播放");
- }
- }
- }, 10000);
- }
- /**
- * 三区域推送逻辑 (Grid布局版 - 固定位置平滑移动)
- * @param html 卡片HTML
- * @param cardType 卡片类型 ('enter'|'leave'|'vacation')
- */
- function pushCardToThreeAreas(html, newCardType){
- var $container = $('#ryxxlb');
- var $leftCard = $container.find('.ryxxlb-child-left');
- var $centerCard = $container.find('.ryxxlb-child-center');
- var $rightCard = $container.find('.ryxxlb-child-right');
- var $newCard = $(html);
- // 每次推送新卡片时,重置10秒自动隐藏计时器
- resumeVideoAfterDelay();
- // 如果没有中间卡片,直接放中间
- if($centerCard.length == 0){
- $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
- $container.append($newCard);
- setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
- return;
- }
- // 获取当前中间卡片的类型
- var currentCenterType = $centerCard.attr('data-type');
- // 根据【当前中间卡片】的类型决定推送方向 (不管新卡片是什么)
- if(currentCenterType == 'enter'){
- // 当前中间是进校 → 往左推
- var $allCards = $container.find('.ryxxlb-child');
- // 只有当已经有3张卡片时,才删除最左边的
- if($allCards.length >= 3 && $leftCard.length > 0){
- console.log("🗑️ 删除最左边卡片,当前总数:", $allCards.length);
- $leftCard.addClass('fade-out');
- setTimeout(function(){ $leftCard.remove(); }, 400);
- }
- // 当前中间移到左边
- $centerCard.removeClass('ryxxlb-child-center')
- .addClass('ryxxlb-child-left');
- // 新卡片淡入中间
- $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
- $container.append($newCard);
- setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
- }else{
- // 当前中间是离校/请假 → 往右推
- var $allCards = $container.find('.ryxxlb-child');
- // 只有当已经有3张卡片时,才删除最右边的
- if($allCards.length >= 3 && $rightCard.length > 0){
- console.log("🗑️ 删除最右边卡片,当前总数:", $allCards.length);
- $rightCard.addClass('fade-out');
- setTimeout(function(){ $rightCard.remove(); }, 400);
- }
- // 当前中间移到右边
- $centerCard.removeClass('ryxxlb-child-center')
- .addClass('ryxxlb-child-right');
- // 新卡片淡入中间
- $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
- $container.append($newCard);
- setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
- }
- }
- var zmxxhq;
- if(${not empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- // 防止重复启动定时器
- if(zmxxhq) clearInterval(zmxxhq);
- zmxxhq = setInterval(getAutodoorInfo,1000);
- console.log("闸门信息获取定时器已启动, ID:", zmxxhq);
- }
- /**
- * 绑定门卫id
- */
- /* 再去掉,没用到,也不用 < 打开 gateHome.home.jsp 时,写到 门禁点.门卫ID。此时,写入的 .门卫ID 为空(还没登录) < 也不能每次换班都写。Lin
- function bindMwid(){
- $.ajax({
- url: "<serv.ss name='gate_bindMwidByMjd'/>", // :"mjd_bind_mwid"。Lin
- type: 'post',
- dataType: 'json',
- data: {
- /// * 改,直接用页面写死的 sbbs(<input name="sbbs") -- 因抛出错误 "beacon is not defined",后面的程序被越过。Lin
- // sbbs: beacon.getMacAddress(),
- /// *
- sbbs: $("input[name=sbbs]").val(),
- mwid: "$@{sessionScope.ssUser.ryid}" // ['env.ry'].。Lin
- },
- success: function(data) {
- }
- });
- }
- */
- /**
- * 检查session是否有效
- */
- if(${not empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
- setInterval(function(){
- $.ajax({
- url: "<serv.ss name='gate_chkSess'/>", // :"mjd_check_session"。Lin
- type: 'post',
- dataType: 'json',
- success: function(data) {
- if(data.isvalid == '0'){
- window.location.href = "/";
- }
- }
- });
- },1000 * 10);
- }
- </script>
- </html>
|