scwd.html 11 KB

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