123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143 |
- $(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="information-brow.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 = "search.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/qaPro",
- 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="articalInfo.html?articleId=' + data.data[i].articleId + '&professorId=' + professorId + '" 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].industry);
- 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/qapro",
- "type": "get",
- "async": false,
- "data": {
- "professorId": professorId
- },
- "success": function(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="resourceInfo.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);
- $(".resourceImg").eq(i).attr("src", "/images/resource/" + data.data[i].resourceId + ".jpg");
- $(".resourceImg").load(function() {})
- .error(function() {
- $(this).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;
- }
-
- })
-
- })
|