tongxunlu.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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 deletes(id){
  16. layer.open({
  17. content: '确定删除吗?',
  18. btn: ['取消', '确定'],
  19. shadeClose: false,
  20. yes: function(){
  21. layer.closeAll()
  22. }, no: function(){
  23. $.ajax({
  24. type: 'post',
  25. url: '../../txlcontroller/deletetxl.do',
  26. data:{id:id,uid:"402881e44e86c26d014e86c9ae8c0008",code:getQueryString("code")},
  27. dataType: 'json',
  28. success: function(data){
  29. if(data.resultCode==0){
  30. layer.open({
  31. shade:false,
  32. content: '删除成功',
  33. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  34. time:1
  35. });
  36. setTimeout(function(){
  37. window.location.reload();
  38. },500);
  39. }
  40. }
  41. })
  42. }})
  43. }
  44. $(function(){
  45. $.ajax({
  46. type: 'post',
  47. url: '../../txlcontroller/queryAlltxl.do',
  48. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  49. dataType: 'json',
  50. success: function(data){
  51. console.log(data)
  52. var result = '';
  53. if(data.length==0)
  54. {
  55. layer.open({
  56. shade:false,
  57. content: '没有相关数据',
  58. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  59. time: 1
  60. });
  61. $('.lists').html('');
  62. return;
  63. }
  64. for(var i = 0; i < data.length; i++){
  65. result += '<li class="mui-table-view-cell mui-media">'+
  66. '<div class="mui-media-body">'+
  67. '姓名:'+data[i].name+
  68. '<p class="mui-ellipsis">所属部门:<a>'+data[i].orgname+'</a> </p>'+
  69. '<p class="mui-ellipsis">固定电话:<span style="color:rgb(33, 150, 243);"><a href="tel:'+data[i].tel+'">'+data[i].tel+
  70. '</a></span></br>移动电话:<span style="color:rgb(33, 150, 243);"><a href="tel:'+data[i].mobile+'">'+data[i].mobile+'</a></span></p>'+
  71. '</div>'+
  72. '<span onclick="window.location.href=\'deltx.html?id='+data[i].id+'\'" class="mui-icon mui-icon-compose upjihua"></span><span onclick="deletes(\''+data[i].id+'\')" class="mui-icon mui-icon-trash"></span></li>';
  73. }
  74. $('.lists').html('');
  75. $('.lists').prepend(result);
  76. if(data.length>=rows){
  77. showJZ();
  78. }else{
  79. hideJZ();
  80. }
  81. myScroll.refresh();
  82. }})
  83. $("#sousuo").on("click",function(){
  84. // var title=$("#title").val();
  85. page = 1;
  86. $.ajax({
  87. type: 'post',
  88. url: '../../txlcontroller/queryAlltxl.do',
  89. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  90. dataType: 'json',
  91. success: function(data){
  92. if(data.length<1){
  93. layer.open({
  94. shade:false,
  95. content: '没有搜索到相关数据',
  96. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  97. time: 1
  98. });
  99. $('.lists').html('');
  100. return;
  101. }else{
  102. var result = '';
  103. for(var i = 0; i < data.length; i++){
  104. result += '<li class="mui-table-view-cell mui-media">'+
  105. '<div class="mui-media-body">'+
  106. '姓名:'+data[i].name+
  107. '<p class="mui-ellipsis">所属部门:<a>'+data[i].orgname+'</a> </p>'+
  108. '<p class="mui-ellipsis">固定电话:<span style="color:rgb(33, 150, 243);"><a href="tel:'+data[i].tel+'">'+data[i].tel+
  109. '</a></span></br>移动电话:<span style="color:rgb(33, 150, 243);"><a href="tel:'+data[i].mobile+'">'+data[i].mobile+'</a></span></p>'+
  110. '</div>'+
  111. '<span onclick="window.location.href=\'deltx.html?id='+data[i].id+'\'" class="mui-icon mui-icon-compose upjihua"></span><span onclick="deletes(\''+data[i].id+'\')" class="mui-icon mui-icon-trash"></span></li>';
  112. }
  113. if(data.length<rows){
  114. hideJZ();
  115. }else{
  116. showJZ();
  117. }
  118. $('.lists').html('');
  119. $('.lists').prepend(result);
  120. myScroll.refresh();
  121. }
  122. }})
  123. })
  124. })
  125. var myScroll,
  126. pullDownEl, pullDownOffset,
  127. pullUpEl, pullUpOffset,
  128. generatedCount = 0;
  129. function pullDownAction () {
  130. page = 1;
  131. $.ajax({
  132. type: 'post',
  133. url: '../../txlcontroller/queryAlltxl.do',
  134. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  135. dataType: 'json',
  136. success: function(data){
  137. var result = '';
  138. for(var i = 0; i < data.length; i++){
  139. result += '<li class="mui-table-view-cell mui-media">'+
  140. '<div class="mui-media-body">'+
  141. '姓名:'+data[i].name+
  142. '<p class="mui-ellipsis">所属部门:<a>'+data[i].orgname+'</a> </p>'+
  143. '<p class="mui-ellipsis">固定电话:<span style="color:rgb(33, 150, 243);"><a href="tel:'+data[i].tel+'">'+data[i].tel+
  144. '</a></span></br>移动电话:<span style="color:rgb(33, 150, 243);"><a href="tel:'+data[i].mobile+'">'+data[i].mobile+'</a></span></p>'+
  145. '</div>'+
  146. '<span onclick="window.location.href=\'deltx.html?id='+data[i].id+'\'" class="mui-icon mui-icon-compose upjihua"></span><span onclick="deletes(\''+data[i].id+'\')" class="mui-icon mui-icon-trash"></span></li>';
  147. }
  148. $('.lists').html('');
  149. $('.lists').prepend(result);
  150. if(data.length>=rows){
  151. showJZ();
  152. }else{
  153. hideJZ();
  154. }
  155. myScroll.refresh();
  156. }})
  157. }
  158. function pullUpAction () {
  159. page+=1;
  160. $.ajax({
  161. type: 'post',
  162. url: '../../txlcontroller/queryAlltxl.do',
  163. data:{uid:"402881e44e86c26d014e86c9ae8c0008",page:page,rows:rows,no:"",title:$("#title").val(),start:"",stop:""},
  164. dataType: 'json',
  165. success: function(data){
  166. var result = '';
  167. for(var i = 0; i < data.length; i++){
  168. result += '<li class="mui-table-view-cell mui-media">'+
  169. '<div class="mui-media-body">'+
  170. '姓名:'+data[i].name+
  171. '<p class="mui-ellipsis">所属部门:<a>'+data[i].orgname+'</a> </p>'+
  172. '<p class="mui-ellipsis">固定电话:<span style="color:rgb(33, 150, 243);"><a href="tel:'+data[i].tel+'">'+data[i].tel+
  173. '</a></span></br>移动电话:<span style="color:rgb(33, 150, 243);"><a href="tel:'+data[i].mobile+'">'+data[i].mobile+'</a></span></p>'+
  174. '</div>'+
  175. '<span onclick="window.location.href=\'deltx.html?id='+data[i].id+'\'" class="mui-icon mui-icon-compose upjihua"></span><span onclick="deletes(\''+data[i].id+'\')" class="mui-icon mui-icon-trash"></span></li>';
  176. }
  177. $('.lists').append(result);
  178. if(data.length<rows){
  179. wcJZ();
  180. }
  181. myScroll.refresh();
  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. .sousuotiaojian{
  252. position: absolute;
  253. left:0px;
  254. margin:0px;
  255. top:45px;
  256. height:48px;
  257. line-height:48px;
  258. text-align: center
  259. ;padding-left: 5px;
  260. padding-right: 5px;
  261. position: relative;
  262. border: 1px solid gray;
  263. border-radius:5px;
  264. }
  265. #header a {
  266. color:white;
  267. text-decoration:none;
  268. }
  269. #wrapper {
  270. position:absolute; z-index:1;
  271. top:110px; bottom:0px; left:-9999px;
  272. width:100%;
  273. overflow:auto;
  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. .mui-icon-trash:before {
  287. content: "\e401";
  288. font-size: 25px;
  289. position: absolute;
  290. right: 10px;
  291. bottom: 20px;
  292. bottom: 10px;
  293. }
  294. .mui-icon-compose:before {
  295. content: "\e400";
  296. font-size: 25px;
  297. position: absolute;
  298. right: 40px;
  299. bottom: 10px;
  300. }
  301. /**
  302. *
  303. * Pull down styles
  304. *
  305. */
  306. #pullDown, #pullUp {
  307. background:#fff;
  308. height:45px;
  309. line-height:45px;
  310. font-weight:bold;
  311. font-size:14px;
  312. color:#888;
  313. padding-left: 50%;
  314. margin-left:-54.5px;
  315. }
  316. .mui-table-view-cell {
  317. position: relative;
  318. padding: 11px 15px;
  319. overflow: hidden;
  320. padding-bottom: 0px;
  321. background-color: inherit;
  322. -webkit-touch-callout: none;
  323. }
  324. #pullDown .pullDownIcon, #pullUp .pullUpIcon {
  325. display:block; float:left;
  326. width:40px; height:40px;
  327. background:url(../images/pull-icon@2x.png) 0 0 no-repeat;
  328. -webkit-background-size:40px 80px; background-size:40px 80px;
  329. -webkit-transition-property:-webkit-transform;
  330. -webkit-transition-duration:250ms;
  331. }
  332. #pullDown .pullDownIcon {
  333. -webkit-transform:rotate(0deg) translateZ(0);
  334. }
  335. #pullUp .pullUpIcon {
  336. -webkit-transform:rotate(-180deg) translateZ(0);
  337. }
  338. #pullDown.flip .pullDownIcon {
  339. -webkit-transform:rotate(-180deg) translateZ(0);
  340. }
  341. #pullUp.flip .pullUpIcon {
  342. -webkit-transform:rotate(0deg) translateZ(0);
  343. }
  344. #pullDown.loading .pullDownIcon, #pullUp.loading .pullUpIcon {
  345. background-position:0 100%;
  346. -webkit-transform:rotate(0deg) translateZ(0);
  347. -webkit-transition-duration:0ms;
  348. -webkit-animation-name:loading;
  349. -webkit-animation-duration:2s;
  350. -webkit-animation-iteration-count:infinite;
  351. -webkit-animation-timing-function:linear;
  352. }
  353. @-webkit-keyframes loading {
  354. from { -webkit-transform:rotate(0deg) translateZ(0); }
  355. to { -webkit-transform:rotate(360deg) translateZ(0); }
  356. }
  357. ul,li{padding: 0px;margin: 0px;}
  358. a {
  359. color:;
  360. text-decoration: none;
  361. }
  362. </style>
  363. </head>
  364. <body>
  365. <div id="header"><a>通讯录</a>
  366. <button id="todaybutton" onclick="window.location.href='xinzengtx.html'"
  367. style="background-color: #2981e4; border-radius: 5px; border: 0px; font-size: 20px; padding-left: 10px; padding-right: 10px; padding-top: 2px; padding-bottom: 2px; color: white; position: fixed; right: 10px; top: 7px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); cursor: pointer;">添加</button>
  368. </div>
  369. <div class="sousuotiaojian">
  370. <input id="title" value="" type="text" style="width: 100%;background: white;color: gray;border: 0px">
  371. <img id="sousuo" alt="" src="../images/search-icon.png" style="width: 26px;height: 26px;position: absolute;top: 10px;right: 10px">
  372. </div>
  373. <div id="wrapper">
  374. <div id="scroller">
  375. <div id="pullDown" >
  376. <div><span class="pullDownIcon"></span><span class="pullDownLabel">下拉刷新...</span></div>
  377. </div>
  378. <div id="mui-content">
  379. <ul id="thelist mui-table-view" class="lists">
  380. </ul>
  381. </div>
  382. <div id="pullUp">
  383. </div>
  384. </div>
  385. </div>
  386. </body>
  387. </html>