//赛事申请 //赛事列表 function findShowsBaomingList(page){ var sendData = {}; sendData["showLocation"] = $("#matchPlace").val().trim(); sendData["mainShowName"] = $("#matchName").val().trim(); sendData["pageSize"] = "10"; sendData["pageNo"] = page; util.sendAjax({ url:'show/main', data:sendData, async:true, loadFlag:true, type:'GET', cache:false, success:function(data){ if(data.rc==0){ $("#ShowsBaomingList").html(""); if(data.list!=null) { list = data.list; $.each(list, function (index, item) { var durTime = new Date(new Date(util.formatDateLong(item.closingTime).replace(/-/g,"/"))).getTime() - new Date().getTime(); var showTime = util.endTime(durTime); item["showDurTime"] = showTime; }); $.each(list,function(index,item){ $("#ShowsBaomingList").append("" +""+item.mainShowName+"" +""+item.showLocation+"" +""+item.showDurTime+"" +"申请" +""); }); var timeRun = null; timeRun = setInterval(function() { setTime(list) },10000); initPage(page,10,data.total); }else{ layer.open({ content:"赛事活动列表为空!", skin:"msg", time:2 }); initPage(page,10,1); list = []; $("#ShowsBaomingList").html("") } }else{ layer.open({ content:"信息查询失败:"+data.msg, skin:"msg", time:2 }); } } }); } //截止时间 function setTime(list){ $("#ShowsBaomingList").html("") $.each(list,function(index,item){ var durTime = new Date(new Date(util.formatDateLong(item.closingTime).replace(/-/g,"/"))).getTime()-new Date().getTime(); var showTime = util.endTime(durTime); item.showDurTime = showTime; }); $.each(list,function(index,item){ $("#ShowsBaomingList").append("" +""+item.mainShowName+"" +""+item.showLocation+"" +""+item.showDurTime+"" +"申请" +""); }); } //初始化分页 function initPage(nowPage,pageSize,total){ var html="
上一页
"+ "
"+nowPage+"/"+Math.ceil(total/pageSize)+"
"+ "
下一页
"; $("#showPageContent").html(html); } $(function(){ var page =1; var obj = util.getQueryString(); if(obj.page==undefined){ page=1; }else{ page=obj.page; } findShowsBaomingList(page); })