ysfw.html 12 KB

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