12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142 |
- $(function() {
- loginStatus();
- var userid = $.cookie("userid");
- var professorId = GetQueryString("professorId");
- var name,orgId,orgAuth;
- if(userid == professorId) {
- $("#conbtn,.attentBtn").hide();
- }
- if(professorId) {
- var subjectShow = function(data) {
- if(data != undefined && data.length != 0) {
- var subs = new Array();
- if(data.indexOf(',')) {
- subs = data.split(',');
- } else {
- subs[0] = data;
- }
- if(subs.length > 0) {
- for(var i = 0; i < subs.length; i++) {
- $("#subjectShow").append("<div class='acad'>" + subs[i] + "</div>");
- };
- }
- }
- }
- var industryShow = function(data) {
- if(data != undefined && data.length != 0) {
- var subs = new Array();
- if(data.indexOf(',')) {
- subs = data.split(',');
- } else {
- subs[0] = data;
- }
- if(subs.length > 0) {
- for(var i = 0; i < subs.length; i++) {
- $("#industryShow").append("<li>" + subs[i] + "</li>");
- };
- }
- }
- }
- var eduBgShow = function(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- var showHtml = '<li><div class="h4Font h4tit">';
- if(data[i].college && data[i].major && data[i].degree) {
- showHtml += data[i].school + '-' + data[i].college + '-' + data[i].major + '-' + data[i].degree
- } else if(!data[i].college && data[i].major && data[i].degree) {
- showHtml += data[i].school + '-' + data[i].major + '-' + data[i].degree
- } else if(data[i].college && !data[i].major && data[i].degree) {
- showHtml += data[i].school + '-' + data[i].college + '-' + data[i].degree
- } else if(data[i].college && data[i].major && !data[i].degree) {
- showHtml += data[i].school + '-' + data[i].college + '-' + data[i].major
- } else if(!data[i].college && !data[i].major && data[i].degree) {
- showHtml += data[i].school + '-' + data[i].degree
- } else if(!data[i].college && data[i].major && !data[i].degree) {
- showHtml += data[i].school + '-' + data[i].major
- } else if(data[i].college && !data[i].major && !data[i].degree) {
- showHtml += data[i].school + '-' + data[i].college
- }
- if(typeof(data[i].year) !== "undefined") {
- showHtml += '<small class="h6Font">' + data[i].year + '</small>';
- } else {
- showHtml += "";
- }
- showHtml += "</div></li>";
- $("#eduBgShow").append(showHtml);
- }
- }
- }
- var timeJobShow = function(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- var sDate = "";
- var eDate = "";
- if(data[i].department) {
- var dep = "-" + data[i].department;
- } else {
- var dep = ""
- }
- if(data[i].startMonth) {
- sDate = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6) + "-";
- if(data[i].stopMonth) {
- eDate = data[i].stopMonth.substr(0, 4) + "-" + data[i].stopMonth.substr(4, 6);
- } else {
- eDate = "至今";
- }
- }
- var JobHtml = '<li>';
- JobHtml += '<div class="h4Font h4tit">' + data[i].company + '-' + data[i].title + '' + dep + '<small class="h6Font">' + sDate + '' + eDate + '</small></div>';
- JobHtml += '</li>';
- $("#timeJobShow").append(JobHtml);
- }
- }
- }
- var projectShow = function(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- if(!data[i].descp) {
- data[i].descp = "";
- }
- if(!data[i].startMonth) {
- data[i].startMonth = '';
- data[i].stopMonth = '';
- } else {
- data[i].startMonth = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6) + "-"
- if(!data[i].stopMonth) {
- data[i].stopMonth = '至今';
- } else {
- data[i].stopMonth = data[i].stopMonth.substr(0, 4) + "-" + data[i].stopMonth.substr(4, 6)
- }
- }
- var projectHtml = '<li class="paddingSpace">';
- projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].startMonth + '' + data[i].stopMonth + '</small></div>';
- projectHtml += '<div class="h5Font pIndent">' + data[i].descp + '</div>';
- projectHtml += '</li>';
- $("#projectShow").append(projectHtml);
- }
- }
- }
- var paperShow = function(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- if(!data[i].year) {
- data[i].year = "";
- }
- if(!data[i].descp) {
- data[i].descp = "";
- }
- if(!data[i].url) {
- data[i].url = "";
- }
- var paperHtml = '<li class="paddingSpace">';
- paperHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].year + '</small></div>';
- paperHtml += '<div class="h5Font pIndent">' + data[i].descp + '</div>';
- paperHtml += '</li>';
- $("#paperShow").append(paperHtml);
- }
- }
- }
- var patentShow = function(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- if(!data[i].year) {
- data[i].year = "";
- }
- if(!data[i].descp) {
- data[i].descp = "";
- }
- if(!data[i].url) {
- data[i].url = "";
- }
- var patentHtml = '<li class="paddingSpace">';
- patentHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].year + '</small></div>';
- patentHtml += '<div class="h5Font pIndent">' + data[i].descp + '</div>';
- patentHtml += '</li>';
- $("#patentShow").append(patentHtml);
- }
- }
- }
- var honorShow = function(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- if(!data[i].year) {
- data[i].year = "";
- }
- if(!data[i].descp) {
- data[i].descp = "";
- }
- var honorHtml = '<li class="paddingSpace">';
- honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].year + '</small></div>';
- honorHtml += '<div class="h5Font pIndent">' + data[i].descp + '</div>';
- honorHtml += '</li>';
- $("#honorShow").append(honorHtml);
- }
- }
- }
- var researchAreaShow = function($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 isAgree = -1;
- for(var j = 0; j < $photos.length; j++) {
- if(userid == $photos[j].id)
- isAgree++;
- }
- if(professorId != userid) {
- if(isAgree) {
- var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox' caption='" + $data.caption + "'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class='plus ' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox' caption='" + $data.caption + "'>";
- } else {
- var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox' caption='" + $data.caption + "'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class='plus' style=' background-position-y:-26px' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox' caption='" + $data.caption + "'>";
- }
- } else {
- var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox' caption='" + $data.caption + "'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><div class='like-num favorBox' caption='" + $data.caption + "'>";
- }
- if($photos.length < 6) {
- for(var j = 0; j < $photos.length; ++j) {
- if($photos[j].img) {
- showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_s.jpg'></span>";
- } else {
- showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>";
- }
- }
- } else {
- for(var j = $photos.length - 5; j < $photos.length; ++j) {
- if($photos[j].img) {
- showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_s.jpg'></span>";
- } else {
- showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>";
- }
- }
- showDiv += "<span class='like-people like-more userRadius'></span>";
- }
- showDiv += "</div></div></div>";
- html.push(showDiv);
- }
- document.getElementById("researchAreaShow").innerHTML = html.join('');
- }
- }
- var getRecords = function($researchAreaLogs, caption) {
- var ret = [];
- var t = 0;
- for(var i = 0; i < $researchAreaLogs.length; i++) {
- if(caption == $researchAreaLogs[i].caption) {
- ret[t] = {
- id: $researchAreaLogs[i].opreteProfessorId,
- img: $researchAreaLogs[i].hasHeadImage
- }
- t++;
- }
- }
- return ret;
- }
- var clFlag = 1;
- $("#researchAreaShow").on("click", ".plus", function() {
- if(userid && userid != null && userid != "null") {
-
- if(clFlag) {
- clFlag = 0;
- } else {
- return;
- }
- if($(this).data("isagree") > -1) {
- $(this).stop(true, true).animate({
- backgroundPositionY: 0
- }, 300);
- } else {
- $(this).stop(true, true).animate({
- backgroundPositionY: -26
- }, 300);
- }
- $.ajax({
- "url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
- "type": "POST",
- "data": {
- "targetId": $(this).data("pid"),
- "targetCaption": $(this).data("caption"),
- "opId": userid
- },
- "contentType": "application/x-www-form-urlencoded",
- "success": function($data) {
- if($data.success) {
- $.get("/ajax/professor/info/" + professorId, function($data) {
- if($data.success) {
- clFlag = 1;
- var $info = $data.data;
- if($info) {
- $("#researchAreaShow").empty("")
- if($info.researchAreas) {
- researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
- }
- }
- }
- })
- } else {
- $.MsgBox.Alert("message", $data.msg);
- }
- }
- });
- } else {
- $.MsgBox.Alert("消息", "请登录后点赞");
-
- }
- })
-
-
- $("#workclose").click(function() {
- $(".resAreaCover").fadeOut();
- $("body").css("position", "");
- });
- $("#researchAreaShow").on("click", ".list-browse,.like-num", function() {
- var cap = $(this).attr("caption");
-
- $.ajax({
- url: "/ajax/researchAreaLog/ql",
- dataType: 'json',
- type: 'GET',
- timeout: 10000,
- data: {
- "professorId": professorId,
- 'caption': cap,
- "rows": 10
- },
- success: function(data) {
- if(data.success) {
- $(".attentList").html("");
- var $info = data.data;
- $("#subArea").text(cap);
- $(".resAreaCover").fadeIn();
- $(".resAreaCon").show()
- if($info.length == 0) {
- $(".resAreaCon").hide();
- return;
- }
- for(var i = 0; i < $info.length; i++) {
- if($info[i].professor.hasHeadImage == 1) {
- var img = "/images/head/" + $info[i].professor.id + "_l.jpg";
- } else {
- var img = "../images/default-photo.jpg";
- }
-
- var oSty=autho($info[i].professor.authType,$info[i].professor.orgAuth,$info[i].professor.authStatus);
-
- var title = "",
- office = "",
- orgName = "",
- address = '';
- if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
- title = $info[i].professor.title + ",";
- office = $info[i].professor.office + ",";
- orgName = $info[i].professor.orgName + " | ";
- address = $info[i].professor.address;
- } else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
- office = $info[i].professor.office + ",";
- orgName = $info[i].professor.orgName + " | ";
- address = $info[i].professor.address;
- } else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
- title = $info[i].professor.title + ",";
- orgName = $info[i].professor.orgName + " | ";
- address = $info[i].professor.address;
- } else if($info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
- title = $info[i].professor.title + ",";
- office = $info[i].professor.office + " | ";
- address = $info[i].professor.address;
- } else if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
- title = $info[i].professor.title + ",";
- office = $info[i].professor.office + ",";
- orgName = $info[i].professor.orgName;
- } else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
- orgName = $info[i].professor.orgName + " | ";
- address = $info[i].professor.address;
- } else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
- office = $info[i].professor.office + " | ";
- address = $info[i].professor.address;
- } else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
- office = $info[i].professor.office + ",";
- orgName = $info[i].professor.orgName;
- } else if($info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
- title = $info[i].professor.title + " | ";
- address = $info[i].professor.address;
- } else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
- office = $info[i].professor.title + ",";
- address = $info[i].professor.orgName;
- } else if($info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
- title = $info[i].professor.title + ",";
- office = $info[i].professor.office;
- } else if(!$info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
- address = $info[i].professor.address;
- } else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
- orgName = $info[i].professor.orgName;
- } else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
- office = $info[i].professor.office;
- } else if($info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
- title = $info[i].professor.title;
- }
- var addw = '<li data-id="'+$info[i].professor.id+'" style="cursor:pointer">'
- addw += '<a class="proinfor clearfix">'
- addw += '<div class="headblock floatL"><img id="proHead" class="headimg userRadius" src="' + img + '"></div>'
- addw += '<div class="mediaBody">'
- addw += '<span class="listtit"><span id="proName">' + $info[i].professor.name + '</span><em class="authiconNew ' + oSty.sty + '" title="'+ oSty.title +'"></em></span>'
- addw += '<div class="listtit2">' + title + office + orgName + address + '</div>'
- addw += '</div></a></li>'
- $(".attentList").append(addw);
- }
-
- $("body").css("position", "fixed");
- }
- },
- error: function() {}
- });
- });
-
- $(".attentList").on("click","li",function(){
- var opid=$(this).attr("data-id");
- location.href="userInforShow.html?professorId="+opid;
- })
- $.get("/ajax/professor/info/" + professorId, function($data) {
- if($data.success) {
- var $info = $data.data;
- orgId=$info.orgId;
- orgAuth=$info.orgAuth;
- if(orgAuth==1){
- $("#orgNameS").css("cursor","pointer");
- }
- if($info) {
- if($info.authType == 1) {
- $(".yesshow").show();
- if(ass == 0){
- $('span:contains("合作历史及评价")').parents(".introduction").hide();
- }
- if(resou == 0 && ass == 0) {
- $('div:contains("合作机会")').parents(".menublock").hide();
- }
- } else {
- if($info.authentication == 3) {
- $("#office").hide();
- $("#titleS").hide();
- }
- }
-
- if($info.title) {
- var qtitle = " - " + $info.title;
- } else {
- var qtitle = "";
- }
- if($info.office) {
- var qoffice = " - " + $info.office;
- } else {
- var qoffice = "";
- }
- var llqtitle = $info.name + qtitle + qoffice + "-" + $info.orgName + "-科袖网";
- window.setInterval(function() {
- document.title = llqtitle;
- }, 500);
-
-
- var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
- $(".proModify").addClass(oStyS.sty);
- $(".proModify").attr("title",oStyS.title);
-
- $("#nameS").text($info.name);
- if($info.office) {
- if($info.title) {
- $("#office").text($info.office + ",");
- } else {
- $("#office").text($info.office);
- }
- }
- if($info.title) {
- $("#titleS").text($info.title);
- }
- if($info.department) {
- if($info.orgName) {
- $("#industryS").text($info.department + ",");
- } else {
- $("#industryS").text($info.department);
- }
- }
- if($info.orgName) {
- $("#orgNameS").text($info.orgName);
- }
- if($info.address) {
- $("#address").text($info.address);
- }
- if($info.hasHeadImage) {
- $("#headImage").attr("src", "/images/head/" + professorId + "_l.jpg");
- } else {
- $("#headImage").attr("src", "/images/default-photo.jpg");
- }
- $("#orgImage").attr("src", "/images/org/" + $info.orgId + ".jpg");
- $("#orgImage").load(function() {})
- .error(function() {
- $("#orgImage").attr("src", "/images/default-icon.jpg");
- });
-
- name = $info.name;
- if($info.descp == undefined && $info.subject == undefined && $info.researchAreas.length == 0 && $info.industry == undefined && $info.edus.length == 0 && $info.jobs.length == 0 && $info.projects.length == 0 && $info.papers.length == 0 && $info.patents.length == 0 && $info.honors.length == 0) {
- $("div:contains('个人信息')").parents(".menublock").hide();
- }
- if($info.descp) {
- $("#descpS").text($info.descp);
- } else {
- $("span:contains('个人简介')").parents(".introduction").hide();
- $("a:contains('个人简介')").hide();
- }
-
-
- if($info.authType == 1) {
- if($info.subject) {
- subjectShow($info.subject);
- } else {
- $("span:contains('学术领域')").parents(".introduction").hide();
- $("a:contains('学术领域')").hide();
- }
- } else {
- if($info.authentication == 1) {
- if($info.subject) {
- subjectShow($info.subject);
- } else {
- $("span:contains('学术领域')").parents(".introduction").hide();
- $("a:contains('学术领域')").hide();
- }
- } else {
- $("span:contains('学术领域')").parents(".introduction").hide();
- $("a:contains('学术领域')").hide();
- }
- }
-
- if($info.authType == 1) {
- if($info.researchAreas.length) {
- researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
- } else {
- $("span:contains('研究方向')").parents(".introduction").hide();
- $("a:contains('研究方向')").hide();
- }
- } else {
- $("span:contains('研究方向')").parents(".introduction").hide();
- $("a:contains('研究方向')").hide();
- }
-
- if($info.authType == 1) {
- if($info.industry) {
- industryShow($info.industry);
- } else {
- $("span:contains('应用行业')").parents(".introduction").hide();
- $("a:contains('应用行业')").hide();
- }
- } else {
- if($info.authentication == 2) {
- if($info.industry) {
- industryShow($info.industry);
- } else {
- $("span:contains('应用行业')").parents(".introduction").hide();
- $("a:contains('应用行业')").hide();
- }
- } else {
- $("span:contains('应用行业')").parents(".introduction").hide();
- $("a:contains('应用行业')").hide();
- }
- }
-
- if($info.edus.length) {
- eduBgShow($info.edus);
- } else {
- $("span:contains('教育背景')").parents(".introduction").hide();
- $("a:contains('教育背景')").hide();
- }
-
- if($info.jobs.length) {
- timeJobShow($info.jobs);
- } else {
- $("span:contains('工作经历')").parents(".introduction").hide();
- $("a:contains('工作经历')").hide();
- }
-
- if($info.projects.length) {
- projectShow($info.projects)
- } else {
- $("span:contains('项目经历')").parents(".introduction").hide();
- $("a:contains('项目经历')").hide();
- }
-
- if($info.papers.length) {
- paperShow($info.papers);
- } else {
- $("span:contains('著作、论文、文章')").parents(".introduction").hide();
- $("a:contains('著作、论文、文章')").hide();
- }
-
- if($info.patents.length) {
- patentShow($info.patents);
- } else {
- $("span:contains('专利')").parents(".introduction").hide();
- $("a:contains('专利')").hide();
- }
-
- if($info.honors.length) {
- honorShow($info.honors);
- } else {
- $("span:contains('荣誉及奖项')").parents(".introduction").hide();
- $("a:contains('荣誉及奖项')").hide();
- }
- var d;
- var t;
- $(function() {
- var art_height;
- var isHidden=$("#reA").is(":hidden");
- if(isHidden) {
- art_height=0;
- }else{
- art_height=$("#reA").outerHeight(true);
- }
-
- $(document).scroll(function() {
- var top3 = $(window).height();
- var top5 = $(".content-left").height();
- var top4 = $("#container").height() + art_height;
-
- var top1 = $(document).scrollTop();
- var top2 = $("#container").height() - top3 + (top3 - 80 - top5) - 10;
- if(top1 >= 300) {
- $(".content-left").css({
- "position": "fixed",
- "top": "80px"
- });
- if(top1 >= top2) {
- $('.information-content').css("position", "static");
- $(".content-left").css("position", "absolute");
- $(".content-left").css("top", top4 - top5 - 10 + "px");
- } else {
- $('.information-content').css("position", "relative");
- $(".content-left").css({
- "position": "fixed",
- "top": "80px"
- });
- }
- } else {
- $(".content-left").css({
- "position": "static"
- });
- }
-
- var foot_height = $(".footerblock").height();
- if(top1 >= 180 && top1 < top4 - top3) {
- $(".coulstblock").slideDown();
- $(".coulstblock").css({
- "bottom": "0"
- });
- } else if(top1 >= top4 - top3) {
- $(".coulstblock").css({
- "bottom": -(top4 - top3 - top1 ) - art_height + "px"
- });
- } else {
- $(".coulstblock").slideUp();
- $(".coulstblock").css({
- "bottom": "0"
- });
- }
- })
- });
-
- }
- }
- });
- }
- $("#hsearch").on("click", function() {
- var searchContent = $("#hsearchContent").val();
- location.href = "searchNew.html?searchContent=" + searchContent;
- });
-
-
-
- $(".subsidebar").mouseenter(function(){
- var dd=$(this)[0].className;
- if(dd!="subsidebar subcolor"){
- $(this).css("background","#efefef");
- }
- }).mouseleave(function(){
- $(this).css("background","")
- });
-
- $(".subsidebar").click(function() {
- $(".subsidebar").removeClass("subcolor");
- $(".subsidebar").eq($(".subsidebar").index(this)).addClass("subcolor");
- });
- $(".subsidebar").click(function() {
- var index = $(".subsidebar").index(this)+1;
-
- var offset = $(".introduction").eq(index).offset();
- $("body,html").animate({
- scrollTop: offset.top - 80 + "px"
- }, 1000);
- }).mousedown(function(){
- $(this).css("background","");
- });
-
-
-
- $.ajax({
- url: "/ajax/article/qaProPublish",
- dataType: 'json',
- type: 'GET',
- data: {
- "professorId": professorId
- },
- timeout: 10000,
- success: function(data) {
- if(data.success) {
- var pp=ifUserType(professorId)
- if(!pp.authType2) {
- $("#reA").hide();
- return;
- } else {
- if(data.data.length == 0) {
- $("#reA").hide();
- return;
- }
- $("#reA").show();
- for(var i = 0; i < data.data.length; i++) {
- var add = '<li><a href="articalShow.html?articleId=' + data.data[i].articleId + '" style="display:block;">'
- add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
- add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
- add += '</div><div class="tagsBox"><span></span></div>'
- add += '</a></li>';
- $add = $(add);
- $("#reachArticle").append($add);
- $add.find('.tagsBox span').text(data.data[i].subject);
- if(data.data[i].articleImg) {
- $add.find(".art_img").attr("style", "background: url(/data/article/" + data.data[i].articleImg + ") 0 0 no-repeat;background-size:cover;");
- }
- }
-
- var $content2 = $(".sharescrollbox.Acrollbox");
- var childcount2 = $content2.find(".otherRes.shareshow li").length;
- Carousel(3, 3, 3, childcount2, $content2, $(".articalbtn.resounext"), $(".articalbtn.resouprev"));
- }
- }
- },
- error: function() {
- return;
- }
- });
- var resou;
-
-
- $.ajax({
- "url": "/ajax/resource/qaProPublish",
- "type": "get",
- "async": false,
- "data": {
- "professorId": professorId
- },
- "success": function(data) {
- console.log(data);
- if(data.success) {
- var pp=ifUserType(professorId)
- if(!pp.authType2) {
- $("span:contains('研发资源')").parents(".introduction").hide();
- return;
- } else {
- resou = data.data.length;
- if(data.data.length == 0) {
- $("#infor-browse").css("display", "none");
- $("span:contains('研发资源')").parents(".introduction").hide();
- $("a:contains('研发资源')").hide();
- return;
- } else {
- $("span:contains('研发资源')").parents(".introduction").show();
- }
- if(data.data.length > 3) {
- $("#infor-browse").css("display", "block");
- $(".resoubtn").css("display", "block");
- }
- var add = "";
- for(var i = 0; i < data.data.length; i++) {
- add = '<div class="sharesrc">'
- add += '<div class="shareshow">'
- add += '<a href="resourceShow.html?resourceId=' + data.data[i].resourceId + '"class="remess" style="display:block;" resourceId=' + data.data[i].resourceId + '>'
- add += '<div class="ResImgBox" style="max-width:200px;width:200px;height: 200px;">'
- add += '<img class="resImg headRadius resourceImg" src="/images/resource/' + data.data[i].resourceId + '.jpg" />'
- add += '</div></a>'
- add += '<div class="shareopeart"><a class="sharebtn resourceConsult" professorId=' + data.data[i]["professorId"] + '>咨询</a><a class="sharebtn applicant" style="display:none">申请</a></div>'
- add += '</div>'
- add += '<p class="restit ellipsisSty">资源名称:<span class="presou consultTitleVal" resourceConsultTitle = "">' + data.data[i].resourceName + '</span></p>'
- add += '<p class="briefinfor ellipsisSty-2">应用用途:' + data.data[i].supportedServices + '</p>'
- add += '</div>'
- $("#sharescrollbox").append(add);
- $('.applicant').eq(i).attr("resourceId", data.data[i].resourceId);
- if(data.data[i].images.length) {
- $(".resourceImg").eq(i).attr("src","/data/resource/" + data.data[i].images[0].imageSrc);
- }else{
- $(".resourceImg").eq(i).attr("src","/images/default-resource.jpg");
- }
- add = "";
- }
-
- var $content = $("#sharescrollbox");
- var childcount = $content.find(".sharesrc").length;
- Carousel(3, 3, 3, childcount, $content, $(".resoubtn2.resounext"), $(".resoubtn2.resouprev"));
-
- $(".introduction").find(".resourceConsult").bind("click", clickResourceConsult);
- }
- } else {
- $.MsgBox.Alert("消息", "系统异常!");
- }
- },
- "error": function() {
- $.MsgBox.Alert('message', 'failddd')
- }
- });
- function getIdentity(professorId) {
- $.ajax({
- "url": "ajax/professor/" + professorId,
- "type": "get",
- "async": false,
- "success": function(data) {
- if(data.success) {
-
- $("option")[0].value = data.data.name;
- $("option")[1].value = data.data.organization.name;
-
-
- } else {
- $.MsgBox.Alert("消息", "系统异常!");
- }
- },
- "error": function() {
- $.MsgBox.Alert('message', 'failddd')
- }
- })
- }
-
- $('.introduction').on("click", '.applicant', function() {
- if(userid && userid != null && userid != "null") {
- ResourceApply();
- $(".limitBox").removeClass("limitBox");
- $(".limitwords").removeClass("limitwords");
- $(".limitwordbox").removeClass("limitwordbox");
-
- var myDate = new Date();
- var nowYear = myDate.getFullYear();
- var nowMonth = myDate.getMonth() + 1;
- var nowDate = myDate.getDate();
- if(nowMonth < 10) {
- nowMonth = "0" + nowMonth.toString();
- }
- if(nowDate < 10) {
- nowDate = "0" + nowDate.toString();
- }
- var now = nowYear + "-" + nowMonth + "-" + nowDate;
- $("#datepicker").val(now);
- $("#datepicker").datepicker({
- "dateFormat": " yy-mm-dd"
- });
- $(".timelo").css("display", "none");
- $(".namecon").text(name);
- $(".applysure").hide();
- $(".btnboxup").hide();
- var index1 = $(this).parent().parent().parent().index();
- var resName = $('.presou').eq(index1).text();
- var resourceID = $(this).attr("resourceId");
- $.ajax({
- "url": "/ajax/resource/" + resourceID,
- "type": "get",
- "async": false,
- "success": function(info) {
- if(info.success) {
- if(info.data.images.length) {
- $(".resouImage").attr("src", "/images/resource/" + resourceID + ".jpg");
- } else {
- $(".resouImage").attr("src", "/images/default-resource.jpg");
- }
- }
- }
- })
- $(".log").text(resName);
- getIdentity(userid);
- $("#deliver").on("click", function() {
- var $data = {};
- $data.demandId = userid;
- $data.resourceId = resourceID;
- $data.detailDemand = $(".detail").val();
-
- $data.deliverTime = replaceStr($.trim($(".dealTime").val()));
-
-
- $data.operationStatus = 1;
- $data.applysquare = $("select option:selected").val();
-
- $.ajax({
- "url": "/ajax/operation",
- "type": "POST",
- "success": function(rdata) {
- if(rdata.success) {
- $.MsgBox.Alert('message', '资源"' + resName + '"申请发送成功!');
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- $(".blackcover").remove();
- $("body").css("position", "");
-
- } else {
- $.MsgBox.Alert('message', '资源"' + resName + '"申请发送失败,请重新申请!');
- }
- },
- "data": $data,
- "beforeSend": function() { },
- "contentType": "application/x-www-form-urlencoded",
- dataType: "json"
- });
- });
- } else {
- $.MsgBox.Alert("消息", "您还未登录,请登录之后进行资源申请");
- }
- });
-
- function clickResourceConsult() {
- if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
- var professorId = $(this).attr("professorId");
- consultHandler();
- var liEle = $("ul.menucon").children();
- for(var i = 0; i < liEle.length; i++) {
- $(liEle[i]).removeClass('clicknow');
- $(liEle[1]).addClass("clicknow");
- };
- var item = $(this).parent().parent().parent();
- var consultTitleVal = item.find(".consultTitleVal").text();
- $("#consultTitle").val("关于" + consultTitleVal + "的咨询");
- } 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');
- }
- };
-
- var userid = $.cookie("userid");
- var professorId = GetQueryString("professorId");
-
- $("#consultbtn,#conbtn").bind('click', consultHandler);
- function consultHandler() {
- if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
- ConsultApply();
- concultProInfo(professorId);
-
- $("#sendConsultBtn").click(function() {
- sendConsultHandler($(this).attr("proId"));
- });
- } 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');
- }
- };
-
- var ass;
- $.ajax({
- "url": "/ajax/consult/pqAssessHis",
- "type": "get",
- "data": {
- "professorId": professorId
- },
- "async": false,
- "success": function(response) {
- if(response.success) {
- var $data = response.data.data;
- ass = $data.length;
- if($data.length == 0) {
- $("span:contains('合作历史及评价')").parents(".introduction").hide();
- $("a:contains('合作历史及评价')").hide();
- }
- for(var i = 0; i < $data.length; i++) {
- var add = "";
- var assessTime = $data[i]["assessTime"].substr(0, 4) + "-" + $data[i].assessTime.substr(4, 2) + "-" + $data[i].assessTime.substr(6, 2) + " " +
- $data[i].assessTime.substr(8, 2) + ":" + $data[i].assessTime.substr(10, 2);
- add += '<div class="evaluate2">'
- add += '<div class="lefteva">'
- add += '<a class="evaimg userRadius">'
- if($data[i].professor.hasHeadImage) {
- add += '<img src="/images/head/' + $data[i].professor.id + '_l.jpg" width="100%" height="100%">'
- } else {
- add += '<img src="/images/default-photo.jpg" width="100%" height="100%">'
- }
- add += '</a>'
- add += '<p>' + $data[i].professor.name + '</p><p>'
-
-
-
-
-
-
- add += '</p><p>'
-
-
-
-
-
-
- add += '</p>'
- add += '</div>'
- add += '<div class="righteva">'
- add += '<ul class="evasort">'
- add += '<li>咨询时间:<span>' + assessTime + '</span></li>'
- add += '</ul>'
- add += '<div class="evastarbox" id="evastarboxx" style="margin-left: -5px;">'
- add += '<span class="evastar"></span>'
- add += '<span class="evastar"></span>'
- add += '<span class="evastar"></span>'
- add += '<span class="evastar"></span>'
- add += '<span class="evastar"></span>'
- add += '</div>'
- if($data[i].assessContant) {
- add += '<p class="evabrief">' + $data[i].assessContant + ' </p>'
- }
- add += '</div>'
- add += '</div>'
- var $add = $(add);
- $(".shareabout2").append($add);
- $add.find(".evastar:lt(" + $data[i].assessStar + ")").addClass('staspan');
- }
- $(".evaluate2").eq($data.length - 1).css("border-bottom", "none");
- }
- }
- })
- proinfo(professorId);
-
- function proinfo(professorId) {
- $.ajax({
- url: "/ajax/professor/editBaseInfo/" + professorId,
- type: "get",
- data: {
- "id": professorId
- },
- contentType: "application/x-www-form-urlencoded",
- success: function(response) {
- var myData = response["data"];
-
- $("#foot_proname").html(myData["name"]);
- if(myData["address"]) {
- $("#foot_proaddress").html(' | ' + myData["address"]);
- }
- if(myData["title"]) {
- $("#foot_protitle").html(myData["title"]);
- }
- if(myData["department"]) {
- $("#foot_prodepar").html(myData["department"]);
- }
- if(myData["orgName"]) {
- if(myData["department"] == null || myData["department"] == '') {
- $("#foot_proorgname").html(myData["orgName"]);
- } else {
- $("#foot_proorgname").html(',' + myData["orgName"]);
- }
- }
-
- var oStyT=autho(myData.authType,myData.orgAuth,myData.authStatus);
- $("#foot_promodify").addClass(oStyT.sty);
- $("#foot_promodify").attr("title",oStyT.title);
-
- if(myData["hasHeadImage"] == 0) {
- $("#foot_proimg").attr("src", "images/default-photo.jpg");
- } else {
- $("#foot_proimg").attr("src", "images/head/" + myData["id"] + "_l.jpg");
- }
- },
- error: function(error) {
- $.MsgBox.Alert("message", "请求数据失败");
- }
- });
- }
- $("#orgNameS").click(function(){
- if(orgAuth==1){
- location.href="companybrowinfor.html?orgId="+orgId;
- }
-
- })
-
- })
|