<%@page import="java.util.Date"%>
<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ page import="com.gaowj.business.util.Java_tool" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
Java_tool jt = new Java_tool();
%>
 <%--  富客户端环境引用文件  --%> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head> 
<title>系统登陆</title>
<!-- fancyBox的css -->
<link rel="stylesheet" type="text/css" href="${ctx}/lib/plug/fancyBox-2.1.5/source/jquery.fancybox.css" media="screen">
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<!-- fancyBox的js -->
<script type="text/javascript" src="${ctx}/lib/plug/fancyBox-2.1.5/source/jquery.fancybox.js"></script>
<script type="text/javascript" src="system/pages/login/js/jquery.cookie.js"></script>
<script type="text/javascript" src="${ctx}/custom/plug/inputTips/inputTips.js"></script>
<script type="text/javascript" src="${ctx}/lib/js/scroll.js"></script>
<link rel="shortcut icon" href="images/main/logo.ico" />
<link rel="icon" type="image/gif" href="images/main/logo.png" />
<style>
body{
	font-size: 14px;
	color: #666;
	font-family:"Microsoft YaHei";
	margin:0;
	padding:0;
}
a{
	color:inherit;
	text-decoration:none !important;
}
*{
	box-sizing:border-box;
	-moz-box-sizing:border-box; /* Firefox */
	-webkit-box-sizing:border-box; /* Safari */
}
.login_center{
	position:absolute;
	top:0;
	left:0;
	right:0;
	bottom:102px;
	background:url(${ctx}/custom/images/login_back.jpg);
	background-size:cover;
	overflow:hidden;
	width:100%;
}
.login_center>div{
	float:left;
	color:white;
	padding-top:14%;
}
.login_center>div:hover{
	background:rgba(255,255,255,0.3);
}
.login_left{
	width:30%;
	height:100%;
	overflow:hidden;
}
.login_left_title{
	font-size:24px;
	font-weight:bold;
	text-align:center;
	margin:143px 0 20px;
	padding:0 25px 0 15px;
}
.login_left_content{
	margin:20px 25px 0 15px; 
	position:relative;
	height:186px;
}
.login_left_content>div{
	padding:11px 10px;
	border:1px solid rgba(255,255,255,0.5);
	position:absolute;
	height:186px;
    width: 100%;
    line-height:24px;
    border-radius:5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp:7;
    -webkit-box-orient: vertical;
}
.login_left_click{
	overflow:hidden;
	padding:0 9px;
	margin:12px 25px 0 15px;
}
.login_left_click>div:hover{
	cursor:pointer;
	text-decoration: underline;
}
.login_left_click>div:first-child{
	float:left;
}
.login_left_click>div:first-child+div{
	float:right;
}
.login_middle{
	width:40%;
	height:100%;
	padding:0 20px;
}
.login_middle_text1{
	margin:20px auto 14px;
	text-align:center; 
}
.login_middle_text2{
	font-size:24px;
	font-weight:bold;
	text-align:center;
}
.login_middle_text3{
	font-size:12px;
	margin:13px 0 14px;	
	text-align:center; 
}
.login_yzm{
	cursor: text;
	margin-top: 14px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 3px;
    background: rgba(255,255,255,0.25);
    overflow: hidden;
}
.login_yzm>input{
	height: 40px;
    padding-left: 12px;
    font-size: 16px;
    border: none;
    outline: none;
    background: none;
    color: white;
    line-height:40px;
    width:100%;
}
.login_yzm>img{
    cursor: pointer;
    position: absolute;
    right: 0;
}
.login_middle_text5{
	margin-top:14px;
	border:1px solid rgba(255,255,255,0.5);
	border-radius:3px;
	background:rgba(255,255,255,0.25);
}
.login_middle_text5>input{
	height:40px;
	padding-left:12px;
	width:100%;
	font-size:16px;
	border:none;
	outline:none;
	background:none;
	color:white;
}
.login_middle_text6{
	margin:14px 0 7px;
	font-size:12px;
	overflow:hidden;
}
.login_middle_text6 label{
	cursor: pointer;
}
.login_middle_text6>div:hover{
	text-decoration:underline;
	cursor:pointer;
}
.login_middle_text6>div:first-child{
	float:left;
}
.login_middle_text6>div:first-child>input{
	vertical-align: sub;
}
.login_middle_text6>div:first-child+div{
	float:right;
	margin-top:2px;
}
.login_middle_text7{
	height:42px;
	line-height:42px;
	background:white;
	color:#6aaef0;
	text-align:center;
	font-size:16px;
	border-radius:3px;
	cursor:pointer;
	margin: auto;
    width: 200px;
}
.login_middle_text7:hover{
	opacity: 0.5;
}
.login_middle_text8{
	margin-top:14px;
	font-size:14px;
}
.login_right{
	width:30%;
	height:100%;
}
.login_right_title{
	font-size:24px;
	font-weight:bold;
	text-align:center;
	margin:143px 0 20px;
	padding:0 15px 0 25px;
}
.login_right_content{
	padding:11px 10px;
	border:1px solid rgba(255,255,255,0.5);
    line-height:24px;
    margin:20px 15px 0 25px; 
    border-radius:5px;
}
.login_right_content_text1{
	font-weight:bold;
}
.login_right_content_text2{
	color:#ccdff6;
	font-size:12px;
}
.login_right_content_text3{
	height:144px;
	overflow: hidden;
}
.login_right_content_text3 ul{
	margin:0;
	padding:0;
}
.login_right_content_text3 li{
	list-style:disc inside;
	font-size:12px;
}
.footer{
    width: 100%;
    background: #eff2f5;
    overflow: hidden;
	position:absolute;
	left:0;
	right:0;
	bottom:0px;
}
.footer_inside{
    width: 900px;
    margin: 0 auto;
}
.footer_logo{
    float: left;
    background:  url("system/pages/login/img/footer_logo.png") center  no-repeat;
    width: 20px;
    height: 60px;
    margin: 10px 0 ;
}
.footer_company_info{
    float: left;
    margin: 10px 20px ;
    overflow: hidden;
}
.footer_company_info h1{
    margin: 12px 0 8px 0;
    padding: 0;
    font-size: 16px;
    font-weight: lighter;
    font-family: "微软雅黑";
    color: #184962;
}
.footer_company_info p{
    margin: 0 ;
    padding: 0;
    font-size: 12px;
    font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
    color: #a5a5a5;
}
.footer_links{
    float: right;
    margin: 28px 0 ;
    padding: 0;
    text-align: right;
}
.links_about{
    list-style: none;
}
.links_about li{
    float: right;
    font-size: 12px;
    color: #899ba6;
    font-weight: lighter;
    margin-left: 10px;
}
.links_about li a{
    color: #899ba6;
    -webkit-transition: 0.3s 0.2s ease;
    -moz-transition: 0.3s 0.2s ease;
}
.links_about li a:hover{
    color: #61747f;
}
.footer_links h1{
    overflow: hidden;
}
.footer_links p{
    clear: both;
    font-size: 12px;
    color: #899ba6;
    margin: 10px 0 20px 0 ;
}
@media screen and (min-width:1200px){
	.login_center,.footer{
		width:1200px;
		margin:auto;
	}
}
@media screen and (max-width:1366px){
	.login_center>div{
		padding-top:1%;
	}
}
@media screen and (min-width:1367px) and (max-width:1440px){
	.login_center>div{
		padding-top:7%;
	}
}
form input:focus{
	background:white;
	color:#333;
}
</style>
</head>
<body>
<div class="login_center">
	<!-- 左边 -->
	<div class="login_left">
		<div class="login_left_title">平台通知</div>
		<div class="login_left_content">
			<div>平台通知1</div>
			<div>平台通知2</div>
			<div>平台通知3</div>
		</div>
		<div class="login_left_click">
			<div onclick="login_notice(0)">&lt;上一条</div>
			<div onclick="login_notice(1)">下一条 &gt;</div>
		</div>
	</div>
	<!-- 中间 -->
	<div class="login_middle">
		<form id="loginForm" name="login" method="post" action="login">
	 		<div class="login_middle_text1"><img src="custom/images/login_logo.png" height="90"/></div>
	 		<div class="login_middle_text2">统一身份认证</div>
	 		<div class="login_middle_text3">用户只需登录一次,即可通过本系统访问后台的多个应用系统</div>
	 		
	 		<div class="login_middle_text5">
	 			<input type="text" id="username" name="loginusername" />
	 		</div>
	 		<div class="login_middle_text5">
	 			<input type="password" id="password" name="loginuserpass"/>
	 		</div>
	 		<s:if test="#session.chkyzm!=null && #session.chkyzm==1">
	       		<div class="login_yzm"><input name="loginyzm" type="text"/><img src="images/image.jsp" height="40" onclick="changeImg(this)"/></div>
	       	</s:if>
	 		<div class="login_middle_text6">
	 			<div><input type="checkbox" name="remember" id="remember"/><label for="remember">记住账号</label></div>
	 			<div><a href="#">忘记密码</a></div>
	 		</div>
	 		<%-- <div style="margin-top:10px;*margin-top:0px;text-align:center;background: #ffebeb;color: #e4393c;border: 1px solid #faccc6;height:42px;line-height:42px;"><s:property value="#request.err"/></div> --%>
	 		<div style="text-decoration:none;cursor:text;color:red;margin-top:5px;*margin-top:0px;text-align:center;"><s:property value="#request.err"/></div>
			<div style="text-decoration:none;cursor:text;color:red;margin-top:5px;margin-bottom:7px;*margin-top:0px;text-align:center;">
		      <%
		         if(session.getAttribute("beforeUser")!=null){
		              java.util.Map<String,Object> beforeUser = (java.util.Map<String,Object>)session.getAttribute("beforeUser");
		              request.removeAttribute("beforeUser");
		              System.out.println(beforeUser);
		              String loginDate = (String)beforeUser.get("BEFORETIME");
		              out.println("登陆用户已存在,之前登时间："+loginDate+" 登陆IP:"+beforeUser.get("LOGINIP"));
		        }
		       %>
		    </div>
	 		<div class="login_middle_text7" id="b_login">登 录</div>
	 		<div class="login_middle_text8">服务电话:0574-8726 3526</div>
	 		
		</form>
	</div>
	<!-- 右边 -->
	<div class="login_right">
		<div class="login_right_title">更新日志</div>
		<div class="login_right_content">
			<div class="login_right_content_text1">2.16日更新日志</div>
			<div class="login_right_content_text2">2018-02-05</div>
			<div class="login_right_content_text3">
				<ul>
					<li>1.现在补刀成功现在补刀成功现在补刀成功现在补刀成功现在补刀成功现在补刀成功</li>
					<li>2.现在补刀成功现在补刀成功现在补刀成功现在补刀成功现在补刀成功现在补刀成功</li>
					<li>3.现在补刀成功现在补刀成功现在补刀成功现在补刀成功现在补刀成功现在补刀成功</li>
					<li>4.现在补刀成功现在补刀成功现在补刀成功现在补刀成功现在补刀成功现在补刀成功</li>
				</ul>
			</div>
		</div>
	</div>
