header.jsp 7.1 KB
<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    Cookie[] cookies = request.getCookies();
	String userName="";
    if (cookies!=null&&cookies.length > 0) {
        for (int i = 0; i < cookies.length; i++) {
            Cookie cookie = cookies[i];
            if(cookie.getName().equals("userName")){
          	 	 userName=cookie.getValue();
            }
        }
    }
%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<div class="header_box">
        <div class="sbox">
            <span class="top_header_box">
            	<c:if test="${sessionScope.USER_INFO == null }">
	            	<a href="${ctx }/login" class="wtr">登录</a>&nbsp;&nbsp;|&nbsp;&nbsp;
	            	<a href="${ctx }/register" class="wtr">注册</a>&nbsp;&nbsp;|&nbsp;&nbsp;
	            </c:if>
            	<c:if test="${sessionScope.USER_INFO != null }">
            		<a class="wtr">欢迎你,${sessionScope.USER_INFO.client_name }</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            		<a href="${ctx }/user/balance" class="wtr">进入会员中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            		<a href="${ctx }/loginout" class="wtr">退出登录</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            		
            	</c:if>
            	<a class="kefu-line">Tel:400-969-0800</a>
            	
            </span>
        </div>
    </div>
    <div class="sbox">
        <div class="menubox">

            <ul id="navbar">
                <li>
                	<a href="${ctx }/" class="headBar " id="homePage">首页</a>
                </li>
                <li>
                	<a href="${ctx }/info/gonggao2" class="headBar" id="message">历史资讯</a>
                </li>
                <li>
                	<a href="${ctx }/info/gonggao" class="headBar" id="collocation">最新资讯</a>
                </li>
                
                <li>
                	<a href="#" class="headBar" id="recordList">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
                </li>
                <div style="clear:both;"></div>
                <!-- 
                <li><a href="${ctx }/trade/articles?cid=13" class="red" id="collocation">托管</a>
                </li>
                <li><a href="${ctx }/trade/info"  class="red" id="deal">交易</a>
                </li>
                <li><a href="${ctx }/info/gonggao" class="red" id="message">资讯</a>
                </li>
                <li><a href="${ctx }/help/searchArticle?categoryId=36&id=216" class="red" id="help">帮助</a>
                </li>
                <li><a href="${ctx }/down/toDownLoad" class="red" id="downLoad">下载</a></li> -->
            </ul>
        </div>
    </div>
    </div>
    
    
    <!--登陆-->
    <div id="loginModal" class="loginbox" style="display:none">
        <div class="logintit">登录</div>
        <a href="javascript:ajaxLogin.closeLogin()" id="loginModalClose" class="close">×</a>
        <div class="logincon">
            <form id="login-form2" action="${ctx }/login" method="post">
            <div class="inputs">
                <div class="nameyh">账号
                    <input id="username2"  placeholder="会员号/手机号" name="username" type="text" class="input0" maxlength="18" value="<%=userName %>" />
                    <span class="errortip" id="tip-username2" ></span>
                </div>
                <div class="password">密码
                     <input type="password" name="password" id="password2" class="input1" maxlength="8" />
                     <span class="errortip" id="tip-password2"></span>
                </div>
                <!-- <div class="yanzheng">验证码
                    <input name="code" id="code2" type="text" class="input0" maxlength="4" /> 
                    <img id="imgCaptcha2" alt="验证码" style="vertical-align:middle" src="" 
						width="70px;" height="27px;" border="1" id="validaCode" />
                    <a href="javascript:changeCaptcha2()" class="blues">看不清,换一张</a>
                    <span class="errortip" id="tip-code2"></span>
                </div> -->
                
                <div class="xieyi"><input type="checkbox" checked="checked" id="login_agree" /><a target="view_window" href="https://www.zhao.com/trade/article?id=96&cid=9">我已认真阅读并同意遵守《赵涌牛服务协议》 </a>
                	<span class="errortip" id="tip-login-agree" ></span>
                </div>
            </div>
            <div class="loginenter">
                <div class="juli"><label><input  name="remberme" type="checkbox" value="remberme" id="remberme" 
                  <%if(!"".equals(userName)) {%>checked="checked" <%} %>
                /> &nbsp;记住会员号</label></div>
                <a href="#" id="ajaxLogin" class="btnw loginbtn">登录</a>
                <div class="xiaozi">还不是赵涌牛会员?<a href="${ctx }/register" class="blues">立即注册</a></div>
                
            </div>
            </form>
        </div>
    </div>
    
<script type="text/javascript">
	$(function(){
		var url=window.location.href;
		var arr= url.split('/');
		if(arr[3]==''){
			$("#homePage").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
			$("#homePage").siblings().show()
		}else if(arr[3]=='entrust'){
			if(arr[4]=='list'||arr[4]=='data'||arr[4].split('?')[0]=='info'){
				$("#collocation").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
				$("#collocation").siblings().show()
			}else if(arr[4]=='record' ){
				$("#recordList").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
				$("#recordList").siblings().show()
			}else{
				$("#deal").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
				$("#deal").siblings().show()
			}
		}else if(arr[3]=='trade'){
			if(arr[4].split('?')[0]=='article'){
				$("#message").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
				$("#message").siblings().show()
			}else{
				$("#collocation").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
				$("#collocation").siblings().show()
			}
		}else if(arr[3]=='info'){
            if(arr[4].split('?')[0]=='gonggao2'){
                $("#message").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
                $("#message").siblings().show()
            }else{
                $("#collocation").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
                $("#collocation").siblings().show()
            }

		}else if(arr[3]=='user'){
			if(arr[4].split('?')[0]=='entrust'){
				$("#collocation").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
				$("#collocation").siblings().show()
			}else if(arr[4].split('?')[0]=='attention'){
				$("#deal").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
				$("#deal").siblings().show()
			}
		}else if(arr[3]=='ec'){
			$("#deal").addClass("headBar-seleced").siblings().removeClass("headBar-seleced");
			$("#deal").siblings().show()
		}
		
		
	})
</script>