济源12345的前端

login.html 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  6. <title>登录</title>
  7. <meta name="keywords">
  8. <meta name="description">
  9. <meta name="renderer" content="webkit">
  10. <link rel="shortcut icon" href="img/32.ico" />
  11. <script src="./Script/Common/huayi.load.js"></script>
  12. <script src="./Script/Common/huayi.config.js"></script>
  13. <link rel="stylesheet" href="./css/init.css" />
  14. <script src="./js/jquery.md5.js"></script>
  15. <style>
  16. html {
  17. margin: 0 auto;
  18. padding: 0;
  19. height: 100%;
  20. }
  21. body {
  22. height: 100%;
  23. background: #fff;
  24. }
  25. .wrap {
  26. width: 100%;
  27. height: 100%;
  28. }
  29. .wrap_left,
  30. .wrap_right {
  31. float: left;
  32. width: 50%;
  33. height: 100%;
  34. }
  35. .wrap_right{
  36. position: relative;
  37. }
  38. .wrap_left {
  39. background: url(img/left_amg_01.jpg) no-repeat;
  40. background-size: contain;
  41. }
  42. .tab_box {
  43. border: 1px solid #41caf2;
  44. border-top-right-radius: 15px;
  45. border-bottom-left-radius: 15px;
  46. margin: 50px auto 65px;
  47. padding: 0;
  48. overflow: hidden;
  49. width: 410px;
  50. }
  51. .tab_box ul {
  52. list-style: none;
  53. margin: 0;
  54. padding: 0;
  55. width: 100%;
  56. height: 50px;
  57. line-height: 50px;
  58. font-size: 16px;
  59. color: #41caf2;
  60. border-bottom: 1px solid #41caf2;
  61. text-align: center;
  62. }
  63. .tab_box ul li {
  64. width: 50%;
  65. float: left;
  66. }
  67. .active {
  68. background: #41caf2;
  69. color: #fff;
  70. }
  71. .tab_content {
  72. margin: 57px 0 35px 0;
  73. }
  74. .tab_content div p {
  75. width: 80%;
  76. margin: 0 auto;
  77. height: 35px;
  78. border: 1px solid #41caf2;
  79. border-radius: 15px;
  80. margin-bottom: 25px;
  81. line-height: 30px;
  82. padding-left: 20px;
  83. }
  84. .tab_content div p input {
  85. width: 75%;
  86. border: 0;
  87. font-size: 16px;
  88. outline: none;
  89. font-family: "仿宋", "宋体";
  90. }
  91. .login_icon {
  92. display: inline-block;
  93. width: 17px;
  94. height: 19px;
  95. vertical-align: middle;
  96. margin-right: 15px;
  97. }
  98. .login_icon_user {
  99. background: url(img/login_user.png) no-repeat;
  100. }
  101. .login_icon_lock {
  102. background: url(img/login_lock.png) no-repeat;
  103. }
  104. .login_icon_hua {
  105. background: url(img/login_hua.png) no-repeat;
  106. }
  107. .login_go {
  108. text-align: center;
  109. padding: 0!important;
  110. font-size: 16px;
  111. letter-spacing: 16px;
  112. font-family: "仿宋", "宋体";
  113. color: #fff;
  114. filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#1f90ec, endcolorstr=#1cb5ef, gradientType=1);
  115. background: -webkit-gradient(li near, 0 0, 100% 0, from(#1f90ec), to(#1cb5ef));
  116. background: -webkit-linear-gradient(left, #1f90ec, #1cb5ef);
  117. background: -moz-linear-gradient(left, #1f90ec, #1cb5ef);
  118. background: -o-linear-gradient(left, #1f90ec, #1cb5ef);
  119. background: linear-gradient(left, #1f90ec, #1cb5ef);
  120. cursor: pointer;
  121. }
  122. .error {
  123. height: 13px;
  124. background: url(img/yz.png) no-repeat 0 -8px;
  125. display: none;
  126. }
  127. .errorShow {
  128. display: inline-block;
  129. }
  130. .rightCon{
  131. width: 100%;
  132. position: absolute;
  133. top: 0;
  134. bottom: 0;
  135. right: 0;
  136. left: 0;
  137. margin: auto;
  138. height: 580px;
  139. }
  140. .service{
  141. width: 100%;
  142. position: absolute;
  143. bottom: 30px;
  144. }
  145. .logo h1,h3{color:#3FB3F3;}
  146. </style>
  147. </head>
  148. <body class="signin">
  149. <div class="wrap clearfix">
  150. <div class="wrap_left ">
  151. </div>
  152. <div class="wrap_right">
  153. <div class="rightCon">
  154. <div class="logo" style="width: 100%;text-align: center;">
  155. <!--<i class="logo"></i><div class="logoWord"></div>-->
  156. <h1>济源123456政府服务热线</h1>
  157. <h3>JiYuan123456 Government Service Hotline</h3>
  158. <!--<img src="img/sqLogo.png" alt="" />-->
  159. </div>
  160. <!--<div class="row clearfix">-->
  161. <div class="tab_box">
  162. <!--col-sm-7-->
  163. <ul class="clearfix tab_ul">
  164. <li class="active">坐席登录</li>
  165. <li>用户登录</li>
  166. </ul>
  167. <div class="tab_content">
  168. <div class="tab_one">
  169. <p>
  170. <i class="login_icon login_icon_user "></i>
  171. <input class="zx_user" type="text" placeholder="请输入您的管理账号" />
  172. <i class="login_icon error error_zx error_zx_user"></i>
  173. </p>
  174. <p>
  175. <i class="login_icon login_icon_hua "></i>
  176. <input class="zx_fj" type="text" placeholder="请输入分机号" />
  177. <i class="login_icon error error_zx error_zx_fj"></i>
  178. </p>
  179. <p>
  180. <i class="login_icon login_icon_lock "></i>
  181. <input class="zx_psw" type="password" placeholder="请输入您的密码" />
  182. <i class="login_icon error error_zx error_zx_psw"></i>
  183. </p>
  184. <p class="login_go login_zx">登录</p>
  185. </div>
  186. <div class="tab_two" style="display: none;">
  187. <p>
  188. <i class="login_icon login_icon_user "></i>
  189. <input class="gl_user" type="text" placeholder="请输入您的管理账号" />
  190. <i class="login_icon error error_gl error_gl_user"></i>
  191. </p>
  192. <p>
  193. <i class="login_icon login_icon_lock"></i>
  194. <input class="gl_psw" type="password" placeholder="请输入您的密码" />
  195. <i class="login_icon error error_gl error_gl_psw"></i>
  196. </p>
  197. <p class="login_go login_gl">登录</p>
  198. </div>
  199. </div>
  200. </div>
  201. <!--</div>-->
  202. <div class="service" >
  203. <!--row clearfix-->
  204. <!--<div class="col-sm-7">-->
  205. <p style="color: #313c58; font-size: 12px;text-align: center;"></p>
  206. <!--</div>-->
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. <script>
  212. $(function() {
  213. var a=0;
  214. $('.tab_ul li').click(function() {
  215. $(this).addClass("active").siblings().removeClass("active");
  216. var index = $(this).index();
  217. a=index;
  218. $('.tab_content').children('div').eq(index).show().siblings().hide();
  219. })
  220. /*cook存储数据*/
  221. if($.cookie("username")) {
  222. //取值如果存在则赋值
  223. $(".gl_user").val($.cookie("user")); //用户名
  224. $("zx_fj").val($.cookie("fj"));
  225. $(".zx_user").val($.cookie("user"));
  226. }
  227. //键盘登录事件
  228. $('input').bind('keypress', function(event) {
  229. if(event.keyCode == "13") {
  230. if(a == 0) {
  231. $('.login_zx').trigger("click");
  232. } else {
  233. $(".login_gl").trigger("click");
  234. }
  235. }
  236. });
  237. //坐席登录
  238. $('.login_zx').click(function(){
  239. var zx_user = $(".zx_user").val();
  240. var zx_fj = $(".zx_fj").val();
  241. var zx_psw = $(".zx_psw").val();
  242. if(zx_user == "" || zx_fj == "" || zx_psw == "") {
  243. $(".error_zx").addClass('errorShow');
  244. if($(".zx_user").val() == "") {
  245. $(".zx_user").focus(function() {
  246. $(".error_zx").removeClass('errorShow');
  247. });
  248. } else {
  249. $(".error_zx_user").removeClass('errorShow');
  250. }
  251. }else {
  252. /*请求后台*/
  253. $.cookie("extno",zx_fj);
  254. $.cookie("zx_user",zx_user);
  255. $.ajax({
  256. type: "post",
  257. url: huayi.config.callcenter_url + "/Login/login",
  258. dataType: 'json',
  259. async: true,
  260. data: {
  261. username: zx_user,
  262. extensionphone: zx_fj,
  263. password: $.md5(zx_psw)
  264. },
  265. success: function(data) {
  266. /*验证请求*/
  267. if(data.state == "success") {
  268. $.cookie("token", data.data.token, {
  269. expires: 7
  270. });
  271. $.cookie("extno", zx_fj, {
  272. expires: 7
  273. });
  274. $.cookie("zx_user", zx_user, {
  275. expires: 7
  276. });
  277. window.location.href = "index.html";
  278. }
  279. //else {
  280. // $(".zx_user").val('');
  281. // $(".zx_fj").val('');
  282. // $(".zx_psw").val('');
  283. //}
  284. }
  285. });
  286. }
  287. })
  288. //用户登录
  289. $('.login_gl').click(function() {
  290. var gl_user = $(".gl_user").val();
  291. var gl_psw = $(".gl_psw").val();
  292. if(gl_user == "" || gl_psw == "") {
  293. $(".error_gl").addClass('errorShow');
  294. if($(".gl_user").val() == "") {
  295. $(".gl_user").focus(function() {
  296. $(".error_gl").removeClass('errorShow');
  297. });
  298. } else {
  299. $(".error_gl_user").removeClass('errorShow');
  300. }
  301. } else {
  302. /*请求后台*/
  303. $.ajax({
  304. type: "post",
  305. url: huayi.config.callcenter_url + "/Login/login",
  306. dataType: 'json',
  307. async: true,
  308. data: {
  309. username: gl_user,
  310. password: $.md5(gl_psw)
  311. },
  312. success: function(data) {
  313. /*验证请求*/
  314. if(data.state == "success") {
  315. $.cookie("token", data.data.token, {
  316. expires: 7
  317. });
  318. $.cookie("zx_user", gl_user, {
  319. expires: 7
  320. });
  321. window.location.href = "index.html";
  322. }
  323. //else{
  324. // $(".gl_user").val('');
  325. // $(".gl_psw").val('');
  326. //}
  327. }
  328. });
  329. }
  330. })
  331. })
  332. </script>
  333. </body>
  334. </html>