zhengwen.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <title>江苏港口智能监管信息平台</title>
  9. <link href="../css/base.min.css" rel="stylesheet">
  10. <link href="../css/mui.min.css" rel="stylesheet">
  11. <script type="text/javascript" src="../js/zepto.min.js"></script>
  12. <script type="text/javascript" src="../js/iscroll.js" charset="utf-8"></script>
  13. <script type="text/javascript">
  14. var page =1;
  15. var rows =10;
  16. function download(id){
  17. // var ua = navigator.userAgent.toLowerCase();
  18. // if(ua.match(/MicroMessenger/i)=="micromessenger") {
  19. // alert("请在其他浏览器进行下载")
  20. // } else {
  21. window.location.href="../../fjcontroller/download.do?flag=zw&id="+id;
  22. // }
  23. }
  24. $(function(){
  25. $.ajax({
  26. type: 'post',
  27. url: '../../fjcontroller/queryFj.do',
  28. data:{id:getQueryString("id"),type:getQueryString("type"),page:page,rows:rows},
  29. dataType: 'json',
  30. success: function(data){
  31. console.log(data)
  32. if(data.length<1)
  33. {
  34. $('.lists').html('<div style="text-align:center;">没有正文</div>');
  35. return;
  36. }
  37. var result = '';
  38. for(var i = 0; i < data.length; i++){
  39. result += '<li style="color:black" class="mui-table-view-cell"><a href="javascript:download(\''+data[i].id+'\')">'+
  40. '<span >'+
  41. '<div class="mui-media-body">'+
  42. '<span style="font-size: 20px;margin-right:5px;">'+(i+1)+'.</span>'+data[i].name+
  43. '<p class="mui-ellipsis" style="margin-left:20px">'+todata(data[i].addDate)+'</p>'+
  44. '</div>'+
  45. '</span>'+
  46. '</a></li>';
  47. }
  48. $('.lists').html('');
  49. $('.lists').prepend(result);
  50. if(data.length>=rows){
  51. showJZ();
  52. }else{
  53. hideJZ();
  54. }
  55. myScroll.refresh();
  56. }})
  57. })
  58. var myScroll,
  59. pullDownEl, pullDownOffset,
  60. pullUpEl, pullUpOffset,
  61. generatedCount = 0;
  62. function pullDownAction () {
  63. page = 1;
  64. rows = 8;
  65. $.ajax({
  66. type: 'post',
  67. url: '../../fjcontroller/queryFj.do',
  68. data:{id:getQueryString("id"),type:getQueryString("type"),page:page,rows:rows},
  69. dataType: 'json',
  70. success: function(data){
  71. var result = '';
  72. for(var i = 0; i < data.length; i++){
  73. result += '<li style="color:black" class="mui-table-view-cell"><a href="javascript:download(\''+data[i].id+'\')">'+
  74. '<span >'+
  75. '<div class="mui-media-body">'+
  76. '<span style="font-size: 20px;margin-right:5px;">'+(i+1)+'.</span>'+data[i].name+
  77. '<p class="mui-ellipsis" style="margin-left:20px">'+todata(data[i].addDate)+'</p>'+
  78. '</div>'+
  79. '</span>'+
  80. '</a></li>';
  81. }
  82. $('.lists').html('');
  83. $('.lists').prepend(result);
  84. if(data.length>=rows){
  85. showJZ();
  86. }else{
  87. hideJZ();
  88. }
  89. myScroll.refresh();
  90. }})
  91. }
  92. function pullUpAction () {
  93. page+=1;
  94. $.ajax({
  95. type: 'post',
  96. url: '../../fjcontroller/queryFj.do',
  97. data:{id:getQueryString("id"),type:getQueryString("type"),page:page,rows:rows},
  98. dataType: 'json',
  99. success: function(data){
  100. var result = '';
  101. for(var i = 0; i < data.length; i++){
  102. result += '<li style="color:black" class="mui-table-view-cell"><a href="javascript:download(\''+data[i].id+'\')">'+
  103. '<span >'+
  104. '<div class="mui-media-body">'+
  105. '<span style="font-size: 20px;margin-right:5px;">'+(i+1)+'.</span>'+data[i].name+
  106. '<p class="mui-ellipsis" style="margin-left:20px">'+todata(data[i].addDate)+'</p>'+
  107. '</div>'+
  108. '</span>'+
  109. '</a></li>';
  110. }
  111. $('.lists').html('');
  112. $('.lists').prepend(result);
  113. if(data.length>=rows){
  114. showJZ();
  115. }else{
  116. hideJZ();
  117. }
  118. myScroll.refresh();
  119. }})
  120. }
  121. function loaded() {
  122. pullDownEl = document.getElementById('pullDown');
  123. pullDownOffset = pullDownEl.offsetHeight;
  124. pullUpEl = document.getElementById('pullUp');
  125. pullUpOffset = pullUpEl.offsetHeight;
  126. myScroll = new iScroll('wrapper', {
  127. useTransition: true,
  128. topOffset: pullDownOffset,
  129. onRefresh: function () {
  130. if (pullDownEl.className.match('loading')) {
  131. pullDownEl.className = '';
  132. pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
  133. } else if (pullUpEl.className.match('loading')) {
  134. pullUpEl.className = '';
  135. pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
  136. }
  137. },
  138. onScrollMove: function () {
  139. if (this.y > 5 && !pullDownEl.className.match('flip')) {
  140. pullDownEl.className = 'flip';
  141. pullDownEl.querySelector('.pullDownLabel').innerHTML = '松手刷新...';
  142. this.minScrollY = 0;
  143. } else if (this.y < 5 && pullDownEl.className.match('flip')) {
  144. pullDownEl.className = '';
  145. pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
  146. this.minScrollY = -pullDownOffset;
  147. } else if (this.y < (this.maxScrollY - 5) && !pullUpEl.className.match('flip')) {
  148. pullUpEl.className = 'flip';
  149. pullUpEl.querySelector('.pullUpLabel').innerHTML = '松手加载...';
  150. this.maxScrollY = this.maxScrollY;
  151. } else if (this.y > (this.maxScrollY + 5) && pullUpEl.className.match('flip')) {
  152. pullUpEl.className = '';
  153. pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
  154. this.maxScrollY = pullUpOffset;
  155. }
  156. },
  157. onScrollEnd: function () {
  158. if (pullDownEl.className.match('flip')) {
  159. pullDownEl.className = 'loading';
  160. pullDownEl.querySelector('.pullDownLabel').innerHTML = '载入中...';
  161. pullDownAction(); // Execute custom function (ajax call?)
  162. } else if (pullUpEl.className.match('flip')) {
  163. pullUpEl.className = 'loading';
  164. pullUpEl.querySelector('.pullUpLabel').innerHTML = '载入中...';
  165. pullUpAction(); // Execute custom function (ajax call?)
  166. }
  167. }
  168. });
  169. setTimeout(function () { document.getElementById('wrapper').style.left = '0'; }, 800);
  170. }
  171. document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
  172. document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);
  173. </script>
  174. <style type="text/css" media="all">
  175. #header {
  176. position:absolute; z-index:2;
  177. top:0; left:0;
  178. width:100%;
  179. height:45px;
  180. line-height:45px;
  181. padding:0;
  182. color:#eee;
  183. font-size:22px;
  184. text-align:center;
  185. color:white;
  186. background: #2196f3;
  187. }
  188. #header a {
  189. color:white;
  190. text-decoration:none;
  191. }
  192. #wrapper {
  193. position:absolute; z-index:1;
  194. top:48px; bottom:0px; left:-9999px;
  195. width:100%;
  196. overflow:auto;
  197. }
  198. #scroller {
  199. position:absolute; z-index:1;
  200. /* -webkit-touch-callout:none;*/
  201. -webkit-tap-highlight-color:rgba(0,0,0,0);
  202. width:100%;
  203. padding:0;
  204. }
  205. #myFrame {
  206. position:absolute;
  207. top:0; left:0;
  208. }
  209. /**
  210. *
  211. * Pull down styles
  212. *
  213. */
  214. #pullDown, #pullUp {
  215. background:#fff;
  216. height:45px;
  217. line-height:45px;
  218. font-weight:bold;
  219. font-size:14px;
  220. color:#888;
  221. padding-left: 50%;
  222. margin-left:-54.5px;
  223. }
  224. #pullDown .pullDownIcon, #pullUp .pullUpIcon {
  225. display:block; float:left;
  226. width:40px; height:40px;
  227. background:url(../images/pull-icon@2x.png) 0 0 no-repeat;
  228. -webkit-background-size:40px 80px; background-size:40px 80px;
  229. -webkit-transition-property:-webkit-transform;
  230. -webkit-transition-duration:250ms;
  231. }
  232. #pullDown .pullDownIcon {
  233. -webkit-transform:rotate(0deg) translateZ(0);
  234. }
  235. #pullUp .pullUpIcon {
  236. -webkit-transform:rotate(-180deg) translateZ(0);
  237. }
  238. #pullDown.flip .pullDownIcon {
  239. -webkit-transform:rotate(-180deg) translateZ(0);
  240. }
  241. #pullUp.flip .pullUpIcon {
  242. -webkit-transform:rotate(0deg) translateZ(0);
  243. }
  244. #pullDown.loading .pullDownIcon, #pullUp.loading .pullUpIcon {
  245. background-position:0 100%;
  246. -webkit-transform:rotate(0deg) translateZ(0);
  247. -webkit-transition-duration:0ms;
  248. -webkit-animation-name:loading;
  249. -webkit-animation-duration:2s;
  250. -webkit-animation-iteration-count:infinite;
  251. -webkit-animation-timing-function:linear;
  252. }
  253. @-webkit-keyframes loading {
  254. from { -webkit-transform:rotate(0deg) translateZ(0); }
  255. to { -webkit-transform:rotate(360deg) translateZ(0); }
  256. }
  257. .nav{position: fixed;}
  258. .header {
  259. width:100%;
  260. height:45px;
  261. line-height:45px;
  262. padding:0;
  263. color:#eee;
  264. font-size:22px;
  265. text-align:center;
  266. color:white;
  267. background: #2196f3;
  268. }
  269. ul,li{padding: 0px;margin: 0px;}
  270. </style>
  271. </head>
  272. <body>
  273. <header class="header">
  274. <ul class="nav nav-list pull-left">
  275. <li><a href="javascript:void(0);" id="goback" onclick="history.back()"><span class="icon icon-arrow-back icback"></span>
  276. </a>
  277. </li>
  278. </ul>
  279. <a class="" href="#">正文列表</a>
  280. </header>
  281. <div id="wrapper">
  282. <div id="scroller">
  283. <div id="pullDown" >
  284. <div><span class="pullDownIcon"></span><span class="pullDownLabel">下拉刷新...</span></div>
  285. </div>
  286. <div id="mui-content">
  287. <ul id="thelist mui-table-view" class="lists">
  288. </ul>
  289. </div>
  290. <div id="pullUp">
  291. </div>
  292. </div>
  293. </div>
  294. </body>
  295. </html>