</div>

<div class="footer">
    <div class="footer_inside">
        <div class="footer_logo"></div>
        <div class="footer_company_info">
            <h1>杰夫V5微应用服务平台</h1>
            <p>Powered By  © 2014-<%=jt.now_year() %> www.jfbrother.com </p>
        </div>
        <div class="footer_links">
            <p>建议使用IE8.0及以上版本浏览器/现代浏览器访问本站</p>
        </div>
    </div>
</div>
<script type="text/javascript">
$(document).ready(function () {
	
	//判断ie浏览器ie8以下执行
	if(IEVersion()<='8'&&IEVersion()!='-1'){
		$.fancybox.open('<div style="line-height:20px;">ie浏览器版本过低,请使用高版本浏览器</div>')
	}
	
	//更新日志的滚动
	$(".login_right_content_text3").myScroll({
		speed:40, //数值越大，速度越慢
		rowHeight:48 //li的高度
	});
	
	//添加凭条通知的left属性
	$('.login_left_content>div').each(function(index,element){
		$(element).css('left',$('.login_left').width()*index+'px');
	})
	
	//初始化所有的文本提示框
	init_login_tip($('#username'),'请输入账号');
	init_login_tip($('#password'),'请输入密码');
	init_login_tip($('.login_yzm>input'),'请输入验证码');

	document.onkeydown = function(e) {
		var ev = document.all ? window.event : e;
		if (ev.keyCode == 13) {
			$("#b_login").click(); //处理事件
		}
	}

	// 判断记住密码的操作
	if ($.cookie("username") != '' && $.cookie("username") != null && $.cookie("username") != 'undefined') {
		$("#username").val(BASE64.decode($.cookie("username")));
		$("#username").next().hide();
		if ($.cookie("password") != '' && $.cookie("password") != null && $.cookie("password") != 'undefined') {
			$("#password").val(BASE64.decode($.cookie("password")));
			$("#remember").attr('checked', 'checked');
			$("#password").next().hide();
		}
	}
	
	// 点击记住密码
	$("#remember").live('click', function() {
		updateCookie();
	});
	// 点击重置
	$("#b_cancel").live('click', function() {
		$("#remember").removeAttr('checked');
		$("#username").val('');
		$("#password").val('');
		updateCookie();
	});
	// 输入用户名清空密码
	$("#username").live('keyup', function() {
		$("#password").val('');
		$("#password").next().show();
	});

	/**
	 * cookie操作
	 */
	function updateCookie() {
		if ($("#remember").attr('checked') == 'checked') {
			$.cookie("username", BASE64.encode($("#username").val()), {
				expires : 1000
			});
			$.cookie("password", BASE64.encode($("#password").val()), {
				expires : 1000
			});
		} else {
			$("#remember").removeAttr('checked');
			$.cookie("username", null);
			$.cookie("password", null);
		}
	}
	// 设置cookie 默认7天
	function SetCookie(name, value) // 两个参数，一个是cookie的名子，一个是值
	{
		$.cookie(name, value, {
			expires : 1000
		});
	}

	//提交操作
	$("#b_login").live('click', function() {
		updateCookie();
		$("#loginForm").submit();
	});
});

