var contentArray = new Array(); function loadData(obj,time,page){ tmpObj = obj; searchType = time; if(typeof(page)=='undefined'){ page = 1; } var pageCount = 12; $(obj).addClass("active").siblings().removeClass(); var startTime = ''; var endTime = ''; if(time=='week'){ searchType = 'week'; startTime = getDay(-7)+' 00:00'; endTime = ''; } else if(time=='month'){ startTime = getDay(-30)+' 00:00'; endTime = ''; } else if(time=='quarter'){ startTime = getDay(-90)+' 00:00'; endTime = ''; } containerObj.load('/thtml/searchContent.thtml?siteId='+siteId+'&channelId='+channelId+'&searchTimeFlag=publishTime&startTime='+encodeURIComponent(startTime)+'&endTime='+endTime+'&tpl='+tpl+'&PrmItemsPerPage='+pageCount+'&PrmPageNo='+page,function(){ //$(".videoList li:nth-child(6n+2)").css("clear","left"); $('.pading').html($('.paging').html()); }); } function getDay(day){ 銆€銆€var today = new Date(); 銆€銆€var targetday_milliseconds=today.getTime() + 1000*60*60*24*day; 銆€銆€today.setTime(targetday_milliseconds); //娉ㄦ剰锛岃繖琛屾槸鍏抽敭浠g爜 銆€銆€var tYear = today.getFullYear(); 銆€銆€var tMonth = today.getMonth(); 銆€銆€var tDate = today.getDate(); 銆€銆€tMonth = doHandleMonth(tMonth + 1); 銆€銆€tDate = doHandleMonth(tDate); 銆€銆€return tYear+"-"+tMonth+"-"+tDate; } function doHandleMonth(month){ 銆€銆€var m = month; 銆€銆€if(month.toString().length == 1){ 銆€銆€銆€銆€m = "0" + month; 銆€銆€} return m; } function searchHtml(page) { searchType = 'search'; if(typeof(page)=='undefined'){ page = 1; } var pageCount = 12; var word=$('#searchbox').val(); containerObj.load('/thtml/searchContent.thtml?siteId='+siteId+'&channelId='+channelId+'&title='+encodeURIComponent(word)+'&tpl='+tpl+'&PrmItemsPerPage='+pageCount+'&PrmPageNo='+page,function(){ //$(".videoList li:nth-child(6n+2)").css("clear","left"); //$('.pading').html($('.paging').html()); $('.paging').html(''); }); } function videoBoxPop_(title,poster,link,contentId,downloadUrl){ Cms.viewCount('/thtml', contentId); $('#hits'+contentId).text(parseInt($('#hits'+contentId).text(),10)+1); videoBoxPop(title,poster,link,contentId,downloadUrl); } $(document).ready(function(){ if(typeof(notLoadHits)=='undefined'){ refreshHits(); } }); function toNextPage(pageNo){ if(searchType=='search'){ searchHtml(pageNo); } else{ loadData(tmpObj,searchType,pageNo); } } function refreshHits(){ var url = '/thtml/contentHitsCount.thtml'; var contentIds = ''; for(i=0;i鍏ㄩ儴鍐呭鍔犺浇瀹孅/span>"); } else{ $(window).scroll(function () { var num1=300; var scrollTop = $(this).scrollTop();//鍨傜洿婊氬姩鐨勮窛绂 var scrollHeight = $(document).height();//鏁翠釜鏂囨。鐨勯珮搴 var windowHeight = $(this).height();//鍙璺濈 if (scrollTop + windowHeight >= scrollHeight-num1) { $('.load').show(); $(window).unbind('scroll'); loadmore('/json/news/index','.load','133'); $(window).unbind('scroll'); } }) } $.each(data.contentList, function(i,item){ var content_id="first"+item.contentId; //if($("#"+content_id).html()==''||$("#"+content_id).html()=='firstundefined'){ html += '
  • '; html += ''; html += '
    '; html += '
    '; html += ''+(item.publishTime).substr(8)+''; html += ''+(item.publishTime).substr(0,7)+''; html += '
    '; html += ''; html += '
    '; html += '
    '; html += '

    '+item.title+'

    '; //html += '
    '+6+'
    '; html += '
    '; html += '
    '; html += '
  • '; //} }); $(dest).append(html); }); }