| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167 |
- <%@ 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,
- */
- /* 再改,移到 ry_selBaseInfoByRyid(”获取人员基本信息“),与 grcz_inp.ss.jsp 共用。Lin
- * 统一 Ajax 返回标准 -- .ssCode、.ssMsg、.ssData
- url: "<serv.ss name='gate_selBmAndBjByRyid'/>",
- */ url: "<serv.ss name='ry_selBaseInfoByRyid'/>",
- data: {
- ryid: jfryid,
- },
- async: true,
- dataType: "json",
- success: function(data) {
- /* 再改,统一 Ajax 返回标准 -- .ssCode、.ssMsg、.ssData。Lin
- 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});
- }
- */
- if (data.ssCode != 0) {
- wd.display.alert(data.msg);
- } else {
- wd.edit.objectPicker.getInstance("jfbmid").initValue(data.ssData.bmid,{triggerChange:false});
- wd.edit.objectPicker.getInstance("jfbjid").initValue(data.ssData.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>
|