//变更验证码
function changeImg(handler){
	 event.stopPropagation();
	var date = new Date();
	$(handler).attr('src','images/image.jsp?date='+date.getTime());
}

//初始文本框的提示信息
function init_login_tip(handler,text){
	$(handler).inputTips({
		tip : {
			color : '#fff',
			text : text,
			fontSize : '14px'
		}
	});
}

//平台通知
function login_notice(index){
	//index为0时是上一条,为1时是下一条
	if(index==0){
		//如果已经是第一条时
		if($('.login_left_content>div').eq(0).css('left')=='0px'){
			return ;
		}
		$('.login_left_content>div').each(function(index,element){
			if($(element).is(":animated")){
				return;
			}
			$(element).animate({'left':($(element).css('left').substring(0,$(element).css('left').length-2)-0+$('.login_left').width())+'px'});
		})
	}
	else{
		//如果是最后一条时
		if($('.login_left_content>div').eq($('.login_left_content>div').length-1).css('left')=='0px'){
			return ;
		}
		$('.login_left_content>div').each(function(index,element){
			if($(element).is(":animated")){
				return;
			}
			$(element).animate({'left':($(element).css('left').substring(0,$(element).css('left').length-2)-$('.login_left').width())+'px'});
		})
	}
}

//判断ie浏览器
function IEVersion() {
    var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串  
    var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器  
    var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器  
    var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
    if(isIE) {
        var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
        reIE.test(userAgent);
        var fIEVersion = parseFloat(RegExp["$1"]);
        if(fIEVersion == 7) {
            return 7;
        } else if(fIEVersion == 8) {
            return 8;
        } else if(fIEVersion == 9) {
            return 9;
        } else if(fIEVersion == 10) {
            return 10;
        } else {
            return 6;//IE版本<=7
        }   
    } else if(isEdge) {
        return 'edge';//edge
    } else if(isIE11) {
        return 11; //IE11  
    }else{
        return -1;//不是ie浏览器
    }
}
</script>
</body>
</html>
