loginyy.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title></title>
  7. <!--<script src="js/mui.min.js"></script>-->
  8. <link href="css/mui.min.css" rel="stylesheet"/>
  9. <link rel="stylesheet" type="text/css" href="css/lod.css"/>
  10. <style>
  11. /*页面背景白色*/
  12. .mui-content{background-color: #FFFFFF;}
  13. body {background-color: #FFFFFF;}
  14. /*登入表单样式修改*/
  15. .mui-input-group{
  16. margin: -30px 30px 0px 30px;
  17. border-radius: 10px;
  18. padding: 20px 20px 60px 20px;
  19. box-shadow: #ababab 5px 5px 5px;
  20. }
  21. .mui-input-group:before{background-color: rgba(200, 199, 204, 0);}
  22. .mui-input-group:after{background-color: rgba(200, 199, 204, 0);}
  23. .mui-input-row label{padding: 5px 15px;width: 20%;}
  24. .mui-input-row label~input, .mui-input-row label~select, .mui-input-row label~textarea{width: 80%;}
  25. /*登入按钮*/
  26. .mui-btn-blue, .mui-btn-primary, input[type=submit]{
  27. border: 1px solid #468CF0;
  28. background-color: #468CF0;
  29. }
  30. .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{
  31. border: 1px solid #99d7d5;
  32. background-color: #99d7d5;
  33. }
  34. .mui-btn-block{width: 55%;margin: -23px auto;border-radius: 55px;padding: 10px 0px;}
  35. </style>
  36. <script type="text/javascript" charset="utf-8">
  37. function plusReady(){
  38. // 设置系统状态栏背景为蓝色
  39. plus.navigator.setStatusBarBackground( "#76cbf4" );
  40. // 设置系统状态栏样式为浅色文字
  41. plus.navigator.setStatusBarStyle( "UIStatusBarStyleBlackOpaque" );
  42. }
  43. if(window.plus){
  44. plusReady();
  45. }else{
  46. document.addEventListener("plusready",plusReady,false);
  47. }
  48. </script>
  49. </head>
  50. <body>
  51. <div class="mui-content">
  52. <!--绿色背景div-->
  53. <div class="lod-bar">
  54. <!--浅绿色背景div-->
  55. <div class="lod-bar-y">
  56. <!--背景图片-->
  57. <div class="lod-logo"></div>
  58. </div>
  59. </div>
  60. <!--登入表单-->
  61. <form class="mui-input-group">
  62. <!--用户名-->
  63. <div class="mui-input-row">
  64. <!--左侧图标-->
  65. <label><i class="mui-icon mui-icon-email"></i></label>
  66. <!--输入框-->
  67. <input id='account' type="text" class="mui-input-clear" placeholder="请输入用户名">
  68. </div>
  69. <!--密码框-->
  70. <div class="mui-input-row lod-ma30">
  71. <!--左侧图标-->
  72. <label><i class="mui-icon mui-icon-locked"></i></label>
  73. <!--输入框-->
  74. <input id='password' type="password" class="mui-input-password" placeholder="请输入密码">
  75. </div>
  76. <!--自动登入-->
  77. <div class="weiz">
  78. <div style="font-size: 12px;float: right;margin-top: 5px;"> &nbsp; &nbsp;自动登录</div>
  79. <div id="autoLogin" class="mui-switch mui-switch-blue mui-switch-mini" style="float: right;margin-top: 5px;">
  80. <div class="mui-switch-handle"></div>
  81. </div>
  82. </div>
  83. <!--END-->
  84. </form>
  85. <!--登入按钮-->
  86. <button id='login' type="button" class="mui-btn mui-btn-primary mui-btn-block mui-text-center">登录</button>
  87. </div>
  88. <script src="js/mui.min.js"></script>
  89. <script src="js/jquery-1.11.2.min.js">
  90. <script src="js/mui.enterfocus.js"></script>
  91. <script src="js/app.js"></script>
  92. <script src="js/config.js"></script>
  93. <script type="text/javascript">
  94. // mui.init({
  95. // statusBarBackground: 'transparent', //设置状态栏颜色,仅iOS可用
  96. // });
  97. (function($, doc) {
  98. $.init({
  99. statusBarBackground: '#f7f7f7'
  100. });
  101. $.plusReady(function() {
  102. var settings = app.getSettings();
  103. var state = app.getState();
  104. plus.push.addEventListener("click", function(msg) {
  105. // 判断是从本地创建还是离线推送的消息
  106. switch(msg.payload) {
  107. case "LocalMSG":
  108. alert("点击本地创建消息启动:");
  109. break;
  110. default:
  111. alert("点击离线推送消息启动:");
  112. break;
  113. }
  114. // 提示点击的内容
  115. plus.ui.alert(msg.content);
  116. alert(msg.content);
  117. // 处理其它数据
  118. logoutPushMsg(msg);
  119. }, false);
  120. // 监听在线消息事件
  121. plus.push.addEventListener("receive", function(msg) {
  122. if(msg.aps) { // Apple APNS message
  123. alert("接收到在线APNS消息:");
  124. } else {
  125. //alert("接收到在线透传消息:");
  126. }
  127. logoutPushMsg(msg);
  128. }, false);
  129. var main_loaded_flag = true;
  130. var toMain = function() {
  131. var id = setInterval(function() {
  132. console.log(main_loaded_flag);
  133. if(main_loaded_flag) {
  134. clearInterval(id);
  135. var mainPage = plus.webview.getWebviewById("main");
  136. mainPage = $.preload({
  137. "id": 'main',
  138. "url": 'tab-webview-main.html'
  139. });
  140. $.fire(mainPage, 'show', null);
  141. mainPage.show("pop-in");
  142. }
  143. }, 20);
  144. };
  145. //检查 "登录状态/锁屏状态" 开始
  146. if (settings.autoLogin && state.token && settings.gestures) {
  147. $.openWindow({
  148. url: '/page/person/handPwd.html',
  149. id: 'handPwd',
  150. show: {
  151. aniShow: 'pop-in'
  152. },
  153. waiting: {
  154. autoShow: false
  155. }
  156. });
  157. } else if (settings.autoLogin && state.token) {
  158. toMain();
  159. }
  160. // close splash
  161. setTimeout(function() {
  162. //关闭 splash
  163. plus.navigator.closeSplashscreen();
  164. }, 600);
  165. //检查 "登录状态/锁屏状态" 结束
  166. var loginButton = doc.getElementById('login');
  167. var accountBox = doc.getElementById('account');
  168. var passwordBox = doc.getElementById('password');
  169. var autoLoginButton = doc.getElementById("autoLogin");
  170. // var regButton = doc.getElementById('reg');
  171. // var forgetButton = doc.getElementById('forgetPassword');
  172. loginButton.addEventListener('tap', function(event) {
  173. console.log("login");
  174. var loginInfo = {
  175. account: accountBox.value,
  176. password: passwordBox.value
  177. };
  178. app.login(loginInfo, function(err) {
  179. if(err) {
  180. plus.nativeUI.toast(err);
  181. return;
  182. }
  183. toMain();
  184. });
  185. });
  186. autoLoginButton.classList[settings.autoLogin ? 'add' : 'remove']('mui-active')
  187. autoLoginButton.addEventListener('toggle', function(event) {
  188. setTimeout(function() {
  189. var isActive = event.detail.isActive;
  190. settings.autoLogin = isActive;
  191. app.setSettings(settings);
  192. }, 50);
  193. }, false);
  194. var backButtonPress = 0;
  195. $.back = function(event) {
  196. backButtonPress++;
  197. if(backButtonPress > 1) {
  198. plus.runtime.quit();
  199. } else {
  200. plus.nativeUI.toast('再按一次退出应用');
  201. }
  202. setTimeout(function() {
  203. backButtonPress = 0;
  204. }, 1000);
  205. return false;
  206. };
  207. });
  208. }(mui, document));
  209. function logoutPushMsg(msg) {
  210. var data = msg.content;
  211. var temp = data.split(",");
  212. // 任务
  213. if (temp[0] == 'assess_list') {
  214. mui.openWindow({
  215. url: 'login.html',
  216. id:'login.html',
  217. });
  218. }else if (temp[0] == 'noticeDetail') { //通知列表
  219. mui.openWindow({
  220. url: 'page/detailHtml/' + temp[0] + '.html',
  221. id: temp[0] + '.html',
  222. extras: {
  223. nid: temp[1]
  224. }
  225. });
  226. }else if (temp[0] == 'dutyDay') { // 值班列表
  227. mui.openWindow({
  228. url: 'pagestHtml/' + temp[0] + '.html',
  229. id: temp[0] + '.html'});
  230. }
  231. }
  232. function saveCid() {
  233. var url = API.API_URL();
  234. var info = plus.push.getClientInfo();
  235. var os = plus.os.name;
  236. var clientid = info.clientid;
  237. var state = app.getState(); //获取登陆信息
  238. var staffId = state.user.useId;
  239. console.log(JSON.stringify(clientid));
  240. var obj = {
  241. 'serviceId': 'oa_2018B1108SAVECID001',
  242. 'params': '{staffId:' + staffId + ',clientid:"' + clientid + '"}'
  243. };
  244. mui.ajax(url, {
  245. dataType: 'json', //服务器返回json格式数据
  246. type: 'post', //HTTP请求类型
  247. data: obj,
  248. timeout: 10000, //超时时间设置为10秒;
  249. headers: {
  250. 'Accept': 'application/json'
  251. }, //超时时间设置为10秒;
  252. success: function(data) {
  253. },
  254. error: function(xhr, type, errorThrown) {}
  255. });
  256. };
  257. // var eyes = document.getElementById('eyes');
  258. // var sign = true;
  259. // eyes.addEventListener('click',function (){
  260. // if(sign){
  261. // $("#eyes").removeClass('eye-pos');
  262. // $("#eyes").addClass('eye-pos-blue');
  263. // $("#password").prop("type","text");
  264. //
  265. // sign = false ;
  266. // }else{
  267. // $("#eyes").removeClass('eye-pos-blue');
  268. // $("#eyes").addClass('eye-pos');
  269. // sign = true ;
  270. // $("#password").prop("type","password");
  271. // }
  272. // });
  273. </script>
  274. </body>
  275. </html>