<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path+"/";
	request.setAttribute("contextPath", basePath);
%>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <title>进度管理</title>
    <base href="${contextPath}">
    <script src="app/lib/flexible.js"></script>
    <script type="text/javascript" src="res/js/jquery.min.js"></script>
    <script type="text/javascript" src="res/js/layer/layer.min.js"></script>
    <script type="text/javascript" src="app/js/public.js"></script>
    <link rel="stylesheet" href="app/lib/flexible.css">
	<link rel="stylesheet" href="app/css/basem.css">
	<link rel="stylesheet" href="app/css/logome.css">
	<link rel="stylesheet" href="app/css/public.css">
</head>
<body>
	<div class="titbox blubg">
		<!-- <a class="titreturn left" href="javascript:void(0)" onclick="javascript:history.go(-1)"><img src="app/img/fanhui16@2x.png" alt=""></a> -->
		<h1>进度管理</h1>
	</div>
	<div class="whbg top50">
		<div class="safe" style="padding-bottom:1.6rem;">
			<ul id="orderlist" >
				<c:forEach var="list" items="${list}" varStatus="status">
					<li>
					<a class="jinduli" href="web/mgmOrder/getOrderProgressDeteails.cs?orderId=${list.id}">
						<div class="left jindule">
							<h3>客户：${list.customerName}</h3>
							<p>跟单：${list.salerName}</p>
						</div>
						<div class="left jinduri">
							<h3><span class="left">联系电话：</span><Object><a href="tel:${list.customerPhone}" class="blutxt right">${list.customerPhone}</a></Object></h3>
							<div class="clear">
								<p class="redtxt left">
									<c:if test="${list.orderType=='1' }">
											<c:choose>
											<c:when test="${list.orderState=='0'}">备案成功</c:when>
											<c:when test="${list.orderState=='1'}">受理成功</c:when>
											<c:when test="${list.orderState=='2'}">邀约成功</c:when>
											<c:when test="${list.orderState=='3'}">到访成功</c:when>
											<c:when test="${list.orderState=='4'}">认购成功</c:when>
											<c:when test="${list.orderState=='5'}">签约成功</c:when>
											<c:when test="${list.orderState=='6'}">确认签约</c:when>
											<c:otherwise>
												交房
											</c:otherwise>
										</c:choose>
									</c:if>
									<c:if test="${list.orderType=='2' }">
										<c:choose>
											<c:when test="${list.orderState=='0'}">备案成功</c:when>
											<c:when test="${list.orderState=='1'}">订单推进中</c:when>
											<c:when test="${list.orderState=='2'}">签约成功</c:when>
											<c:when test="${list.orderState=='3'}">确认签约</c:when>
										</c:choose>
									</c:if>
								
								</p>
								<p class="graytxt right"><fmt:formatDate value="${list.createDate}" pattern="yyyy-MM-dd" /></p>
							</div>
						</div>
						<img class="jinduimg right" src="app/img/fanh3@2x.png" alt="">
					</a>
				</li>
				</c:forEach>
				<c:if test="${list== null || fn:length(list) == 0}">
					<li>
							<h3 style="text-align:center;padding-top:0.1rem;">暂无数据</h3>
					</li>
				</c:if>
				
				
			</ul> 
		</div>
	</div>
	<footer>
        <a href="<%=basePath %>web/mgmUserCtl/index.cs">
            <img src="app/img/shouye@2x.png" class="img1">
            <img src="app/img/shouygao@2x.png" class="img2">
            <p>首页</p>
        </a>
         <a href="<%=basePath%>web/mgmProduct/followList.cs?page=1">
            <img src="app/img/guanz@2x.png" class="img1">
            <img src="app/img/guanzgao@2x.png" class="img2">
            <p>关注</p>
        </a>
         <a href="${contextPath}web/mgmOrder/getOrderList.cs"  class="active">
            <img src="app/img/jindu@2x.png" class="img1">
            <img src="app/img/jindgao@2x.png" class="img2">
            <p>进度</p>
        </a>
         <a href="${contextPath }web/meWebCtl/me.cs" >
            <img src="app/img/my.png" class="img1">
            <img src="app/img/wode@2x.png" class="img2">
            <p>我的</p>
        </a>
    </footer>
    
    <script type="text/javascript">
	var page=1;
	var totalpage="${pageTotal}";
	var totalheight=0 ;
	var totalheight2=0 ;
    		$(window).scroll(function(){ 
    		   	totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());  
    	      	if($(document).height() == totalheight){
    	      	  page++;
    	    	  if(page<=totalpage){
    	    		 	 $.ajax({
    	    				  type: 'POST',
    	    				  url: 'web/mgmOrder/getOrderListMore.cs?page='+page,
    	    				  dataType:"html",
    	    				  data:"",
    	    				  success: function(html){
    	    					  $('#orderlist').append(html);
    	    	             }
    	    			}); 
    	    	  }else{
    	    		  page =  totalpage ;
    	    	  }
    	 		}
    		}); 
    		
    		
    </script>
</body>
</html>