0cd30ed3 by 任超

style:登录

1 parent d8f93b5e
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset='UTF-8'>
<title>网上“一窗办事”登记系统</title>
<link type="text/css" rel="stylesheet" href="./staticCss/common.css" />
<link type="text/css" rel="stylesheet" href="./staticCss/pageHome.css" />
<script type="text/javascript" src="./staticJs/head.js"></script>
<meta name='copyright' content=' &reg 技术支持 All Rights Reserved' />
<meta name='robots' content='index,follow' />
<meta name='googlebot' content='index,follow,archive' />
<link rel='alternate icon' type='image/png' href='/staticImages/logo-realestate.png'>
<link rel='icon' href='favicon.ico' type='image/x-ico' />
<meta name='description' content='' />
<meta name='Keywords' content='' />
<link type="text/css" rel="stylesheet" href="/staticLib/layui/css/layui.css" />
<link type="text/css" rel="stylesheet" href="/staticCss/common.css" />
<link type="text/css" rel="stylesheet" href="/staticCss/header.css" />
<link type="text/css" rel="stylesheet" href="/staticCss/pageHome.css" />
</head>
<body>
<div class='home-sticky'>
<div class='top-logo'>
<div class='top_logo_content'>
<h1><a href='/index.html'><img src='/staticImages/logo.png' alt='西安市不动产登记平台' /></a></h1>
<div class='top_logo_search'>
<input type='text' name='title' required lay-verify='required' placeholder='请输入关键字搜索'
autocomplete='off' class='layui-input'>
<img class='search_img' src='/staticImages/search.png'>
</div>
<ul class='login layui-nav login-con'>
<span class='loginButton' id="login">登录</span>
<p class='loginButton register' id='register'><a href='/staticViews/register.html'>注册</a></p>
</ul>
</div>
</div>
<div class='layui-nav navigation layui-bg-blue'>
<ul class="navigation-content">
<li id='index' class='layui-nav-item'><a href='/index.html' title='首页'>首页</a></li>
<li id='news' class='layui-nav-item'><a href='/staticViews/xwdt.html' title='新闻动态'>新闻动态</a></li>
<li id='zwgk' class='layui-nav-item'>
<a href='javascript:;'>政务公开</a>
<dl class='layui-nav-child'>
<dd><a href='/staticViews/xyzc.html'>相应政策</a></dd>
<dd><a href='/staticViews/flfg.html'>法律法规</a></dd>
<dd><a href='/staticViews/gsgg.html'>公示公告</a></dd>
</dl>
</li>
<li id='bszn' class='layui-nav-item'><a href='/staticViews/bszn.html'
title='办事指南'>办事指南</a></li>
<li id='wssq' class='layui-nav-item'><a href='/staticViews/wssq.html'
title='网上申请'>网上申请</a></li>
<li class='layui-nav-item'>
<a href='javascript:;'>查验中心</a>
<dl class='layui-nav-child'>
<!-- 二级菜单 -->
<dd><a href='/staticViews/convenienceService/fileQuery.html'>档案查询</a></dd>
<dd><a href='/staticViews/convenienceService/recordInquiry.html'>合同备案查询</a>
</dd>
<dd><a href='/staticViews/convenienceService/certificateVerification.html'>证书核验</a>
</dd>
</dl>
</li>
<li id='zxjf' class='layui-nav-item'><a href='/staticViews/zxjf.html'>在线缴费</a></li>
<li id='evaluate' class='layui-nav-item'><a
href='/staticViews/evaluate.html'>好差评</a></li>
</ul>
</div>
</div>
<!-- 轮播 -->
<div class="homeindex">
<div class="banner">
<div class="layui-carousel" id="banner_swiper">
......@@ -372,7 +429,12 @@
</div>
</div>
</body>
<script src='https://at.alicdn.com/t/font_2174584_uxkon9mpq1.js'></script>
<script type="text/javascript" src="/staticLib/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/staticLib/layui/layui.js"></script>
<script type="text/javascript" src="/staticJs/login.js"></script>
<script type="text/javascript" src="/staticJs/common.js"></script>
<script type="text/javascript" src="/staticJs/header.js"></script>
<script type="text/javascript" src="./staticJs/down.js"></script>
<script type="text/javascript" src="./staticJs/common.js"></script>
<script type="text/javascript" src="./staticJs/pageHome.js"></script>
</html>
</html>
\ No newline at end of file
......
......@@ -202,32 +202,14 @@ div.footer .system_service ul li a:hover {
.layui-layer-btn {
text-align: center;
}
.login-con {
background-color: #fff!important;
}
.loginSelect {
position: relative;
top: -5px;
cursor: pointer;
}
.loginSelect p {
font-size: 16px;
display: inline-block;
}
.layui-nav * {
font-size: 16px;
}
.register {
position: relative;
margin-left: 12px;
}
.register::before {
content: '';
position: absolute;
left: -9px;
height: 10px;
border-left: 1px solid #b1afaf;
}
.not-select{
-moz-user-select:none; /*火狐*/
-webkit-user-select:none; /*webkit浏览器*/
......@@ -235,11 +217,6 @@ div.footer .system_service ul li a:hover {
-khtml-user-select:none; /*早期浏览器*/
user-select:none;
}
.userImage {
position: relative;
top: 2px;
left: -3px;
}
.isLogin {
position: relative;
top: 18px!important;
......
......@@ -43,6 +43,7 @@ div.top-logo {
padding-top: 20px;
margin: 0 auto;
background-color: #ffffff;
white-space: nowrap;
}
div.top-logo ::-webkit-input-placeholder { /* WebKit browsers */
......@@ -74,19 +75,15 @@ div.top-logo .top_logo_search input {
border-radius: 50px;
border: 1.5px solid #CBCBCB;
padding-left: 15px;
margin-top: 6px;
}
.search_img {
width: 13px;
height: 13px;
position: absolute;
top: 11px;
top: 17px;
right: 19px;
}
div.top-logo .login {
float: right;
position: relative;
top: -5px;
}
.login li {
color: #6D7278;
font-size: 16px;
......@@ -115,32 +112,42 @@ div.top-logo .top_logo_search i {
.top-logo ul li {
display: inline-block;
padding: 0 12px;
height: 30px;
}
.top-logo ul li:first-child {
height: 13px;
line-height: 12px;
.loginButton {
display: inline-block;
color: #4a4a4a;
cursor: pointer;
margin-top: -6px;
}
#cancellation {
cursor: pointer;
}
div.navigation {
.navigation {
text-align: center;
height: 59px;
}
.navigation .layui-nav-item {
width: 147px!important;
position: relative;
}
.navigation .layui-nav-item a {
border-right: 1px solid rgba(255,255,255, 0.1);
border-left: 1px solid rgba(255,255,255, 0.1);
margin-right: -1px;
margin-left: -1px;
}
.navigation .layui-nav-item:first-child {
.navigation .layui-nav-item:first-child a{
border-left: 1px solid rgba(255,255,255, 0.2);
}
.navigation .layui-nav-item:nth-child(8) {
.navigation .layui-nav-item:nth-child(8) a{
border-right: 1px solid rgba(255,255,255, 0.2);
}
.navigation-content {
width: 1200px;
margin: 0 auto;
white-space: nowrap;
font-size: 0;
}
.layui-bg-blue {
background-color: #006CFF!important;
}
......@@ -185,9 +192,35 @@ div.navigation {
font-size: 12px;
display: none
}
.userInfo {
border-radius: 5px!important;
top: 45px!important;
.register {
position: relative;
margin-left: 12px;
}
.register::before {
content: '';
position: absolute;
left: -7px;
height: 10px;
border-left: 1px solid #b1afaf;
top: 6px;
}
.login-con {
float: right;
background-color: #fff!important;
position: relative;
top: 17px;
}
.userImage {
position: relative;
left: -3px;
top: -3px;
}
.loginSelect {
line-height: 30px!important;
margin-top: -11px;
}
.loginSelect p {
display: inline-block;
}
.userInfo img {
width: 18px;
......@@ -202,6 +235,8 @@ div.navigation {
}
.personalCenter {
display: inline-block;
position: relative;
top: -5px;
}
.personalCenter a {
color: #006CFF;
......
......@@ -9,8 +9,6 @@ document.writeln("<!DOCTYPE html>");
document.writeln("<html lang=\'en\'>");
document.writeln("");
document.writeln("<head>");
document.writeln(" <link rel=\'stylesheet\' type=\'text/css\' href=\'"+localhostPaht+"/staticLib/layui/css/layui.css\' />");
document.writeln(" <link type=\'text/css\' rel=\'stylesheet\' href=\'"+localhostPaht+"/staticCss/common.css\' />");
document.writeln("");
document.writeln("<body> ");
document.writeln(" <div class=\'footer\'> ");
......@@ -86,6 +84,5 @@ document.writeln("");
document.writeln("</body>");
document.writeln("");
document.writeln("</html>");
document.writeln("<script type='text/javascript' src=\'" + localhostPaht + "/staticLib/jquery/jquery.min.js\'></script>");
document.writeln("<script type='text/javascript' src=\'" + localhostPaht + "/staticLib/layui/layui.js\'></script>");
document.writeln("<script src=\'https://at.alicdn.com/t/font_2174584_uxkon9mpq1.js\'></script>");
\ No newline at end of file
document.writeln("");
\ No newline at end of file
......
......@@ -23,7 +23,6 @@ document.writeln("<script type='text/javascript' src=\'" + localhostPaht + "/sta
document.writeln("<script type='text/javascript' src=\'" + localhostPaht + "/staticJs/header.js\'></script>");
document.writeln("</head>");
document.writeln("");
document.writeln("<body>");
document.writeln("<div class='home-sticky'>");
document.writeln(" <div class=\'top-logo\'>");
document.writeln(" <div class=\'top_logo_content\'>");
......@@ -92,8 +91,6 @@ document.writeln(" <li id='evaluate' class=\'layui-nav-item\'><a href
document.writeln(" </ul>");
document.writeln(" </div> ");
document.writeln(" </div> ");
document.writeln("</body>");
document.writeln("");
document.writeln("</html>");
document.writeln("<script type='text/javascript' src=\'" + localhostPaht + "/staticLib/layui/layui.js\'></script>");
document.writeln("<script src=\'https://at.alicdn.com/t/font_2174584_1j8kvwarwge.js\'></script>");
......
var localhostPaht = curWwwPath.substring(0, pos);
function login() {
layui.use('layer', function () {
layer.open({
......@@ -20,7 +19,7 @@ function login() {
});
})
}
$(document).on('click', '.PersonLogin', function () {
$(document).on('click', '#login', function () {
login();
})
// 点击登陆的时候
......@@ -30,17 +29,16 @@ $(document).on('click', '#loginButton', function () {
var password = $('#IDcard').val();
userLoginRequest.phone = username;
userLoginRequest.password = password;
clicklogin(userLoginRequest);
handleLogin(userLoginRequest);
});
function fetchDataReview() {
// cancellation
$(document).on('click', '#cancellation', function () {
layui.use('layer', function () {
layer.confirm('此操作将进行注销', {
btn: ['是', '否'] //按钮
}, function () {
$('.loginButton').addClass('PersonLogin');
window.open('' + localhostPaht + '/index.html', '_self');
window.open('/index.html', '_self');
$('.loginAfter').hide();
$('.isLogin').show();
sessionStorage.clear()
......@@ -55,14 +53,10 @@ function fetchDataReview() {
$(function () {
fetchDataReview();
if (getItem('myCookie') && getItem('myCookie').username) {
$('.loginButton').html(getItem('myCookie').username);
$('.loginButton').removeClass('PersonLogin')
$('.personalCenter').addClass('show');
$('.loginAfter').show();
$('.isLogin').hide();
appendData();
$('.loginInfo').html(getItem('myCookie').username);
} else {
$('.loginAfter').hide();
$('.isLogin').show();
beforeLogin();
}
})
function delCookie() {
......@@ -76,10 +70,10 @@ function delCookie() {
}
}
function clicklogin(data) {
function handleLogin(data) {
$.ajax({
type: "post",
url: portal.api_url + "/protal/users/login",//路径
url: portal.api_url + "/protal/users/login",
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
......@@ -87,12 +81,9 @@ function clicklogin(data) {
data: JSON.stringify(data),//***关键******
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data !== null) {
$('.loginAfter').show();
$('.isLogin').hide();
appendData();
setItem('myCookie', result.data)
$('.loginButton').removeClass('PersonLogin')
$('.personalCenter').addClass('show');
$('.loginButton').html(result.data.username);
$('.loginInfo').html(result.data.username);
layer.closeAll();
} else if (result.code == 210) {
layer.msg(result.message);
......@@ -100,9 +91,59 @@ function clicklogin(data) {
}
});
}
// 登录成功之前数据操作
function beforeLogin() {
$('.login-con').empty();
$('.login-con').append('<span class="loginButton" id="login">登录</span>'+
'<p class="loginButton register" id="register"><a href="/staticViews/register.html">注册</a></p>')
}
// 登录成功之后数据操作
function appendData() {
$('.login-con').empty();
$('.login-con').append(
'<li class="layui-nav-item sysNews">' +
'<p class="sysNewsItem">' +
'<img class="userImage" src="/staticImages/xiaoxi.png">' +
'<span class="sysNewsNum">12</span>' +
'</p>' +
'<dl class="layui-nav-child sysNewsList">' +
'<div class="sysNewsTitle">最新消息</div>' +
'<div class="sysNewsOperation">' +
'<span>全部标记为已阅</span><a href="/staticViews/sysnews-center.html">查看全部</a>' +
'</div>' +
'<dd>' +
'<a>' +
'<p class="newsDetail ellipsis">您申请办理的XXX业务已成功提交您申请办理的XXX业务已成功提交</p>' +
'<div class="newsDetail-time"><span>2020-12-32</span> <span>已读</span></div>' +
'</a>' +
'</dd>' +
'<dd>' +
'<a>' +
'<p class="newsDetail ellipsis">您申请办理的XXX业务已成功提交您申请办理的XXX业务已成功提交</p>' +
'<div class="newsDetail-time"><span>2020-12-32</span> <span>已读</span></div>' +
'</a>' +
'</dd>' +
'</dl>' +
'</li>' +
'<img class="userImage" src="/staticImages/user.png">' +
'<p class="personalCenter"><a href="/staticViews/grzx.html">个人中心</a></p>' +
'<li class="layui-nav-item loginSelect">' +
'<p class="loginInfo">登录</p>' +
'<dl class="layui-nav-child userInfo">' +
'<dd><a>个人信息</a></dd>' +
'<dd><a id="cancellation"><img src="/staticImages/zhuxiao.png">退出</a>' +
'</dd>' +
'</dl>' +
'</li>'
)
layui.use(['element'],function(){
layui.element.init();//手动调用初始化方法
})
}
// 点击注册的时候
$(document).on('click', '#registerButton', function () {
window.open('' + localhostPaht + '/staticViews/register.html', '_self')
window.open('/staticViews/register.html', '_self')
});
// 点击判断是否登录
......
......@@ -74,40 +74,40 @@ function initData() {
}
//加载新闻数据
function NewsData() {
// var ulNews = $("#ulNews");
// ulNews.empty();
// var li, publishTime;
// $.ajax({
// type: "get", //提交方式
// url: portal.api_url + "/portal/MhNews/getNewsList",//路径
// dataType: "json",
// //数据,这里使用的是Json格式进行传输
// success: function (result) {//返回数据根据结果进行相应的处理
// if (result.code == 200 && result.data != null) {
// if (result.data[0].preViewUrl) {
// $('.news-img img').attr('src', result.data[0].preViewUrl);
// } else {
// $('.news-img img').attr('src', './staticImages/news_demo.jpg');
// }
// for (var i = 0; i < result.data.length; i++) {
// if (i == 6) return;
// publishTime = CutDate(result.data[i].publishTime);
// if (result.data[i].preViewUrl) {
// li = '<li url="' + result.data[i].preViewUrl + '"><a href="./staticViews/news/' + result.data[i].id + '.html" title="' + result.data[i].headline + '" target="_blank">';
// } else {
// li = '<li><a href="./staticViews/news/' + result.data[i].id + '.html" title="' + result.data[i].headline + '" target="_blank">';
// }
// li += '<div class="news_item">';
// if (recentlyDay.indexOf(publishTime) > -1) {
// li += '<svg class="icon svg-icon" aria-hidden="true"> <use xlink:href="#iconzuixin"></use> </svg>';
// }
// li += result.data[i].headline + '</div>';
// li += '<span>' + publishTime + '</span></a></li>';
// ulNews.append(li);
// }
// }
// }
// });
var ulNews = $("#ulNews");
ulNews.empty();
var li, publishTime;
$.ajax({
type: "get", //提交方式
url: portal.api_url + "/portal/MhNews/getNewsList",//路径
dataType: "json",
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data != null) {
if (result.data[0].preViewUrl) {
$('.news-img img').attr('src', result.data[0].preViewUrl);
} else {
$('.news-img img').attr('src', './staticImages/news_demo.jpg');
}
for (var i = 0; i < result.data.length; i++) {
if (i == 6) return;
publishTime = CutDate(result.data[i].publishTime);
if (result.data[i].preViewUrl) {
li = '<li url="' + result.data[i].preViewUrl + '"><a href="./staticViews/news/' + result.data[i].id + '.html" title="' + result.data[i].headline + '" target="_blank">';
} else {
li = '<li><a href="./staticViews/news/' + result.data[i].id + '.html" title="' + result.data[i].headline + '" target="_blank">';
}
li += '<div class="news_item">';
if (recentlyDay.indexOf(publishTime) > -1) {
li += '<svg class="icon svg-icon" aria-hidden="true"> <use xlink:href="#iconzuixin"></use> </svg>';
}
li += result.data[i].headline + '</div>';
li += '<span>' + publishTime + '</span></a></li>';
ulNews.append(li);
}
}
}
});
if ($('#ulNews li').eq(0).attr('url')) {
$('.news-img img').attr('src', $('#ulNews li').eq(0).attr('url'));
......