dbgg.html 14 KB

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