noticeInfo.zml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <div class=" intro_text" style="margin-left: auto;margin-right: auto;">
  2. <div class="header">
  3. <h1 id="title" style="text-align:center"></h1>
  4. <span id="updateTime" style="text-align:center;display:block;"></span>
  5. </div>
  6. <div class="content">
  7. <p id="p1"></p>
  8. </div>
  9. </div>
  10. <style>
  11. .intro_text {
  12. width: 100%;
  13. }
  14. .intro_text .header {
  15. font-size: 18px;
  16. line-height: 18px;
  17. padding: 1px 20px 1px 20px;
  18. }
  19. .intro_text .content {
  20. font-size: 16px;
  21. padding: 40px 50px;
  22. }
  23. .container{ min-height:743px;
  24. background:#fff;
  25. }
  26. </style>
  27. <script>
  28. Z.onload(function(){
  29. var id='${id}';
  30. var ajax = new Z.Ajax();
  31. ajax.setClassName("DesignerNoticePresenter");
  32. ajax.setMethodName("getNoticeInfo");
  33. ajax.addParam(id);
  34. ajax.setFailureAlert();
  35. ajax.setSuccess(function(res){
  36. var data = eval('('+res+')');
  37. Z("#title").html(data.title);
  38. if(data.finshTime){
  39. Z("#updateTime").html(timestampToTime(data.finshTime));
  40. }
  41. Z("#p1").html(data.content);
  42. });
  43. ajax.execute();
  44. })
  45. function timestampToTime(timestamp) {
  46. var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  47. Y = date.getFullYear() + '-';
  48. M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
  49. D = (date.getDate()< 10 ? '0'+(date.getDate()) : date.getDate()) + ' ';
  50. h = (date.getHours()< 10 ? '0'+(date.getHours()) : date.getHours()) + ':';
  51. m = (date.getMinutes() < 10 ? '0'+(date.getMinutes()) : date.getMinutes()) + ':';
  52. s = (date.getSeconds() < 10 ? '0'+(date.getSeconds()) : date.getSeconds());
  53. return Y+M+D+h+m+s;
  54. }
  55. </script>