sjemail.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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. <style>
  13. .Hdel{
  14. position:absolute;
  15. right:-70px;
  16. width:70px;
  17. height: 64px;
  18. background-color: red;
  19. top: 0px;
  20. color: white;
  21. padding-top: 21px;
  22. text-align: center;
  23. }
  24. .Hdel a{
  25. color: white;
  26. }
  27. </style>
  28. <script type="text/javascript">
  29. var page =1;
  30. var rows =10;
  31. var sPosx = 0; //记录触碰时的x位置
  32. var sPosy = 0; //记录触碰时的y位置
  33. var mPosx = 0; //记录滑动时的x位置
  34. var mPosy = 0; //记录滑动时的y位置
  35. var nChangx = 0;//记录滑动结束时的x位置
  36. var nChangy = 0;//记录滑动结束时的y位置
  37. var statusname = {"1":"草稿","2":"已发送"}
  38. $(function(){
  39. $.ajax({
  40. type: 'post',
  41. url: '../../yjcontroller/findSjxAll.do',
  42. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:"",code:getQueryString("code")},
  43. dataType: 'json',
  44. success: function(data){
  45. console.log(data)
  46. console.log(data)
  47. var result = '';
  48. if(data.length==0)
  49. {
  50. layer.open({
  51. shade:false,
  52. content: '没有相关数据',
  53. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  54. time: 1
  55. });
  56. $('.lists').html('');
  57. return;
  58. }
  59. for(var i = 0; i < data.length; i++){
  60. result += '<li class="mui-table-view-cell mui-media"><a href="xiangqingemailSJ.html?id='+data[i].id+'" >'+
  61. '<div class="mui-media-body">'+data[i].title+
  62. '<p class="mui-ellipsis">发件人:<span style="color:rgb(33, 150, 243);">'+data[i].sendUserName+'</span> 发件日期:<span style="color:rgb(33, 150, 243);">'+todata(data[i].sendDate)+'</span> 状态:<span style="color:rgb(33, 150, 243);">'+statusname[data[i].status]+'</span></p>'+
  63. '</div>'+
  64. '</a><div class="Hdel" id="'+data[i].id+'"><a onclick="delbyid(\''+data[i].id+'\');">删除</a></div></li>';
  65. }
  66. $('.lists').html('');
  67. $('.lists').prepend(result);
  68. Hdel();
  69. if(data.length>=rows){
  70. showJZ();
  71. }else{
  72. hideJZ();
  73. }
  74. myScroll.refresh();
  75. }})
  76. })
  77. var myScroll,
  78. pullDownEl, pullDownOffset,
  79. pullUpEl, pullUpOffset,
  80. generatedCount = 0;
  81. function pullDownAction () {
  82. page = 1;
  83. rows = 8;
  84. $.ajax({
  85. type: 'post',
  86. url: '../../yjcontroller/findSjxAll.do',
  87. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  88. dataType: 'json',
  89. success: function(data){
  90. console.log(data)
  91. var result = '';
  92. if(data.length==0)
  93. {
  94. layer.open({
  95. shade:false,
  96. content: '没有相关数据',
  97. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  98. time: 1
  99. });
  100. $('.lists').html('');
  101. return;
  102. }
  103. for(var i = 0; i < data.length; i++){
  104. result += '<li class="mui-table-view-cell mui-media"><a href="xiangqingemailSJ.html?id='+data[i].id+'" >'+
  105. '<div class="mui-media-body">'+data[i].title+
  106. '<p class="mui-ellipsis">发件人:<span style="color:rgb(33, 150, 243);">'+data[i].sendUserName+'</span> 发件日期:<span style="color:rgb(33, 150, 243);">'+todata(data[i].sendDate)+'</span> 状态:<span style="color:rgb(33, 150, 243);">'+statusname[data[i].status]+'</span></p>'+
  107. '</div>'+
  108. '</a><div class="Hdel" id="'+data[i].id+'"><a onclick="delbyid(\''+data[i].id+'\');">删除</a></div></li>';
  109. }
  110. $('.lists').html('');
  111. $('.lists').prepend(result);
  112. Hdel();
  113. if(data.length>=rows){
  114. showJZ();
  115. }else{
  116. hideJZ();
  117. }
  118. myScroll.refresh();
  119. }})
  120. }
  121. function pullUpAction () {
  122. page+=1;
  123. $.ajax({
  124. type: 'post',
  125. url: '../../yjcontroller/findSjxAll.do',
  126. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  127. dataType: 'json',
  128. success: function(data){
  129. console.log(data)
  130. var result = '';
  131. if(data.length==0)
  132. {
  133. layer.open({
  134. shade:false,
  135. content: '没有相关数据',
  136. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  137. time: 1
  138. });
  139. $('.lists').html('');
  140. return;
  141. }
  142. for(var i = 0; i < data.length; i++){
  143. result += '<li class="mui-table-view-cell mui-media"><a href="xiangqingemailSJ.html?id='+data[i].id+'" >'+
  144. '<div class="mui-media-body">'+data[i].title+
  145. '<p class="mui-ellipsis">发件人:<span style="color:rgb(33, 150, 243);">'+data[i].sendUserName+'</span> 发件日期:<span style="color:rgb(33, 150, 243);">'+todata(data[i].sendDate)+'</span> 状态:<span style="color:rgb(33, 150, 243);">'+statusname[data[i].status]+'</span></p>'+
  146. '</div>'+
  147. '</a><div class="Hdel" id="'+data[i].id+'"><a onclick="delbyid(\''+data[i].id+'\');">删除</a></div></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. function delbyid(id){
  207. $.ajax({
  208. type: 'post',
  209. url: '../../yjcontroller/deleteMailUser.do',
  210. data:{
  211. mailIds:id,
  212. id:"402881e44e86c26d014e86c9ae8c0008"
  213. },
  214. dataType: 'json',
  215. success: function(data){
  216. if(data.resultCode){
  217. $("#"+id).parent().remove();
  218. }
  219. }
  220. });
  221. }
  222. function Hdel(){
  223. $(".mui-table-view-cell").each(function(){
  224. this.addEventListener('touchmove', function(event) {
  225. // 如果这个元素的位置内只有一个手指的话
  226. if (event.targetTouches.length == 1) {
  227.      event.preventDefault();// 阻止浏览器默认事件,重要
  228. var touch = event.targetTouches[0];
  229. mPosx = touch.pageX;
  230. mPosy = touch.pageY;
  231. }
  232. }, false);
  233. this.addEventListener('touchend', function(event) {
  234. // 如果这个元素的位置内只有一个手指的话
  235. if (event.changedTouches.length == 1) {
  236.      event.preventDefault();// 阻止浏览器默认事件,重要
  237. var touch = event.changedTouches[0];
  238. nChangx = touch.pageX;
  239. nChangy = touch.pageY;
  240. if(nChangx - sPosx < -150){
  241. $(".Hdel").animate({right: '-70px'}, "slow");
  242. $(this).find(".Hdel").animate({right: '0px'}, "50");
  243. }else if(nChangx - sPosx > 50){
  244. $(this).find(".Hdel").animate({right: '-70px'}, "50");
  245. }
  246. }
  247. }, false);
  248. this.addEventListener('touchstart', function(event) {
  249. // 如果这个元素的位置内只有一个手指的话
  250. if (event.targetTouches.length == 1) {
  251.      event.preventDefault();// 阻止浏览器默认事件,重要
  252. var touch = event.targetTouches[0];
  253. sPosx = touch.pageX;
  254. sPosy = touch.pageY;
  255. }
  256. }, false);
  257. });
  258. }
  259. document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
  260. document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);
  261. </script>
  262. <style type="text/css" media="all">
  263. #header {
  264. position:absolute; z-index:2;
  265. top:0; left:0;
  266. width:100%;
  267. height:45px;
  268. line-height:45px;
  269. padding:0;
  270. color:#eee;
  271. font-size:22px;
  272. text-align:center;
  273. color:white;
  274. background: #2196f3;
  275. }
  276. #header a {
  277. color:white;
  278. text-decoration:none;
  279. }
  280. #wrapper {
  281. position:absolute; z-index:1;
  282. top: 45px; bottom:0px; left:-9999px;
  283. width:100%;
  284. overflow:auto;
  285. }
  286. #scroller {
  287. position:absolute; z-index:1;
  288. /* -webkit-touch-callout:none;*/
  289. -webkit-tap-highlight-color:rgba(0,0,0,0);
  290. width:100%;
  291. padding:0;
  292. }
  293. #myFrame {
  294. position:absolute;
  295. top:0; left:0;
  296. }
  297. /**
  298. *
  299. * Pull down styles
  300. *
  301. */
  302. #pullDown, #pullUp {
  303. background:#fff;
  304. height:45px;
  305. line-height:45px;
  306. font-weight:bold;
  307. font-size:14px;
  308. color:#888;
  309. padding-left: 50%;
  310. margin-left:-54.5px;
  311. }
  312. #pullDown .pullDownIcon, #pullUp .pullUpIcon {
  313. display:block; float:left;
  314. width:40px; height:40px;
  315. background:url(../images/pull-icon@2x.png) 0 0 no-repeat;
  316. -webkit-background-size:40px 80px; background-size:40px 80px;
  317. -webkit-transition-property:-webkit-transform;
  318. -webkit-transition-duration:250ms;
  319. }
  320. #pullDown .pullDownIcon {
  321. -webkit-transform:rotate(0deg) translateZ(0);
  322. }
  323. #pullUp .pullUpIcon {
  324. -webkit-transform:rotate(-180deg) translateZ(0);
  325. }
  326. #pullDown.flip .pullDownIcon {
  327. -webkit-transform:rotate(-180deg) translateZ(0);
  328. }
  329. #pullUp.flip .pullUpIcon {
  330. -webkit-transform:rotate(0deg) translateZ(0);
  331. }
  332. #pullDown.loading .pullDownIcon, #pullUp.loading .pullUpIcon {
  333. background-position:0 100%;
  334. -webkit-transform:rotate(0deg) translateZ(0);
  335. -webkit-transition-duration:0ms;
  336. -webkit-animation-name:loading;
  337. -webkit-animation-duration:2s;
  338. -webkit-animation-iteration-count:infinite;
  339. -webkit-animation-timing-function:linear;
  340. }
  341. @-webkit-keyframes loading {
  342. from { -webkit-transform:rotate(0deg) translateZ(0); }
  343. to { -webkit-transform:rotate(360deg) translateZ(0); }
  344. }
  345. ul,li{padding: 0px;margin: 0px;}
  346. </style>
  347. </head>
  348. <body>
  349. <div id="header"><a>收件箱</a></div>
  350. <div id="wrapper">
  351. <div id="scroller">
  352. <div id="pullDown" >
  353. <div><span class="pullDownIcon"></span><span class="pullDownLabel">下拉刷新...</span></div>
  354. </div>
  355. <div id="mui-content">
  356. <ul id="thelist mui-table-view" class="lists">
  357. </ul>
  358. </div>
  359. <div id="pullUp">
  360. </div>
  361. </div>
  362. </div>
  363. </body>
  364. </html>