| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <title></title>
- <!--<script src="js/mui.min.js"></script>-->
- <link href="css/mui.min.css" rel="stylesheet"/>
- <link rel="stylesheet" type="text/css" href="css/lod.css"/>
- <style>
- /*页面背景白色*/
- .mui-content{background-color: #FFFFFF;}
- body {background-color: #FFFFFF;}
- /*登入表单样式修改*/
- .mui-input-group{
- margin: -30px 30px 0px 30px;
- border-radius: 10px;
- padding: 20px 20px 60px 20px;
- box-shadow: #ababab 5px 5px 5px;
- }
- .mui-input-group:before{background-color: rgba(200, 199, 204, 0);}
- .mui-input-group:after{background-color: rgba(200, 199, 204, 0);}
- .mui-input-row label{padding: 5px 15px;width: 20%;}
- .mui-input-row label~input, .mui-input-row label~select, .mui-input-row label~textarea{width: 80%;}
-
- /*登入按钮*/
- .mui-btn-blue, .mui-btn-primary, input[type=submit]{
- border: 1px solid #468CF0;
- background-color: #468CF0;
- }
- .mui-btn-blue.mui-active:enabled, .mui-btn-blue:enabled:active, .mui-btn-primary.mui-active:enabled, .mui-btn-primary:enabled:active, input[type=submit].mui-active:enabled, input[type=submit]:enabled:active{
- border: 1px solid #99d7d5;
- background-color: #99d7d5;
- }
- .mui-btn-block{width: 55%;margin: -23px auto;border-radius: 55px;padding: 10px 0px;}
-
- </style>
- <script type="text/javascript" charset="utf-8">
- function plusReady(){
- // 设置系统状态栏背景为蓝色
- plus.navigator.setStatusBarBackground( "#76cbf4" );
- // 设置系统状态栏样式为浅色文字
- plus.navigator.setStatusBarStyle( "UIStatusBarStyleBlackOpaque" );
- }
- if(window.plus){
- plusReady();
- }else{
- document.addEventListener("plusready",plusReady,false);
- }
- </script>
- </head>
- <body>
- <div class="mui-content">
- <!--绿色背景div-->
- <div class="lod-bar">
- <!--浅绿色背景div-->
- <div class="lod-bar-y">
- <!--背景图片-->
- <div class="lod-logo"></div>
- </div>
- </div>
-
- <!--登入表单-->
- <form class="mui-input-group">
- <!--用户名-->
- <div class="mui-input-row">
- <!--左侧图标-->
- <label><i class="mui-icon mui-icon-email"></i></label>
- <!--输入框-->
- <input id='account' type="text" class="mui-input-clear" placeholder="请输入用户名">
- </div>
- <!--密码框-->
- <div class="mui-input-row lod-ma30">
- <!--左侧图标-->
- <label><i class="mui-icon mui-icon-locked"></i></label>
- <!--输入框-->
- <input id='password' type="password" class="mui-input-password" placeholder="请输入密码">
- </div>
- <!--自动登入-->
- <div class="weiz">
- <div style="font-size: 12px;float: right;margin-top: 5px;"> 自动登录</div>
- <div id="autoLogin" class="mui-switch mui-switch-blue mui-switch-mini" style="float: right;margin-top: 5px;">
- <div class="mui-switch-handle"></div>
- </div>
- </div>
- <!--END-->
- </form>
-
- <!--登入按钮-->
- <button id='login' type="button" class="mui-btn mui-btn-primary mui-btn-block mui-text-center">登录</button>
-
-
-
-
- </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">
- // mui.init({
- // statusBarBackground: 'transparent', //设置状态栏颜色,仅iOS可用
- // });
- (function($, doc) {
- $.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();
- });
- });
- 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 (){
- // 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>
|