ZZDianXin_UI - 郑州电信 演示

User-login.html 7.4KB

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