<ul class="xzqy">
<span style="border: none;" class="f_l">类型:</span>
<a οnclick="chooseClass('all',this);"><span class="f_l cut">全部</span></a>
<c:forEach items="${classes}" var="cls">
<a οnclick="chooseClass('${cls.TRAINING_CLASS_CODE}',this)"><span class="f_l">${cls.TRAINING_CLASS_NAME}</span></a>
</c:forEach>
</ul>
<jsp:include page="../public/footer.jsp"></jsp:include>
</body>
<script type="text/javascript">
var code="all";
$(".my-nav").find("li").removeClass("cut");
$(".my-nav").find("li").eq(4).addClass("cut");
//初始化layui插件
var layer, laypage;
layui.use([ 'layer', 'laypage' ], function() {
layer = layui.layer;
laypage = layui.laypage;
});
$(function(){
page("${trainingCount}");
setItems(1);
});
$(function() {
$("img.lazy").lazyload({effect: "fadeIn"});
});
var layer = layui.layer
,laypage = layui.laypage
,element = layui.element();
laypage({
cont: 'pageDemo',
pages: Math.ceil(parseInt(totalPage)/8),
skin: '#942727',
skip: true,
jump: function(obj,first){
if(!first){
setItems(obj.curr);
layer.msg('第'+ obj.curr +'页');
}
}
});
});
}
function setItems(pageNum)
{
var now=CurrentDate();
var dataMap={'pageNum':pageNum};
if(code!="all")
dataMap.TRAINING_CLASS_CODE=code;
ajax.remoteCall("${path}/com.open.eac.whg.dao.TrainingDao:getTrainingWithPage",[dataMap],function(reply){
var list=reply.getResult();
$("#list").empty();
for(var i=0;i<list.length;i++)
{
var html='<li><div class="kuang">'+
'<img class="lazy" data-original="${imgBasePath}'+list[i].TRAINING_IMG+'" src="/whg-portal/images/error-img.png"/>'+
'<div style="text-align:left;padding:0 10px;">'+
'<h3 class="aui-ellipsis-1">'+list[i].TRAINING_NAME+'</h3>'+
'<p style="height:50px;overflow:hidden;">'+list[i].SHORT_DESC+'</p></div>';
if(list[i].APPLY_DEADLINE>now)
html+='<a class="all_tri4s ckxq background-h" href="content0.jsp?id='+list[i].TRAINING_ID+'">立即报名</a>';
else
html+='<a class="all_tri4s ckxq" href="content0.jsp?id='+list[i].TRAINING_ID+'" style="background-color:gray;color:white;">已经结束</a>';
html+='</div></li>';
$("#list").append(html);
$("img.lazy").lazyload({effect: "fadeIn"});
}
});
}
function chooseClass(c,tag)
{
code=c;
$(".f_l").removeClass('cut');
$(tag).children('span').addClass('cut');
var dataMap={'TRAINING_CLASS_CODE':code};
ajax.remoteCall("${path}/com.open.eac.whg.dao.TrainingDao:getTrainingCount",[dataMap],function(reply){
page(reply.getResult());
setItems(1);
});
}
</script>
</html>
<span style="border: none;" class="f_l">类型:</span>
<a οnclick="chooseClass('all',this);"><span class="f_l cut">全部</span></a>
<c:forEach items="${classes}" var="cls">
<a οnclick="chooseClass('${cls.TRAINING_CLASS_CODE}',this)"><span class="f_l">${cls.TRAINING_CLASS_NAME}</span></a>
</c:forEach>
</ul>
<jsp:include page="../public/footer.jsp"></jsp:include>
</body>
<script type="text/javascript">
var code="all";
$(".my-nav").find("li").removeClass("cut");
$(".my-nav").find("li").eq(4).addClass("cut");
//初始化layui插件
var layer, laypage;
layui.use([ 'layer', 'laypage' ], function() {
layer = layui.layer;
laypage = layui.laypage;
});
$(function(){
page("${trainingCount}");
setItems(1);
});
$(function() {
$("img.lazy").lazyload({effect: "fadeIn"});
});
function page(totalPage){
layui.use(['layer', 'laypage', 'element'], function(){var layer = layui.layer
,laypage = layui.laypage
,element = layui.element();
laypage({
cont: 'pageDemo',
pages: Math.ceil(parseInt(totalPage)/8),
skin: '#942727',
skip: true,
jump: function(obj,first){
if(!first){
setItems(obj.curr);
layer.msg('第'+ obj.curr +'页');
}
}
});
});
}
function setItems(pageNum)
{
var now=CurrentDate();
var dataMap={'pageNum':pageNum};
if(code!="all")
dataMap.TRAINING_CLASS_CODE=code;
ajax.remoteCall("${path}/com.open.eac.whg.dao.TrainingDao:getTrainingWithPage",[dataMap],function(reply){
var list=reply.getResult();
$("#list").empty();
for(var i=0;i<list.length;i++)
{
var html='<li><div class="kuang">'+
'<img class="lazy" data-original="${imgBasePath}'+list[i].TRAINING_IMG+'" src="/whg-portal/images/error-img.png"/>'+
'<div style="text-align:left;padding:0 10px;">'+
'<h3 class="aui-ellipsis-1">'+list[i].TRAINING_NAME+'</h3>'+
'<p style="height:50px;overflow:hidden;">'+list[i].SHORT_DESC+'</p></div>';
if(list[i].APPLY_DEADLINE>now)
html+='<a class="all_tri4s ckxq background-h" href="content0.jsp?id='+list[i].TRAINING_ID+'">立即报名</a>';
else
html+='<a class="all_tri4s ckxq" href="content0.jsp?id='+list[i].TRAINING_ID+'" style="background-color:gray;color:white;">已经结束</a>';
html+='</div></li>';
$("#list").append(html);
$("img.lazy").lazyload({effect: "fadeIn"});
}
});
}
function chooseClass(c,tag)
{
code=c;
$(".f_l").removeClass('cut');
$(tag).children('span').addClass('cut');
var dataMap={'TRAINING_CLASS_CODE':code};
ajax.remoteCall("${path}/com.open.eac.whg.dao.TrainingDao:getTrainingCount",[dataMap],function(reply){
page(reply.getResult());
setItems(1);
});
}
</script>
</html>