<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,height=device-height, user-scalable=no,initial-scale=1, minimum-scale=1, maximum-scale=1,target-densitydpi=device-dpi "> 
	<title>充值记录</title>
    <link rel="stylesheet" type="text/css" href="${ctx }/styles/wechat/rechargeRecord.css?ver=4.0" />
    <link href="${ctx }/plugin/layer/skin/default/layer.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="${ctx }/scripts/common/jquery-1.11.3.min.js"></script>
	<script type="text/javascript" src="${ctx }/scripts/visitor/controlOptionMenu.js?v=4.0"></script>
	<script type="text/javascript" src="${ctx }/plugin/layer/layer.js"></script>
</head>
<body>
<script type="text/javascript">

function rechargeRecord(){
	var contextPath=$("#contextPath").val();
	var openId=$("#openId").val();
	var developId=$("#developId").val();
	var channelCode ="0000";
	if(""!=$("#channelCode").val()&&$("#channelCode").val()!=null){
		channelCode=$("#channelCode").val();
	}
	if($("#operationType").val()=="YSHY" || $("#operationType").val()==""){
		$("#operationType").val("YSHY");
		location.href=contextPath+"/wechat/navigation/filmIndex?openId="+openId+"&developId="+developId+"&userId=&serviceCode="+$("#operationType").val()+"&channelCode="+channelCode;		
		return;
	}
	if($("#operationType").val()=="1" || $("#operationType").val()=="0" || $("#operationType").val()=="JYK"){
		location.href=contextPath+"/wechat/recharge/toFlowRecharge?openId="+openId+"&developId="+developId+"&operationType="+$("#operationType").val();		
	}else{
		location.href=contextPath+"/wechat/recharge/moviesvipreCharge?openId="+openId+"&developId="+developId+"&operationType="+$("#operationType").val();		
	}
}

function rechargeRecordDetails(id){
	var contextPath=$("#contextPath").val();
	var openId=$("#openId").val();
	var developId=$("#developId").val();
	var channelCode ="0000";
	if(""!=$("#channelCode").val()&&$("#channelCode").val()!=null){
		channelCode=$("#channelCode").val();
	}
	location.href=contextPath+"/wechat/recharge/getRechareRecordInfo?openId="+openId+"&developId="+developId+"&operationType="+$("#operationType").val()+"&id="+id+"&channelCode="+channelCode;	
}
</script>
<input id="contextPath" value="${ctx}" type="hidden" />
<input id="tradeType" value="${tradeType}" type="hidden" />
<input id="payWay" value="${payWay}" type="hidden" />
<input id="openId" value="${openId}" type="hidden" />
<input id="operationType"  value="${operationType }" type="hidden"/>
<input id="developId" value="${developId}" type="hidden" />
<input type="hidden" id="channelCode" value="${channelCode}"  />

		<c:if test="${not empty recordList}">
			<div class="rechargewrap">
				<c:forEach items="${recordList }" var="model">
		            <h3 class="month">${model.weeMoth }</h3>
		            	<c:forEach items="${model.recordOrderList }" var="obj">
				            <a href="javaScript:void(0)" class="rechargeitem clearfix" onclick="rechargeRecordDetails('${obj.id}')">
				                <div class="operatorlogo">
				                    <c:if test="${obj.type=='1' || obj.type=='0' }">
					                	<c:choose>
					                		<c:when test="${obj.carrieroperator=='移动' }">
					                			<img src="${ctx }/images/common/move.png" alt="" />
					                		</c:when>
					                		<c:when test="${obj.carrieroperator=='联通' }">
					                			<img src="${ctx }/images/common/unicom.png" alt="" />
					                		</c:when>
					                		<c:when test="${obj.carrieroperator=='电信' }">
					                			<img src="${ctx }/images/common/ctcc.png" alt="" />
					                		</c:when>
					                		<c:otherwise>
					                			
					                		</c:otherwise>
					                	</c:choose> 
                					</c:if>
				                	<c:if test="${obj.type!='1' && obj.type!='0' && obj.type!='SINOPEC' && obj.type!='CNPC' }">
				                		<img src="${visitPrefix }${obj.iconUrl}" alt="" />
				                	</c:if>
				                	<c:if test="${obj.type=='SINOPEC' }">
				                		<img src="${ctx }/images/common/zhongshihua.png" alt="" />
				                	</c:if>
				                	<c:if test="${obj.type=='CNPC' }">
				                		<img src="${ctx }/images/common/zhongshiyou.png" alt="" />
				                	</c:if>
				                </div>
				                <div class="record">
				                    <span>
				                    	 <c:if test="${obj.type == '0'}">${obj.productName }流量</c:if>
							             <c:if test="${obj.type == '1'}">${obj.productName }元话费</c:if>
							             <c:if test="${obj.type != '1' && obj.type!='0'}">${obj.name }${obj.productName }</c:if>
				                    </span>
				                    <em>
					                     <c:choose>
				                    		<c:when test="${obj.status=='0' }">
				                    			 <em>充值中</em>
				                    		</c:when>
				                    		<c:when test="${obj.status=='1' }">
				                    		 	 <em style="color: #999;">充值成功</em>
				                    		</c:when>
				                    		<c:otherwise>
				                    			<em style="color: #999;">充值失败</em>
	                    					</c:otherwise>
	                    				 </c:choose>
				                    </em>
				                </div>
				                <div class="record recorddata">
				                    <span>${obj.createTimes }</span>
				                    <em>￥${obj.price }</em>
				                </div>
				            </a>
				          </c:forEach>
				   </c:forEach>
		       </div>
	    </c:if>
		<c:if test="${empty recordList}">
         <div class="nothing">
            <img src="${ctx }/images/gasrecharge/nothinggas.png"  alt="" />
            <span style="color: #88acd8; margin-top: 10px;">暂无充值记录</span>
            <a href="javaScript:void(0)" class="gocharge"  onclick="rechargeRecord()">去充值</a>
        </div>
        </c:if>
</body>
</html>