12345市长热线标准版-前端

login.html 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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. $(".gl_user").val($.cookie("user")); //用户名
  225. $("zx_fj").val($.cookie("fj"));
  226. $(".zx_user").val($.cookie("user"));
  227. }
  228. //键盘登录事件
  229. $('input').bind('keypress', function(event) {
  230. if(event.keyCode == "13") {
  231. console.log(a);
  232. if(a == 0) {
  233. $('.login_zx').trigger("click");
  234. } else {
  235. $(".login_gl").trigger("click");
  236. }
  237. }
  238. });
  239. //坐席登录
  240. $('.login_zx').click(function(){
  241. var zx_user = $(".zx_user").val();
  242. var zx_fj = $(".zx_fj").val();
  243. var zx_psw = $(".zx_psw").val();
  244. if(zx_user == "" || zx_fj == "" || zx_psw == "") {
  245. $(".error_zx").addClass('errorShow');
  246. if($(".zx_user").val() == "") {
  247. $(".zx_user").focus(function() {
  248. $(".error_zx").removeClass('errorShow');
  249. });
  250. } else {
  251. $(".error_zx_user").removeClass('errorShow');
  252. }
  253. }else {
  254. /*请求后台*/
  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. window.location.href = "index.html";
  275. }else{
  276. $(".zx_user").val('');
  277. $(".zx_fj").val('');
  278. $(".zx_psw").val('');
  279. }
  280. }
  281. });
  282. }
  283. })
  284. //用户登录
  285. $('.login_gl').click(function() {
  286. var gl_user = $(".gl_user").val();
  287. var gl_psw = $(".gl_psw").val();
  288. if(gl_user == "" || gl_psw == "") {
  289. $(".error_gl").addClass('errorShow');
  290. if($(".gl_user").val() == "") {
  291. $(".gl_user").focus(function() {
  292. $(".error_gl").removeClass('errorShow');
  293. });
  294. } else {
  295. $(".error_gl_user").removeClass('errorShow');
  296. }
  297. } else {
  298. /*请求后台*/
  299. $.ajax({
  300. type: "post",
  301. url: huayi.config.callcenter_url + "/Login/login",
  302. dataType: 'json',
  303. async: true,
  304. data: {
  305. username: gl_user,
  306. password: $.md5(gl_psw)
  307. },
  308. success: function(data) {
  309. /*验证请求*/
  310. if(data.state == "success") {
  311. $.cookie("token", data.data.token, {
  312. expires: 7
  313. });
  314. window.location.href = "index.html";
  315. }else{
  316. $(".gl_user").val('');
  317. $(".gl_psw").val('');
  318. }
  319. }
  320. });
  321. }
  322. })
  323. })
  324. </script>
  325. </body>
  326. </html>