portal html css js resource

2.html 54KB

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>找团队-科袖网</title> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <link rel="stylesheet" href="../css/reset.css" /> <link rel="stylesheet" href="../css/common.css" /> <link rel="stylesheet" href="../css/share.css" /> <style> html, body { margin: 0; padding: 0px; background: #F4F6F8; } .showCardI{ position: relative; } .cardTop { position: relative; height: 150px; width: 92%; } .userCard{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); } .box1 { margin: 10px 0px; } .teamName { margin-bottom: 10px; } </style> <script type="text/javascript" src="../js/jquery-1.11.1.js"></script> <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> <script type="text/javascript" src="../js/public/baseUtil.js"></script> <script type="text/javascript" src="../js/public/shareCom.js"></script> <script type="text/javascript" src="../js/public/openApp.js"></script> </head> <body> <div class="contentBody2"> <div class="showCardI"> <div class="cardTop" style="padding: 0; margin: -50px 15px 8px;"> <div class=" userCard"> <h1 class="teamName" id="teamName"></h1> <div class="box1 organization" id="organization"></div> <div class="box2 city" id="city"></div> </div> <div class="cardInfo"> <p><span class="h1Font" id="professor"></span><em class="authicon " id="nameLi"></em> </p> <p class="h2Font" id="tMess"></p> <p class="h2Font" id="tMess2"></p> <p class="h3Font" id="address"></p> </div> </div> </div> <!-- 头部文本 --> <!-- <div class="showCardI" style="background: none; position: relative; "> <div style="height: 221px; background: #fff"> <div class="box"> <h3 class="teamName">团队名称</h3> <p class="organization">所在机构</p> <p class="city">所在城市</p> </div> </div> </div> --> <div class="mainbox displayNone"> <div class="infocon madiaBlock needList" style="border:none"> <ul class="mui-table-view" id="demandShow"> <!--<li class="mui-table-view-cell"> <div class="madiaInfo"> <p class="h1Font ellipsisSty-2">需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问</p> <p class="h2Font ellipsisSty-5">需求内容:我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进, 想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出产品的三维模型,用于展示以及为后续生产做准备我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进, 想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出</p> <div class="showli ellipsisSty"> <span>北京市</span> <span>预期 1个月内</span> <span>预算 1万元以内</span> <span>有效期至 8月17日</span> </div> </div> </li>--> </ul> </div> </div> <div class="mainbox displayNone"> <div class="infocontit">可提供服务</div> <div class="infocon infoconM madiaBlock"> <ul class="mui-table-view" id="serviceShow"> </ul> </div> <div class="seeMore displayNone" id="seeMoreService"><em>查看全部 <span id="serviceNum">0</span>个</em></div> </div> <div class="mainbox displayNone"> <div class="infocontit">可共享资源</div> <div class="infocon madiaBlock"> <ul class="mui-table-view" id="resourceShow"> </ul> </div> <div class="seeMore displayNone" id="seeMoreResource"><em>查看全部 <span id="resourceNum">0</span>个</em></div> </div> <div class="mainbox" style="cursor: pointer;" id="goCmpBrief"> <div class="infocontit mui-clearfix">团队介绍<em></em></div> <div class="infocon"> <span class="breifinfo ellipsisSty" id="breifinfo" style="display: block"> <p id="breifinfo"></p> </span> </div> </div> <div class="mainbox"> <div class="infocontit">行业领域</div> <div class="infocon listArea"> <ul id="industryShow"> </ul> </div> </div> <div class="mainbox"> <div class="infocontit">学术领域</div> <div class="infocon listArea"> <ul id="subjectShow"> </ul> </div> </div> <div class="mainbox displayNone"> <div class="infocontit">问答</div> <div class="infocon infoconM madiaBlock needList"> <ul class="mui-table-view" id="QAShow"> </ul> </div> <div class="seeMore displayNone" id="seeMoreQA"><em>查看全部 <span id="QANum">0</span>个</em></div> </div> <!-- <div class="mainbox displayNone"> <div class="infocontit">文章</div> <div class="infocon madiaBlock"> <ul class="mui-table-view" id="articelShow"> </ul> </div> <div class="seeMore displayNone" id="seeMoreArtical"><em>查看全部 <span id="articalNum">0</span>篇</em></div> </div> --> <div class="mainbox displayNone "> <div class="infocontit">非专利</div> <div class="infocon madiaBlock"> <ul class="mui-table-view" id="proUnPatent"> </ul> </div> <div class="seeMore " id="seeMoreUnpatent"> <em>查看全部 <span id="unpatentNum">0</span>篇</em></div> </div> <div class="mainbox displayNone "> <div class="infocontit">专利</div> <div class="infocon madiaBlock"> <ul class="mui-table-view" id="paperShow"> </ul> </div> <div class="seeMore displayNone " id="seeMorePatent"> <em>查看全部 <span id="patentNum">0</span>篇</em></div> </div> <div class="mainbox displayNone"> <div class="infocontit">论文</div> <div class="infocon madiaBlock"> <ul class="mui-table-view" id="paperList"> <!-- <li class="mui-table-view-cell"> <div class="madiaInfo"> <p class="h1Font ellipsisSty-2">需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问 </p> <p class="h2Font ellipsisSty-5">需求内容:我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进, 想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出产品的三维模型,用于展示以及为后续生产做准备我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进, 想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出</p> <div class="showli ellipsisSty"> <span>北京市</span> <span>预期 1个月内</span> <span>预算 1万元以内</span> <span>有效期至 8月17日</span> </div> </div> </li> --> </ul> </div> <div class="seeMore " id="seeMorePaper"><em>查看全部 <span id="forumNum">0</span>篇</em></div> </div> <!--合作专家--> <div class="mainbox displayNone"> <div class="infocontit">团队专家</div> <div class="infocon madiaBlock"> <ul class="mui-table-view" id="relateTeam"> </ul> </div> <!-- <div class="seeMore " id="seeMorePaper"><em>查看全部 <span id="personNum">0</span>个</em></div> --> </div> <!-- <div class="shareEcode"> <img class="Ecodecon" src="../images/ecordCard.jpg" /> <div class="Ecodeinfo"> <a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app"><button class="frmbtn frmactive">下载移动客户端</button></a> </div> --> </div> </div> <script type="text/javascript"> $(document).ready(function () { var imgUrl = "http://www.ekexiu.com/images/logo180.png"; var lineLink = document.location.href; var descContent; var shareTitle; var appid = ''; var proId = GetQueryString("id"); var secretary = '', //团队秘书id chief = '' //首席专家id // var userid = $.cookie("userid"); function userMessage(id) { //团队详情 $.ajax({ type: "get", url: "/ajax/team/qo?id=" + proId, async: true, success: function (data) { var $info = data.data; if (data.success) { //团队 $('.teamName').text($info.name) $('.city').text($info.city) $('.organization').text($info.orgName) // $("#proName").text($info.name); var oStyS = autho($info.authType, $info.orgAuth, $info.authStatus); $("#proAuth").addClass(oStyS.sty); $("#proAuth").attr("title", oStyS.title); if ($info.address) { $("#proAddress").html( '<em class="mui-icon iconfontnew icon-address"></em> ' + $info.address); } var proOther = ""; if ($info.orgName) { if ($info.department) { if ($info.title) { proOther = $info.title + "," + $info.department + "," + $info.orgName } else { if ($info.office) { proOther = $info.office + "," + $info.department + "," + $info.orgName } else { proOther = $info.department + "," + $info.orgName } } } else { proOther = $info.orgName } } $("#proOther").text(proOther); var llqtitle = $info.name + "-" + proOther.replace(/,/gi, "-"); //修改浏览器title信息 document.title = llqtitle; //团队简介 如果有这个字段就显示没有就不显示 if ($info.descp) { $("#breifinfo").text($info.descp); } else { document.getElementById("breifinfo").parentNode.parentNode.style .display = "none"; } //学术领域 if ($info.subject) { indu($info.subject, 'subjectShow') } else { document.getElementById("subjectShow").parentNode.parentNode.style .display = "none"; } //行业领域 if ($info.industry) { indu($info.industry, 'industryShow') } else { document.getElementById("industryShow").parentNode.parentNode.style .display = "none"; } //微信再次分享 // shareTitle = document.getElementById("proName").innerText; // descContent = document.getElementById("subjectShow").innerText // .substring(0, 70); } }, error: function () {} }); } var resear = ""; function researchAreaShow($datas, $datarecords) { if ($datas != undefined && $datas.length != 0) { var html = []; for (var i = 0; i < $datas.length; ++i) { var $data = $datas[i]; var $photos = []; //获取头像 if ($datarecords.length > 0) { $photos = getRecords($datarecords, $data.caption); } var showDiv = "<div class='listbox'><div class='listbrowse ellipsisSty'dataCaption=" + $data .caption + "><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><div class='likenum' dataCaption=" + $data.caption + ">" if ($photos.length < 4) { for (var j = 0; j < $photos.length; ++j) { if ($photos[j].img) { showDiv += "<span class='likepeople userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_m.jpg'></span>"; } else { showDiv += "<span class='likepeople userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>"; } } } else { for (var j = $photos.length - 2; j < $photos.length; ++j) { if ($photos[j].img) { showDiv += "<span class='likepeople userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_m.jpg'></span>"; } else { showDiv += "<span class='likepeople userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>"; } } showDiv += "<span class='mui-icon iconfont icon-more likepeople likemore userRadius'></span>"; } showDiv += "</div></div></div>"; html.push(showDiv); resear += (i + 1) + "." + $data.caption + " "; } document.getElementById("reserachMess").innerHTML = html.join('') } } /*应用行业及领域及企业纸质*/ function indu(oString, oSelector) { var arr = oString.split(","); var oArr = new Array(); var i; for (i in arr) { oArr.push('<li>' + arr[i] + '</li>'); } document.getElementById(oSelector).innerHTML = oArr.join(""); } var rows = 1 var oAjax = function (url, dataS, otype, oFun) { $.ajax({ url: url, dataType: 'json', type: otype, data: dataS, traditional: true, success: function (res) { if (res.success) { oFun(res) } } }); }, demandListVal = function () { var aimId = "demandShow" oAjax("/ajax/demand/pq", { "state": [1], "uid": proId, "pageSize": 5 }, "get", function (res) { var obj = res.data.data; if (obj.length > 0) { document.getElementById(aimId).parentNode.parentNode.classList.remove( "displayNone"); for (var i = 0; i < obj.length; i++) { var li = document.createElement("li"); li.setAttribute("data-id", obj[i].id); var needDate = obj[i].invalidDay; var lastDate = TimeTr(needDate); li.className = "mui-table-view-cell"; var oString = '<div class="madiaInfo">' oString += '<p class="h1Font ellipsisSty-2">' + obj[i].title + '</p>'; oString += '<p class="h2Font ellipsisSty-5">' + obj[i].descp + '</p>' oString += '<div class="showli ellipsisSty h3Font">' oString += '<span>' + obj[i].province + '</span>' if (obj[i].duration != 0) { oString += '<span>预期 ' + demandDuration[obj[i].duration] + '</span>' } if (obj[i].cost != 0) { oString += '<span>预算 ' + demandCost[obj[i].cost] + '</span>' } oString += '<span>有效期至' + lastDate + ' </span>' oString += '</div>' oString += '</div>' li.innerHTML = oString document.getElementById(aimId).appendChild(li); } } }) }, articalListVal = function () { var aimId = "articelShow" oAjax("/ajax/article/publish", { "category": "1", "owner": proId, "rows": rows }, "get", function (res) { var obj = res.data; if (obj.length > 0) { document.getElementById(aimId).parentNode.parentNode.classList.remove( "displayNone"); for (var i = 0; i < obj.length; i++) { var hasImg = "../images/default-artical.jpg" if (obj[i].articleImg) { hasImg = "/data/article/" + obj[i].articleImg } var li = document.createElement("li"); li.setAttribute("data-id", obj[i].articleId); li.className = "mui-table-view-cell"; li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' + '<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty-2 h1Font">' + obj[i].articleTitle + '</p>' + '<p class="h2Font ellipsisSty"><span class="time">' + commenTime(obj[i] .publishTime) + '</span></p>' + '</div>' + '</div>' document.getElementById(aimId).appendChild(li); } } }) }, resourceListVal = function () { var aimId = "resourceShow" oAjax("/ajax/resource/publish", { "category": "1", "owner": proId, "rows": rows }, "get", function (res) { var obj = res.data; if (obj.length > 0) { document.getElementById(aimId).parentNode.parentNode.classList.remove( "displayNone"); for (var i = 0; i < obj.length; i++) { var cnt = "", hasImg = "../images/default-resource.jpg" if (obj[i].images.length) { hasImg = '/data/resource/' + obj[i].images[0].imageSrc } if (obj[i].supportedServices) { cnt = "用途:" + obj[i].supportedServices } var li = document.createElement("li"); li.setAttribute("data-id", obj[i].resourceId); li.className = "mui-table-view-cell"; li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' + '<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty-2 h1Font">' + obj[i].resourceName + '</p>' + '<p class="ellipsisSty h2Font">' + cnt + '</p>' + '</div>' + '</div>' document.getElementById(aimId).appendChild(li); } } }) }, serviceListVal = function () { var aimId = "serviceShow" oAjax("/ajax/ware/publish", { "category": "1", "owner": proId, "rows": rows }, "get", function (res) { var obj = res.data; if (obj.length > 0) { document.getElementById(aimId).parentNode.parentNode.classList.remove( "displayNone"); for (var i = 0; i < obj.length; i++) { var cnt = "", hasImg = "../images/default-service.jpg" if (obj[i].images) { var subs = strToAry(obj[i].images) if (subs.length > 0) { hasImg = "/data/ware" + subs[0] } } if (obj[i].cnt) { cnt = "内容:" + obj[i].cnt } var li = document.createElement("li"); li.setAttribute("data-id", obj[i].id); li.className = "mui-table-view-cell"; li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' + '<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty-2 h1Font">' + obj[i].name + '</p>' + '<p class="ellipsisSty h2Font">' + cnt + '</p>' + '</div>' + '</div>' document.getElementById(aimId).appendChild(li); } } }) }, patentListVal = function () { var aimId = "patentShow" oAjax("/ajax/ppatent/professor", { "owner": proId, "rows": rows }, "get", function (res) { var obj = res.data; if (obj.length > 0) { document.getElementById(aimId).parentNode.parentNode.classList.remove( "displayNone"); for (var i = 0; i < obj.length; i++) { var li = document.createElement("li"); li.setAttribute("data-id", obj[i].id); li.className = "mui-table-view-cell"; li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' + '<div class="madiaHead patentHead"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty-2 h1Font">' + obj[i].name + '</p>' + '<p class="ellipsisSty h2Font">' + obj[i].authors.substring(0, obj[i] .authors.length - 1) + '</p>' + '</div>' + '</div>' document.getElementById(aimId).appendChild(li); } } }) }, answerListVal = function () { var aimId = "QAShow" oAjax("/ajax/question/answer/bySelf", { "uid": proId, "rows": rows }, "get", function (res) { var obj = res.data; if (obj.length > 0) { document.getElementById(aimId).parentNode.parentNode.classList.remove( "displayNone"); for (var i = 0; i < obj.length; i++) { var hd = ""; if (obj[i].agree > 0) { hd = '<span>赞 ' + obj[i].agree + '</span>' } var li = document.createElement("li"); li.setAttribute("data-id", obj[i].id); li.className = "mui-table-view-cell"; li.innerHTML = '<div class="madiaInfo">' + '<p class="h1Font ellipsisSty-2 qa-question"></p>' + '<div class="flexCenter qa-owner"></div>' + '<div class="qa-con ellipsisSty-5">' + listConCut(obj[i].cnt) + '</div>' + '<div class="showliSpan ellipsisSty">' + '<span>' + commenTime(obj[i].createTime) + '</span>' + hd + '<span class="leaveMsgCount"></span>' + '</div>' + '</div>' document.getElementById(aimId).appendChild(li); var $str = $(li); questioninfo(obj[i].qid, $str); proinfo(obj[i].uid, $str); leaveMsgCount(obj[i].id, "4", $str); } } }) }, proinfo = function (pid, $str) { oAjax("/ajax/professor/baseInfo/" + pid, {}, "get", function (data) { var dataStr = data.data var baImg = "../images/default-photo.jpg"; if (dataStr.hasHeadImage == 1) { baImg = "/images/head/" + dataStr.id + "_l.jpg"; } var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus); var os = ""; if (dataStr.title) { if (dataStr.orgName) { os = dataStr.title + "," + dataStr.orgName; } else { os = dataStr.title; } } else { if (dataStr.office) { if (dataStr.orgName) { os = dataStr.office + "," + dataStr.orgName; } else { os = dataStr.office; } } else { if (dataStr.orgName) { os = dataStr.orgName; } } } var str = '<div class="owner-head useHead" style="background-image:url(' + baImg + ')"></div>' + '<div class="owner-info">' + '<div class="owner-name"><span class="h1Font">' + dataStr.name + '</span><em class="authiconNew ' + userType.sty + '" title="' + userType.title + '"></em></div>' + '<div class="owner-tit ellipsisSty h2Font">' + os + '</div>' + '</div>' $str.find(".qa-owner").html(str) }); }, questioninfo = function (qid, $str) { oAjax("/ajax/question/qo", { id: qid }, "get", function (data) { $str.find(".qa-question").html(data.data.title); if (data.data.pageViews > 0) { $str.find(".qaPageview").html("阅读量 " + data.data.pageViews); } else { $str.find(".qaPageview").hide() } }); }, queryPubCount = function () { // oAjax("/ajax/article/count/publish", { //文章总数 // "owner": proId, // "category": "1" // }, "GET", function (data) { // if (data.data > rows) { // $("#seeMoreArtical").removeClass("displayNone") // $("#articalNum").text(data.data); // } // }); oAjax("/ajax/resource/count/publish", { //资源总数 "owner": proId, "category": "1" }, "GET", function (data) { if (data.data > rows) { $("#seeMoreResource").removeClass("displayNone") $("#resourceNum").text(data.data); } }); oAjax("/ajax/ware/count/publish", { //服务总数 "owner": proId, "category": "1" }, "GET", function (data) { if (data.data > rows) { $("#seeMoreService").removeClass("displayNone") $("#serviceNum").text(data.data); } }); oAjax("/ajax/ppatent/count/publish", { //专利总数 "owner": proId, }, "GET", function (data) { if (data.data > rows) { } }); oAjax("/ajax/ppaper/count/publish", { //论文总数 "owner": proId, }, "GET", function (data) { // if (data.data > rows) { // $("#seeMorePaper").removeClass("displayNone") // $("#paperShow").text(data.data); // } }); oAjax("/ajax/question/answer/bySelf/count", { //回答总数 "uid": proId, }, "GET", function (data) { if (data.data > rows) { $("#seeMoreQA").removeClass("displayNone") $("#QANum").text(data.data); } }); }, bindClickFun = function () { var this_ = "../html/userInforShow.html?proid=" + proId; wcFresh(this_); $("body").on("click", ".seeMore,#goCmpBrief", function () { isInstalled(this_, true); $(this).addClass("activeThis"); }) $('#articelShow,#relateArt').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/a.html?id=" + id; $(this).addClass("activeThis"); }) $('#resourceShow').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/r.html?id=" + id; $(this).addClass("activeThis"); }) $('#paperShow').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/l.html?id=" + id; $(this).addClass("activeThis"); }) $('#patentShow').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/z.html?id=" + id; $(this).addClass("activeThis"); }) $('#demandShow').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/d.html?id=" + id; $(this).addClass("activeThis"); }) $('#serviceShow').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/s.html?id=" + id; $(this).addClass("activeThis"); }) //论文 $('#paperList').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/l.html?id=" + id; $(this).addClass("activeThis"); }) //专利 $('#paperShow').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/z.html?id=" + id; $(this).addClass("activeThis"); }) //非专 $('#proUnPatent').on('click', 'li', function () { var id = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/3.html?id=" + id; $(this).addClass("activeThis"); }) } userMessage(proId); demandListVal() serviceListVal() resourceListVal() // articalListVal() patentListVal() answerListVal() relevantExperts(); //合作专家 // relevantarticalList(); //相关文章 likeExperts(); //感兴趣专家 bindClickFun() queryPubCount(); pageViewLog(proId, 1); // consociationTeam() //合作专家 function relevantExperts() { $.ajax({ "url": "/ajax/professor/coadjutant", "type": "get", "dataType": "json", "data": { "id": proId }, "success": function (data) { if (data.success && data.data) { var lengthT; if (data.data.length > 5) { lengthT = 5; } else { lengthT = data.data.length } for (var i = 0; i < lengthT; i++) { var ExpId = data.data[i].professorId; var paperN = data.data[i].paperCount; var patentN = data.data[i].patentCount; var liItem = document.createElement("li"); liItem.className = "mui-table-view-cell flexCenter"; document.getElementById("relatePro").appendChild(liItem); relExpertsList(ExpId, paperN, patentN, liItem); //合作专家 } } }, "error": function () { $.MsgBox.Alert('提示', '链接服务器超时') } }); } //相关文章信息 function relevantarticalList() { $.ajax({ "url": "/ajax/article/byAssProfessor", "type": "GET", "dataType": "json", "data": { "id": proId }, "async": "false", "traditional": true, //传数组必须加这个 "success": function (data) { console.log(data); if (data.success && data.data != "") { document.getElementById("relateArt").parentNode.parentNode.classList.remove( "displayNone"); document.getElementById("relateArt").innerHTML = ""; var StrData = data.data var lengthT; if (data.data.length > 5) { lengthT = 5; } else { lengthT = data.data.length } for (var i = 0; i < lengthT; i++) { (function (n) { var imgL = "../images/default-artical.jpg"; if (StrData[i].articleImg) { imgL = '../data/article/' + StrData[i].articleImg } var oURL; if (StrData[i].articleType == 1) { oURL = "/ajax/professor/baseInfo/" + StrData[i].ownerId; } else if (StrData[i].articleType == 2) { oURL = "/ajax/org/" + StrData[i].ownerId; } else if (StrData[i].articleType == 3) { oURL = "/ajax/platform/info"; } $.ajax({ "url": oURL, "data": { id: StrData[i].ownerId }, "type": "GET", 'dataType': "json", "success": function (data) { var thisName, userType, thisAuth, thisTitle if (data.data.forShort) { thisName = data.data.forShort; } else { thisName = data.data.name; } if (StrData[n].articleType == 1) { userType = autho(data.data.authType, data .data.orgAuth, data.data .authStatus); thisTitle = userType.title; thisAuth = userType.sty; } else if (StrData[n].articleType == 2) { if (data.data.authStatus == 3) { thisTitle = "科袖认证企业"; thisAuth = "authicon-com-ok"; } } else if (StrData[n].articleType == 3) { } var add = document.createElement("li"); add.className = "mui-table-view-cell flexCenter OflexCenter"; add.setAttribute("data-id", StrData[n] .articleId); var itemlist = '<div class="madiaHead artHead" style="background-image:url(' + imgL + ')"></div>'; itemlist += '<div class="madiaInfo OmadiaInfo">'; itemlist += '<p class="ellipsisSty-2 h1Font" id="usertitle">' + StrData[n].articleTitle + '</p>'; itemlist += '<p><span class="h2Font" style="margin-right:10px">' + thisName + '</span><span class="time">' + commenTime(StrData[n].publishTime) + '</span></p>'; itemlist += '</div>'; add.innerHTML = itemlist; document.getElementById("relateArt") .appendChild(add); }, 'error': function () { $.MsgBox.Alert('提示', '服务器连接超时!'); } }); })(i); } } }, "error": function () { console.log(1) // $.MsgBox.Alert('提示', '链接服务器超时') } }); } //感兴趣 function likeExperts() { $.ajax({ "url": "/ajax/professor/ralateProfessors", "type": "get", "dataType": "json", "data": { "professorId": proId }, "success": function (data) { if (data.success && data.data) { var lengthT; if (data.data.length > 5) { lengthT = 5; } else { lengthT = data.data.length } for (var i = 0; i < lengthT; i++) { var ExpId = data.data[i].id; likeExpertsList(ExpId); } } }, "error": function () { $.MsgBox.Alert('提示', '链接服务器超时') } }); } function likeExpertsList(Id) { $.ajax({ "url": "/ajax/professor/info/" + Id, "type": "GET", "dataType": "json", "success": function (data) { if (data.success && data.data != "") { console.log(data) document.getElementById("likePro").parentNode.parentNode.classList.remove( "displayNone"); var itemlist = '<li class="flexCenter"><a href="" class="urlgo">'; itemlist += '<div class="madiaHead useHead" id="userimg"></div>'; itemlist += '<div class="madiaInfo">'; itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>'; itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>'; itemlist += '</div></a></li>'; $itemlist = $(itemlist); $("#likePro").append($itemlist); if (data.data.title) { if (data.data.orgName) { $itemlist.find("#usertitle").text(data.data.title + "," + data.data .orgName); } else { $itemlist.find("#usertitle").text(data.data.title); } } else { if (data.data.office) { if (data.data.orgName) { $itemlist.find("#usertitle").text(data.data.office + "," + data .data.orgName); } else { $itemlist.find("#usertitle").text(data.data.office); } } else { if (data.data.orgName) { $itemlist.find("#usertitle").text(data.data.orgName); } } } $itemlist.find("#userName").text(data.data.name); $itemlist.find(".urlgo").attr("href", "p.html?id=" + data.data.id); if (data.data.hasHeadImage == 1) { $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);" ); } var userType = autho(data.data.authType, data.data.orgAuth, data.data .authStatus); $itemlist.find(".authiconNew").attr("title", userType.title); $itemlist.find(".authiconNew").addClass(userType.sty); } }, "error": function () { $.MsgBox.Alert('提示', '链接服务器超时') } }); } /*微信分享*/ $.ajax({ url: "../ajax/weixin/jsapiTicket", type: 'get', dataType: 'json', contentType: "application/x-www-form-urlencoded; charset=utf-8", data: { 'url': location.href.split('#')[0] }, success: function (data) { if (data.data) { wx.config({ debug: false, //调试模式好犀利 appId: data.data.appId, timestamp: data.data.timestamp, nonceStr: data.data.nonceStr, signature: data.data.signature, jsApiList: [ // 所有要调用的 API 都要加到这个列表中 "onMenuShareAppMessage", "onMenuShareTimeline", "onMenuShareQQ", "onMenuShareQZone", "scanQRCode", ] }); wx.ready(function () { // 在这里调用 API wx.onMenuShareAppMessage({ //分享给朋友 title: shareTitle, // 分享标题 desc: descContent, // 分享描述 link: lineLink, // 分享链接 imgUrl: imgUrl, // 分享图标 success: share_success_callback, cancel: share_cancel_callback }); wx.onMenuShareTimeline({ //分享到朋友圈 title: shareTitle, // 分享标题 desc: descContent, // 分享描述 link: lineLink, // 分享链接 imgUrl: imgUrl, // 分享图标 success: share_success_callback, cancel: share_cancel_callback }); wx.onMenuShareQQ({ //分享到QQ title: shareTitle, // 分享标题 desc: descContent, // 分享描述 link: lineLink, // 分享链接 imgUrl: imgUrl, // 分享图标 success: share_success_callback, cancel: share_cancel_callback }); wx.onMenuShareQZone({ //分享到QQ空间 title: shareTitle, // 分享标题 desc: descContent, // 分享描述 link: lineLink, // 分享链接 imgUrl: imgUrl, // 分享图标 success: share_success_callback, cancel: share_cancel_callback }); }); //分享成功后的回调函数 function share_success_callback() {} //用户取消分享后执行的回调函数 function share_cancel_callback() {} } } }); }) //非专 function sevrResource($data) { var namepo, userType; if ($data.resourceType == 1) { namepo = $data.editProfessor.name; userType = autho($data.editProfessor.authType, $data.editProfessor.orgAuth, $data.editProfessor.authStatus); } else { userType = {}; if ($data.organization.forShort) { namepo = $data.organization.forShort; } else { namepo = $data.organization.name; } if ($data.organization.authStatus == 3) { userType.sty = "authicon-com-ok" } } var rImg = "../images/default-resource.jpg"; if ($data.images.length > 0) { rImg = "/data/resource/" + $data.images[0].imageSrc; } var li = document.createElement("li"); li.setAttribute("data-id", $data.resourceId); li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' + ' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty h1Font">' + $data.resourceName + '</p>' + '<p><span class="h2Font">' + namepo + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' + '<p class="ellipsisSty-2 h2Font">用途:' + $data.supportedServices + '</p>' + '</div>' + '</div>' document.getElementById("resourceList").appendChild(li); } //专利 function sevrResource($data) { var namepo, userType; if ($data.resourceType == 1) { namepo = $data.editProfessor.name; userType = autho($data.editProfessor.authType, $data.editProfessor.orgAuth, $data.editProfessor.authStatus); } else { userType = {}; if ($data.organization.forShort) { namepo = $data.organization.forShort; } else { namepo = $data.organization.name; } if ($data.organization.authStatus == 3) { userType.sty = "authicon-com-ok" } } var rImg = "../images/default-resource.jpg"; if ($data.images.length > 0) { rImg = "/data/resource/" + $data.images[0].imageSrc; } var li = document.createElement("li"); li.setAttribute("data-id", $data.resourceId); li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' + ' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty h1Font">' + $data.resourceName + '</p>' + '<p><span class="h2Font">' + namepo + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' + '<p class="ellipsisSty-2 h2Font">用途:' + $data.supportedServices + '</p>' + '</div>' + '</div>' document.getElementById("resourceList").appendChild(li); } //论文 function sevrResource($data) { var namepo, userType; if ($data.resourceType == 1) { namepo = $data.editProfessor.name; userType = autho($data.editProfessor.authType, $data.editProfessor.orgAuth, $data.editProfessor.authStatus); } else { userType = {}; if ($data.organization.forShort) { namepo = $data.organization.forShort; } else { namepo = $data.organization.name; } if ($data.organization.authStatus == 3) { userType.sty = "authicon-com-ok" } } var rImg = "../images/default-resource.jpg"; if ($data.images.length > 0) { rImg = "/data/resource/" + $data.images[0].imageSrc; } var li = document.createElement("li"); li.setAttribute("data-id", $data.resourceId); li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' + ' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty h1Font">' + $data.resourceName + '</p>' + '<p><span class="h2Font">' + namepo + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' + '<p class="ellipsisSty-2 h2Font">用途:' + $data.supportedServices + '</p>' + '</div>' + '</div>' document.getElementById("resourceList").appendChild(li); } //定义一个数组储存返回的数据 var patentArr = [], unpatentArr = []; var tId = GetQueryString("id"); //获取url Id var pageNo = 1, rows = 20, oAjax = function (url, dataS, otype, oFun, beforeFun, completeFun, async) { $.ajax({ async: async ==null ? true : async, url: url, dataType: 'json', type: otype, data: dataS, traditional: true, beforeSend: beforeFun, success: function (res) { oFun(res) }, complete: completeFun }); }, //专利 patentListVal = function (isbind) { var aimId = "paperShow", newStr = "尚未关联任何专利成果" oAjax("/ajax/team/patent", { id: tId, pageSize: rows, pageNo: pageNo, }, "get", function (res) { var $info = res.data.data; $("#patentShow").html("") if ($info.length > 0) { if ($info.length > 1) { $("#seeMorePatent").removeClass("displayNone") } $("#patentNum").text($info.length); if (res.data.total > 0 && res.data.total < 99) { $("#patCount").text(res.data.total); } if (res.data.total > 99) { $("#patCount").text("99+"); } $("#" + aimId).show() for (var i = 0; i < $info.length; i++) { patentArr.push($info[i].patent) } detailPat(aimId) } else { $("#showPatent").parents('.otherShow').hide() } var liLen = document.getElementById(aimId).querySelectorAll("li").length; // removeNodata(aimId); if ($info.length == 0 && liLen == 0) { $("#" + aimId).hide() // insertNodata(aimId, newStr); } if (isbind) { $("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () { pageNo++ patentListVal(false) }) } if ($info.length < rows) { $("#" + aimId).parent().find(".js-load-more").unbind("click"); $("#" + aimId).parent().find(".js-load-more").hide(); } }, function () { $("#" + aimId).parent().find(".js-load-more").attr("disabled", true); $("#" + aimId).parent().find(".js-load-more").addClass("active"); }, function () { $("#" + aimId).parent().find(".js-load-more").removeAttr("disabled"); $("#" + aimId).parent().find(".js-load-more").removeClass("active"); }) } //获取专利数据 detailPat = function (obj) { oAjax("/ajax/ppatent/qm", { id: patentArr, }, "get", function (data) { var dataStr = data.data; var strAdd = ''; // strAdd += '<li class="mui-table-view-cell"><a target="_blank" href="/'+ pageUrl("pt",dataStr[i]) +'" class="flexCenter urlgo">'; // strAdd += '<div class="madiaHead patentHead"></div>'; // strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>'; // strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>'; // strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>'; // strAdd += '</div>'; // strAdd += '</a></li>'; if (dataStr.length > 0) { document.getElementById('paperShow').parentNode.parentNode.classList.remove("displayNone"); var li = document.createElement("li"); li.setAttribute("data-id", dataStr[0].id); li.className = "mui-table-view-cell"; li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' + '<div class="madiaHead paperHead"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty-2 h1Font">' + dataStr[0].name + '</p>' + '<p class="ellipsisSty h2Font">' + dataStr[0].authors + '</p>' + //.substring(0, dataStr[i].authors.length - 1) '</div>' + '</div>' document.getElementById('paperShow').appendChild(li); $("#" + obj).append(strAdd) // if (dataStr.length == 1) { // $('#paperNum').parent().parent().css('display', 'none') // } // // $('#paperNum').text(dataStr.length) // if (i < 3) { // $("#showPatent").append(strAdd); // } } }); } //非专利 unpatentListVal = function (isbind) { var aimId = "proUnPatent", newStr = "尚未关联任何非专利成果" oAjax("/ajax/team/resResult", { id: tId, pageSize: rows, pageNo: pageNo, }, "get", function (res) { var $info = res.data.data; $("#showUnPatent").html("") if ($info.length > 0) { if (res.data.total > 0 && res.data.total < 99) { $("#unpatCount").text(res.data.total); } if (res.data.total > 99) { $("#unpatCount").text("99+"); } // $("#" + aimId).show() // $("#" + aimIdF).parents(".leftconItem").find(".nodatabox").hide() // $("#" + aimIdF).parents(".form-item").removeClass("displayNone"); // $("#" + aimIdF).parents(".coninfobox").show(); for (var i = 0; i < $info.length; i++) { unpatentArr.push($info[i].researchResult) } detailUnPat(aimId) } else { $("#showUnPatent").parents('.otherShow').hide() } var liLen = document.getElementById(aimId).querySelectorAll("li").length; // removeNodata(aimId); // if ($info.length == 0 && liLen == 0) { // $("#" + aimId).hide() // insertNodata(aimId, newStr); // } if (isbind) { $("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () { pageNo++ unpatentListVal(false) }) } if ($info.length < rows) { $("#" + aimId).parent().find(".js-load-more").unbind("click"); $("#" + aimId).parent().find(".js-load-more").hide(); } }, function () { $("#" + aimId).parent().find(".js-load-more").attr("disabled", true); $("#" + aimId).parent().find(".js-load-more").addClass("active"); }, function () { $("#" + aimId).parent().find(".js-load-more").removeAttr("disabled"); $("#" + aimId).parent().find(".js-load-more").removeClass("active"); }) }, //团队非专数据渲染 detailUnPat = function (obj) { //二次请求获取到id 请求数据进行渲染 oAjax("/ajax/resResult/qm", { id: unpatentArr, }, "get", function (data) { var dataStr = data.data; var strAdd = ''; if (dataStr.length > 0) { var src = "../images/default-resource.jpg"; var subject; if (dataStr[0].pic) { src = '/data/researchResult' + dataStr[0].pic.split(",")[0] } if (dataStr[0].subject) { subject = '应用领域:' + dataStr[0].subject } else { subject = '' } var department = dataStr[0].department == undefined ? '' : '所属部门: ' + dataStr[0].department document.getElementById('proUnPatent').parentNode.parentNode.classList.remove("displayNone"); var li = document.createElement("li"); li.setAttribute("data-id", dataStr[0].id); li.className = "mui-table-view-cell"; li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' + '<div class="madiaHead " style="background-image:url(' + src + ')"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty-2 h1Font">' + dataStr[0].name + '</p>' + '<p class="ellipsisSty h2Font dis">' + subject + '</p>' + '<p class="ellipsisSty h2Font org">' + '</p>' + //.substring(0, dataStr[i].authors.length - 1) '</div>' + '</div>' document.getElementById('proUnPatent').appendChild(li); if (dataStr[0].orgId) { console.log(dataStr[0].orgId) orgname(dataStr[0].orgId, li) } $("#" + obj).append(strAdd) console.log(dataStr.length) if (dataStr.length <= 1) { $('#seeMoreUnpatent').css('display', 'none') } $('#unpatentNum').text(dataStr.length) // if (i < 3) { // $("#showPatent").append(strAdd); // } } // $("#" + obj).append(strAdd); // if (i < 3) { // $("#showUnPatent").append(strAdd) // } // var $itemlist = $(strAdd); // // queryResearcher(dataStr[i].id, $itemlist) // // if (dataStr[i].orgId) { // // queryReseOrgName(dataStr[i].orgId, $itemlist) // // } }); }, paperListId = function () { oAjax('/ajax/team/paper', { 'id': tId, 'pageSize': 10, 'pageNo': 10 }, 'get', function (res) { if (res.data.data.length) { var $info = res.data.data[0].paper paperListVal($info) } if (res.data.total <= 1) { $('#forumNum').parent().parent().css('display', 'none') } $('#forumNum').text(res.data.total) }) } orgname = function (par, $pa) { $.ajax({ "url": "/ajax/org/" + par, "type": "GET", "success": function (data) { if (data.success) { $('.org').html('所属机构:' + data.data.name) } }, "data": { "id": par }, dataType: "json", 'error': function () { // $.MsgBox.Alert('提示', '服务器连接超时!'); } }); } // 论文 paperListVal = function (Id) { //论文 var aimId = "paperList" oAjax("/ajax/ppaper/qm", { id: Id }, "get", function (res) { if (res.data.length) { var obj = res.data; if (obj.length > 0) { var li = document.createElement("li"); li.setAttribute("data-id", obj[0].id); li.className = "mui-table-view-cell"; li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' + '<div class="madiaHead paperHead"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty-2 h1Font">' + obj[0].name + '</p>' + '<p class="ellipsisSty h2Font">' + obj[0].authors.substring(0, obj[0].authors .length - 1) + '</p>' + '</div>' + '</div>' document.getElementById(aimId).appendChild(li); $('#paperList').parent().parent().removeClass('displayNone') } } }) }, paperListId() //团队论文id teamofExperts() //专家团队 function teamofExperts() { oAjax('/ajax/team/pro', { id: tId, "pageSize": rows, "pageNo": 25, }, 'get', function (res) { if (res.success && res.data) { var data = res.data.data for (var i = 0; i < data.length; i++) { var paperN, patentN; $.ajax({ url: '/ajax/professor/coadjutant', data: { id: data[i].professor }, type: 'get', timeout: 400, success: function (res) { var $data = res.data for (let i = 0; i < $data.length; i++) { paperN = $data[i].paperCount patentN = $data[i].patentCount } } }) // var paperN = data.total; var ExpId = data[i].professor; //传专家id // var patentN = data[i].secretary; var secretary = '' var chief = '' var liItem = document.createElement("li"); liItem.className = "mui-table-view-cell flexCenter"; if (data[i].secretary) { //团队秘书 // console.log(secretary) secretary = data[i].professor } if (data[i].chief) { //团队专家 chief = data[i].professor } document.getElementById("relateTeam").appendChild(liItem); relExpertsList(ExpId, paperN, patentN, liItem, secretary, chief) //专家团队 } // console.log($('#personNum').parent().parent(1)); // data.length==1? $('#personNum').css('display','none'):$('#personNum').css('display:block') if (data.length == 1) { $('#personNum').parent().parent().css('display', 'none') } else { $('#personNum').parent().parent().css('display', 'block') } $('#personNum').text(data.length) } }) } //获取团队专家内部内容 function relExpertsList(Id, numL, numZ, liItem, secretary, chief) { $.ajax({ "url": "/ajax/professor/info/" + Id, "type": "GET", "dataType": "json", "success": function (data) { if (data.success && data.data != "") { // if (flay.secretary) { // console.log(flay.secretary) // } if (data.data.id === secretary) { spanA = "<span class='spanA'>" + '团队秘书' + "</span>" } else { spanA = '' } if (data.data.id === chief) { spanB = "<span class='spanB'>" + '首席专家' + "</span>" } else { spanB = '' } document.getElementById("relateTeam").parentNode.parentNode.classList.remove( "displayNone"); var thisTit, thisImg, spanA, spanB, copNum = "" if (data.data.hasHeadImage == 1) { thisImg = "/images/head/" + data.data.id + "_l.jpg);" } else { thisImg = "../images/default-photo.jpg);" } if (numL) { if (numZ) { copNum = "合作:" + numZ + "项专利," + numL + "篇论文" } else { copNum = "合作:" + numL + "篇论文" } } else { if (numZ) { copNum = "合作:" + numZ + "项专利" } else { } } if (data.data.title) { if (data.data.orgName) { thisTit = data.data.title + "," + data.data.orgName; } else { thisTit = data.data.title; } } else { if (data.data.office) { if (data.data.orgName) { thisTit = data.data.office + "," + data.data.orgName; } else { thisTit = data.data.office; } } else { if (data.data.orgName) { thisTit = data.data.orgName; } } } var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus); var itemlist = '<a href="p.html?id=' + data.data.id + '" class="urlgo"><div class="madiaHead useHead" style="background-image:url(' + thisImg + ')"></div>'; itemlist += '<div class="madiaInfo">'; itemlist += '<div class="tag-show">' + spanA + spanB + '</div>'; itemlist += '<p class="ellipsisSty"><span class="h1Font" id="userName">' + data.data .name + '</span><em class="authiconNew ' + userType.sty + '" title="' + userType .title + '"></em></p>'; itemlist += '<p class="ellipsisSty h2Font">' + thisTit + '</p>'; itemlist += '<p class="h2Font ellipsisSty">' + copNum + '</p>'; itemlist += '</div></a>'; liItem.innerHTML = itemlist liItem.setAttribute("data-id", data.data.id) var arr = $('#relateTeam').find('li').toArray() //首席专家排序处理 for (var i = 0; i < arr.length; i++) { if (arr[i].querySelector('.spanB')) { //如果找到手机专家标签交换位置 返回新数组 var index = i //团队专家索引 var temp = arr[0] arr[0] = arr[index] arr[index] = temp $('#relateTeam').html(arr) } } } }, "error": function () { $.MsgBox.Alert('提示', '链接服务器超时') } }); } patentListVal(true) unpatentListVal(true) </script> </body> </html>