news.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <%
  8. String basePath = request.getScheme() + "://"
  9. + request.getServerName() + ":" + request.getServerPort()
  10. + request.getContextPath() + "/";
  11. %>
  12. <meta name="viewport"
  13. content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  14. <meta name="apple-mobile-web-app-capable" content="yes">
  15. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  16. <link rel="apple-touch-icon" href="images/apple-touch-icon.png" />
  17. <link rel="apple-touch-startup-image"
  18. href="images/apple-touch-startup-image-320x460.png" />
  19. <title>新闻公告</title>
  20. <base href="<%=basePath%>jsps/mobile/" />
  21. <link rel="stylesheet" href="style.css">
  22. <link rel="stylesheet" type='text/css' href="css/powerFloat.css">
  23. <link rel="stylesheet" type='text/css' href="css/xmenu.css">
  24. <link
  25. href='http://fonts.useso.com/css?family=Source+Sans+Pro:400,300,700,900'
  26. rel='stylesheet' type='text/css' />
  27. </head>
  28. <script type="text/javascript"
  29. src="<%=basePath%>resource/jquery/jquery-1.8.0.min.js"></script>
  30. <script type="text/javascript"
  31. src="<%=basePath%>resource/jquery/jquery-powerFloat-min.js"></script>
  32. <script type="text/javascript"
  33. src="<%=basePath%>resource/jquery/jquery-xmenu.js"></script>
  34. <script type="text/javascript">
  35. var basePath = (function() {
  36. var fullPath = window.document.location.href;
  37. var path = window.document.location.pathname;
  38. var subpos = fullPath.indexOf('//');
  39. var subpath = subpos > -1 ? fullPath.substring(0, subpos + 2) : '';
  40. if (subpos > -1)
  41. fullPath = fullPath.substring(subpos + 2);
  42. var pos = fullPath.indexOf(path), sname = path.substring(0, path.substr(1).indexOf('/') + 1);
  43. return subpath + fullPath.substring(0, pos) + (sname == '/ERP' ? '/ERP/' : '/');
  44. })();
  45. var hasshow = false, page = 1, pageSize = 10, notepage = 1, notePageSize = 10,currentType='content_news';
  46. window.onload = function() {
  47. new tab('info_li_now_','_',function() {
  48. currentType=this['id'];
  49. if(this['id']=='content_note' && $('#note>li').length==0){
  50. loadNoteData();
  51. }
  52. });
  53. };
  54. Date.prototype.Format = function(fmt) { //author: meizz
  55. var o = {
  56. "M+" : this.getMonth() + 1, //月份
  57. "d+" : this.getDate(), //日
  58. "h+" : this.getHours(), //小时
  59. "m+" : this.getMinutes(), //分
  60. "s+" : this.getSeconds(), //秒
  61. "q+" : Math.floor((this.getMonth() + 3) / 3), //季度
  62. "S" : this.getMilliseconds()
  63. //毫秒
  64. };
  65. if (/(y+)/.test(fmt))
  66. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "")
  67. .substr(4 - RegExp.$1.length));
  68. for ( var k in o)
  69. if (new RegExp("(" + k + ")").test(fmt))
  70. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k])
  71. : (("00" + o[k]).substr(("" + o[k]).length)));
  72. return fmt;
  73. };
  74. $(document).ready(
  75. function() {
  76. var lasttime=new Date();
  77. $("#selectpos").xMenu({
  78. width : 600,
  79. eventType : "click", //事件类型 支持focus click hover
  80. dropmenu : "#m1",//弹出层
  81. hiddenID : "selectposhidden"//隐藏域ID
  82. });
  83. $('#pages_maincontent').scroll(
  84. function() {
  85. if ($('#pages_maincontent').scrollTop() >= $(
  86. '#'+currentType+'_lists').height()
  87. - $(window).height()) {
  88. if(new Date().getTime()-lasttime>2000){
  89. lasttime=new Date();
  90. if(currentType=='content_news'){
  91. page += 1;
  92. loadData();
  93. }
  94. else {
  95. notepage += 1;
  96. loadNoteData();
  97. }
  98. }
  99. }
  100. });
  101. });
  102. function loadNoteData(){
  103. $("#background,#progressBar").show();
  104. $.ajax({
  105. type : "POST",
  106. url : basePath
  107. + "mobile/note/getNotesByPage.action",
  108. data : {
  109. page : notepage,
  110. pageSize : notePageSize
  111. },
  112. cache : true,
  113. success : function(result) {
  114. $("#background,#progressBar").hide();
  115. var data = result.note;
  116. $(data).each(
  117. function(index, item) {
  118. html = '';
  119. html += "<li class='swipeout'><div class='swipeout-content item-content'><div class='post_entry'>";
  120. html += '<div class="post_details"><h2><a href="../../mobile/note/noteDetail.action?id='+item.no_id+'">'
  121. + item.no_title
  122. + ".</a></h2><p>"
  123. + item.no_content
  124. + "</p><span class='post_date'>"
  125. + new Date(item.no_apptime).Format('yyyy-MM-dd hh:mm:ss.0')
  126. + "</span> <span class='post_author'><a href='#'>"
  127. + item.no_approver
  128. + "</a></span><span class='post_comments'><a href='#'>0</a></span></div>";
  129. html += "</div></div></li>";
  130. $('#note').append(html);
  131. });
  132. top = document.body.scrollTop;
  133. }
  134. });
  135. };
  136. function loadData() {
  137. var html;
  138. $("#background,#progressBar").show();
  139. $.ajax({
  140. type : "POST",
  141. url : basePath + "mobile/news/getNewsByPage.action",
  142. data : {
  143. page : page,
  144. pageSize : pageSize,
  145. },
  146. cache : true,
  147. success : function(result) {
  148. $("#background,#progressBar").hide();
  149. var data = result.news;
  150. $(data).each(
  151. function(index, item) {
  152. html = '';
  153. html += "<li class='swipeout'><div class='swipeout-content item-content'><div class='post_entry'>";
  154. html += "<div class='post_thumb'><img src="+item.headerImg+" alt='' title='' /></div>";
  155. html += "<div class='post_details'><h2><a href='#'>"
  156. + item.ne_theme+ ".</a></h2><p>"
  157. + item.ne_content
  158. + "</p><span class='post_date'>"
  159. + new Date(item.ne_releasedate).Format('yyyy-MM-dd hh:mm:ss.0')
  160. + "</span> <span class='post_author'><a href='#'>"
  161. + item.ne_releaser
  162. + "</a></span><span class='post_comments'><a href='#'>0</a></span></div>";
  163. html += "</div></div></li>";
  164. $('#posts').append(html);
  165. });
  166. top = document.body.scrollTop;
  167. }
  168. });
  169. };
  170. function showMenu() {
  171. if (!hasshow) {
  172. $("#selectpos").xMenu({
  173. width : 600,
  174. eventType : "click", //事件类型 支持focus click hover
  175. dropmenu : "#m1",//弹出层
  176. hiddenID : "selectposhidden"//隐藏域ID
  177. });
  178. hasshow = true;
  179. } else {
  180. $.powerFloat.hide();
  181. hasshow = false;
  182. }
  183. }
  184. function tab(o, s, cb, ev) { //tab切换类
  185. var $ = function(o) {
  186. return document.getElementById(o)
  187. };
  188. var css = o.split((s || '_'));
  189. if (css.length != 4)
  190. return;
  191. this.event = ev || 'onclick';
  192. o = $(o);
  193. if (o) {
  194. this.ITEM = [];
  195. o.id = css[0];
  196. var item = o.getElementsByTagName(css[1]);
  197. var j = 1;
  198. for (var i = 0; i < item.length; i++) {
  199. if (item[i].className.indexOf(css[2]) >= 0
  200. || item[i].className.indexOf(css[3]) >= 0) {
  201. if (item[i].className == css[2])
  202. o['cur'] = item[i];
  203. item[i].callBack = cb || function() {
  204. };
  205. item[i]['css'] = css;
  206. item[i]['link'] = o;
  207. this.ITEM[j] = item[i];
  208. item[i]['Index'] = j++;
  209. item[i][this.event] = this.ACTIVE;
  210. }
  211. }
  212. return o;
  213. }
  214. }
  215. tab.prototype = {
  216. ACTIVE : function() {
  217. var $ = function(o) {
  218. return document.getElementById(o)
  219. };
  220. this['link']['cur'].className = this['css'][3];
  221. this.className = this['css'][2];
  222. try {
  223. $(this['link']['id'] + '_' + this['link']['cur']['Index']).style.display = 'none';
  224. $(this['link']['id'] + '_' + this['Index']).style.display = 'block';
  225. } catch (e) {
  226. }
  227. this.callBack.call(this);
  228. this['link']['cur'] = this;
  229. }
  230. }
  231. </script>
  232. <style>
  233. .background {
  234. display: block;
  235. width: 100%;
  236. height: 100%;
  237. opacity: 0.4;
  238. filter: alpha(opacity=40);
  239. background:while;
  240. position: absolute;
  241. top: 0;
  242. left: 0;
  243. z-index: 2000;
  244. }
  245. .progressBar {
  246. display: block;
  247. width: 148px;
  248. height: 28px;
  249. position: fixed;
  250. top: 50%;
  251. left: 50%;
  252. margin-left: -74px;
  253. margin-top: -14px;
  254. padding: 10px 10px 10px 50px;
  255. text-align: left;
  256. line-height: 27px;
  257. font-size:13px;
  258. font-weight: bold;
  259. position: absolute;
  260. z-index: 2001;
  261. }
  262. .tab {
  263. height: 34px;
  264. margin: auto;
  265. text-align: center;
  266. }
  267. .tab ul {
  268. list-style-type: none;
  269. padding-left: 0px;
  270. }
  271. .tab li {
  272. display: inline-block;
  273. padding: 0 30px;
  274. height: 34px;
  275. line-height: 34px;
  276. font-size: 18px;
  277. text-align: center;
  278. /* border-bottom:1px #ebf7ff solid; */
  279. cursor: pointer;
  280. }
  281. .tab li.now {
  282. color: #5299c4;
  283. background: #fff;
  284. font-weight: bold;
  285. border-bottom: 1px #cfedff solid;
  286. font-size: 18px;
  287. }
  288. .tablist {
  289. padding: 10px;
  290. font-size: 14px;
  291. line-height: 24px; /* border:1px #cfedff solid; */
  292. border-top: 0;
  293. display: none;
  294. }
  295. .block {
  296. display: block;
  297. }
  298. .red {
  299. color: #BD0A01;
  300. }
  301. #c {
  302. margin-top: 10px;
  303. }
  304. .c1,.c2 { /* width:378px; */
  305. line-height: 20px;
  306. }
  307. .c1 {
  308. color: #014CC9;
  309. }
  310. .c2 {
  311. color: #7E6095;
  312. display: none;
  313. }
  314. /* h3{font-size:16px;padding:5px 0;} */
  315. </style>
  316. <body>
  317. <div class="pages navbar-through toolbar-through">
  318. <div data-page="projects" class="page no-toolbar no-navbar">
  319. <div class="page-content">
  320. <div class="navbarpages">
  321. <div class="navbar_home_link">
  322. <a href="javascript:window.location.reload();" data-panel="left"
  323. class="open-panel"><img src="../../resource/images/user.png"
  324. alt="" title="" /></a>
  325. </div>
  326. <div class="navbar_page_center">企业新闻</div>
  327. <div class="menu_open_icon_white">
  328. <a id="selectpos" href="javascript:showMenu();"><img
  329. src="../../resource/images/menu_open.png" alt="" title="" /> </a>
  330. </div>
  331. </div>
  332. <div id="pages_maincontent">
  333. <div class="tab">
  334. <ul id="info_li_now_">
  335. <li id="content_news" class="now">时事新闻</li>
  336. <li id="content_note">公告通知</li>
  337. </ul>
  338. </div>
  339. <div>
  340. <div id="info_1" class="tablist block">
  341. <div class="list-block" id="content_news_lists">
  342. <ul class="posts" id="posts">
  343. <c:forEach items="${news}" var="info">
  344. <li class="swipeout">
  345. <div class="swipeout-content item-content">
  346. <div class="post_entry">
  347. <div class="post_thumb">
  348. <img src="${info.headerImg}" alt="" title="" />
  349. </div>
  350. <div class="post_details">
  351. <h2>
  352. <a href="../../mobile/news/newsDetail.action?ne_id=${info.ne_id}">${info.ne_theme}.</a>
  353. </h2>
  354. <p>${info.ne_content}</p>
  355. <span class="post_date">${info.ne_releasedate}</span> <span
  356. class="post_author"><a href="#">${info.ne_releaser}</a></span>
  357. <span class="post_comments"><a href="#">0</a></span>
  358. </div>
  359. </div>
  360. </div>
  361. </li>
  362. </c:forEach>
  363. </ul>
  364. </div>
  365. </div>
  366. <!--系统公告 -->
  367. <div id="info_2" class="tablist">
  368. <div class="list-block" id="content_note_lists">
  369. <ul class="posts" id="note">
  370. </ul>
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. <div id="m1" class="xmenu" style="display: none;">
  378. <dl>
  379. <dt class="open">热门网站</dt>
  380. <dd>
  381. <ul>
  382. <li rel="1"><a href="http://3g.qq.com">腾讯</a></li>
  383. <li rel="2"><a href="http://www.sohu.com/">搜狐</a></li>
  384. <li rel="3"><a href="http://sina.cn/">新浪</a></li>
  385. <li rel="4"><a href="http://www.163.com/">网易</a></li>
  386. <li rel="5"><a href="http://www.baidu.com/">百度</a>&nbsp;•&nbsp;<a
  387. href="http://tieba.baidu.com/">贴吧</a></li>
  388. <li rel="6"><a href="http://www.tmall.com/">天猫</a></li>
  389. <li rel="7"><a href="http://www.taobao.com/">淘宝网</a></li>
  390. <li rel="8"><a href="http://www.jd.com/">京东</a></li>
  391. <li rel="8"><a href="http://www.ifeng.com/">凤凰网</a></li>
  392. <li rel="9"><a href="http://www.top81.com.cn/">军事头条</a></li>
  393. <li rel="10"><a href="http://china.nba.com/">NBA</a></li>
  394. </ul>
  395. </dd>
  396. <dt class="open">其他网站</dt>
  397. <dd>
  398. <ul>
  399. <li rel="1"><a href="http://sz.58.com/">58同城</a></li>
  400. <li rel="2"><a href="http://sz.fang.com/">搜房网</a></li>
  401. <li rel="3"><a href="http://www.ctrip.com/">携程网</a></li>
  402. <li rel="4"><a href="http://www.qunar.com/">去哪儿</a></li>
  403. <li rel="5"><a href="http://www.ganji.com/">赶集网</a></li>
  404. <li rel="6"><a href="http://n.vip.com/">唯品会</a></li>
  405. <li rel="7"><a href="http://www.tuniu.com//">途牛网</a></li>
  406. <li rel="8"><a href="http://www.renren.com/">人人网</a></li>
  407. <li rel="8"><a href="http://www.zhaopin.com/">智联招聘</a></li>
  408. <li rel="9"><a href="http://www.yhd.com/">1号店</a></li>
  409. <li rel="10"><a href="http://www.amazon.cn/">亚马逊</a></li>
  410. </ul>
  411. </dd>
  412. </dl>
  413. </div>
  414. </div>
  415. <div id="background" class="background" style="display: none; "></div>
  416. <div id="progressBar" class="progressBar" style="display: none; ">
  417. <img src="<%=basePath%>resource/images/loading.gif" alt="loading.." />加载中...</div>
  418. </body>
  419. </html>