<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html>
<html>
<head>
	<link type="text/css" rel="stylesheet" href="<c:url value='/resources/version_new/css/reset.css' />" />
	<link type="text/css" rel="stylesheet" href="<c:url value='/resources/version_new/css/bootstrap.min.css' />" />
	<link type="text/css" rel="stylesheet" href="<c:url value='/resources/version_new/css/YD.css' />" />
	<style>
		.active {
			font-weight: bold;
		}
	</style>
</head>
<body>
<div class="wrap">
	<div class="Con row">
		<%--<header class="order-header">
			<h1 class="nav-border-bottom pull-left">保障中心</h1>
			<a href="<c:url value='/api/order/myOrder' />" class="btn-b pull-right">我的订单</a>
			<a href="<c:url value='/api/preservation/recordList' />" class="btn-b pull-right">我的保全</a>
		</header>--%>
		<c:if test="${fn:contains(userdetail.web_type, 'PSS')}">
			<header class="order-header clearfix" style="margin: 0 auto;border-bottom:none;font-size: 16px">
					<%--				<h1 class="nav-border-bottom pull-left">产品列表</h1>--%>
				<ul class="nav nav-tabs" style="margin-top: 19px;" id="myTab">
					<li><a>大活保险：</a></li>
					<li id="nav_1" class="active"><a data-toggle="tab" href="javascript:activeCheck('GZX',1);">公众责任险</a></li>
					<li><a data-toggle="tab" href="javascript:activeCheck('ZZX',2);">展会责任险</a></li>
					<li><a data-toggle="tab" href="javascript:activeCheck('TYX',3);">短期意外险</a></li>
					<li style="float: right;"><a href="<c:url value='/api/order/myOrder?ACCESS_TOKEN=${ACCESS_TOKEN}' />">我的订单</a></li>
				</ul>
					<%--				<a href="<c:url value='/api/order/myOrder?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="btn-b pull-right">我的订单</a>--%>
			</header>
		</c:if>
		<c:forEach items="${listVo }" var="list">
			<div hidden class="orderBox clearfix ${fn:contains(list.product_code, 'GZX')? 'GZX':fn:contains(list.product_code, 'ZZX')? 'ZZX':fn:contains(list.product_code, 'TYX')? 'TYX':'OTHR'}">
				<div class="col-md-9 col-xs-12">
					<h2 class="order-title-h2">
							${list.product_name}
					</h2>
					<div class="bg-dfeafc clearfix" style="padding: 10px 5px 0;font-weight: bold">
						<p>${list.intro}</p>
					</div>
					<div class="tab_container">
						<table border="1">
							<tr>
								<td>保险责任</td>
								<td>保险金额</td>
							</tr>
							<c:forEach items="${list.responsibilityVoList }" var="irp">
								<tr>
									<td>${irp.name}</td>
									<td>
										<c:choose>
											<c:when test="${empty irp.insurance_amount_max && not empty irp.fcy}">
									<span>
										<c:if test="${ empty irp.fcy}">
											-
										</c:if>
										<c:if test="${empty irp.compensation_days && not empty irp.fcy}">
											<c:if test="${irp.fcy/10000 >= 1}">
												${(fn:split((irp.fcy/10000),'.')[1] eq '0' || fn:split((irp.fcy/10000),'.')[1] eq '00') ? fn:split((irp.fcy/10000),'.')[0] : (irp.fcy/10000)}
												万元
											</c:if>
											<c:if test="${irp.fcy/10000 < 1}">
												${(fn:split(irp.fcy,'.')[1] eq '0' || fn:split(irp.fcy,'.')[1] eq '00') ? fn:split(irp.fcy,'.')[0] : irp.fcy}
												元
											</c:if>
										</c:if>
										<c:if test="${not empty irp.compensation_days && not empty irp.fcy}">
											<c:if test="${irp.fcy/10000 >= 1}">
												${(fn:split((irp.fcy/10000),'.')[1] eq '0' || fn:split((irp.fcy/10000),'.')[1] eq '00') ? fn:split((irp.fcy/10000),'.')[0] : (irp.fcy/10000)}
												万元/天
											</c:if>
											<c:if test="${irp.fcy/10000 < 1}">
												${(fn:split(irp.fcy,'.')[1] eq '0' || fn:split(irp.fcy,'.')[1] eq '00') ? fn:split(irp.fcy,'.')[0] : irp.fcy}
												元/天
											</c:if>
										</c:if>
									</span>
											</c:when>
											<c:when test="${empty irp.fcy && not empty irp.insurance_amount_max}">
									<span>
										<c:if test="${ empty irp.insurance_amount_max}">
											-
										</c:if>
										<c:if test="${empty irp.compensation_days && not empty irp.insurance_amount_max}">
											<c:if test="${irp.insurance_amount_max/10000 >= 1}">
												${(fn:split((irp.insurance_amount_max/10000),'.')[1] eq '0' || fn:split((irp.insurance_amount_max/10000),'.')[1] eq '00') ? fn:split((irp.insurance_amount_max/10000),'.')[0] : (irp.insurance_amount_max/10000)}
												万元
											</c:if>
											<c:if test="${irp.insurance_amount_max/10000 < 1}">
												${(fn:split(irp.insurance_amount_max,'.')[1] eq '0' || fn:split(irp.insurance_amount_max,'.')[1] eq '00') ? fn:split(irp.insurance_amount_max,'.')[0] : irp.insurance_amount_max}
												元
											</c:if>
										</c:if>
										<c:if test="${not empty irp.compensation_days && not empty irp.insurance_amount_max}">
											<c:if test="${irp.insurance_amount_max/10000 >= 1}">
												${(fn:split((irp.insurance_amount_max/10000),'.')[1] eq '0' || fn:split((irp.insurance_amount_max/10000),'.')[1] eq '00') ? fn:split((irp.insurance_amount_max/10000),'.')[0] : (irp.insurance_amount_max/10000)}
												万元/天
											</c:if>
											<c:if test="${irp.insurance_amount_max/10000 < 1}">
												${(fn:split(irp.insurance_amount_max,'.')[1] eq '0' || fn:split(irp.insurance_amount_max,'.')[1] eq '00') ? fn:split(irp.insurance_amount_max,'.')[0] : irp.insurance_amount_max}
												元/天
											</c:if>
										</c:if>
									</span>
											</c:when>
											<c:otherwise>
												<span>-</span>
											</c:otherwise>
										</c:choose>
									</td>
								</tr>
							</c:forEach>
						</table>
					</div>
				</div>
				<div class="col-md-3 col-xs-12 BuyInsurance" style="text-align: center;">
					<c:if test="${not empty list.min_insurance_draw && fn:contains(list.min_insurance_draw, '?') }"><img src="${ list.min_insurance_draw }" style="margin-top: 20px;width: 196px"></c:if>
					<strong class="ComName2">${ list.insurance_name }</strong>
					<div class="Howmany">
						<strong>￥${ list.premium_min }</strong>
						元起
					</div>
					<c:if test="${fn:contains(list.product_code, 'GZX')}">
						<a href="<c:url value='/insurance/gzx/product/productInfo/${ list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="btn-b">保险详情</a>
						<a href="javascript:enterGZX('${ list.oid }')" class="btn-ligr">立即购买</a>
					</c:if>
					<c:if test="${fn:contains(list.product_code, 'ZZX')}">
						<a href="<c:url value='/insurance/lote/product/productInfo/${ list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="btn-b">保险详情</a>
						<a href="javascript:enterZZX('${ list.oid }')" class="btn-ligr">立即购买</a>
					</c:if>
					<c:if test="${fn:contains(list.product_code, 'TYX')}">
						<a href="<c:url value='/api/gmr/product/productInfo/${ list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="btn-b">保险详情</a>
						<a href="javascript:enterBX('${ list.oid }')" class="btn-ligr">立即购买</a>
					</c:if>
					<c:if test="${fn:contains(list.product_code, 'GZZRX')}">
						<a href="<c:url value='/insurance/gzzrx/product/productInfo/${ list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="btn-b">保险详情</a>
						<a href="javascript:enterGX('${ list.oid }')" class="btn-ligr">立即购买</a>
					</c:if>
				</div>
			</div>
		</c:forEach>
	</div>
