tab-webview-subpage-app.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. <link href="css/mui.min.css" rel="stylesheet" />
  10. <link href="css/mui.indexedlist.css" rel="stylesheet" />
  11. <link href="css/OA-style.css" rel="stylesheet" />
  12. <style type="text/css">
  13. .mui-content>.mui-table-view:first-child {
  14. margin-top: -1px;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <div class="mui-content">
  20. <ul class="mui-table-view mui-grid-view mui-grid-9" id="grid">
  21. <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" id="attendance">
  22. <a href="attendance.html">
  23. <div class="media-body-img"><img src="images/yy_kq.png"></div>
  24. <div class="mui-media-body">考勤管理</div>
  25. </a>
  26. </li>
  27. <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" id="process">
  28. <a href="#">
  29. <div class="media-body-img"><img src="images/yy_splc.png"></div>
  30. <div class="mui-media-body">流程管理</div>
  31. </a>
  32. </li>
  33. <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" id="notice">
  34. <a href="#">
  35. <div class="media-body-img"><img src="images/yy_tzgg.png"></div>
  36. <div class="mui-media-body">通知公告</div>
  37. </a>
  38. </li>
  39. <!-- <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" id="schedule">
  40. <a href="#">
  41. <div class="media-body-img"><img src="images/index_richeng.png"></div>
  42. <div class="mui-media-body">我的日程</div>
  43. </a>
  44. </li> -->
  45. <!--<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" id="document">
  46. <a href="#">
  47. <div class="media-body-img"><img src="images/yy_fmwjcy.png"></div>
  48. <div class="mui-media-body">公文管理</div>
  49. </a>
  50. </li>
  51. <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" id="office">
  52. <a href="#">
  53. <div class="media-body-img"><img src="images/yy_wpgl.png"></div>
  54. <div class="mui-media-body">日常办公</div>
  55. </a>
  56. </li>-->
  57. <!-- <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" id="meeting">
  58. <a href="#">
  59. <div class="media-body-img"><img src="images/meeting.png"></div>
  60. <div class="mui-media-body">会议通知</div>
  61. </a>
  62. </li> -->
  63. </ul>
  64. </div>
  65. </body>
  66. <script type="text/javascript" src="js/jquery.min.js"></script>
  67. <script src="js/mui.min.js"></script>
  68. <script src="js/config.js"></script>
  69. <script>
  70. mui.init({
  71. swipeBack: true //启用右滑关闭功能
  72. });
  73. mui.plusReady(function() {
  74. mui('#grid').on('tap', 'li', function() {
  75. // if(this.getAttribute("id") == 'notice') {
  76. // mui.openWindow({
  77. // url: 'page/notice/noticeFolder.html',
  78. // id: 'noticeFolder.html'
  79. // })
  80. //
  81. // } else
  82. if(this.getAttribute("id") == 'attendance') {
  83. mui.openWindow({
  84. url: 'page/attendance/attendance.html',
  85. id: 'attendance.html'
  86. })
  87. }
  88. else if(this.getAttribute("id") == 'notice') {//通知公告
  89. mui.openWindow({
  90. url: 'page/notice/noticeList.html',
  91. id: 'noticeList.html'
  92. })
  93. }
  94. // else if(this.getAttribute("id") == 'food') {
  95. // mui.openWindow({
  96. // url: 'page/food/foodFolder.html',
  97. // id: 'foodFolder.html'
  98. // })
  99. // }
  100. else if(this.getAttribute("id") == 'process') {
  101. mui.openWindow({
  102. url: 'page/flow/flow_main.html',
  103. id: 'flow_main.html'
  104. })
  105. }
  106. // else if(this.getAttribute("id") == 'materials') {
  107. // mui.openWindow({
  108. // url: 'page/material/materialFolder.html',
  109. // id: 'materialFolder.html'
  110. // })
  111. // } else if(this.getAttribute("id") == 'efficiency') {
  112. // mui.openWindow({
  113. // url: 'page/efficiency/efficiency.html',
  114. // id: 'efficiency.html'
  115. // })
  116. // }
  117. else if(this.getAttribute("id")=='schedule'){
  118. mui.openWindow({
  119. url:'page/schedule/scheduleList.html',
  120. id:'scheduleList.html'
  121. })
  122. }
  123. // else if(this.getAttribute("id")=='trip'){
  124. // mui.openWindow({
  125. // url:'page/trip/tripFolder.html',
  126. // id:'tripFolder.html'
  127. // })
  128. // }
  129. else if(this.getAttribute("id")=='document'){
  130. mui.openWindow({
  131. url:'page/document/document.html',
  132. id:'document.html'
  133. })
  134. }
  135. else if(this.getAttribute("id")=='office'){
  136. mui.openWindow({
  137. url:'page/office/office.html',
  138. id:'office.html'
  139. })
  140. }
  141. else if(this.getAttribute("id")=='meeting'){ //会议通知
  142. mui.openWindow({
  143. url:'page/meeting/meetingFolder.html',
  144. id:'meetingFolder.html'
  145. })
  146. }
  147. })
  148. //自定义事件,模拟点击“首页选项卡”
  149. document.addEventListener('appEvent', function() {
  150. // alert(22);
  151. // getNotice();
  152. });
  153. //公告点击事件
  154. // var pageDetail = mui.preload({
  155. // url: 'page/article/detailList.html',
  156. // id: 'detailList.html',
  157. // })
  158. // mui('#noticeList').on('tap', 'li', function() {
  159. // mui.fire(pageDetail, 'newsEvent', {
  160. // 'articleId': this.getAttribute('articleId')
  161. // })
  162. // mui.openWindow({
  163. // url: 'page/article/detailList.html',
  164. // id: 'detailList.html'
  165. // })
  166. // })
  167. })
  168. // function timer(opj) {
  169. // $(opj).find('ul').animate({
  170. // marginTop: "-1.5rem"
  171. // }, 500, function() {
  172. // $(this).css({
  173. // marginTop: "0.75rem"
  174. // }).find("li:first").appendTo(this);
  175. // })
  176. // }
  177. // $(function() {
  178. // var num = $('.notice_active').find('li').length;
  179. // if(num > 1) {
  180. // var time = setInterval('timer(".notice_active")', 3500);
  181. // $('.gg_more a').mousemove(function() {
  182. // clearInterval(time);
  183. // }).mouseout(function() {
  184. // time = setInterval('timer(".notice_active")', 3500);
  185. // });
  186. // }
  187. // $(".news_ck").click(function() {
  188. // location.href = $(".notice_active .notice_active_ch").children(":input").val();
  189. // })
  190. // });
  191. //获取最新5条公告
  192. function getNotice() {
  193. var url = API.API_URL();
  194. mui.ajax(url, {
  195. dataType: 'json', //服务器返回json格式数据
  196. type: 'post', //HTTP请求类型
  197. data: {
  198. method: 'pageArticle',
  199. pageNo: 1,
  200. pageSize: 5,
  201. p: '{folderId:291}'
  202. },
  203. timeout: 10000, //超时时间设置为10秒;
  204. headers: {
  205. 'Accept': 'application/json'
  206. },
  207. success: function(data) {
  208. //服务器返回响应
  209. console.log(JSON.stringify(data))
  210. var response = data;
  211. var obj = eval(response);
  212. var totalRow = obj.data.totalRow;
  213. var totalPage = obj.data.totalPage;
  214. var list = obj.data.list;
  215. var table = document.body.querySelector('#noticeList');
  216. //$('#noticeList').empty();
  217. table.innerHTML = ''; //清空公告
  218. for(var i = 0, len = list.length; i < len; i++) {
  219. var listTitle = list[i].title;
  220. var articleId = list[i].id;
  221. var li = document.createElement('li');
  222. li.setAttribute("articleId", articleId);
  223. li.className = 'notice_active_ch';
  224. li.innerHTML = '<span>' + listTitle + '</span>';
  225. table.appendChild(li);
  226. }
  227. // var num = $('.notice_active').find('li').length;
  228. // alert(num +'=='+totalRow);
  229. var time = null;
  230. if(totalRow > 1) {
  231. // clearInterval(time);
  232. if(time == null) {
  233. // time = setInterval('timer(".notice_active")', 3500);
  234. }
  235. // $('.gg_more a').mousemove(function() {
  236. // clearInterval(time);
  237. // }).mouseout(function() {
  238. // time = setInterval('timer(".notice_active")', 3500);
  239. // });
  240. }
  241. },
  242. error: function(xhr, type, errorThrown) {
  243. //异常处理;
  244. console.log(type);
  245. }
  246. });
  247. }
  248. </script>
  249. </html>