$(document).ready(function(){ $(".onlogin .headnavbtn li").eq(0).addClass("navcurrent"); loginStatus(); //判断个人是否登录 var userid = $.cookie("userid"); var resourceId; /*资源列表查询*/ function getRecourceMe(n,isbind) { var resourceNameVa=$("#resouceName").val(); var $info={}; $info.professorId=userid; $info.pageSize=10; if(resourceNameVa !="") { $info.key=resourceNameVa; } $info.pageNo=n; $.ajax({ "url": "/ajax/resource/pqSelf", "type": "GET", "success": function(data) { console.log(data) if(data.success) { $("#resourceList").html(""); if(data.data.data.length==0) { $("#noresource").removeClass("displayNone"); return; }else{ $("#noresource").addClass("displayNone"); } resourceHtml(data.data.data); if(isbind == true) { $(".tcdPageCode").createPage({ pageCount: Math.ceil(data.data.total / data.data.pageSize), current: data.data.pageNo, backFn: function(p) { getRecourceMe(p,false); } }); } } }, "data": $info, dataType: "json", 'error': function() { $.MsgBox.Alert('提示', '服务器连接超时!'); } }); } getRecourceMe(1,true); function resourceHtml($data) { for(var i=0;i<$data.length;i++) { var imgSrc="../images/default-resource.jpg"; var oTime,pageview="",draftLable="",oHtml,oLi=''; if($data[i].images.length) { imgSrc="/data/resource/"+$data[i].images[0].imageSrc } console.log($data[i].status) if($data[i].status==0) { oTime="修改于 "+timeTran($data[i].modifyTime); draftLable='草稿'; oHtml="resourceIssue.html"; oLi="class='draftList'" }else{ oTime="发布于 "+timeTran($data[i].publishTime); pageview='
'+$data[i].resourceName+'
'+ '