<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>
<%@ page language="java" import="com.fadu.web.util.Constant" %>
<% 
	String token = (String)session.getAttribute(Constant.Session.TOKEN) ;
	String openid = (String)session.getAttribute(Constant.Session.DWLSD_OPENID);
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>多问律师</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="${contextPath}/static/weixin/ssdb/css/common.css" rel="stylesheet">
<link href="${contextPath}/static/weixin/ssdb/css/main.css" rel="stylesheet">
<link href="${contextPath}/static/weixin/ssdb/css/ssdb.css" rel="stylesheet">
<script src="${contextPath}/static/js/flexible.min.js"></script>
<style>
.bc53a2 {
	background-color: #53A2FF;
	color: white;
}
</style>
</head>
<body class="bg-grey">
	<header class="pad-lr-20 bc53a2 fc-white ub ub-ac">
		<span class="icon icon-placeholder"></span>
		<p class="ub-f1 fs-16 text-center">担保机构(${res.total})</p>
		<span class="header-back" onclick="goToHome('${contextPath}')">取消</span>
	</header>
	<section>
		<div class="pad-tb-10 ub fs-14 guarantee-order-tab">
			<div class="ub-f1 ub ub-ac ub-pc br-r text-center" data-target="guarantee-premium">
				<span>保费</span>
				<span class="mar-l-15 icon icon-blue-down"></span>
			</div>
			<div class="ub-f1 ub ub-ac ub-pc br-r text-center">
				<span>时间</span>
			</div>
			<div class="ub-f1 ub ub-ac ub-pc text-center" data-target="guarantee-integral">
				<span>积分</span>
				<span class="mar-l-15 icon icon-blue-down"></span>
			</div>
		</div>
		<div class="pad-lr-20 br-tb bg-white fs-14 fc-dgrey ub ub-pj ub-ac ub-pj guarantee-top">
			<p>担保金额: <span>${req.targetAmount}</span></p>
			<p>法院: <span>${req.courtName}</span></p>
		</div>
		<ul class="fs-14 guarantee-qualificate-list" id="companyList">
			<c:forEach var="company" items="${res.infos}">
				<c:if test="${company.sort > 0}"><img src="${contextPath}/static/weixin/ssdb/images/icon_list_top.png" class="mar-t-35  br-t" style="width: 100%;height: 100%;left: 0;"></c:if>
				<c:if test="${company.sort > 0}"><li class="pad-l-20 pad-tb-15  bg-white"></c:if>
				<c:if test="${company.sort <= 0}"><li class="mar-t-35 pad-l-20 pad-tb-15 br-tb bg-white"></c:if>
					<div class="pad-r-20 pad-b-15 ub ub-ac ub-pj guarantee-qualificate-item-top">
						<div class="fc-dgrey ub-f1">
							<p><span class="mar-r-10 fc-black">保费：${company.premium}</span>${company.rat}<c:if test="${company.sort > 0}"><span class=" br1 br-ff6600 br-radius5 text-center  search-state1 fs-12 mar-l-15 colorff6600"><span style="padding: 0.15rem;">${company.text0}</span></span></c:if></p>
							<p>积分：${company.score} <c:if test="${company.sort > 0}"><span class=" br1 br-ff6600 br-radius5 text-center  search-state1 fs-12 mar-l-15 colorff6600"><span style="padding: 0.15rem;">${company.text1}</span></span></c:if></p>
							<p>出函：${company.timeDesc}<c:if test="${company.sort > 0}"><span class=" br1 br-ff6600 br-radius5 text-center  search-state1 fs-12 mar-l-15 colorff6600"><span style="padding: 0.15rem;">${company.text2}</span></span></c:if></p>
							<p>配送：提供${company.sendType}</p>
						</div>
						<a href="#"  class="applyId btn btn-sm btn-brblue guarantee-qualificate-apply-btn" company-id="${company.id}">申请</a>
					</div>
					<div class="pad-t-15 pad-r-20 ub ub-ac fc-dgrey guarantee-qualificate-item-bottom">
						<img src="${company.path}" width="100px" height="50px">
						<div class="ub-f1 mar-l-50">
							<p>${company.name}</p>
						</div>
						<c:if test="${company.sort > 0}"><img src="${contextPath}/static/weixin/ssdb/images/icon_list_flow.png" style="width:50%;height:50%;position: relative;top: -0.5rem;right: -0.7rem;"></c:if>
					</div>
				</li>
			</c:forEach>		
		</ul>
		<!-- <a href="#" class="btn btn-sm btn-brblue search-NrCompany-btn">查看其它法院认证机构</a> -->
		<form class="hide" method="post" action="${contextPath}/web/ssdb/searchNrCompany" id="searchNrCompanyForm">
			<input type="hidden" name="courtId" value="${req.courtId}"/>
			<input type="hidden" name="courtName" value="${req.courtName}"/>
			<input type="hidden" name="targetAmount" value="${req.targetAmount}"/>
		</form>
	</section>
	<div class="modal-layout guarantee-modal-layout hide" data-target="guarantee-premium">
		<ul class="pad-lr-20 bg-white fs-14 br-t guarantee-modal-list">
			<li class="pad-tb-15 br-b">保费从高到低</li>
			<li class="pad-tb-15">保费从低到高</li>
		</ul>
	</div>
	<div class="modal-layout guarantee-modal-layout hide" data-target="guarantee-integral">
		<ul class="pad-lr-20 bg-white fs-14 br-t guarantee-modal-list">
			<li class="pad-tb-15 br-b">积分从高到低</li>
			<li class="pad-tb-15">积分从低到高</li>
		</ul>
	</div>
	<input type="hidden" id="param_courtId" value="${req.courtId}"/>
	<input type="hidden" id="param_rows" value="${res.total}"/>
	<input type="hidden" id="param_stage" value="${req.stage}"/>
	<input type="hidden" id="param_targetAmount" value="${req.targetAmount}"/>
	<input type="hidden" id="param_bdCode" value="${req.bdCode}"/>
	<input type="hidden" id="param_bdCode1" value="${req.bdCode1}"/>
	<input type="hidden" id="param_bdCode2" value="${req.bdCode2}"/>
	<script src="${contextPath}/static/js/jquery-1.12.0.min.js"></script>
	<script type="text/javascript" src="${contextPath}/static/js/jstorage.js"></script>
    <script src="${contextPath}/static/weixin/ssdb/js/util.js"></script>
    <script src="${contextPath}/static/weixin/ssdb/js/companys.js"></script>
    <script type="text/javascript">
    	var baseUrl = '<%=com.fadu.app.util.AppConfig.url_duowenapp_b%>';
	   $(document).ready(function() {
	    searchId="${res.searchId}";
	  	$(".applyId").click(function(){
	  	
	  		var company_id=$(this).attr("company-id");
	  		var token = '<%=token==null?"":token%>';
	  		if(token&&company_id){//已经登录了 可以去申请 
	  			var toUrl="${contextPath}/web/ssdb/toApply?company_id="+company_id+"&searchId="+searchId;
	  			location.href=toUrl;
	  		}else{//未登录的调到登录页面
	  			var toUrl="${contextPath}/web/ssdb/toLogin";
	  			location.href=toUrl;
	  		}
	  	});
	   });
    </script>
</body>
</html>
