<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String basePath = request.getContextPath();
    String resourcePath = basePath + "/resource";
%>
<div class="userbanner">
    <div class="user-top0">
        <div class="user-top1">
            <div class="user-font01">
                <div class="user-font1">累计消费金额</div>
                <div id="userAllCount" class="user-font2"></div>
            </div>
            <div class="user-line01"></div>
            <div class="user-font03">
                <div class="user-font1">关注API</div>
                <div id="followApiCount" class="user-font2"></div>
            </div>
            <div class="user-font02">
                <div class="user-font1">关注服务</div>
                <div id="followMicCount" class="user-font2"></div>
            </div>
            <div class="user-line01"></div>
            <div class="user-font03">
                <div class="user-font1">账户余额</div>
                <div  class="user-font2">
                    <span id="surplus"></span>
                    <span >元</span>

                </div>
            </div>
            <button type="button" onclick="cz()"   class="chongzhi">去充值</button>
            <img src="<%=resourcePath%>/images/img_user.png" alt="" class="img-user">
        </div>
    </div>
    <div class="user-top">
        <div class="user-top00">
            <div class="user-name"><shiro:principal/></div>
            <div class="clearfix"></div>
            <div id="authState" class="renzheng"></div>
            <div id="divUserCenterMenu" class="user-caidan">
                <ul>
                    <c:set var="url" value="${pageContext.request.requestURI}"/>
                    <li style="visibility: hidden;"><a href="<%=basePath%>/">首页</a></li>
                    <li class="${fn:contains(url, "/user_verify/") ? "active" : ""}"><a href="<%=basePath%>/open/userverify/detail.htm">个人中心</a></li>
                    <li class="${fn:contains(url, "/myrequirement/") ? "active" : ""}"><a href="<%=basePath%>/open/MyOpenDataRequirement/list.action">我的需求</a></li>
                    <li class="${fn:contains(url, "/myreceive/") ? "active" : ""}"><a href="<%=basePath%>/open/Receive/receiveList.action">我的接单</a></li>
                    <li class="${fn:contains(url, "/my_data/") ? "active" : ""}"><a href="<%=basePath%>/open/mydata/index.htm/1">我的数据</a></li>
                    <li class="${fn:contains(url, "/myApi/") ? "active" : ""}"><a href="<%=basePath%>/open/myApi/list.htm">我的API</a></li>
                    <li class="${fn:contains(url, "/myMicroapp/") ? "active" : ""}"><a href="<%=basePath%>/open/myMicroapp/list.htm">我的服务</a></li>
                    <li class="${fn:contains(url, "/offlieConference/") ? "active" : ""}"><a href="<%=basePath%>/open/offlieConference/list.htm">线下洽谈</a></li>
                    <li class="${fn:contains(url, "/order/") ? "active" : ""}"><a href="<%=basePath%>/open/order/index.htm">订单管理</a></li>
                    <li class="${fn:contains(url, "/myAccount/") ? "active" : ""}"><a href="<%=basePath%>/open/myAccount/index.htm">我的账户</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    userInfo() ;
    function userInfo() {
        $.post("<%=basePath%>/open/userInfo.action",function(datas){
            $("#userAllCount").text(datas.userAllCount+'元') ;
            $("#followApiCount").text(datas.followApiCount) ;
            $("#followMicCount").text(datas.followMicCount) ;
            $("#surplus").text(datas.surplus) ;
            $("#authState").text(datas.authState) ;
        },"json") ;
    }

    function cz() {
        var jiaqian = $("#surplus").text();
        location.href="<%=basePath%>/open/myAccount/recharge.htm?balance="+jiaqian;
    }

</script>