$(document).ready(function(){ loginStatus(); //判断个人是否登录 var userid = $.cookie("userid"); var resourceId; /*资源列表查询*/ function getRecourceMe(n,isbind) { var resourceNameVa=$("#resouceName").val(); var $info={}; $info.professorId=userid; $info.pageSize=3; if(resourceNameVa !="") { $info.key=resourceNameVa; } $info.pageNo=n; $.ajax({ "url": "/ajax/resTmp/pq", "type": "GET", "success": function(data) { console.log(data) if(data.success) { $(".importUl").html(""); if(data.data.data.length==0) { $(".importUl").html("暂无数据").css("text-align","center"); return; }else{ $(".importUl").css("text-align",""); } 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 oSpec="",orgName="",domain=""; if($data[i].img) { imgSrc = "/data/resource/" + $data[i].img; } if($data[i].spec) { oSpec="厂商型号:"+$data[i].spec } if($data[i].orgName) { orgName="所属机构:"+$data[i].orgName; } if($data[i].domain) { domain="关键词:"+$data[i].domain; } var oString = '
'+$data[i].name+'
' + ''+oSpec+'
' + ''+orgName+'
' + ''+domain+'
' + '