| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- /* var informationsMap = Object.create(MAP); */
- function displayinformation(informations) {
- var html = "";
- for ( var i in informations) {
- if (i == 0 && informations[i].weight == 0) {
- html += "<li class='first_news' >"
- + "<table style='width:100%;height:100%;padding-bottom:40px;'><tr><td style='width:30%;background: url("
- + imageurl
- + informations[i].informationTime
- + "-1.jpg) no-repeat;background-size: contain;'></td><td style='padding-left:40px;'>"
- + "<p style='font-family: arial,\"Microsoft Yahei\",\"Hiragino Sans GB\",sans-serif;font-size: 22px;color: #000;'>"
- + informations[i].title
- + "</p>"
- + "<p style='font-family: arial,\"Microsoft Yahei\",\"Hiragino Sans GB\",sans-serif;font-size: 14px;color: #999;'>"
- + informations[i].informationTime
- + "</p>"
- + "<p style='font-family: arial,\"Microsoft Yahei\",\"Hiragino Sans GB\",sans-serif;font-size: 12px;color: #8c8c8c;line-height:24px;margin-bottom: 0;'>"
- + informations[i].subContent
- + "</p>"
- + "<p style='text-align: right;margin-top: 0;'><a href='javascript:void(0);' name="
- + informations[i].id
- + " id='news_more'>【详情】</a></p>"
- + "</td></tr></table>" + "</li>";
- /* informationsMap.Set(informations[i].id,
- informations[i].informationContent); */
- } else {
- html += "<li class='common_news' id="+informations[i].id+"><table style='width:100%;height:100%'><tr><td class='td_left'><span class='round'>•</span></td><td class='td_middle'>"
- + informations[i].title
- + "</td><td class='td_right'>"
- + informations[i].informationTime
- + "</td></tr></table></li>";
- /* informationsMap.Set(informations[i].id,
- informations[i].informationContent); */
- }
- }
- $("#all_news").html(html);
- $("#news_more").on("click", function() {
- /* var html = informationsMap.Get(this.name);
- html = html.replace(new RegExp(/(imageurl)/g), imageurl);
- $("#company_dynamic").html(html); */
- window.open(newsDetailUrl + this.name + ".html", '_blank');
- // 防止事件冒泡
- event.stopPropagation();
- });
- $(".common_news").on("click", function() {
- /* var html = informationsMap.Get(this.id); */
- /* html = html.replace(new RegExp(/(imageurl)/g), imageurl); */
- window.open(newsDetailUrl + this.id + ".html", '_blank');
- /* $("#company_dynamic").html(html); */
- });
- }
- function getinformation(pagesize, nextpage) {
- $.ajax({
- type : "GET",
- url : url + "informations/" + pagesize + "/" + nextpage
- + ".json",
- dataType : "json",
- contentType : "application/json",
- success : function(data) {
- if (data != null) {
- totalPage = data.pageCount;
- totalRecords = data.allrecodesCount;
- setpage(data.currentPage);
- //设置内容
- displayinformation(data.informations);
- }
- }
- });
- }
- var pagesize = 15;
- if (pageNo == null || pageNo == "") {
- getinformation(pagesize, 1);
- } else {
- getinformation(pagesize, pageNo);
- }
- var totalPage = 20;
- var totalRecords = 390;
- function setpage(currentpage) {
- if (!pageNo) {
- pageNo = currentpage;
- }
- //生成分页
- //有些参数是可选的,比如lang,若不传有默认值
- kkpager.generPageHtml({
- pno : pageNo,
- //总页码
- total : totalPage,
- //总数据条数
- totalRecords : totalRecords,
- mode : 'link',//默认值是link,可选link或者click
- getLink : function(n) {
- return "/about/news/" + n;
- }
- /* click : function(n) {
- // do something
- getinformation(pagesize, n);
- //手动选中按钮
- this.selectPage(n);
- return false;
- } */
- /*
- ,lang : {
- firstPageText : '首页',
- firstPageTipText : '首页',
- lastPageText : '尾页',
- lastPageTipText : '尾页',
- prePageText : '上一页',
- prePageTipText : '上一页',
- nextPageText : '下一页',
- nextPageTipText : '下一页',
- totalPageBeforeText : '共',
- totalPageAfterText : '页',
- currPageBeforeText : '当前第',
- currPageAfterText : '页',
- totalInfoSplitStr : '/',
- totalRecordsBeforeText : '共',
- totalRecordsAfterText : '条数据',
- gopageBeforeText : ' 转到',
- gopageButtonOkText : '确定',
- gopageAfterText : '页',
- buttonTipBeforeText : '第',
- buttonTipAfterText : '页'
- }*/
- });
- }
|