newslist.jsp 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path+"/";
  8. request.setAttribute("contextPath", basePath);
  9. %>
  10. <!DOCTYPE html>
  11. <html lang="en">
  12. <head>
  13. <meta charset="UTF-8">
  14. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  15. <meta name="apple-mobile-web-app-capable" content="yes">
  16. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  17. <meta name="format-detection" content="telephone=no">
  18. <title>集团公告</title>
  19. <base href="${contextPath}">
  20. <script src="app/lib/flexible.js"></script>
  21. <script type="text/javascript" src="res/js/jquery.min.js"></script>
  22. <script type="text/javascript" src="res/js/layer/layer.min.js"></script>
  23. <script type="text/javascript" src="app/js/public.js"></script>
  24. <link rel="stylesheet" href="app/lib/flexible.css">
  25. <link rel="stylesheet" href="app/css/basem.css">
  26. <link rel="stylesheet" href="app/css/logome.css">
  27. <link rel="stylesheet" href="app/css/public.css">
  28. </head>
  29. <body>
  30. <div class="titbox blubg">
  31. <a class="titreturn left" href="javascript:void(0)" onclick="javascript:history.go(-1)"><img src="app/img/fanhui16@2x.png" alt=""></a>
  32. <h1>集团公告</h1>
  33. </div>
  34. <div class="whbg top50">
  35. <div class="safe">
  36. <ul id="newslist">
  37. <c:forEach var="list" items="${list}" varStatus="status">
  38. <li><a class="mejituanli" href="web/news/newsdetil.cs?id=${list.id}">
  39. <img class="mejituanimg left" src="${list.news_image}" alt="">
  40. <p class="left">${list.news_title}</p>
  41. <img class="right mejituanjin" src="app/img/fanh3@2x.png" alt="">
  42. </a>
  43. </li>
  44. </c:forEach>
  45. <c:if test="${list== null || fn:length(list) == 0}">
  46. <li>
  47. <h3 style="text-align:center;padding-top:0.1rem;">暂无数据</h3>
  48. </li>
  49. </c:if>
  50. </ul>
  51. </div>
  52. </div>
  53. <script type="text/javascript">
  54. var page=1;
  55. var totalpage="${pageTotal}";
  56. var totalheight=0 ;
  57. var totalheight2=0 ;
  58. $(window).scroll(function(){
  59. totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
  60. if($(document).height() == totalheight){
  61. page++;
  62. if(page<=totalpage){
  63. $.ajax({
  64. type: 'POST',
  65. url: 'web/news/newsListMore.cs?page='+page,
  66. dataType:"html",
  67. data:"",
  68. success: function(html){
  69. $('#newslist').append(html);
  70. }
  71. });
  72. }else{
  73. page = totalpage ;
  74. }
  75. }
  76. });
  77. </script>
  78. </body>
  79. </html>