123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- $(function(){
- var dataLength;
- var EndTime = new Date().getTime();
- var StartTime = EndTime - 31536000000;
- var NoticeType = '招标公告';
- var dataUrl = '/web-back/nx/n/list/notice';
- function AjaxFan(pagenum){
- $.ajax({
- url:dataUrl,
- type:'post',
- cache:false,
- dataType:'json',
- data:{
- p:pagenum,
- notice_type:NoticeType,
- start_time:StartTime,
- end_time:EndTime
- },
- success:function (data){
- var doms = "";
- dataLength = data.count;
- $('.result-content-title-right span i').html(dataLength);
- for(var i=0;i<data.rows.length;i++){
- var iDom = "";
- var applyTime = data.rows[i].apply_date_end;
- var noticeTime = data.rows[i].notice_end_time;
- var nowDate = new Date();
- if( applyTime>noticeTime || applyTime === noticeTime ){
- var endDate = new Date( applyTime );
- }else if(applyTime<noticeTime){
- var endDate = new Date( noticeTime );
- }
- var overDate = endDate - nowDate;
- var timeDay = Math.floor( overDate/86400000 );
- var timeHour = Math.floor((overDate%86400000)/3600000);
- var timeHtml = '<span class="countdowns">剩余<i class="day">'+timeDay+'</i>天<i class="hour">'+timeHour+'</i>小时</span>';
- var iconStyle = data.rows[i].notice_nature;
- if( iconStyle === "正常公告" || iconStyle === "再次公告"){
- iDom = '<i class="icons greens">新</i>';
- } else if( iconStyle === "变更公告" ){
- iDom = '<i class="icons blues">变更</i>';
- }else if( iconStyle === "延期公告" ){
- iDom = '<i class="icons blues">延期</i>';
- }else if( iconStyle === "补充公告" ){
- iDom = '<i class="icons blues">补充</i>';
- }else if( iconStyle === "控制价" ){
- iDom = '<i class="icons blues">控价</i>';
- }else if( iconStyle === "撤销公告" ){
- iDom = '<i class="icons reds">撤销</i>';
- }
- if( timeDay < 0 || iconStyle === "控制价" || iconStyle === "变更公告" || iconStyle === "延期公告" || iconStyle === "补充公告" || iconStyle === "撤销公告" ){
- timeHtml = '<span class="countdowns">无</span>';
- }
- var porjectUrl = '../page_detailed/list.html?kid='+data.rows[i].kid;
- doms += '<li>'+iDom+'<a href="'+porjectUrl+'" class="names" target="_blank" title="'+data.rows[i].project_name+'">'+data.rows[i].project_name+'</a><span class="times">'+data.rows[i].notice_release_time+'</span><a href="javascript:void(0)" class="sources" title="'+data.rows[i].org_name+'">'+data.rows[i].org_name+'</a><span class="areas">'+data.rows[i].region_name+'</span>'+timeHtml+'</li>';
- }
- $('.result-content-line ul').html(doms);
- layui.laypage.render({
- elem: 'paging',
- count: dataLength,
- limit: 20,
- first:'首页',
- last:'尾页',
- curr:pagenum,
- groups:5,
- jump: function(obj, first){
- if(!first){
- AjaxFan(obj.curr);
- }
- }
- });
- }
- });
- }
- layui.laypage.render({
- elem: 'paging',
- count: 1,
- limit: 20,
- first:'首页',
- last:'尾页',
- curr:1,
- groups:5,
- // jump: function(obj, first){
- // if(!first){
- // AjaxFan(obj.curr);
- // }
- // }
- });
- // AjaxFan(1);
- //条件筛选
- $.fn.extend({
- Screen:function(){
- $(this).on('click',function(){
- if(!$(this).find('a').hasClass('all-btn')){
- $(this).find('a').addClass('all-btn');
- $(this).siblings().find('a').removeClass('all-btn');
- }else{return}
- if($(this).find('a').hasClass('notices')){
- NoticeType = $(this).find('a').html();
- }else if( $(this).find('a').hasClass('releasetime') ){
- var ReleaseTime = $(this).find('a').attr('id');
- if(ReleaseTime == 'year'){
- StartTime = EndTime - 31536000000;
- }else if(ReleaseTime == 'month'){
- StartTime = EndTime - 2592000000;
- }else if(ReleaseTime == 'week'){
- StartTime = EndTime - 604800000;
- }else if(ReleaseTime == 'day'){
- StartTime = EndTime - 259200000;
- }
- }
- AjaxFan(1);
- })
- }
- });
- (function(){
- // $('.screen-content-box div ul li').Screen();
- }())
- })
|