12345市长热线标准版-前端

login2.html 8.7KB

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