ybsw.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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/mui.min.css" rel="stylesheet">
  10. <script type="text/javascript" src="../js/iscroll.js" charset="utf-8"></script>
  11. <script type="text/javascript" src="../js/zepto.min.js"></script>
  12. <script type="text/javascript">
  13. var page =1;
  14. var rows =10;
  15. $(function(){
  16. $.ajax({
  17. type: 'post',
  18. url: '../../swcontroller/ybsw.do',
  19. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:"",code:getQueryString("code")},
  20. dataType: 'json',
  21. success: function(data){
  22. console.log(data)
  23. var result = '';
  24. if(data.length==0)
  25. {
  26. layer.open({
  27. shade:false,
  28. content: '没有相关数据',
  29. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  30. time: 1
  31. });
  32. $('.lists').html('');
  33. return;
  34. }
  35. for(var i = 0; i < data.length; i++){
  36. result += '<li class="mui-table-view-cell mui-media"><a onclick="window.open(\'info.html?hname=yb&id='+data[i].id+'\')" href="javascript:void(0)" >'+
  37. '<div class="mui-media-body">'+data[i].title+
  38. '<p class="mui-ellipsis">当前环节:<span style="color:rgb(33, 150, 243);">'+data[i].status+'</span> 来文日期 :<span style="color:rgb(33, 150, 243);">'+todata(data[i].addDate)+'</span></p>'+
  39. '</div>'+
  40. '</a></li>';
  41. }
  42. $('.lists').html('');
  43. $('.lists').prepend(result);
  44. if(data.length>=rows){
  45. showJZ();
  46. }else{
  47. hideJZ();
  48. }
  49. myScroll.refresh();
  50. }})
  51. $("#sousuo").on("click",function(){
  52. // var title=$("#title").val();
  53. page = 1;
  54. $.ajax({
  55. type: 'post',
  56. url: '../../swcontroller/ybsw.do',
  57. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  58. dataType: 'json',
  59. success: function(data){
  60. if(data.length<1){
  61. $('.lists').html('');
  62. return;
  63. }else{
  64. var result = '';
  65. for(var i = 0; i < data.length; i++){
  66. result += '<li class="mui-table-view-cell mui-media"><a onclick="window.open(\'info.html?hname=yb&id='+data[i].id+'\')" href="javascript:void(0)" >'+
  67. '<div class="mui-media-body">'+data[i].title+
  68. '<p class="mui-ellipsis">当前环节:<span style="color:rgb(33, 150, 243);">'+data[i].status+'</span> 来文日期 :<span style="color:rgb(33, 150, 243);">'+todata(data[i].addDate)+'</span></p>'+
  69. '</div>'+
  70. '</a></li>';
  71. }
  72. if(data.length<rows){
  73. hideJZ();
  74. }else{
  75. showJZ();
  76. }
  77. $('.lists').html('');
  78. $('.lists').prepend(result);
  79. myScroll.refresh();
  80. }
  81. }})
  82. })
  83. })
  84. var myScroll,
  85. pullDownEl, pullDownOffset,
  86. pullUpEl, pullUpOffset,
  87. generatedCount = 0;
  88. function pullDownAction () {
  89. page = 1;
  90. $.ajax({
  91. type: 'post',
  92. url: '../../swcontroller/ybsw.do',
  93. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  94. dataType: 'json',
  95. success: function(data){
  96. var result = '';
  97. for(var i = 0; i < data.length; i++){
  98. result += '<li class="mui-table-view-cell mui-media"><a onclick="window.open(\'info.html?hname=yb&id='+data[i].id+'\')" href="javascript:void(0)" >'+
  99. '<div class="mui-media-body">'+data[i].title+
  100. '<p class="mui-ellipsis">当前环节:<span style="color:rgb(33, 150, 243);">'+data[i].status+'</span> 来文日期 :<span style="color:rgb(33, 150, 243);">'+todata(data[i].addDate)+'</span></p>'+
  101. '</div>'+
  102. '</a></li>';
  103. }
  104. $('.lists').html('');
  105. $('.lists').prepend(result);
  106. if(data.length>=rows){
  107. showJZ();
  108. }else{
  109. hideJZ();
  110. }
  111. myScroll.refresh();
  112. }})
  113. }
  114. function pullUpAction () {
  115. page+=1;
  116. $.ajax({
  117. type: 'post',
  118. url: '../../swcontroller/ybsw.do',
  119. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  120. dataType: 'json',
  121. success: function(data){
  122. var result = '';
  123. for(var i = 0; i < data.length; i++){
  124. result += '<li class="mui-table-view-cell mui-media"><a onclick="window.open(\'info.html?hname=yb&id='+data[i].id+'\')" href="javascript:void(0)">'+
  125. '<div class="mui-media-body">'+data[i].title+
  126. '<p class="mui-ellipsis">当前环节:<span style="color:rgb(33, 150, 243);">'+data[i].status+'</span> 来文日期 :<span style="color:rgb(33, 150, 243);">'+todata(data[i].addDate)+'</span></p>'+
  127. '</div>'+
  128. '</a></li>';
  129. }
  130. $('.lists').append(result);
  131. if(data.length<rows){
  132. wcJZ();
  133. }
  134. myScroll.refresh();
  135. }})
  136. }
  137. function loaded() {
  138. pullDownEl = document.getElementById('pullDown');
  139. pullDownOffset = pullDownEl.offsetHeight;
  140. pullUpEl = document.getElementById('pullUp');
  141. pullUpOffset = pullUpEl.offsetHeight;
  142. myScroll = new iScroll('wrapper', {
  143. useTransition: true,
  144. topOffset: pullDownOffset,
  145. onRefresh: function () {
  146. if (pullDownEl.className.match('loading')) {
  147. pullDownEl.className = '';
  148. pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
  149. } else if (pullUpEl.className.match('loading')) {
  150. pullUpEl.className = '';
  151. pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
  152. }
  153. },
  154. onScrollMove: function () {
  155. if (this.y > 5 && !pullDownEl.className.match('flip')) {
  156. pullDownEl.className = 'flip';
  157. pullDownEl.querySelector('.pullDownLabel').innerHTML = '松手刷新...';
  158. this.minScrollY = 0;
  159. } else if (this.y < 5 && pullDownEl.className.match('flip')) {
  160. pullDownEl.className = '';
  161. pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
  162. this.minScrollY = -pullDownOffset;
  163. } else if (this.y < (this.maxScrollY - 5) && !pullUpEl.className.match('flip')) {
  164. pullUpEl.className = 'flip';
  165. pullUpEl.querySelector('.pullUpLabel').innerHTML = '松手加载...';
  166. this.maxScrollY = this.maxScrollY;
  167. } else if (this.y > (this.maxScrollY + 5) && pullUpEl.className.match('flip')) {
  168. pullUpEl.className = '';
  169. pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
  170. this.maxScrollY = pullUpOffset;
  171. }
  172. },
  173. onScrollEnd: function () {
  174. if (pullDownEl.className.match('flip')) {
  175. pullDownEl.className = 'loading';
  176. pullDownEl.querySelector('.pullDownLabel').innerHTML = '载入中...';
  177. pullDownAction(); // Execute custom function (ajax call?)
  178. } else if (pullUpEl.className.match('flip')) {
  179. pullUpEl.className = 'loading';
  180. pullUpEl.querySelector('.pullUpLabel').innerHTML = '载入中...';
  181. pullUpAction(); // Execute custom function (ajax call?)
  182. }
  183. }
  184. });
  185. setTimeout(function () { document.getElementById('wrapper').style.left = '0'; }, 800);
  186. }
  187. document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
  188. document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);
  189. </script>
  190. <style type="text/css" media="all">
  191. #header {
  192. position:absolute; z-index:2;
  193. top:0; left:0;
  194. width:100%;
  195. height:45px;
  196. line-height:45px;
  197. padding:0;
  198. color:#eee;
  199. font-size:22px;
  200. text-align:center;
  201. color:white;
  202. background: #2196f3;
  203. }
  204. .sousuotiaojian{
  205. position: absolute;
  206. left:0px;
  207. margin:0px;
  208. top:45px;
  209. height:48px;
  210. line-height:48px;
  211. text-align: center
  212. ;padding-left: 5px;
  213. padding-right: 5px;
  214. position: relative;
  215. border: 1px solid gray;
  216. border-radius:5px;
  217. }
  218. #header a {
  219. color:white;
  220. text-decoration:none;
  221. }
  222. #wrapper {
  223. position:absolute; z-index:1;
  224. top:110px; bottom:0px; left:-9999px;
  225. width:100%;
  226. overflow:auto;
  227. }
  228. #scroller {
  229. position:absolute; z-index:1;
  230. /* -webkit-touch-callout:none;*/
  231. -webkit-tap-highlight-color:rgba(0,0,0,0);
  232. width:100%;
  233. padding:0;
  234. }
  235. #myFrame {
  236. position:absolute;
  237. top:0; left:0;
  238. }
  239. /**
  240. *
  241. * Pull down styles
  242. *
  243. */
  244. #pullDown, #pullUp {
  245. background:#fff;
  246. height:45px;
  247. line-height:45px;
  248. font-weight:bold;
  249. font-size:14px;
  250. color:#888;
  251. padding-left: 50%;
  252. margin-left:-54.5px;
  253. }
  254. #pullDown .pullDownIcon, #pullUp .pullUpIcon {
  255. display:block; float:left;
  256. width:40px; height:40px;
  257. background:url(../images/pull-icon@2x.png) 0 0 no-repeat;
  258. -webkit-background-size:40px 80px; background-size:40px 80px;
  259. -webkit-transition-property:-webkit-transform;
  260. -webkit-transition-duration:250ms;
  261. }
  262. #pullDown .pullDownIcon {
  263. -webkit-transform:rotate(0deg) translateZ(0);
  264. }
  265. #pullUp .pullUpIcon {
  266. -webkit-transform:rotate(-180deg) translateZ(0);
  267. }
  268. #pullDown.flip .pullDownIcon {
  269. -webkit-transform:rotate(-180deg) translateZ(0);
  270. }
  271. #pullUp.flip .pullUpIcon {
  272. -webkit-transform:rotate(0deg) translateZ(0);
  273. }
  274. #pullDown.loading .pullDownIcon, #pullUp.loading .pullUpIcon {
  275. background-position:0 100%;
  276. -webkit-transform:rotate(0deg) translateZ(0);
  277. -webkit-transition-duration:0ms;
  278. -webkit-animation-name:loading;
  279. -webkit-animation-duration:2s;
  280. -webkit-animation-iteration-count:infinite;
  281. -webkit-animation-timing-function:linear;
  282. }
  283. @-webkit-keyframes loading {
  284. from { -webkit-transform:rotate(0deg) translateZ(0); }
  285. to { -webkit-transform:rotate(360deg) translateZ(0); }
  286. }
  287. ul,li{padding: 0px;margin: 0px;}
  288. </style>
  289. </head>
  290. <body>
  291. <div id="header"><a>已办收文</a></div>
  292. <div class="sousuotiaojian">
  293. <input id="title" value="" type="text" style="width: 100%;background: white;color: gray;border: 0px">
  294. <img id="sousuo" alt="" src="../images/search-icon.png" style="width: 26px;height: 26px;position: absolute;top: 10px;right: 10px">
  295. </div>
  296. <div id="wrapper">
  297. <div id="scroller">
  298. <div id="pullDown" >
  299. <div><span class="pullDownIcon"></span><span class="pullDownLabel">下拉刷新...</span></div>
  300. </div>
  301. <div id="mui-content">
  302. <ul id="thelist mui-table-view" class="lists">
  303. </ul>
  304. </div>
  305. <div id="pullUp">
  306. </div>
  307. </div>
  308. </div>
  309. </body>
  310. </html>