index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <!doctype html>
  2. <html manifest="weixin.appcache">
  3. <head>
  4. <title>X3手机平台</title>
  5. <meta charset="utf-8">
  6. <script src="assets/js/importJs.js"></script>
  7. <script type="text/javascript">
  8. Handlebars.registerHelper("arySize",function(ary,options){
  9. if(ary.length>0){
  10. return options.fn(this);
  11. }else{
  12. return options.inverse(this);
  13. }
  14. });
  15. </script>
  16. <style type="text/css">
  17. #contentDiv{
  18. height:-webkit-calc(100% );
  19. height:calc(100% );
  20. overflow:auto ;
  21. }
  22. </style>
  23. </head>
  24. <body onload="init()">
  25. <header data-am-widget="header" class="am-header am-header-default am-header-fixed">
  26. <h1 class="am-header-title">
  27. <a href="#title-link" class="" id="title"> X3手机平台 V1</a>
  28. </h1>
  29. <div class="am-header-right am-header-nav">
  30. <a href="../logout" class="" alt="退出系统" >
  31. <i class="am-header-icon fa fa-sign-out"></i>
  32. </a>
  33. </div>
  34. </header>
  35. <script type="text/x-handlebars-template" id="amz-tpl">
  36. <div data-am-widget="list_news" class="am-list-news am-list-news-default" >
  37. <div class="am-list-news-hd am-cf">
  38. <a href="bpm/myToDo.html" class="">
  39. <h2>我的待办</h2>
  40. <span class="am-list-news-more am-fr">更多 &raquo;</span>
  41. </a>
  42. </div>
  43. <div class="am-list-news-bd">
  44. {{#arySize task}}
  45. <ul class="am-list">
  46. {{#each task}}
  47. <li class="am-g am-list-item-dated">
  48. <a href="bpm/task.html?taskId={{id}}&defId={{defId}}&runId={{runId}}" class="am-list-item-hd">{{{subject}}}</a>
  49. <div class="am-list-item-text">发起时间:{{createTime}} 发起人:{{creator}}</div>
  50. <div class="am-list-item-text">当前节点:{{nodename}}</div>
  51. </li>
  52. {{/each}}
  53. </ul>
  54. {{else}}
  55. <div class="am-badge am-badge-secondary am-radius am-icon fa fa-info-circle am-text-xl">当前你还没有代办数据</div>
  56. {{/arySize}}
  57. </div>
  58. </div>
  59. <div data-am-widget="list_news" class="am-list-news am-list-news-default" >
  60. <div class="am-list-news-hd am-cf">
  61. <a href="bulletin/column.html" class="">
  62. <h2>最新公告</h2>
  63. <span class="am-list-news-more am-fr">更多 &raquo;</span>
  64. </a>
  65. </div>
  66. <div class="am-list-news-bd">
  67. <ul class="am-list">
  68. {{#each bulletin}}
  69. <li class="am-g am-list-item-dated">
  70. <a href="bulletin/detail.html?bulletinId={{id}}" class="am-list-item-hd ">{{{subject}}}</a>
  71. <span class="am-list-date">{{date}}</span>
  72. </li>
  73. {{/each}}
  74. </ul>
  75. </div>
  76. </div>
  77. </script>
  78. <script type="text/javascript">
  79. $(function(){
  80. loadData();
  81. });
  82. function loadData(){
  83. if(navigator.onLine){
  84. var $tpl = $('#amz-tpl');
  85. var $modal = $('#my-modal-loading');
  86. var tpl = $tpl.html();
  87. var template = Handlebars.compile(tpl);
  88. var url="index.ht";
  89. $modal.modal();
  90. $.get(url,function(obj){
  91. if(!obj.curUser){
  92. window.location.href = "login.html";
  93. return;
  94. }
  95. var title="X3手机平台[" + obj.curUser +"]";
  96. $("#title").html(title);
  97. html = template(obj);
  98. $("#contentDiv").html(html);
  99. $modal.modal('close');
  100. });
  101. }
  102. else{
  103. var title="X3手机平台";
  104. $("#title").html(title);
  105. $("#contentDiv").html('<div class="am-badge am-badge-warning am-radius am-icon fa fa-info-circle am-text-xl">当前网络已离线</div>');
  106. }
  107. }
  108. function init(){
  109. //一分钟检查一次服务端的weixin.appcache文件。
  110. setInterval(function(){
  111. applicationCache.update();
  112. },6000);
  113. //如果文件有更新那么清空本地缓存并刷新主界面。
  114. applicationCache.addEventListener("updateready",function(){
  115. console.info("手工更新缓存");
  116. applicationCache.swapCache();
  117. location.reload();
  118. });
  119. //离线判断
  120. window.addEventListener("offline", function(e) {loadData();})
  121. window.addEventListener("online", function(e) {loadData();})
  122. }
  123. </script>
  124. <div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="my-modal-loading">
  125. <div class="am-modal-dialog">
  126. <div class="am-modal-hd">正在加载数据请稍候...</div>
  127. <div class="am-modal-bd">
  128. <span class="am-icon-spinner am-icon-spin"></span>
  129. </div>
  130. </div>
  131. </div>
  132. <div id="contentDiv" >
  133. </div>
  134. <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default " >
  135. <ul class="am-navbar-nav am-cf am-avg-sm-4">
  136. <li>
  137. <a href="bulletin/column.html" class="">
  138. <i class="am-icon-rss"></i>
  139. <span class="am-navbar-label">公司公告</span>
  140. </a>
  141. </li>
  142. <li>
  143. <a href="bpm/index.html" >
  144. <i class="am-icon-share-alt-square"></i>
  145. <span class="am-navbar-label">流程中心</span>
  146. </a>
  147. </li>
  148. </ul>
  149. </div>
  150. </body>
  151. </html>