Aucune description

Management.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Hello MUI</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <!--标准mui.css-->
  10. <link rel="stylesheet" href="../css/mui.min.css">
  11. <link rel="stylesheet" href="../css/iconfont.css" />
  12. <!--App自定义的css-->
  13. <!--<link rel="stylesheet" type="text/css" href="css/app.css" />-->
  14. <style>
  15. .mui-table h4,
  16. .mui-table h5,
  17. .mui-table .mui-h5,
  18. .mui-table .mui-h6,
  19. .mui-table p {
  20. margin-top: 0;
  21. }
  22. .mui-table h4 {
  23. line-height: 21px;
  24. font-size: 16px;
  25. font-weight: 500;
  26. }
  27. .mui-table .oa-icon {
  28. position: absolute;
  29. right: 0;
  30. bottom: 0;
  31. }
  32. .mui-table .oa-icon-star-filled {
  33. color: #f14e41;
  34. }
  35. .mui-bar-nav {
  36. background-color: #00a1cb;
  37. }
  38. .mui-action-back {
  39. color: #fff;
  40. }
  41. </style>
  42. </head>
  43. <body>
  44. <header class="mui-bar mui-bar-nav" style="padding-right: 15px;color: #fff;">
  45. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  46. <h1 class="mui-center mui-title">公告列表</h1>
  47. </header>
  48. <div class="mui-content" id="pullrefresh">
  49. <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed" id="order_list">
  50. <!--<li class="mui-table-view-cell">
  51. <div class="mui-input-row mui-search ">
  52. <input type="search" class="mui-input-clear go_search Width" placeholder="请输入关键字" style="margin-bottom: 0;">
  53. </div>
  54. </li>-->
  55. </ul>
  56. <span></span>
  57. </div>
  58. </body>
  59. <script src="../js/mui.min.js"></script>
  60. <script src="../js/zepto.js"></script>
  61. <script src="../js/huayi.config.js"></script>
  62. <script>
  63. mui.plusReady(function() {
  64. var page = 1; //页数
  65. var pageSize = 10; //每页显示条目
  66. var total; //数据总条数
  67. var token =localStorage.getItem("token"); //获取本地存储
  68. console.log(token);
  69. Ajax();
  70. mui.init({
  71. swipeBack: false,
  72. pullRefresh: {
  73. container: '#pullrefresh',
  74. up: {
  75. contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
  76. contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
  77. callback: pullupRefresh
  78. }
  79. }
  80. });
  81. //下拉刷新
  82. function pullupRefresh() {
  83. setTimeout(function() {
  84. mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
  85. mui.ajax(huayi.config.callcenter_url + 'Notice/GetList', {
  86. data: {
  87. token: token,
  88. page: page,
  89. pagesize: pageSize
  90. },
  91. dataType: 'json', //服务器返回json格式数据
  92. type: 'get', //HTTP请求类型
  93. timeout: 10000, //超时时间设置为10秒;
  94. headers: {
  95. 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
  96. },
  97. success: function(data) {
  98. var a = "";
  99. $(data.rows).each(function(i, n) {
  100. var T = n.F_CreateOn.substring(0, n.F_CreateOn.indexOf(' '));
  101. a = '<li class="mui-table-view-cell" index=' + n.F_NoticeId + '>' +
  102. '<div class="mui-table">' +
  103. '<div class="mui-table-cell mui-col-xs-8">' +
  104. '<h4 class="mui-ellipsis">' + n.F_Title + '</h4>' +
  105. '<h5> 有效日期:'+ n.F_EndDate + '</h5>' +
  106. '</div>' +
  107. '</div>' +
  108. '</li>'
  109. $(a).appendTo($("#order_list"));
  110. })
  111. De();
  112. },
  113. error: function(xhr, type, errorThrown) {
  114. //异常处理;
  115. }
  116. })
  117. }, 1000);
  118. }
  119. //初次加载
  120. function Ajax() {
  121. mui.ajax(huayi.config.callcenter_url + 'Notice/GetList', {
  122. data: {
  123. token: token,
  124. page: 1,
  125. pagesize: 10
  126. },
  127. dataType: 'json', //服务器返回json格式数据
  128. type: 'get', //HTTP请求类型
  129. timeout: 10000, //超时时间设置为10秒;
  130. headers: {
  131. 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
  132. },
  133. success: function(data) {
  134. total = data.total;
  135. console.log(total );
  136. var a = "";
  137. $(data.rows).each(function(i, n) {
  138. var T = n.F_CreateOn.substring(0, n.F_CreateOn.indexOf(' '));
  139. a = '<li class="mui-table-view-cell" index=' + n.F_NoticeId + '>' +
  140. '<div class="mui-table">' +
  141. '<div class="mui-table-cell mui-col-xs-8">' +
  142. '<h4 class="mui-ellipsis">' + n.F_Title + '</h4>' +
  143. '<h5>有效日期:' + n.F_EndDate + '</h5>' +
  144. '</div>' +
  145. '</div>' +
  146. '</li>'
  147. $(a).appendTo($("#order_list"));
  148. })
  149. De();
  150. },
  151. error: function(xhr, type, errorThrown) {
  152. //异常处理;
  153. }
  154. })
  155. }
  156. ////详情
  157. function De() {
  158. $(".mui-table-view-cell").on("tap", function() {
  159. var a = $(this).attr('index');
  160. mui.openWindow({
  161. id: 'Managment',
  162. url: 'Managment-detail.html',
  163. show: {
  164. aniShow: 'pop-in'
  165. },
  166. styles: {
  167. popGesture: 'hide'
  168. },
  169. waiting: {
  170. autoShow: false
  171. },
  172. extras: {
  173. name: a,
  174. token: token
  175. }
  176. });
  177. })
  178. }
  179. });
  180. </script>
  181. </html>