5d0d94cd by 任超

style:登录

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