';
liItem.innerHTML = itemlist;
var $itemlist = $(liItem);
document.getElementById(aimId).appendChild(liItem)
if($info[i].articleType=="1"){
(function(mo){
cacheModel.getProfessor($info[i].ownerId,function(sc,value){
if(sc){
mo.find(".ownerName").html(value.name);
}else{
console.log("error")
}
});
})($itemlist);
}else if($info[i].articleType=="2"){
(function(mo){
cacheModel.getCompany($info[i].ownerId,function(sc, value){
if(sc){
if(value.forShort){
mo.find(".ownerName").html(value.forShort)
}else{
mo.find(".ownerName").html(value.name)
}
}else{
console.log("error")
}
})
})($itemlist);
}else if($info[i].articleType=="3"){
(function(mo){
cacheModel.getPlatform($info[i].ownerId,function(sc, value){
if(sc){
mo.find(".ownerName").html(value.name);
}else{
console.log("error")
}
})
})($itemlist);
}
}
}
var liLen=document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if($info.length == 0 && liLen == 0 ){
$("#"+aimId).hide()
insertNodata(aimId);
}
if ($info.length > rows) {
objSort[3].loadFlag=true;
}
if($info.length == 0){
objSort[3].loadFlag=false;
$(".loadtip").html('没有更多数据了');
return;
}
})
},
teamListVal=function(){ //团队列表
var aimId="teamList" //这定义的变量是用来拼接ul的id
oAjax("/ajax/team/index/search",{
"key": keyt, //搜索的参数
"subject":subject,
"industry":industry,
"address":address,
"publishTime":dataO.teamCreateTime,
"id": dataO.teamId,
"rows": rows
}, "get", function(res){
var $info = res.data;
console.log($info);
if($info.length > 0) { //如果有数据就渲染
$("#"+aimId).show()
dataO.teamCreateTime = $info[$info.length - 1].createTime;
dataO.teamId = $info[$info.length - 1].id;
for(var i = 0; i < $info.length; i++) {
// console.log(i)
var liItem = document.createElement("li");
liItem.setAttribute("data-id",$info[i].id);
liItem.className = "mui-table-view-cell"
var itemlist ='
';
itemlist += '
'; //重置样式
itemlist += '
'+$info[i].name+'
';
itemlist += '
'
itemlist += '
'
itemlist += '
'+$info[i].orgName+" "+''+$info[i].city+''
// itemlist += '
'+$info[i].orgName+" "+''+$info[i].city+''
//研究领域
// itemlist += '
'+$info[i].subject+" :"+$info[i].industry+'
'
itemlist += '
'
itemlist += '
';
liItem.innerHTML = itemlist;
document.getElementById(aimId).appendChild(liItem)
}
}
var liLen=document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if($info.length == 0 && liLen == 0 ){
$("#"+aimId).hide()
insertNodata(aimId);
}
if ($info.length > rows) {
objSort[8].loadFlag=true;
}
if($info.length < rows){
objSort[8].loadFlag=false;
$(".loadtip").html('没有更多数据了');
return;
}
})
},
resourceListVal=function(){
var aimId="resourceList"
oAjax("/ajax/resource/index/search",{
"key": keyt,
"sortNum": dataO.resSortNum,
"publishTime":dataO.resPublishTime,
"id": dataO.resId,
"rows": rows
}, "get", function(res){
var $info = res.data;
if($info.length > 0) {
$("#"+aimId).show()
dataO.resSortNum = $info[$info.length - 1].sortNum;
dataO.resPublishTime = $info[$info.length - 1].publishTime;
dataO.resId = $info[$info.length - 1].resourceId;
for(var i = 0; i < $info.length; i++) {
var hasImg="/images/default-resource.jpg"
if($info[i].images.length > 0) {
hasImg="/data/resource/" + $info[i].images[0].imageSrc
}
var liItem = document.createElement("li");
liItem.setAttribute("data-id",$info[i].resourceId);
liItem.className = "mui-table-view-cell"
var itemlist ='
';
itemlist += '
';
itemlist += '
';
itemlist += '
'+$info[i].resourceName+'
';
itemlist +='
'
itemlist += '
用途:' + $info[i].supportedServices + '
'
itemlist += '
'
itemlist += '
';
liItem.innerHTML = itemlist;
var $itemlist = $(liItem);
document.getElementById(aimId).appendChild(liItem)
if($info[i].resourceType=="1"){
(function(mo){
cacheModel.getProfessor($info[i].professorId,function(sc,value){
if(sc){
mo.find(".ownerName").html(value.name)
var userType = autho(value.authType, value.orgAuth, value.authStatus);
mo.find(".ownerSty").addClass(userType.sty).attr("title",userType.title)
}else{
console.log("error")
}
})
})($itemlist);
}else if($info[i].resourceType=="2"){
(function(mo){
cacheModel.getCompany($info[i].orgId,function(sc,value){
if(sc){
if(value.forShort){
mo.find(".ownerName").html(value.forShort)
}else{
mo.find(".ownerName").html(value.name)
}
if(value.authStatus==3) {
mo.find(".ownerSty").addClass("authicon-com-ok").attr("title","科袖认证企业")
}
}else{
console.log("error")
}
})
})($itemlist);
}
}
}
var liLen=document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if($info.length == 0 && liLen == 0 ){
$("#"+aimId).hide()
insertNodata(aimId);
}
if ($info.length > rows) {
objSort[2].loadFlag=true;
}
if($info.length == 0){
objSort[2].loadFlag=false;
$(".loadtip").html('没有更多数据了');
return;
}
})
},
patentListVal = function() {
var aimId="patentList"
oAjax("/ajax/ppatent/index/search",{
"key": keyt,
"sortNum": dataO.patSortNum,
"createTime":dataO.patCreateTime,
"id": dataO.patId,
"rows": rows
}, "get", function(res){
var $info = res.data;
if($info.length > 0) {
$("#"+aimId).show()
dataO.patSortNum = $info[$info.length - 1].sortNum;
dataO.patCreateTime = $info[$info.length - 1].createTime;
dataO.patId = $info[$info.length - 1].id;
for(var i = 0; i < $info.length; i++) {
var liItem = document.createElement("li");
liItem.setAttribute("data-id",$info[i].id);
liItem.className = "mui-table-view-cell"
var oString = '
'
oString += '
'
oString += '
' + $info[i].name + '
'
oString += '
' + $info[i].authors.substring(0, $info[i].authors.length - 1) + '
'
oString += '
'
liItem.innerHTML = oString;
document.getElementById(aimId).appendChild(liItem)
}
}
var liLen=document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if($info.length == 0 && liLen == 0 ){
$("#"+aimId).hide()
insertNodata(aimId);
}
if ($info.length > rows) {
objSort[4].loadFlag=true;
}
if($info.length == 0){
objSort[4].loadFlag=false;
$(".loadtip").html('没有更多数据了');
return;
}
})
},
paperListVal = function() {
var aimId="paperList"
oAjax("/ajax/ppaper/index/search",{
"key": keyt,
"sortNum": dataO.parSortNum,
"createTime":dataO.parCreateTime,
"id": dataO.parId,
"rows": rows
}, "get", function(res){
var $info = res.data;
if($info.length > 0) {
$("#"+aimId).show()
dataO.parSortNum = $info[$info.length - 1].sortNum;
dataO.parCreateTime = $info[$info.length - 1].createTime;
dataO.parId = $info[$info.length - 1].id;
for(var i = 0; i < $info.length; i++) {
var liItem = document.createElement("li");
liItem.setAttribute("data-id",$info[i].id);
liItem.className = "mui-table-view-cell"
var oString = '
'
oString += '
'
oString += '
' + $info[i].name + '
'
oString += '
' + $info[i].authors.substring(0, $info[i].authors.length - 1) + '
'
oString += '
'
liItem.innerHTML = oString;
document.getElementById(aimId).appendChild(liItem)
}
}
var liLen=document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if($info.length == 0 && liLen == 0 ){
$("#"+aimId).hide()
insertNodata(aimId);
}
if ($info.length > rows) {
objSort[5].loadFlag=true;
}
if($info.length == 0){
objSort[5].loadFlag=false;
$(".loadtip").html('没有更多数据了');
return;
}
})
},
serviceListVal = function() {
var aimId="serviceList"
oAjax("/ajax/ware/index/search",{
"key": keyt,
"sortFirst": dataO.serSortFirst,
"time":dataO.serTime,
"id": dataO.serId,
"rows": rows
}, "get", function(res){
var $info = res.data;
if($info.length > 0) {
$("#"+aimId).show()
dataO.serSortFirst = $info[$info.length - 1].sortFirst;
dataO.serTime = $info[$info.length - 1].modifyTime;
dataO.serId = $info[$info.length - 1].id;
for(var i = 0; i < $info.length; i++) {
var cnt="", img="../images/default-service.jpg"
if($info[i].images) {
var subs = strToAry($info[i].images)
if(subs.length > 0) {
img="/data/ware" + subs[0]
}
}
if($info[i].cnt){
cnt="内容:"+$info[i].cnt
}
var liItem = document.createElement("li");
liItem.setAttribute("data-id",$info[i].id);
liItem.className = "mui-table-view-cell"
var itemlist ='
';
itemlist += '
';
itemlist += '
';
itemlist += '
'+$info[i].name+'
';
itemlist +='
'
itemlist += '
' + cnt + '
'
itemlist += '
'
itemlist += '
';
liItem.innerHTML = itemlist;
var $itemlist = $(liItem);
document.getElementById(aimId).appendChild(liItem)
if($info[i].category=="1"){
(function(mo){
cacheModel.getProfessor($info[i].owner,function(sc,value){
if(sc){
mo.find(".ownerName").html(value.name)
var userType = autho(value.authType, value.orgAuth, value.authStatus);
mo.find(".ownerSty").addClass(userType.sty).attr("title",userType.title)
}else{
console.log("error")
}
})
})($itemlist);
}else if($info[i].category=="2"){
(function(mo){
cacheModel.getCompany($info[i].owner,function(sc,value){
if(sc){
if(value.forShort){
mo.find(".ownerName").html(value.forShort)
}else{
mo.find(".ownerName").html(value.name)
}
if(value.authStatus==3) {
mo.find(".ownerSty").addClass("authicon-com-ok").attr("title","科袖认证企业")
}
}else{
console.log("error")
}
})
})($itemlist);
}
}
}
var liLen=document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if($info.length == 0 && liLen == 0 ){
$("#"+aimId).hide()
insertNodata(aimId);
}
if ($info.length > rows) {
objSort[7].loadFlag=true;
}
if($info.length == 0){
objSort[7].loadFlag=false;
$(".loadtip").html('没有更多数据了');
return;
}
})
},
clearToFun=function(sortN){
objSort[sortN].loadFlag=true
$(objSort[sortN].conbox).html("");
$('.w').css('transform', 'translate3d(0px, 0px, 0px)')
$('.swiper-container2 .swiper-slide-active').css('height','auto').siblings('.swiper-slide').css('height','0px');
mySwiper.update();
dataO = {
proSortFirst:"",
proStarLevel: "",
proId: "",
orgSortNum:"",
orgModifyTime:"",
orgId:"",
artSortNum:"",
artPublishTime:"",
artId:"",
resSortNum:"",
resPublishTime:"",
resId:"",
patSortNum:"",
patCreateTime:"",
patId:"",
parSortNum:"",
parCreateTime:"",
parId:"",
serSortFirst:"",
serTime: "",
serId: "",
};
tabToFun(sortN)
},
tabToFun=function(item){ //判断自定义属性编号
if(!item){ item=1 }
var tabLoad=objSort[item].loadFlag
//console.log(item+"*****"+tabLoad)
$("#searchval").val(searchTmp)
if(item==1 && tabLoad){
expertBox();
$(".loadtip").html('上拉加载更多');
mySwiper.update();
}else if(item==2 && tabLoad){
resourceListVal();
$(".loadtip").html('上拉加载更多');
mySwiper.update();
}else if(item==3 && tabLoad){
articalListVal();
$(".loadtip").html('上拉加载更多');
mySwiper.update();
}else if(item==4 && tabLoad){
patentListVal();
$(".loadtip").html('上拉加载更多');
mySwiper.update();
}else if(item==5 && tabLoad){
paperListVal();
$(".loadtip").html('上拉加载更多');
mySwiper.update();
}else if(item==6 && tabLoad){
companyListVal();
$(".loadtip").html('上拉加载更多');
mySwiper.update();
}else if(item==7 && tabLoad){
serviceListVal();
$(".loadtip").html('上拉加载更多');
mySwiper.update();
}
else if(item==8 && tabLoad){ //上拉下拉刷新
var subjectVal= $("#subject li.filterCurrent").text();
if(subjectVal=="不限"){
subject = "";
}else{
subject = subjectVal;
}
var industryVal= $("#industry li.filterCurrent").text();
if(industryVal=="不限"){
industry = "";
}else{
industry = industryVal;
}
var addressVal= $("#address li.filterCurrent").text();
if(addressVal=="不限"){
address = "";
}else{
address = addressVal;
}
teamListVal();
$(".loadtip").html('上拉加载更多');
mySwiper.update();
}
if(!tabLoad){
$(".loadtip").html('没有更多数据了');
}
},
bindComEvent=function(){
//============open首次加载================
if(tagnum){
tabToFun(tagnum)
var indexTab=0;
for(var i in tabOrder){
if(tabOrder[i]==tagnum){
indexTab=i
}
}
$('.swiper-slide-tab').eq(indexTab).addClass('active-tab').siblings('.swiper-slide-tab').removeClass('active-tab');
mySwiperTab.slideTo(indexTab,500, false);
mySwiper2.slideTo(indexTab, 500, false)
$("#sele").addClass("displayNone");
$("#searB").removeClass("searchboxNewT");
}
//============open首次加载================
//============open筛选条件================
document.getElementById("oRes").addEventListener("click", function() {//重置条件筛选
filterList()
})
document.getElementById("com").addEventListener('click', function() {//完成条件筛选
var arr = [],tagm=0;
for(var n = 0; n < 3; n++) {
if(document.getElementsByClassName('spantext')[n].innerHTML == "不限") {
arr[n] = "";
} else {
arr[n] = document.getElementsByClassName('spantext')[n].innerHTML;
tagm++;
}
}
if(tagm>0){
document.getElementById("sele").getElementsByTagName("span")[0].innerHTML=tagm;
}
var index = 1
if ($('.swiper-slide-active').attr('data-tab') >1 ) {
index = 8
}
$(objSort[index].conbox).html("");
objSort[index].loadFlag=true
clearToFun(index)
//expertBox()
$('html').removeClass('mmenu-opening');
setTimeout(function(){
$('html').removeClass('mmenu-opened').removeClass('mmenu-right');
$('#menu').removeClass('mmenu-opened');
$(window).unbind('resize.mmenu');
},525);
})
$(".filterUl").on("click", "li", function() {//筛选条件的选择
this.parentNode.querySelector('li.filterCurrent').classList.remove("filterCurrent");
this.classList.add("filterCurrent");
this.parentNode.parentNode.querySelector(".spantext").innerText = this.innerText;
})
$(".filterListNew").on("click", ".rightbtn", function() {//筛选条件的展开关闭
if(this.className == "rightbtn filterActive") {
this.classList.remove("filterActive");
this.parentNode.querySelector(".filterUl").classList.remove("filterUlactive");
this.querySelector("em").classList.remove("unfoldtr");
this.querySelector("em").classList.add("foldtr");
} else {
this.classList.add("filterActive");
this.parentNode.querySelector(".filterUl").classList.add("filterUlactive");
this.querySelector("em").classList.remove("foldtr");
this.querySelector("em").classList.add("unfoldtr");
}
})
//============end筛选条件================
//============open搜索================
document.getElementById("searchval").addEventListener("keypress",
function() {//搜索enter
var e = event || window.event;
if(e.keyCode == 13) {
e.preventDefault();
var sC=$.trim($("#searchval").val());
var item=$('.swiper-slide-tab.active-tab').attr("data-tab")
tagnum=item
if(sC){
keyt =sC
searchTmp=keyt
wlog("kw", keyt);
clearToFun(tagnum)
}else{
bombox("请输入关键词");
return;
}
}
});
//============end搜索================
//============open swiper================
$('.swiper-slide-tab').unbind("click").on("click",function(){//tabClick
if($(this).index()==0 || $(this).index()){
$("#sele").removeClass("displayNone");
$("#searB").addClass("searchboxNewT");
}else{
$("#sele").addClass("displayNone");
$("#searB").removeClass("searchboxNewT");
}
$(this).addClass('active-tab').siblings('.swiper-slide-tab').removeClass('active-tab');
var tabitem=$(this).attr("data-tab");
mySwiper2.slideTo($(this).index(), 500, false)
mySwiperTab.slideTo($(this).index(), 500, false)
if($(this).index()<3){
$(".tr").css('transform', 'translate3d(0px, 0px, 0px)')
}
tagnum=tabitem
clearToFun(tagnum)
$('.w').css('transform', 'translate3d(0px, 0px, 0px)')
$('.swiper-container2 .swiper-slide-active').css('height','auto').siblings('.swiper-slide').css('height','0px');
mySwiper.update();
});
//============end swiper================
//============open模块链接跳转================
$("#proList").on("click", "li", function() {
var id = this.getAttribute("data-id");
location.href="http://" + window.location.host + "/e/p.html?id=" + id;
})
$("#serviceList").on("click", "li", function() {
var id = this.getAttribute("data-id");
location.href="http://" + window.location.host + "/e/s.html?id=" + id;
})
$("#resourceList").on("click", "li", function() {
var id = this.getAttribute("data-id");
location.href="http://" + window.location.host + "/e/r.html?id=" + id;
})
$("#articleList").on("click", "li", function() {
var id = this.getAttribute("data-id");
location.href="http://" + window.location.host + "/e/a.html?id=" + id;
})
$("#paperList").on("click", "li", function() {
var id = this.getAttribute("data-id");
location.href="http://" + window.location.host + "/e/l.html?id=" + id;
})
$("#patentList").on("click", "li", function() {
var id = this.getAttribute("data-id");
location.href="http://" + window.location.host + "/e/z.html?id=" + id;
})
$("#companyList").on("click", "li", function() {
var id = this.getAttribute("data-id");
location.href="http://" + window.location.host + "/e/c.html?id=" + id;
})
//跳转
$("#teamList").on("click", "li", function() {
var id = this.getAttribute("data-id");
location.href="http://" + window.location.host + "/e/2.html?id=" + id;
})
//============end模块链接跳转================
}
filterList()
expertBox()
bindComEvent()
})