説明なし

login.html 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <!DOCTYPE html>
  2. <html class="ui-page-login">
  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. <link href="css/mui.min.css" rel="stylesheet" />
  8. <link href="css/iconfont.css" rel="stylesheet" />
  9. <style>
  10. body {
  11. background-color: #fff!important;
  12. }
  13. #login-form {
  14. background-color: #fff!important;
  15. }
  16. .mui-content {
  17. background: #FFF;
  18. }
  19. .area {
  20. margin: 20px auto 0px auto;
  21. }
  22. .mui-input-group {
  23. margin-top: 10px;
  24. }
  25. .mui-input-group:first-child {
  26. margin-top: 20px;
  27. }
  28. .mui-input-group label {
  29. width: 2%;
  30. text-align: right;
  31. }
  32. .mui-input-row label~input,
  33. .mui-input-row label~select,
  34. .mui-input-row label~textarea {
  35. width: 88%;
  36. }
  37. .mui-checkbox input[type=checkbox],
  38. .mui-radio input[type=radio] {
  39. top: 6px;
  40. }
  41. .mui-content-padded {
  42. margin-top: 40px;
  43. }
  44. .mui-btn {
  45. padding: 10px;
  46. }
  47. .link-area {
  48. display: block;
  49. margin-top: 130px;
  50. text-align: center;
  51. font-size: 15px;
  52. }
  53. .spliter {
  54. width: 25%;
  55. display: inline-block;
  56. color: #bbb;
  57. padding: 0px 8px;
  58. /* line-height: 20px; */
  59. vertical-align: middle;
  60. position: relative;
  61. left: -10px;
  62. }
  63. .spliter:after {
  64. position: absolute;
  65. right: 0;
  66. bottom: 0;
  67. left: 15px;
  68. height: 1px;
  69. content: '';
  70. -webkit-transform: scaleY(.5);
  71. transform: scaleY(.5);
  72. background-color: #c8c7cc;
  73. }
  74. .oauth-area {
  75. text-align: center;
  76. width: 100%;
  77. padding: 0px;
  78. margin: 0px;
  79. }
  80. .oauth-area .oauth-btn {
  81. display: inline-block;
  82. width: 50px;
  83. height: 50px;
  84. background-size: 30px 30px;
  85. background-position: center center;
  86. background-repeat: no-repeat;
  87. margin: 0px 20px;
  88. /*-webkit-filter: grayscale(100%); */
  89. border: solid 1px #ddd;
  90. border-radius: 25px;
  91. }
  92. .oauth-area .reg_href{
  93. text-align: center;
  94. display: block;
  95. width: 100%;
  96. float: left;
  97. color: #00A1CB;
  98. }
  99. .oauth-area .oauth-btn:active {
  100. border: solid 1px #aaa;
  101. }
  102. .oauth-area .oauth-btn.disabled {
  103. background-color: #ddd;
  104. }
  105. #login-form {
  106. margin-top: 0px;
  107. }
  108. .mui-logo-box {
  109. text-align: center;
  110. margin-bottom: 130px;
  111. width: 100%;
  112. }
  113. .mui-logo-box img {
  114. padding-top: 150px;
  115. width: 80%;
  116. }
  117. .mui-input-row {
  118. margin-top: 15px;
  119. }
  120. .mui-input-group:after {
  121. position: absolute;
  122. right: 0;
  123. bottom: 0;
  124. left: 15px;
  125. height: 1px;
  126. content: '';
  127. -webkit-transform: scaleY(.5);
  128. transform: scaleY(.5);
  129. /*background-color: #c8c7cc;*/
  130. }
  131. input {
  132. font-size: 14px;
  133. }
  134. .mui-btn-primary {
  135. border: 1px solid #00a1cb;
  136. background-color: #00a1cb;
  137. }
  138. .mui-input-group {
  139. width: 100%;
  140. margin: 0 auto;
  141. margin-bottom: 20px;
  142. }
  143. .mui-input-row {
  144. margin-bottom: 10px;
  145. }
  146. .mui-content-padded {
  147. width: 100%;
  148. width: 90%;
  149. margin: 0 auto;
  150. margin-top: 30px;
  151. }
  152. #login {
  153. border-radius: 20px;
  154. }
  155. .mui-input-group .mui-input-row:after {
  156. left: -5px;
  157. }
  158. .mui-input-row span {
  159. color: #787878;
  160. }
  161. .mui-input-group .mui-input-row {
  162. height: 40px;
  163. /* margin-bottom: 20px; */
  164. width: 90%;
  165. margin: 0 auto;
  166. border: 1px solid #ccc;
  167. border-radius: 20px;
  168. margin-bottom: 20px;
  169. }
  170. .mui-input-group:after {
  171. background-color: #fff;
  172. }
  173. .mui-input-group .mui-input-row:after {
  174. background-color: #fff;
  175. }
  176. </style>
  177. </head>
  178. <body>
  179. <div class="mui-content" >
  180. <form id="login-form" class="mui-input-group">
  181. <!--logo-->
  182. <div class="mui-logo-box">
  183. <div>
  184. <img src="img/123.png" alt="" />
  185. </div>
  186. </div>
  187. <div class="mui-input-row">
  188. <label><span class="mui-icon iconfont icon-yonghu"></span></label>
  189. <input id="account" type="text" class="mui-input-clear mui-input" placeholder="请输入账号">
  190. </div>
  191. <div class="mui-input-row mui-password">
  192. <label><span class="mui-icon iconfont icon-suo"></span></label>
  193. <input id="password" type="password" class=" mui-input-password mui-input" placeholder="请输入密码">
  194. </div>
  195. </form>
  196. <div class="mui-content-padded">
  197. <button id="login" class="mui-btn mui-btn-block mui-btn-primary" style="font-size: 16px;">登录</button>
  198. </div>
  199. <div class="mui-content-padded oauth-area" style="width: 100%; margin-top: 30px;">
  200. <a href="User-login.html" class="reg_href" style="font-size: 14px;">我是市民</a>
  201. </div>
  202. </div>
  203. <script src="js/mui.min.js"></script>
  204. <script src="js/jquery.min.js"></script>
  205. <script src="js/jquery.md5.js"></script>
  206. <script src="js/huayi.http.js"></script>
  207. <script src="js/huayi.config.js"></script>
  208. <script>
  209. mui.init();
  210. mui.plusReady(function() {
  211. var usercode = localStorage.getItem("user"); //获取本地存储
  212. var psw = localStorage.getItem("psw"); //获取本地存储s
  213. if (usercode != null) //如果缓存中有数据,则加载出来
  214. {
  215. document.getElementById("account").value = usercode;
  216. document.getElementById("password").value = localStorage.getItem("psw");
  217. }
  218. document.getElementById("login").addEventListener('tap', function() {
  219. // localStorage.clear();
  220. var username = document.getElementById('account').value;
  221. var password = document.getElementById('password').value;
  222. var data = {
  223. "username": username,
  224. "password": $.md5(password),
  225. " extensionphone": 1
  226. };
  227. if (!username) {
  228. plus.nativeUI.toast('输入账号');
  229. } else if (!password) {
  230. plus.nativeUI.toast('密码不能为空');
  231. } else {
  232. if (plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE) {
  233. mui.toast("网络连接中断!");
  234. }
  235. // 调用ajax
  236. mui.ajax(huayi.config.callcenter_url + '/Login/applogin', {
  237. data: data,
  238. dataType: 'json', //服务器返回json格式数据
  239. type: 'post', //HTTP请求类型
  240. timeout: 10000, //超时时间设置为10秒
  241. success: function(data) {
  242. if (data.state == "success") {
  243. localStorage.setItem("token", data.data.token);
  244. localStorage.setItem("user", username);
  245. localStorage.setItem("psw", password);
  246. var nwaiting = plus.nativeUI.showWaiting();
  247. webviewShow = plus.webview.create("Leader-index.html"); //后台创建webview并打开show.html
  248. //webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件
  249. //nwaiting.close(); //新webview的载入完毕后关闭等待框
  250. //webviewShow.show("slide-in-right", 300); //把新webview窗体显示出来,显示动画效果为速度300毫秒的右侧移入动画
  251. //}, false);
  252. document.getElementById('account').value = "";
  253. document.getElementById('password').value = "";
  254. } else {
  255. mui.alert(data.message);
  256. document.getElementById('account').value = "";
  257. document.getElementById('password').value = "";
  258. }
  259. },
  260. error: function(xhr, type, errorThrown) {}
  261. });
  262. }
  263. });
  264. });
  265. //
  266. </script>
  267. </body>
  268. </html>