| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <link href="css/mui.min.css" rel="stylesheet" />
- <link rel="stylesheet" href="fonts/mui.tff"/>
- <style>
- html,
- body {
- background-color: #FFFFFF;
- }
-
- .mui-content {
- background-color: #FFFFFF;
- }
-
- .mui-bar-nav {
- box-shadow: 0 0px 0px #ccc;
- }
-
- .mui-bar {
- background-color: #FFFFFF;
- }
- /*logo样式*/
-
- .logo {
- width: 110px;
- margin: 10px auto 20px auto;
- display: block;
- }
- /*logo文字*/
-
- .logo-font {
- width: 250px;
- margin: auto;
- display: block;
- }
- /*办公自动化文字*/
-
- .zidonghua {
- width: 160px;
- display: block;
- margin: auto;
- margin-top: 15px;
- }
-
- .qiao{
- width: 100%;
- height: 100%;
- background-image: url(images/login/bg1.jpg);
- background-size: 100%;
- position: absolute;
- background-repeat: no-repeat;
- background-position: bottom;
- }
- /*按钮样式*/
-
- .mui-btn-primary {
- color: #fff;
- border: 1px solid #39aee3;
- background-color: #39aee3;
- width: 60%;
- margin: auto;
- display: block;
- margin-top: 52px;
- border-radius: 50px;
- }
- /*登入表单*/
-
- .logo-div {
- margin-top: 50px;
- }
- /*用户框*/
-
- .user-div {
- width: 70%;
- margin: auto;
- overflow: hidden;
- border-bottom: #ecedf0 1px solid;
- }
- /*用户图标*/
-
- .user-img {
- height: 25px;
- width: 25px;
- background-image: url(images/login/user.png);
- background-size: 100%;
- float: left;
- }
- /*用户输入框*/
-
- .user-name {
- float: right;
- width: 83% !important;
- height: 26px !important;
- border: 0px !important;
- font-size: 15px;
- }
-
- /*密码框*/
- .pass-div {
- width: 70%;
- margin: auto;
- overflow: hidden;
- border-bottom: #ecedf0 1px solid;
- margin-top: 20px;
- position: relative;
- }
- /*显示密码*/
- .eye-pos{position: absolute;right: 1px;color: #cacaca;}
-
- /*密码图片*/
- .pass-img {
- height: 25px;
- width: 25px;
- background-image: url(images/login/pass.png);
- background-size: 100%;
- float: left;
- }
-
- /*自动登入按钮*/
- .mui-switch-mini{width: 37px;}
- .mui-switch{height: 20px;}
- .mui-switch .mui-switch-handle{width: 18px;height: 18px;}
- .weiz{margin: auto;margin-top: 10px;width: 70%;}
- .mui-switch-blue.mui-active{border: 2px solid #39aee3;background-color: #39aee3;}
- .eye-pos{position: absolute;right: 1px;color: #cacaca;}
-
- .eye-pos-blue{position: absolute;right: 1px;color: #39aee3;}
- </style>
- </head>
- <body >
- <header class="mui-bar mui-bar-nav">
- <h1 class="mui-title"></h1>
- </header>
- <div class="mui-content" style="height: 100%;z-index: -1" id="div1">
- <!--logo图片-->
- <img src="images/login/1024.png" class="logo" />
- <!--logo文字图片-->
- <img src="images/login/logo-font.png" class="logo-font" />
- <!--办公自动化文字-->
- <img src="images/login/Office-automation-system.png" class="zidonghua" />
- <!--登入框-->
- <div class="logo-div">
- <form id='login-form'>
- <!--用户输入框-->
- <div class="user-div">
- <!--用户图片图标-->
- <div class="user-img"></div>
- <!--输入框-->
- <input id='account' type="text" class="user-name mui-input-clear " placeholder="用户名" />
- </div>
- <!--密码框-->
- <div class="pass-div">
- <!--密码图标-->
- <div class="pass-img"></div>
- <!--密码输入框-->
- <input id='password' type="password" class="user-name mui-input-password" placeholder="请输入密码">
- <span id="eyes" class="mui-icon mui-icon-eye eye-pos"></span>
- </div>
- </form>
- </div>
- <!--自动登入-->
- <div class="weiz">
- <div style="font-size: 12px;float: right;"> 自动登录</div>
- <div id="autoLogin" class="mui-switch mui-switch-blue mui-switch-mini" style="float: right;">
- <div class="mui-switch-handle"></div>
- </div>
- </div>
- <!--END-->
-
- <!--登入按钮-->
- <button id='login' type="button" class="mui-btn mui-btn-primary">登录</button>
- <!--END-->
-
- </div>
- <script src="js/mui.min.js"></script>
- <script src="js/jquery-1.11.2.min.js">
- <script src="js/mui.enterfocus.js"></script>
- <script src="js/app.js"></script>
- <script src="js/config.js"></script>
- <script type="text/javascript">
- (function($, doc) {
- // var originalHeight=document.documentElement.clientHeight || document.body.clientHeight;
- // window.onresize=function(){
- // //软键盘弹起与隐藏 都会引起窗口的高度发生变化
- // var resizeHeight=document.documentElement.clientHeight || document.body.clientHeight;
- // if(resizeHeight*1<originalHeight*1){ //resizeHeight<originalHeight证明窗口被挤压了
- // plus.webview.currentWebview().setStyle({
- // height:originalHeight
- // });
- // }
- // }
-
- $.init({
- statusBarBackground: '#f7f7f7'
- });
- $.plusReady(function() {
- var settings = app.getSettings();
- var state = app.getState();
-
- plus.push.addEventListener("click", function(msg) {
- // 判断是从本地创建还是离线推送的消息
- switch(msg.payload) {
- case "LocalMSG":
- alert("点击本地创建消息启动:");
- break;
- default:
- alert("点击离线推送消息启动:");
- break;
- }
- // 提示点击的内容
- plus.ui.alert(msg.content);
- alert(msg.content);
- // 处理其它数据
- logoutPushMsg(msg);
- }, false);
- // 监听在线消息事件
- plus.push.addEventListener("receive", function(msg) {
- if(msg.aps) { // Apple APNS message
- alert("接收到在线APNS消息:");
- } else {
- //alert("接收到在线透传消息:");
- }
- logoutPushMsg(msg);
- }, false);
- var main_loaded_flag = true;
- var toMain = function() {
- var id = setInterval(function() {
- console.log(main_loaded_flag);
- if(main_loaded_flag) {
- clearInterval(id);
- var mainPage = plus.webview.getWebviewById("main");
- mainPage = $.preload({
- "id": 'main',
- "url": 'tab-webview-main.html'
- });
- $.fire(mainPage, 'show', null);
- mainPage.show("pop-in");
- }
- }, 20);
- };
-
- //检查 "登录状态/锁屏状态" 开始
- if (settings.autoLogin && state.token && settings.gestures) {
- $.openWindow({
- url: '/page/person/handPwd.html',
- id: 'handPwd',
- show: {
- aniShow: 'pop-in'
- },
- waiting: {
- autoShow: false
- }
- });
- } else if (settings.autoLogin && state.token) {
- toMain();
- }
-
- // close splash
- setTimeout(function() {
- //关闭 splash
- plus.navigator.closeSplashscreen();
- }, 600);
- //检查 "登录状态/锁屏状态" 结束
- var loginButton = doc.getElementById('login');
- var accountBox = doc.getElementById('account');
- var passwordBox = doc.getElementById('password');
- var autoLoginButton = doc.getElementById("autoLogin");
- var regButton = doc.getElementById('reg');
- var forgetButton = doc.getElementById('forgetPassword');
- loginButton.addEventListener('tap', function(event) {
- console.log("login");
- var loginInfo = {
- account: accountBox.value,
- password: passwordBox.value
- };
- app.login(loginInfo, function(err) {
- if(err) {
- plus.nativeUI.toast(err);
- return;
- }
- toMain();
- });
- });
- // $.enterfocus('#login-form input', function() {
- // $.trigger(loginButton, 'tap');
- // });
- autoLoginButton.classList[settings.autoLogin ? 'add' : 'remove']('mui-active')
- autoLoginButton.addEventListener('toggle', function(event) {
- setTimeout(function() {
- var isActive = event.detail.isActive;
- settings.autoLogin = isActive;
- app.setSettings(settings);
- }, 50);
- }, false);
- var backButtonPress = 0;
- $.back = function(event) {
- backButtonPress++;
- if(backButtonPress > 1) {
- plus.runtime.quit();
- } else {
- plus.nativeUI.toast('再按一次退出应用');
- }
- setTimeout(function() {
- backButtonPress = 0;
- }, 1000);
- return false;
- };
- });
- }(mui, document));
- function logoutPushMsg(msg) {
- var data = msg.content;
- var temp = data.split(",");
- // 任务
- if (temp[0] == 'assess_list') {
- mui.openWindow({
- url: 'login.html',
- id:'login.html',
- });
- }else if (temp[0] == 'noticeDetail') { //通知列表
- mui.openWindow({
- url: 'page/detailHtml/' + temp[0] + '.html',
- id: temp[0] + '.html',
- extras: {
- nid: temp[1]
- }
- });
- }else if (temp[0] == 'dutyDay') { // 值班列表
- mui.openWindow({
- url: 'pagestHtml/' + temp[0] + '.html',
- id: temp[0] + '.html'});
- }
- }
- function saveCid() {
- var url = API.API_URL();
- var info = plus.push.getClientInfo();
- var os = plus.os.name;
- var clientid = info.clientid;
- var state = app.getState(); //获取登陆信息
- var staffId = state.user.useId;
- console.log(JSON.stringify(clientid));
- var obj = {
- 'serviceId': 'oa_2018B1108SAVECID001',
- 'params': '{staffId:' + staffId + ',clientid:"' + clientid + '"}'
- };
- mui.ajax(url, {
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- data: obj,
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Accept': 'application/json'
- }, //超时时间设置为10秒;
- success: function(data) {
-
- },
- error: function(xhr, type, errorThrown) {}
- });
- };
-
- var eyes = document.getElementById('eyes');
- var sign = true;
- eyes.addEventListener('click',function (){
-
-
- /*addClass() - 向被选元素添加一个或多个类
- removeClass() - 从被选元素删除一个或多个类*/
- if(sign){
- $("#eyes").removeClass('eye-pos');
- $("#eyes").addClass('eye-pos-blue');
- $("#password").prop("type","text");
- sign = false ;
- }else{
- $("#eyes").removeClass('eye-pos-blue');
- $("#eyes").addClass('eye-pos');
- sign = true ;
- $("#password").prop("type","password");
- }
- });
- </script>
- </body>
- </html>
|