|
$(function() {
loginStatus();//判断个人是否登录
var userid = $.cookie("userid");
var num;
var keyt,subject,industry,address;
var authType = 1;
var searchContent = $.trim(GetQueryString("searchContent"));
var subjectText = $.trim(GetQueryString("subject"));
var tagnum = $.trim(GetQueryString("tagflag"));
if(tagnum==""){
num = 1;
keyt=searchContent;
expertListVal(keyt,subject,industry,address,authType,20,1,true);
}else{
num = tagnum;
if(num==1){
$(".choosediv.filterdiv li").eq(0).addClass("liactive").siblings().removeClass("liactive");
$(".listdiv .listbox").eq(0).show().siblings().hide();
$(".searchsome").attr("placeholder","请输入专家姓名、机构、研究方向或相关关键词");
expertListVal(keyt,subject,industry,address,authType,20,1,true);
}else if(num==2){
$(".choosediv.filterdiv li").eq(2).addClass("liactive").siblings().removeClass("liactive");
$(".listdiv .listbox").eq(2).show().siblings().hide();
$(".searchsome").attr("placeholder","请输入资源名称、用途、发布者或相关关键词");
resourceListVal(20, 1,true);
}else if(num==3){
$(".choosediv.filterdiv li").eq(5).addClass("liactive").siblings().removeClass("liactive");
$(".listdiv .listbox").eq(5).show().siblings().hide();
$(".searchsome").attr("placeholder","请输入文章标题、作者或相关关键词");
articalListVal(20, 1,true);
}else if(num==4){
$(".choosediv.filterdiv li").eq(1).addClass("liactive").siblings().removeClass("liactive");
$(".listdiv .listbox").eq(1).show().siblings().hide();
$(".searchsome").attr("placeholder","请输入企业名称、产品名称或相关关键词");
companyListVal(20,1,true);
}else if(num==5){
$(".choosediv.filterdiv li").eq(3).addClass("liactive").siblings().removeClass("liactive");
$(".listdiv .listbox").eq(3).show().siblings().hide();
$(".searchsome").attr("placeholder","请输入专利名称、发明人或相关关键词");
patentListVal(20, 1,true);
}else if(num==6){
$(".choosediv.filterdiv li").eq(4).addClass("liactive").siblings().removeClass("liactive");
$(".listdiv .listbox").eq(4).show().siblings().hide();
$(".searchsome").attr("placeholder","请输入论文题目、作者或相关关键词");
paperListVal(20, 1,true);
}
}
if(subjectText==""){
subject="";
}else{
subject=subjectText;
}
if(searchContent==""){
keyt="";
}else{
keyt=searchContent;
$(".searchsome").val(searchContent);
}
// expertListVal(keyt,subject,industry,address,authType,20,1,true);
// companyListVal(20,1,true);
// articalListVal(20, 1,true);
// resourceListVal(20, 1,true);
// patentListVal(20, 1,true);
// paperListVal(20, 1,true);
academicFieldVal(subjectText);
applicationIndustryVal();
cityVal();
//切换搜索范围
jquerytab("col-w-12");
//筛选条件的选择
$(".filterUl").on("click","li",function(){
this.parentNode.querySelector('li.filterCurrent').classList.remove("filterCurrent");
this.classList.add("filterCurrent");
})
//筛选条件的展开关闭
$(".filterListNew").on("click",".rightbtn",function(){
if(this.querySelector("em").className == "unfoldtr") {
this.querySelector("em").classList.remove("unfoldtr");
this.querySelector("em").classList.add("foldtr");
this.parentNode.querySelector(".filterUl").classList.remove("filterUlactive");
} else {
this.querySelector("em").classList.add("unfoldtr");
this.querySelector("em").classList.remove("foldtr");
this.parentNode.querySelector(".filterUl").classList.add("filterUlactive");
}
})
$(".searchblock").hide();
$(document).scroll(function() {
var top = $(document).scrollTop();
if (top >= 80) {
$(".searchblock").stop(true,false).fadeIn();
}else{
$(".searchblock").stop(true,false).fadeOut();
}
})
$(".searchsome").keydown(function(e) {
if(e.which == 13) {
num = $(".liactive").attr("data-id");
if(num==1){
expertBox();
}else if(num==2){
resourceListVal(20, 1,true);
}else if(num==3){
articalListVal(20, 1,true);
}else if(num==4){
companyListVal(20, 1,true);
}else if(num==5){
patentListVal(20, 1,true);
}else if(num==6){
paperListVal(20, 1,true);
}
}
})
$(".searchgo").on("click",function(e) {
num = $(".liactive").attr("data-id");
if(num==1){
expertBox();
}else if(num==2){
resourceListVal(20, 1,true);
}else if(num==3){
articalListVal(20, 1,true);
}else if(num==4){
companyListVal(20, 1,true);
}else if(num==5){
patentListVal(20, 1,true);
}else if(num==6){
paperListVal(20, 1,true);
}
})
$("#academicField,#applicationIndustry,#cityList").on("click","li",function(e) {
expertBox();
})
function expertBox(){
keyt = $(".searchsome").val();
var subjectVal= $("#academicField li.filterCurrent").text();
if(subjectVal=="不限"){
subject = "";
}else{
subject = subjectVal;
}
var industryVal= $("#applicationIndustry li.filterCurrent").text();
if(industryVal=="不限"){
industry = "";
}else{
industry = industryVal;
}
var addressVal= $("#cityList li.filterCurrent").text();
if(addressVal=="不限"){
address = "";
}else{
address = addressVal;
}
expertListVal(keyt,subject,industry,address,authType,20,1,true);
}
function jquerytab(name){
var oDome=$('.' + name);
var oSpan=oDome.find('.filterdiv li');
var oP=oDome.find('.listdiv .listbox');
oSpan.click(function(){
$(this).addClass('liactive').siblings().removeClass('liactive');
var index =oSpan.index(this);
oP.eq(index).show().siblings().hide();
//$(".searchsome").val("");
if(index==0){
expertBox();
$(".searchsome").attr("placeholder","请输入专家姓名、机构、研究方向或相关关键词");
}else if(index==1){
companyListVal(20, 1,true);
$(".searchsome").attr("placeholder","请输入企业名称、产品名称或相关关键词");
}else if(index==2){
resourceListVal(20, 1,true);
$(".searchsome").attr("placeholder","请输入资源名称、用途、发布者或相关关键词");
}else if(index==3){
patentListVal(20, 1,true);
$(".searchsome").attr("placeholder","请输入专利名称、发明人或相关关键词");
}else if(index==4){
paperListVal(20, 1,true);
$(".searchsome").attr("placeholder","请输入论文题目、作者或相关关键词");
}else if(index==5){
articalListVal(20, 1,true);
$(".searchsome").attr("placeholder","请输入文章标题、作者或相关关键词");
}
});
}
//学术领域
function academicFieldVal(subjectText){
$.ajax({
"url": "/ajax/dataDict/qaDictCode",
"type": "get",
"async": false,
"data": {
"dictCode":"SUBJECT",
},
"success": function(data) {
console.log(data);
if(data.success) {
$("#academicField").html("");
$("#academicField").append('<li class="filterCurrent">不限</li>');
for(var i = 0; i < data.data.length; i++) {
var itemlist = '<li class="ititle">'+data.data[i].caption+'</li>';
$("#academicField").append(itemlist);
if(i > 20)
break;
}
$("#academicField li").each(function(i){
var textt = $(this).text();
if(textt == subjectText){
$(this).addClass("filterCurrent").siblings().removeClass("filterCurrent");
}
});
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//应用行业
function applicationIndustryVal(){
$.ajax({
"url": "/ajax/dataDict/qaDictCode",
"type": "get",
"data": {
"dictCode":"INDUSTRY",
},
"success": function(data) {
console.log(data);
if(data.success) {
$("#applicationIndustry").html("");
$("#applicationIndustry").append('<li class="filterCurrent">不限</li>');
for(var i = 0; i < data.data.length; i++) {
var itemlist = '<li class="ititle">'+data.data[i].caption+'</li>';
$("#applicationIndustry").append(itemlist);
if(i > 20)
break;
}
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//所在城市
function cityVal(){
$.ajax({
"url": "/ajax/dataDict/qaCity",
"type": "get",
"data": {
"dictCode":"ADDRESS",
},
"success": function(data) {
console.log(data);
if(data.success) {
$("#cityList").html("");
$("#cityList").append('<li class="filterCurrent">不限</li>');
for(var i = 0; i < data.data.length; i++) {
var itemlist = '<li class="ititle">'+data.data[i].caption+'</li>';
$("#cityList").append(itemlist);
if(i > 20)
break;
}
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//专家点击咨询
$('#expertList').on("click",".rightop",function(){
if (userid && userid != "null" && userid != null) {
var professorId = $(this).attr("id");
ConsultApply();
//点击的发送
$("#sendConsultBtn").click(function() {
sendConsultHandler($(this).attr("proId"))
});
concultProInfo(professorId);
}else{
$.MsgBox.Alert('提示',"请先登录再进行咨询");
$("#mb_btn_ok").val("去登录");
var aele = document.createElement('a');
$("#mb_btnbox").append(aele);
$("#mb_btnbox a").css({
'display': "block",
'width': '100%',
'height': '40px',
'position': 'absolute',
'bottom': '-6px',
'left': '0'
});
aele.setAttribute('href', '../login.html');
}
})
//专家
function expertListVal(keyt,subject,industry,address,authType,pageSize,pageNo,isexpert) {
$.ajax({
"url": "/ajax/professor/pqBaseInfo",
"type": "get",
"data": {
"key":keyt,
"subject":subject,
"industry":industry,
"address":address,
"authType":authType,
"pageSize": pageSize,
"pageNo": pageNo
},
"beforeSend": function() {
$("#expertList").append('<img src="../images/loading.gif" class="loading" style="position: absolute;left: 50%; top: 50%;" />');
},
"success": function(data) {
console.log(data);
if(data.success) {
if(data.data.data.length > 0){
$("#expertList,.expertPageCode").show();
$(".expertPage").hide();
$("#expertList").html("");
var itemlist = '';
for(var i = 0; i < data.data.data.length; i++) {
var itemlist = '<li class="flexCenter">';
itemlist += '<a target="_blank" href="" class="expertUrl linkhref"><div class="lefthead userheadt userRadius" id="expertImg"></div>';
itemlist += '<div class="centercon">';
itemlist += '<p class="h1font">';
itemlist += '<span class="nameSpan" id="Name"></span>';
itemlist += '<em class="authiconNew" title="科袖认证专家"></em></p>';
itemlist += '<p class="h2font ellipsisSty" id="ellipsisSty">职称/职位,所在机构</p>';
itemlist += '<p class="h2font ellipsisSty" id="researchAreas"></p>';
itemlist += '</div></a><span class="rightop" style="display:none" id="">咨询</span>';
itemlist += '</li>';
$itemlist = $(itemlist);
$("#expertList").append($itemlist);
var datalist = data.data.data[i];
$itemlist.find(".expertUrl").attr("href", "userInforShow.html?professorId=" + datalist.id );
$itemlist.find("#Name").text(datalist.name);
$itemlist.find(".rightop").attr("id",datalist.id);
if(datalist.id != userid){
$itemlist.find(".rightop").show();
}
var userType = autho(datalist.authType, datalist.orgAuth, datalist.authStatus);
$itemlist.find(".authiconNew").attr("title", userType.title);
$itemlist.find(".authiconNew").addClass(userType.sty);
if(datalist.hasHeadImage) {
$itemlist.find("#expertImg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
}
var title = datalist.title || "";
var orgName = datalist.orgName || "";
var office = datalist.office || "";
if(title != "") {
var ttitle = title + ",";
}else{
if(office!=""){
var ttitle = office + ",";
}else{
var ttitle = office;
}
}
if(orgName != "") {
orgName = orgName;
}
$itemlist.find("#ellipsisSty").text(ttitle+orgName);
/*获取研究方向信息*/
var researchAreas = datalist.researchAreas;
if( researchAreas.length > 0){
var rlist = '研究方向:';
for(var n = 0; n < researchAreas.length; n++) {
//console.log(researchAreas[n].caption);
rlist += researchAreas[n].caption
if(n < researchAreas.length - 1) {
rlist += ";"
}
}
$itemlist.find("#researchAreas").text(rlist);
}
}
//分页
if(isexpert==true){
$(".expertPageCode").createPage({
pageCount: Math.ceil(data.data.total / 20),
current: data.data.pageNo,
backFn: function(p) {
$("#expertList").html("");
expertListVal(keyt,subject,industry,address,authType,20,p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#expertList,.expertPageCode").hide();
$(".expertPage").show();
}
$(".loading").remove();
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//企业
function companyListVal(pageSize,pageNo,isbind) {
$.ajax({
"url": "/ajax/org/find/pq",
"type": "get",
"async": true,
"data": {
"kw":$(".searchsome").val(),
"pageSize": pageSize,
"pageNo": pageNo
},
"beforeSend": function() {
$("#companyList").append('<img src="../images/loading.gif" class="loading" style="position: absolute;left: 50%; top: 50%;" />');
},
"success": function(data) {
console.log(data);
if(data.success) {
if(data.data.data.length > 0){
$("#companyList,.companyPageCode").show();
$(".companyPage").hide();
var itemlist = '';
$("#companyList").html("");
for(var i = 0; i < data.data.data.length; i++) {
var itemlist = '<li class="flexCenter">';
itemlist += '<a target="_blank" href="" class="companyUrl linkhref"><div class="lefthead companyhead">';
itemlist += '<div class="boxBlock"><img class="boxBlockimg" src="" id="companyImg"></div></div>';
itemlist += '<div class="centercon centercon2">';
itemlist += '<p class="h1font"><span id="orgName"></span><em class="authiconNew"></em></p>';
itemlist += '<p class="h2font ellipsisSty"><span id="orgTit"></span> <span id="orgOther"></span></p>';
itemlist += '</div></a></li>';
$itemlist = $(itemlist);
$("#companyList").append($itemlist);
var datalist = data.data.data[i];
var companyType = datalist.authStatus;
if(datalist.forShort){
$itemlist.find("#orgName").text(datalist.forShort);
}else{
$itemlist.find("#orgName").text(datalist.name);
}
$itemlist.find(".companyUrl").attr("href", "cmpInforShow.html?orgId=" + datalist.id );
if(datalist.hasOrgLogo) {
$itemlist.find("#companyImg").attr("src", "/images/org/" + datalist.id + ".jpg" );
}else{
$itemlist.find("#companyImg").attr("src", "/images/default-icon.jpg" );
}
if(companyType == 3) {
$itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "科袖认证企业");;
}
var orgOther = "";
if(datalist.industry) {
orgOther = datalist.industry.replace(/,/gi, " | ");
}
$itemlist.find("#orgOther").text(orgOther);
if(datalist.orgType == "2") {
$("#orgTit").html(orgTypeShow[datalist.orgType] + "<span style='margin-right:10px;'></span>");
}
}
//分页
if(isbind==true){
$(".companyPageCode").createPage({
pageCount: Math.ceil(data.data.total / 20),
current: data.data.pageNo,
backFn: function(p) {
$("#companyList").html("");
companyListVal(20, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#companyList,.companyPageCode").hide();
$(".companyPage").show();
}
$(".loading").remove();
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//文章
function articalListVal(pageSize, pageNo,isbind) {
$.ajax({
"url": "/ajax/article/firstpq",
"type": "get",
"async": true,
"data": {
"key":$(".searchsome").val(),
"pageSize": pageSize,
"pageNo": pageNo
},
"beforeSend": function() {
$("#articalList").append('<img src="../images/loading.gif" class="loading" style="position: absolute;left: 50%; top: 50%;" />');
},
"success": function(data) {
console.log(data);
if(data.success) {
if(data.data.data.length > 0){
$("#articalList,.articalPageCode").show();
$(".articalPage").hide();
var itemlist = '';
$("#articalList").html("");
for(var i = 0; i < data.data.data.length; i++) {
var datalist = data.data.data[i];
var sowU=""
if(datalist.pageViews!=0){
if(datalist.articleAgree!=0){
sowU='<span>阅读量 '+datalist.pageViews+'</span><span>赞 '+datalist.articleAgree+'</span>'
}else{
sowU='<span>阅读量 '+datalist.pageViews+'</span>'
}
}
var itemlist = '<li class="flexCenter">';
itemlist += '<a target="_blank" href="" class="artivleUrl linkhref"><div class="lefthead articalhead" id="articleImg"></div>';
itemlist += '<div class="centercon centercon2">';
itemlist += '<p class="h1font ellipsisSty-2" id="articalTitle"></p>';
itemlist += '<div class="h2font showInfo" id="showInfo">'
itemlist += '<span class="nameSpan" id="userName"></span>'
itemlist += '<span class="time" id="PubTime"></span>'
itemlist += sowU
itemlist += '<span id="comment"></span>'
itemlist += '</div>'
itemlist += '</div></a></li>';
$itemlist = $(itemlist);
$("#articalList").append($itemlist);
var articleType = datalist.articleType;
$itemlist.find("#articalTitle").text(datalist.articleTitle);
$itemlist.find(".artivleUrl").attr("href", "articalShow.html?articleId=" + datalist.articleId );
if(datalist.articleImg) {
$itemlist.find("#articleImg").attr("style", "background-image: url(/data/article/" + datalist.articleImg + ");");
}
$itemlist.find("#PubTime").text(commenTime(datalist.publishTime));
commentnum(datalist.articleId, $itemlist)
if(articleType == 1) { //个人文章
$itemlist.find("#userName").text(datalist.professor.name);
} else if(articleType == 2) { //企业文章
if(datalist.editOrganization.forShort) {
$itemlist.find("#userName").text(datalist.editOrganization.forShort);
}else{
$itemlist.find("#userName").text(datalist.editOrganization.name);
}
}
}
//分页
if(isbind==true){
$(".articalPageCode").createPage({
pageCount: Math.ceil(data.data.total / 20),
current: data.data.pageNo,
backFn: function(p) {
$("#articalList").html("");
articalListVal(20, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#articalList,.articalPageCode").hide();
$(".articalPage").show();
}
$(".loading").remove();
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
function commentnum(articleId, $itemlist) {
$.ajax({
"url": "/ajax/leaveWord/lwCount",
"type": "GET",
"dataType": "json",
"async": false,
"data": {
"articleId": articleId
},
"success": function(data) {
if(data.success) {
if(data.data>0){
$itemlist.find("#comment").text("留言 " + data.data);
}
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//资源
function resourceListVal(pageSize, pageNo,isresource) {
$.ajax({
"url": "/ajax/resource/firstpq",
"type": "get",
"async": true,
"data": {
"key":$(".searchsome").val(),
"pageSize": pageSize,
"pageNo": pageNo
},
"beforeSend": function() {
$("#resourceList").append('<img src="../images/loading.gif" class="loading" style="position: absolute;left: 50%; top: 50%;" />');
},
"success": function(data) {
console.log(data);
if(data.success) {
if(data.data.data.length > 0){
$("#resourceList,.resourcePageCode").show();
$(".resourcePage").hide();
var itemlist = '';
$("#resourceList").html("");
for(var i = 0; i < data.data.data.length; i++) {
var itemlist = '<li class="flexCenter">';
itemlist += '<a href="" target="_blank" class="resourceUrl linkhref"><div class="lefthead resouhead" id="resourceImg"></div>';
itemlist += '<div class="centercon">';
itemlist += '<p class="h1font" id="resourceName"></p>';
itemlist += '<p class="h2font">';
itemlist += '<span class="nameSpan" id="username"></span>';
itemlist += '<em class="authiconNew" title="科袖认证专家"></em></p>';
itemlist += '<p class="h2font ellipsisSty-2" id="supportedServices"></p>';
itemlist += '</div></a></li>';
$itemlist = $(itemlist);
$("#resourceList").append($itemlist);
var datalist = data.data.data[i];
var resourceType = datalist.resourceType;
$itemlist.find("#resourceName").text(datalist.resourceName);
$itemlist.find("#supportedServices").text("用途:" + datalist.supportedServices);
$itemlist.find(".resourceUrl").attr("href", "resourceShow.html?resourceId=" + datalist.resourceId );
if(datalist.images.length > 0) {
$itemlist.find("#resourceImg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
}
if(resourceType == 1) { //个人资源
$itemlist.find("#username").text(datalist.editProfessor.name);
var userType = autho(datalist.editProfessor.authType, datalist.editProfessor.orgAuth, datalist.editProfessor.authStatus);
$itemlist.find(".authiconNew").attr("title", userType.title);
$itemlist.find(".authiconNew").addClass(userType.sty);
} else if(resourceType == 2) { //企业资源
if(datalist.organization.forShort) {
$itemlist.find("#username").text(datalist.organization.forShort);
}else{
$itemlist.find("#username").text(datalist.organization.name);
}
if(datalist.organization.authStatus==3){
$itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "认证企业");;
}
}
}
//分页
if(isresource==true){
$(".resourcePageCode").createPage({
pageCount: Math.ceil(data.data.total / 20),
current: data.data.pageNo,
backFn: function(p) {
$("#resourceList").html("");
resourceListVal(20, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#resourceList,.resourcePageCode").hide();
$(".resourcePage").show();
}
$(".loading").remove();
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//专利
function patentListVal(pageSize, pageNo,isbind) {
$.ajax({
"url": "/ajax/ppatent/pq",
"type": "get",
"async": true,
"data": {
"qw":$(".searchsome").val(),
"pageSize": pageSize,
"pageNo": pageNo
},
"beforeSend": function() {
$("#patentList").append('<img src="../images/loading.gif" class="loading" style="position: absolute;left: 50%; top: 50%;" />');
},
"success": function(data) {
console.log(data);
if(data.success) {
var dataStr=data.data.data
if(dataStr.length > 0){
$("#patentList,.patentPageCode").show();
$(".patentPage").hide();
var itemlist = '';
$("#patentList").html("");
for(var i = 0; i < dataStr.length; i++) {
var itemlist = '<li class="flexCenter">';
itemlist += '<a target="_blank" href="patentShow.html?patentId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead patenthead"></div>';
itemlist += '<div class="centercon centercon2">';
itemlist += '<p class="h1font ellipsisSty">'+ dataStr[i].name +'</p>';
itemlist += '<p class="h2font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
itemlist += '<p class="h2font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
itemlist += '</div></a></li>';
$itemlist = $(itemlist);
$("#patentList").append($itemlist);
}
//分页
if(isbind==true){
$(".patentPageCode").createPage({
pageCount: Math.ceil(data.data.total / 20),
current: data.data.pageNo,
backFn: function(p) {
$("#patentList").html("");
patentListVal(20, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#patentList,.patentPageCode").hide();
$(".patentPage").show();
}
$(".loading").remove();
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//论文
function paperListVal(pageSize, pageNo,isbind) {
$.ajax({
"url": "/ajax/ppaper/pq",
"type": "get",
"async": true,
"data": {
"qw":$(".searchsome").val(),
"pageSize": pageSize,
"pageNo": pageNo
},
"beforeSend": function() {
$("#paperList").append('<img src="../images/loading.gif" class="loading" style="position: absolute;left: 50%; top: 50%;" />');
},
"success": function(data) {
console.log(data);
if(data.success) {
var dataStr=data.data.data
if(dataStr.length > 0){
$("#paperList,.paperPageCode").show();
$(".paperPage").hide();
var itemlist = '';
$("#paperList").html("");
for(var i = 0; i < dataStr.length; i++) {
var moreInf=""
if(!dataStr[i].cn4periodical){
dataStr[i].cn4periodical="";
}
if(!dataStr[i].en4periodical){
dataStr[i].en4periodical="";
}
if(!dataStr[i].pubDay){
dataStr[i].pubDay="";
}
moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay;
var itemlist = '<li class="flexCenter">';
itemlist += '<a target="_blank" href="paperShow.html?paperId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead paperhead"></div>';
itemlist += '<div class="centercon centercon2">';
itemlist += '<p class="h1font ellipsisSty">'+ dataStr[i].name +'</p>';
itemlist += '<p class="h2font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
itemlist += '<p class="h2font ellipsisSty">期刊:'+ moreInf +'</p>';
itemlist += '</div></a></li>';
$itemlist = $(itemlist);
$("#paperList").append($itemlist);
}
//分页
if(isbind==true){
$(".paperPageCode").createPage({
pageCount: Math.ceil(data.data.total / 20),
current: data.data.pageNo,
backFn: function(p) {
$("#paperList").html("");
paperListVal(20, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#paperList,.paperPageCode").hide();
$(".paperPage").show();
}
$(".loading").remove();
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
});
|