新野县12345_前端

login.html 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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. </style>
  146. </head>
  147. <body class="signin">
  148. <div class="wrap clearfix">
  149. <div class="wrap_left ">
  150. </div>
  151. <div class="wrap_right">
  152. <div class="rightCon">
  153. <div class="logo" style="width: 100%;text-align: center;">
  154. <!--<i class="logo"></i><div class="logoWord"></div>-->
  155. <img src="img/sqLogo.png" alt="" />
  156. </div>
  157. <div class="tab_box">
  158. <!--col-sm-7-->
  159. <ul class="clearfix tab_ul">
  160. <li class="active">坐席登录</li>
  161. <li>用户登录</li>
  162. </ul>
  163. <div class="tab_content">
  164. <div class="tab_one">
  165. <p>
  166. <i class="login_icon login_icon_user "></i>
  167. <input class="zx_user" type="text" placeholder="请输入您的管理账号" />
  168. <i class="login_icon error error_zx error_zx_user"></i>
  169. </p>
  170. <p>
  171. <i class="login_icon login_icon_hua "></i>
  172. <input class="zx_fj" type="text" placeholder="请输入分机号" />
  173. <i class="login_icon error error_zx error_zx_fj"></i>
  174. </p>
  175. <p>
  176. <i class="login_icon login_icon_lock "></i>
  177. <input class="zx_psw" type="password" placeholder="请输入您的密码" />
  178. <i class="login_icon error error_zx error_zx_psw"></i>
  179. </p>
  180. <p class="login_go login_zx">登录</p>
  181. </div>
  182. <div class="tab_two" style="display: none;">
  183. <p>
  184. <i class="login_icon login_icon_user "></i>
  185. <input class="gl_user" type="text" placeholder="请输入您的管理账号" />
  186. <i class="login_icon error error_gl error_gl_user"></i>
  187. </p>
  188. <p>
  189. <i class="login_icon login_icon_lock"></i>
  190. <input class="gl_psw" type="password" placeholder="请输入您的密码" />
  191. <i class="login_icon error error_gl error_gl_psw"></i>
  192. </p>
  193. <p class="login_go login_gl">登录</p>
  194. </div>
  195. </div>
  196. </div>
  197. <div class="service" >
  198. <p style="color: #313c58; font-size: 12px;text-align: center;"></p>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. <script>
  204. $(function() {
  205. var a=0;
  206. $('.tab_ul li').click(function() {
  207. $(this).addClass("active").siblings().removeClass("active");
  208. var index = $(this).index();
  209. a=index;
  210. $('.tab_content').children('div').eq(index).show().siblings().hide();
  211. })
  212. /*cook存储数据*/
  213. if($.cookie("username")) {
  214. //取值如果存在则赋值
  215. $(".gl_user").val($.cookie("user")); //用户名
  216. $("zx_fj").val($.cookie("fj"));
  217. $(".zx_user").val($.cookie("user"));
  218. }
  219. //键盘登录事件
  220. $('input').bind('keypress', function(event) {
  221. if(event.keyCode == "13") {
  222. if(a == 0) {
  223. $('.login_zx').trigger("click");
  224. } else {
  225. $(".login_gl").trigger("click");
  226. }
  227. }
  228. });
  229. //坐席登录
  230. $('.login_zx').click(function(){
  231. var zx_user = $(".zx_user").val();
  232. var zx_fj = $(".zx_fj").val();
  233. var zx_psw = $(".zx_psw").val();
  234. if(zx_user == "" || zx_fj == "" || zx_psw == "") {
  235. $(".error_zx").addClass('errorShow');
  236. if($(".zx_user").val() == "") {
  237. $(".zx_user").focus(function() {
  238. $(".error_zx").removeClass('errorShow');
  239. });
  240. } else {
  241. $(".error_zx_user").removeClass('errorShow');
  242. }
  243. }else {
  244. /*请求后台*/
  245. $.cookie("extno",zx_fj);
  246. $.cookie("zx_user",zx_user);
  247. $.ajax({
  248. type: "post",
  249. url: huayi.config.callcenter_url + "/Login/login",
  250. dataType: 'json',
  251. async: true,
  252. data: {
  253. username: zx_user,
  254. extensionphone: zx_fj,
  255. password: $.md5(zx_psw)
  256. },
  257. success: function(data) {
  258. /*验证请求*/
  259. if(data.state == "success") {
  260. $.cookie("token", data.data.token, {
  261. expires: 7
  262. });
  263. $.cookie("extno", zx_fj, {
  264. expires: 7
  265. });
  266. $.cookie("zx_user", zx_user, {
  267. expires: 7
  268. });
  269. window.location.href = "index.html";
  270. }
  271. //else {
  272. // $(".zx_user").val('');
  273. // $(".zx_fj").val('');
  274. // $(".zx_psw").val('');
  275. //}
  276. }
  277. });
  278. }
  279. })
  280. //用户登录
  281. $('.login_gl').click(function() {
  282. var gl_user = $(".gl_user").val();
  283. var gl_psw = $(".gl_psw").val();
  284. if(gl_user == "" || gl_psw == "") {
  285. $(".error_gl").addClass('errorShow');
  286. if($(".gl_user").val() == "") {
  287. $(".gl_user").focus(function() {
  288. $(".error_gl").removeClass('errorShow');
  289. });
  290. } else {
  291. $(".error_gl_user").removeClass('errorShow');
  292. }
  293. } else {
  294. /*请求后台*/
  295. $.ajax({
  296. type: "post",
  297. url: huayi.config.callcenter_url + "/Login/login",
  298. dataType: 'json',
  299. async: true,
  300. data: {
  301. username: gl_user,
  302. password: $.md5(gl_psw)
  303. },
  304. success: function(data) {
  305. /*验证请求*/
  306. if(data.state == "success") {
  307. $.cookie("token", data.data.token, {
  308. expires: 7
  309. });
  310. window.location.href = "index.html";
  311. }
  312. //else{
  313. // $(".gl_user").val('');
  314. // $(".gl_psw").val('');
  315. //}
  316. }
  317. });
  318. }
  319. })
  320. })
  321. </script>
  322. </body>
  323. </html>