message.jsp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. String redirectUrl= request.getParameter("redirectUrl");
  10. request.setAttribute("redirectUrl", redirectUrl);
  11. %>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <meta charset="UTF-8">
  16. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  17. <meta name="apple-mobile-web-app-capable" content="yes">
  18. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  19. <meta name="format-detection" content="telephone=no">
  20. <title>消息通知</title>
  21. <script type="text/javascript" src="${contextPath }res/js/jquery.min.js"></script>
  22. <script src="${contextPath }app/lib/flexible.js"></script>
  23. <link rel="stylesheet" href="${contextPath }app/lib/flexible.css">
  24. <link rel="stylesheet" href="${contextPath }app/css/basem.css">
  25. <link rel="stylesheet" href="${contextPath }app/css/logome.css">
  26. </head>
  27. <body>
  28. <div class="titbox blubg">
  29. <a class="titreturn left" href="${contextPath }web/mgmUserCtl/index.cs?userId=${USER_ID}"><img src="${contextPath }app/img/fanhui16@2x.png" alt=""></a>
  30. <h1>消息通知</h1>
  31. </div>
  32. <div class="top50">
  33. <div class="safe">
  34. <ul>
  35. <c:forEach items="${lists}" var="message">
  36. <c:if test="${message.state==0}">
  37. <li class="messageli" id="F${message.id}">
  38. <h2 class="metime" style="color: #000">${message.createDate}<i>【未读】</i></h2>
  39. <p class="messagep" onclick="updateState(${message.id},this)" style="color: #000" >${message.content}</p>
  40. </li>
  41. </c:if>
  42. <c:if test="${message.state==1}">
  43. <li class="messageli" id="F${message.id}">
  44. <h2 class="metime">${message.createDate}<i>【已读】</i></h2>
  45. <p class="messagep" style="color:#666">${message.content}</p>
  46. </li>
  47. </c:if>
  48. </c:forEach>
  49. </ul>
  50. </div>
  51. </div>
  52. </body>
  53. <script type="text/javascript">
  54. function updateState(id){
  55. $.post('${contextPath }web/messageWebCtl/updateMgmMessageState.cs', {
  56. "id" : id
  57. }, function(data) {
  58. var datas=eval(data.data);
  59. if (data.ret == 1) {
  60. $("#F"+id+" h2 i").html("【已读】");
  61. $("#F"+id+" h2").css("color","#666");
  62. $("#F"+id+" p").css("color","#666");
  63. }else{
  64. layer.msg(data.msg);
  65. }
  66. }, "json");
  67. }
  68. </script>
  69. </html>