<%@ 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">
			<ul id="newslist">
				<c:forEach var="list" items="${list}" varStatus="status">
					<li><a class="mejituanli" href="web/news/newsdetil.cs?id=${list.id}">
						<img class="mejituanimg left" src="${list.news_image}" alt="">
						<p class="left">${list.news_title}</p>
						<img class="right mejituanjin" 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>
    <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/news/newsListMore.cs?page='+page,
    	    				  dataType:"html",
    	    				  data:"",
    	    				  success: function(html){
    	    					  $('#newslist').append(html);
    	    	             }
    	    			}); 
    	    	  }else{
    	    		  page =  totalpage ;
    	    	  }
    	 		}
    		}); 
    		
    		
    </script>
</body>
</html>