</div>


</body>
<script type="text/javascript" src="<c:url value='/resources/version_new/js/jquery.min.js' />"></script>
<script type="text/javascript" src="<c:url value='/resources/js/layer/layer.js'/>"></script>
<script>
	var baseUrl = '${pageContext.request.contextPath }';
	//立即购买
	function enterGZX(v_id){
		var loadIndex = layer.load(0, {shade : [ 0.3, '#808080']});
		window.location.href=baseUrl+"/api/gzx/policyInit/"+v_id+"?ACCESS_TOKEN=${ACCESS_TOKEN}";
	}
	//立即购买
	function enterZZX(v_id){
		var loadIndex = layer.load(0, {shade : [ 0.3, '#808080']});
		window.location.href=baseUrl+"/api/lote/policyInit/"+v_id+"?ACCESS_TOKEN=${ACCESS_TOKEN}";
	}
	//立即购买
	function enterBX(v_id){
		var loadIndex = layer.load(0, {shade : [ 0.3, '#808080']});
		window.location.href=baseUrl+"/api/gmr/policyInit/"+v_id+"?ACCESS_TOKEN=${ACCESS_TOKEN}";
	}
	//立即购买
	function enterGX(v_id){
		var loadIndex = layer.load(0, {shade : [ 0.3, '#808080']});
		window.location.href=baseUrl+"/api/gzzrx/policyInit/"+v_id+"?ACCESS_TOKEN=${ACCESS_TOKEN}";
	}
	function activeCheck(_type,_num){
		$('#myTab li').removeClass();
		$('.orderBox').hide();
		$('#myTab li:eq('+_num+')').attr('class','active');
		$('.'+_type).show();

	}
	$(function () {
		activeCheck('GZX',1);
	});
</script>
</html>
