5d0d94cd by 任超

style:登录

1 parent b0198335
...@@ -194,6 +194,7 @@ div.navigation { ...@@ -194,6 +194,7 @@ div.navigation {
194 /* -----------------底部start----------------------------- */ 194 /* -----------------底部start----------------------------- */
195 div.footer { 195 div.footer {
196 background-color: #233042; 196 background-color: #233042;
197 height: 310px;
197 } 198 }
198 div.footer .system_service { 199 div.footer .system_service {
199 width: 100%; 200 width: 100%;
......
...@@ -39,28 +39,36 @@ ...@@ -39,28 +39,36 @@
39 } 39 }
40 /* --------------------业务模块----------------------- */ 40 /* --------------------业务模块----------------------- */
41 .business_module { 41 .business_module {
42 margin-top: 20px; 42 margin-top: 30px;
43 overflow: hidden; 43 overflow: hidden;
44 margin-left: -10px; 44 margin-left: -25px;
45 margin-right: -10px; 45 margin-right: -25px;
46 } 46 }
47 .business_module li{ 47 .business_module li{
48 width: 25%; 48 width: 25%;
49 height: 230px; 49 height: 230px;
50 text-align: center; 50 text-align: center;
51 line-height: 160px;
52 font-size: 26px; 51 font-size: 26px;
53 float: left; 52 float: left;
54 margin-bottom: 30px; 53 margin-bottom: 30px;
55 box-sizing: border-box; 54 box-sizing: border-box;
56 padding: 0 10px; 55 padding: 0 25px;
56 }
57 .business_module li img {
58 width: 70px;
59 height: 70px;
60 margin-top: 50px;
61 margin-bottom: 30px;
62 }
63 .business_module li p {
64 font-size: 14px;
65 color: #6D7278;
57 } 66 }
58 .business_module li a { 67 .business_module li a {
59 padding-right: 20px; 68 padding-right: 20px;
60 display: block; 69 display: block;
61 width: 100%; 70 width: 100%;
62 height: 100%; 71 height: 100%;
63 border: 1px solid #E6E6E6;
64 box-sizing: border-box; 72 box-sizing: border-box;
65 padding-left: 20px; 73 padding-left: 20px;
66 } 74 }
......
...@@ -57,3 +57,4 @@ function getCookie(){ ...@@ -57,3 +57,4 @@ function getCookie(){
57 return JSON.parse(arr1[1]); 57 return JSON.parse(arr1[1]);
58 } 58 }
59 }; 59 };
60 // 设置最小高度
......
1 function login(){ 1 function login() {
2 layui.use('layer', function () { 2 layui.use('layer', function () {
3 layer.open({ 3 layer.open({
4 type: 1, 4 type: 1,
...@@ -13,67 +13,73 @@ function login(){ ...@@ -13,67 +13,73 @@ function login(){
13 + '<li><span><a class="require">*</a>密码</span>:<input id="IDcard"></li>' 13 + '<li><span><a class="require">*</a>密码</span>:<input id="IDcard"></li>'
14 + '</ul>' 14 + '</ul>'
15 + '<div class="btns">' 15 + '<div class="btns">'
16 +'<button type="button" id="loginButton">登录</button>' 16 + '<button type="button" id="loginButton">登录</button>'
17 +'<button type="button" id="registerButton">注册</button></div>' 17 + '<button type="button" id="registerButton">注册</button></div>'
18 + '</div>' 18 + '</div>'
19 }); 19 });
20 }) 20 })
21 } 21 }
22 $(document).on('click', '.PersonLogin', function(){ 22 $(document).on('click', '.PersonLogin', function () {
23 login() 23 login();
24 window.onbeforeunload = function () {
25 var n = window.event.screenX - window.screenLeft;
26 var b = n > document.documentElement.scrollWidth - 20;
27 if (b && window.event.clientY < 0 || window.event.altKey) {
28 delAllCookie();
29 }
30 }
24 }) 31 })
25 32
26 // 点击登陆的时候 33 // 点击登陆的时候
27 $(document).on('click', '#loginButton', function(){ 34 $(document).on('click', '#loginButton', function () {
28 var userLoginRequest = {} 35 var userLoginRequest = {}
29 var username =$('#phone').val() 36 var username = $('#phone').val()
30 var password =$('#IDcard').val() 37 var password = $('#IDcard').val()
31 userLoginRequest.phone = username 38 userLoginRequest.phone = username
32 userLoginRequest.password = password 39 userLoginRequest.password = password
33 clicklogin(userLoginRequest) 40 clicklogin(userLoginRequest)
34 layer.closeAll() 41 layer.closeAll()
35 }); 42 });
36 $(function(){ 43 $(function () {
37 $('.PersonLogin').html(getCookie().username) 44 $('.PersonLogin').html(getCookie().username)
38 if(getCookie().username) { 45 if (getCookie().username) {
39 $('.personalCenter').addClass('show') 46 $('.personalCenter').addClass('show')
40 } 47 }
41 }) 48 })
42 // 点击注册的时候 49 // 点击注册的时候
43 $(document).on('click', '#registerButton', function(){ 50 $(document).on('click', '#registerButton', function () {
44 // layer.closeAll() 51 // layer.closeAll()
45 window.open(`${localhostPaht}/staticViews/register.html`,'_self') 52 window.open(`${localhostPaht}/staticViews/register.html`, '_self')
46 }); 53 });
47 function clicklogin(data){ 54 function clicklogin(data) {
48 $.ajax({ 55 $.ajax({
49 type: "post", //提交方式 56 type: "post", //提交方式
50 url: portal.api_url + "/protal/users/login",//路径 57 url: portal.api_url + "/protal/users/login",//路径
51 headers:{//***关键****** 58 headers: {//***关键******
52 'Content-Type': 'application/json;charset=UTF-8', 59 'Content-Type': 'application/json;charset=UTF-8',
53 }, 60 },
54 dataType: "json", 61 dataType: "json",
55 data:JSON.stringify(data),//***关键****** 62 data: JSON.stringify(data),//***关键******
56 success: function (result) {//返回数据根据结果进行相应的处理 63 success: function (result) {//返回数据根据结果进行相应的处理
57 if(result.code ==200 && result.data!==null){ 64 if (result.code == 200 && result.data !== null) {
58 setCookie(result.data); 65 setCookie(result.data);
59 $('.personalCenter').addClass('show') 66 $('.personalCenter').addClass('show')
60 $('.PersonLogin').html(getCookie().username); 67 $('.PersonLogin').html(getCookie().username);
61 }else if(result.code ==500){ 68 } else if (result.code == 210) {
62 window.open(`${localhostPaht}/staticViews/register.html`,'_self') 69 window.open(`${localhostPaht}/staticViews/register.html`, '_self')
63 } 70 }
64 } 71 }
65 }); 72 });
66 } 73 }
67 74
68 // 点击判断是否登录 75 // 点击判断是否登录
69 function isLogin() { 76 function isLogin() {
70 let login1; 77 let login1;
71 if(getCookie().username) { 78 if (getCookie().username) {
72 login1 = true; 79 login1 = true;
73 }else { 80 } else {
74 login(); 81 login();
75 login1 = false; 82 login1 = false;
76 } 83 }
77 return login1; 84 return login1;
78 } 85 }
79
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -50,32 +50,35 @@ ...@@ -50,32 +50,35 @@
50 <ul class="business_module"> 50 <ul class="business_module">
51 <li> 51 <li>
52 <a class="cardItem" href="./wdyw.html" title="我的业务"> 52 <a class="cardItem" href="./wdyw.html" title="我的业务">
53 我的业务 53 <img src="../staticImages/myyewu.png">
54 <p>我的业务</p>
54 </a> 55 </a>
55 </li> 56 </li>
56 <li> 57 <li>
57 <a class="cardItem" href="./wdyy.html" title="我的预约"> 58 <a class="cardItem" href="./wdyy.html" title="我的预约">
58 我的预约 59 <img src="../staticImages/myyewu.png">
60 <p>我的预约</p>
59 </a> 61 </a>
60 </li> 62 </li>
61 <li> 63 <li>
62 <a class="cardItem" href="" title="我的不动产"> 64 <a class="cardItem" href="" title="我的不动产">
63 我的不动产 65 <img src="../staticImages/mybdc.png">
66 <p>我的不动产</p>
64 </a> 67 </a>
65 </li> 68 </li>
66 <li> 69 <li>
67 <a class="cardItem" href="" title="业务查询"> 70 <a class="cardItem" href="" title="业务查询">
68 业务查询 71 <p>我的发票</p>
69 </a> 72 </a>
70 </li> 73 </li>
71 <li> 74 <li>
72 <a class="cardItem" href="" title="我的支付"> 75 <a class="cardItem" href="" title="我的支付">
73 我的支付 76 <p>查询业务</p>
74 </a> 77 </a>
75 </li> 78 </li>
76 <li> 79 <li>
77 <a class="cardItem" href="" title="档案查询"> 80 <a class="cardItem" href="" title="档案查询">
78 档案查询 81 <p>档案查询</p>
79 </a> 82 </a>
80 </li> 83 </li>
81 </ul> 84 </ul>
......