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