123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304 |
- $(function() {
- loginStatus();
- var userid = $.cookie("userid");
- var professorId = GetQueryString("professorId");
- if(GetQueryString("flag")) {
-
- researchAlert(GetQueryString("flag"))
- }
- function researchAlert(cap){
- $.ajax({
- url: "/ajax/researchAreaLog/ql",
- dataType: 'json',
- type: 'GET',
- timeout: 10000,
- data: {
- "professorId": professorId,
- 'caption': cap,
- "rows": 1000
- },
- success: function(data) {
- console.log(data)
- if(data.success) {
- $("#areaCon").html("");
- var $info = data.data;
- $("#subArea").text(cap);
- $(".resAreaCover").fadeIn();
- $(".resAreaTip").addClass("displayNone")
- $(".resAreaCon").show()
- if($info.length == 0) {
- $(".resAreaCon").hide();
- $(".resAreaTip").removeClass("displayNone")
- return;
- }
- for(var i = 0; i < $info.length; i++) {
- var liItem = document.createElement("li");
- document.getElementById("areaCon").appendChild(liItem);
- detailPro($info[i],liItem);
- }
- $("body").css("position", "fixed");
- }
- },
- error: function() {}
- });
- }
- if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
- location.href="http://" + window.location.host + "/e/p.html?id="+professorId;
- }
- var oArray=[];
- var watchType=1;
- var QTime,QId,ATime,AId,WTime,WId,rows= 2;
-
- if(professorId) {
- getUserInfo(professorId);
-
- getResource(10,1,true);
- getArticle(10,1,true);
- getPaper(10,1,true);
- getPatent(10,1,true);
- getDemands(5,1,true);
- attentCount();
- collAttent(10,1,true);
- getMyAnswer(professorId,true);
- if(userid!=professorId){
- liulanAdd();
- relevantExperts();
- relevantarticalList();
- likeExperts();
- information();
- ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
- $(".goSpan").show();
- $(".moreBuUl li.attentType").hide();
- $(".moreBuUl li.attendMy").addClass("liNow").text("关注他的人");
- $("#item8user>.coninfobox").eq(9).show().siblings().hide();
- watchType=0;
- attentMy();
- }else{
- getMyQuestion(userid,true);
- $(".goSpanTo").show();
- $(".myoneself").show();
- }
- $(document).bind("click",function(e){
- var target = $(e.target);
- if(target.closest(".moreBuUl>li.rightbtn").length == 0){
- $(".table-drop").hide();
- }
- })
- $(".navconBox").on("click","li",function(){
- $(this).addClass("liNow").siblings().removeClass("liNow");
- $(".leftconBox .leftconItem").eq($(".navconBox li").index(this)).show().siblings().hide();
- })
- $(".navconBox>.mainNavUl").on("click","li:not('.rightbtn')",function(){
- $(".moreNav").hide();
- })
- $(".navconBox>.mainNavUl").on("click","li.wenda",function(){
- if(userid === professorId) {
- $(".wendaNav").show();
- }else{
- $("#item6user .coninfobox").eq(0).addClass("displayNone").siblings().removeClass("displayNone");
- }
- })
- $(".navconBox>.mainNavUl").on("click","li.rightbtn",function(){
- $(".moreBu").show();
- $(".wendaNav").hide();
- })
- $(".wendaUl").on("click","li",function(){
- console.log($(".wendaUl li").index(this))
- $("#item6user>.coninfobox").eq($(".wendaUl li").index(this)).show().siblings().hide();
-
- })
- $(".moreBuUl").on("click","li:not('.rightbtn')",function(){
- $("#item8user").find(".js-load-more").unbind();
- $("#item8user").find(".js-load-more").remove();
- $("#item8user").find("ul").each(function () {
- $(this).html("");
- });
- watchType=$(this).attr("data-num");
- console.log($(".moreBuUl li:not('.rightbtn')").index(this))
- $("#item8user>.coninfobox").eq($(".moreBuUl li:not('.rightbtn')").index(this)).show().siblings().hide();
- WTime = "";WId = "";
- if(watchType==0){
- attentMy()
- }else if(watchType == 9) {
- getMyWatchA(userid,true)
- }else if(watchType == 8) {
- getMyWatchQ(userid, true);
- }else{
- collAttent(10,1,true);
- }
- })
- $(".navconBox .moreBu>.moreBuUl").on("click","li.rightbtn",function(){
- $(this).find(".table-drop").show();
- })
- $(".table-drop").on("click","li",function(){
- $(".navconBox .moreBu>.moreBuUl>.rightbtn").find("span").html($(this).text());
- $(".table-drop").fadeOut(1000);
- })
-
- $("#myAttends").on("click",function(){
- $(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
- $(".navconBox .moreBu").show();
- $("#item8user").show().siblings().hide();
- $(".moreBuUl li.attentType").eq(0).addClass("liNow").siblings().removeClass("liNow");
- $("#item8user>.coninfobox").eq(0).show().siblings().hide();
- })
- $("#attendmyGo").on("click",function(){
- $(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
- $(".navconBox .moreBu").show();
- $("#item8user").show().siblings().hide();
- $(".moreBuUl li.attendMy").addClass("liNow").siblings().removeClass("liNow");
- $("#item8user>.coninfobox").eq(9).show().siblings().hide();
- watchType=0
- attentMy();
- })
-
- $("#conbtn").on('click', function(){
- if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
- location.href="tidings.html?id="+professorId
- } else {
- quickLog();
- operatTab();
- closeLog();
- }
- });
-
- $("#attentBtn").on('click', function() {
- if(userid && userid != null && userid != "null") {
- if($(this).is('.attenedSpan')){
- cancelCollectionAbout(professorId,$(this), 1)
- } else {
- collectionAbout(professorId,$(this), 1);
- }
- attentCount();
- attentMy();
- }else{
- quickLog();
- operatTab();
- closeLog();
- }
- });
-
- 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": oArray[$(this).data("caption")],
- "opId": userid,
- "uname":$.cookie("userName")
- },
- "contentType": "application/x-www-form-urlencoded",
- "success": function(dataStr) {
- if(dataStr.success) {
- $.get("/ajax/professor/info/" + professorId, function(dataStr) {
- if(dataStr.success) {
- clFlag = 1;
- var $info = dataStr.data;
- if($info) {
- $("#researchAreaShow").empty("")
- if($info.researchAreas) {
- researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
- }
- }
- }
- })
- } else {
- $.MsgBox.Alert("提示", dataStr.msg);
- }
- }
- });
- } else {
- quickLog();
- operatTab();
- closeLog();
- }
- })
- function information(){
- $.ajax({
- url: "/ajax/baseUserInfo",
- dataType: 'json',
- type: 'GET',
- timeout: 10000,
- data: {
- "id": professorId
- },
- "success": function(data) {
- if(data.success){
- console.log(data);
- if(!data.data.activeTime){
- $(".last_meg").removeClass("displayNone");
- $(".message_b").on("click",function(){
- $(".meg_md5").toggle();
- if(data.data.email && data.data.mobilePhone){
- $("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号或邮箱 '+data.data.email);
- }else if(data.data.mobilePhone && !data.data.email){
- $("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号');
- }else if(data.data.email && !data.data.mobilePhone){
- $("#wayTel").text('邮箱 '+data.data.email);
- }
- })
- }else{
- $(".last_meg").addClass("displayNone");
- }
- }
- },
- "error": function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- });
- }
-
- $("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
- var cap = $(this).attr("caption");
- researchAlert(cap)
- });
-
-
- $("#workclose").click(function() {
- $(".resAreaCover").fadeOut();
- $("body").css("position", "");
- });
-
-
- $(".coninfobox").on("click","#seeMoreR",function(){
- document.body.scrollTop = document.documentElement.scrollTop = 0;
- $(".navconBox ul>li").eq(1).addClass("liNow").siblings().removeClass("liNow");
- $("#item1user").hide();
- $("#item2user").show();
- })
-
- $(".coninfobox").on("click","#seeMoreA",function(){
- document.body.scrollTop = document.documentElement.scrollTop = 0;
- $(".navconBox ul>li").eq(2).addClass("liNow").siblings().removeClass("liNow");
- $("#item1user").hide();
- $("#item3user").show();
- })
-
- $(".coninfobox").on("click","#seeMoreP",function(){
- document.body.scrollTop = document.documentElement.scrollTop = 0;
- $(".navconBox ul>li").eq(3).addClass("liNow").siblings().removeClass("liNow");
- $("#item1user").hide();
- $("#item4user").show();
- })
-
- $(".coninfobox").on("click","#seeMoreL",function(){
- document.body.scrollTop = document.documentElement.scrollTop = 0;
- $(".navconBox ul>li").eq(4).addClass("liNow").siblings().removeClass("liNow");
- $("#item1user").hide();
- $("#item5user").show();
- })
-
- $(".coninfobox").on("click","#seeMoreQA",function(){
- document.body.scrollTop = document.documentElement.scrollTop = 0;
- $(".navconBox ul>li").eq(5).addClass("liNow").siblings().removeClass("liNow");
- $("#item1user").hide();
- $("#item6user").show();
- if(userid === professorId) {
- $(".wendaNav").show();
- }else{
- $("#item6user .coninfobox").eq(0).addClass("displayNone").siblings().removeClass("displayNone");
- }
- })
- }
-
- function attentCount(){
- $.ajax({
- type:"get",
- url:"/ajax/watch/countObject",
- data: {
- id: professorId,
- type: 1,
- },
- async:true,
- success:function(data){
- if(data.success){
- if(data.data){
- $("#myFocus").html(data.data)
- }else{
- $("#myFocus").html("0")
- }
- }
- }
- });
- $.ajax({
- type:"get",
- url:"/ajax/watch/countProfessor",
- data: {
- id: professorId,
- type: 1,
- },
- async:true,
- success:function(data){
- if(data.success){
- if(data.data){
- $("#focusMe").html(data.data)
- }else{
- $("#focusMe").html("0")
- }
- }
- }
- });
- }
- function liulanAdd() {
- $.ajax({
- "url": "/ajax/professor/incPageViews",
- "type": "POST",
- "dataType": "json",
- "async": true,
- "data": {
- "id": professorId,
- },
- "success": function(data) {
- if(data.success) {
- console.log(data);
- }
- },
- "error": function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- });
- }
-
- function getUserInfo(professorId){
- $.ajax({
- type:"get",
- url:"/ajax/professor/info/"+ professorId,
- async:true,
- success: function(data) {
- var $info = data.data;
- if(data.success) {
- console.log(data)
- if($info.hasHeadImage){
- $("#proHead").css("background-image","url(/images/head/"+ $info.id +"_l.jpg)");
- }
- $("#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($info.address + "<span style='margin-right:10px;'></span>");
- }
- var proOther="";
- if($info.orgName){
- if($info.department){
- if($info.office){
- proOther = $info.orgName + "," + $info.department + "," + $info.office
- }else{
- proOther = $info.orgName + "," + $info.department
- }
- }else{
- if($info.office){
- proOther = $info.orgName +"," + $info.office
- }else{
- proOther = $info.orgName
- }
- }
- }else{
- if($info.department){
- if($info.office){
- proOther = $info.department + "," + $info.office
- }else{
- proOther = $info.department
- }
- }else{
- if($info.office){
- proOther = $info.office
- }
- }
- }
- $("#proOther").text(proOther);
- var llqtitle=$info.name + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
- if($info.title){
- $("#proTit").html($info.title + "<span style='margin-right:10px;'></span>");
- llqtitle = $info.name + "-" + $info.title + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
- }
- document.title = llqtitle;
-
-
- $("#viewNums").text($info.pageViews);
-
- if($info.descp) {
- $("#descpS").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- $("#descpS").text($info.descp);
- }
-
- if($info.subject) {
- $("#subjectShow").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- subjectShow($info.subject);
- }
-
- if($info.researchAreas.length) {
- $("#researchAreaShow").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
- }
-
- if($info.industry) {
- $("#industryShow").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- industryShow($info.industry);
- }
-
- if($info.edus.length) {
- eduBgShow($info.edus);
- } else {
- $("#eduBgShow").parents(".coninfobox").hide();
- }
-
- if($info.jobs.length) {
- timeJobShow($info.jobs);
- } else {
- $("#timeJobShow").parents(".coninfobox").hide();
- }
-
- if($info.projects.length) {
- projectShow($info.projects)
- } else {
- $("#projectShow").parents(".coninfobox").hide();
- }
-
- if($info.honors.length) {
- honorShow($info.honors);
- } else {
- $("#honorShow").parents(".coninfobox").hide();
- }
-
- if($info.honors.length == 0 && $info.projects.length == 0 && $info.jobs.length == 0 && $info.edus.length == 0){
- $("#item6user>.nodatabox").show();
- $("#item6user>.nodatabox").find(".noContip").text("用户尚未完善详细资料")
- }
-
- var weibotitle = $info.name;
- var weibourl = window.location.href;
- var weibopic ="http://"+window.location.host+"/images/head/"+ $info.id +"_l.jpg";
- $("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
-
- }
- },
- error: function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- });
- }
- function subjectShow(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("<li>" + subs[i] + "</li>");
- };
- }
- }
- }
-
- function researchAreaShow(dataStrs, dataStrrecords) {
- if(dataStrs != undefined && dataStrs.length != 0) {
- var html = [];
- for(var i = 0; i < dataStrs.length; ++i) {
- var dataStr = dataStrs[i];
- var $photos = [];
-
- if(dataStrrecords.length > 0) {
- $photos = getRecords(dataStrrecords, dataStr.caption);
- }
- var isAgree = -1;
- for(var j = 0; j < $photos.length; j++) {
- if(userid == $photos[j].id)
- isAgree++;
- }
- oArray[i]=dataStr.caption;
- if(professorId != userid) {
- if(isAgree) {
- var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><span class="plus" data-pid="'+ dataStr.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ dataStr.caption +'">';
- } else {
- var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><span class="plus" style="background-position-y:-26px" data-pid="'+ dataStr.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ dataStr.caption +'">';
- }
- } else {
- var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><div class="favorCount" caption="'+ dataStr.caption +'">';
- }
- if($photos.length < 6) {
- for(var j = 0; j < $photos.length; ++j) {
- if($photos[j].img) {
- showDiv += '<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
- } else {
- showDiv += '<span class="like-people" style="background-image: url(../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" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
- } else {
- showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
- }
- }
- showDiv += '<span class="like-people like-more"></span>';
- }
- showDiv += "</div></li>";
- html.push(showDiv);
- }
- document.getElementById("researchAreaShow").innerHTML = html.join('');
- }
- }
- function industryShow(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><div class='h4tit'>" + subs[i] + "</div></li>");
- };
- }
- }
- }
- function projectShow(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- if(!data[i].descp) {
- data[i].descp = "";
- }
- var sDate = "";
- var eDate = "";
- if(data[i].startMonth) {
- sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
- sDateV = 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 projectHtml = '<li>';
- projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + sDate + eDate + '</small></div>';
- projectHtml += '<div class="h5Font">' + data[i].descp + '</div>';
- projectHtml += '</li>';
- $("#projectShow").append(projectHtml);
- }
- }
- }
- function honorShow(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- var timeho="";
- if(data[i].year){
- timeho = data[i].year+'年';
- }else{
- data[i].year="";
- }
- if(!data[i].descp) {
- data[i].descp = "";
- }
- var honorHtml = '<li>';
- honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + timeho + '</small></div>';
- honorHtml += '<div class="h5Font">' + data[i].descp + '</div>';
- honorHtml += '</li>';
- $("#honorShow").append(honorHtml);
- }
- }
- }
- function timeJobShow(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- if(data[i].department) {
- var dep = " - " + data[i].department;
- } else {
- var dep = ""
- }
- var sDate = "";
- var eDate = "";
- if(data[i].startMonth) {
- sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
- sDateV = 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 + dep + ' - ' + data[i].title + '<small class="h6Font">' + sDate + eDate + '</small></div>';
- JobHtml += '</li>';
- $("#timeJobShow").append(JobHtml);
- }
- }
- }
- function eduBgShow(data) {
- if(data.length > 0) {
- for(var i = 0; i < data.length; i++) {
- var college="",major="",degree=""
- if(data[i].college){
- college =' - ' + data[i].college
- }else{
- data[i].college="";
- }
- if(data[i].major){
- major =' - ' + data[i].major
- }else{
- data[i].major="";
- }
- if(data[i].degree){
- degree =' - ' + data[i].degree
- if(data[i].degree==0){
- degree =""
- }
- }else{
- data[i].degree="";
- }
- var timebiye="";
- if(data[i].year){
- if(data[i].year.trim()=="至今"){
- timebiye=data[i].year;
- }else{
- timebiye=data[i].year+'年';
- }
- }else{
- timebiye="";
- }
-
- var showHtml = '<li><div class="h4Font h4tit">'
- showHtml += data[i].school + college + major + degree;
- showHtml +='<small class="h6Font">' + timebiye + '</small></div></li>';
- $("#eduBgShow").append(showHtml);
- }
- }
- }
-
- function getRecords($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;
- }
-
-
- function historyEvaluate(){
- $.ajax({
- "url": "/ajax/consult/pqAssessHis",
- "type": "get",
- "data": {
- "professorId": professorId,
- "pageSize": 1000
- },
- "async": false,
- "success": function(response) {
- if(response.success) {
- var dataStr = response.data.data;
- if(dataStr.length>0){
- $("#historyEvaluate").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- for(var i = 0; i < dataStr.length; i++) {
- var assessTime = commenTime(dataStr[i].assessTime);
- var assessContant ="";
- if(dataStr[i].assessContant) {
- assessContant = dataStr[i].assessContant;
- }
- var userhed='';
- if(dataStr[i].professor.hasHeadImage) {
- userhed = 'background-image:url(/images/head/' + dataStr[i].professor.id + '_l.jpg)';
- } else {
- userhed = 'background-image:url(/images/default-photo.jpg)';
- }
- var add = "";
- add += '<li class="flexCenter">';
- add += '<a href="userInforShow.html?professorId='+ dataStr[i].professor.id +'" class="userhref"><div class="madiaHead useHead useHeadMsg" style="'+ userhed +'"></div></a>'
- add += '<div class="madiaInfo"><div style="position: relative;">';
- add += '<a href="userInforShow.html?professorId='+ dataStr[i].professor.id +'" class="userhref"><span class="h1Font messageName">'+ dataStr[i].professor.name +'</span></a>';
- add += '<em class="authiconNew authicon-pro" title=" "></em><span class="commenttime">'+ assessTime +'</span>';
- add += '<ul class="starShow">';
- add += '<li></li> <li></li> <li></li> <li></li> <li></li>';
- add += '</ul></div>';
- add += '<p class="h2Font messageContent">'+ assessContant +'</p>';
- add += '</div></li>';
-
- var $add = $(add);
- $("#historyEvaluate").append($add);
- $add.find(".starShow>li:lt(" + dataStr[i].assessStar + ")").addClass('evastar');
- }
- }else{
-
- }
-
- }
- }
- })
- }
-
- function getResource(pageSize, pageNo,isbind){
- $.ajax({
- "url": "/ajax/resource/pqProPublish",
- "type": "get",
- "async": false,
- "data": {
- "professorId": professorId,
- "pageSize": pageSize,
- "pageNo": pageNo
- },
- beforeSend: function() {
-
- $("#proResource").parent().find(".js-load-more").attr("disabled",true);
- $("#proResource").parent().find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#proResource").parent().find(".js-load-more").removeAttr("disabled");
- $("#proResource").parent().find(".js-load-more").removeClass("active");
- },
- "success": function(data) {
- console.log(data);
- if(data.success) {
- var madiaHead ='';
- if(data.data.total>0){
- $("#resCount").html(data.data.total)
- }else if(data.data.total>99){
- $("#resCount").html("99+")
- }
- var dataStr=data.data.data;
- if(dataStr.length > 0){
- $("#showResource").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- for(var i = 0; i < dataStr.length; i++) {
- if(dataStr[i].images.length) {
- madiaHead ='/data/resource/' + dataStr[i].images[0].imageSrc ;
- }else{
- madiaHead ='/images/default-resource.jpg';
- }
- var strAdd = '';
- strAdd += '<li><a target="_blank" href="resourceShow.html?resourceId='+ dataStr[i].resourceId +'" class="flexCenter urlgo">';
- strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ madiaHead +')"></div>';
- strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].resourceName +'</p><p class="h2Font ellipsisSty-2">用途:'+ dataStr[i].supportedServices+'</p></div>';
- strAdd += '</a></li>';
- var $strAdd = $(strAdd);
- $("#proResource").append(strAdd);
- if(isbind==true && i==0){
- var $strAddO=$(strAdd);
- $("#showResource").html("");
- $("#showResource").append($strAddO);
- }
- }
-
- if(isbind==true){
-
-
-
-
-
-
-
-
-
- $("#proResource").parent().find(".js-load-more").on("click", function () {
- getResource(10,++pageNo,false);
- });
- }
- if (pageNo >= Math.ceil(data.data.total / 10)) {
- $("#proResource").parent().find(".js-load-more").unbind("click");
- $("#proResource").parent().find(".js-load-more").hide();
- }
- }else{
- $("#proResource + .nodatabox").show();
- $("#proResource + .nodatabox").find(".noContip").text("用户尚未发布任何资源");
- if(isbind == true) {
- $("#proResource").parent().find(".js-load-more").hide();
- }
- }
- }
- },
- "error": function() {
- $.MsgBox.Alert("提示", "服务器连接超时")
- }
- });
- }
-
- function getArticle(pageSize, pageNo,isbind){
- $.ajax({
- url: "/ajax/article/pqProPublish",
- dataType: 'json',
- type: 'GET',
- data: {
- "professorId": professorId,
- "pageSize": pageSize,
- "pageNo": pageNo
- },
- beforeSend: function() {
-
- $("#proArticel").parent().find(".js-load-more").attr("disabled",true);
- $("#proArticel").parent().find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#proArticel").parent().find(".js-load-more").removeAttr("disabled");
- $("#proArticel").parent().find(".js-load-more").removeClass("active");
- },
- timeout: 10000,
- success: function(data) {
- if(data.success) {
- var madiaHead ='/images/default-artical.jpg';
- if(data.data.total>0){
- $("#artCount").html(data.data.total)
- }else if(data.data.total>99){
- $("#artCount").html("99+")
- }
- var dataStr=data.data.data;
- if(dataStr.length > 0){
- $("#showArticle").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- for(var i = 0; i < dataStr.length; i++) {
- if(dataStr[i].articleImg) {
- madiaHead ='/data/article/' + dataStr[i].articleImg ;
- }
- var sowU="";
- if(dataStr[i].pageViews!=0){
- if(dataStr[i].articleAgree!=0){
- sowU='<li><span>阅读量 '+dataStr[i].pageViews+'</span></li><li><span>赞 '+dataStr[i].articleAgree+'</span></li>'
- }else{
- sowU='<li><span>阅读量 '+dataStr[i].pageViews+'</span></li>'
- }
- }
-
- var strAdd = '';
- strAdd += '<li><a target="_blank" href="/'+ pageUrl('a',dataStr[i]) +'" class="flexCenter urlgo">';
- strAdd += '<div class="madiaHead artHead" style="background-image:url('+ madiaHead +')"></div>';
- strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr[i].articleTitle +'</p>';
- strAdd += '<ul class="h2Font clearfix">';
- strAdd += '<li><span class="time">'+ commenTime(dataStr[i].publishTime) +'</span></li>';
- strAdd += sowU
- strAdd += '<li><span class="comment"></span></li>';
- strAdd += '</ul></div>';
- strAdd += '</a></li>';
-
- var $strAdd = $(strAdd);
- $("#proArticel").append( $strAdd);
- commentnum(dataStr[i].articleId, $strAdd)
- if(isbind==true && i==0){
- var $strAddO = $(strAdd);
- $("#showArticle").html("");
- $("#showArticle").append($strAddO);
- commentnum(dataStr[0].articleId,$strAddO)
- }
- }
-
- if(isbind==true){
-
-
-
-
-
-
-
-
-
- $("#proArticel").parent().find(".js-load-more").on("click", function () {
- getArticle(10,++pageNo,false);
- });
- }
- if (pageNo >= Math.ceil(data.data.total / 10)) {
- $("#proArticel").parent().find(".js-load-more").unbind("click");
- $("#proArticel").parent().find(".js-load-more").hide();
- }
- }else{
- $("#proArticel + .nodatabox").show();
- $("#proArticel + .nodatabox").find(".noContip").text("用户尚未发布任何文章");
- if(isbind==true) {
- $("#proArticel").parent().find(".js-load-more").hide();
- }
- }
-
- }
- },
- error: function() {
- return;
- }
- });
-
- }
-
- function getPatent(pageSize, pageNo,isbind){
- $.ajax({
- url: "/ajax/ppatent/byProfessor",
- dataType: 'json',
- type: 'GET',
- data: {
- "id": professorId,
- "pageSize": pageSize,
- "pageNo": pageNo
- },
- beforeSend: function() {
-
- $("#proPatent").parent().find(".js-load-more").attr("disabled",true);
- $("#proPatent").parent().find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#proPatent").parent().find(".js-load-more").removeAttr("disabled");
- $("#proPatent").parent().find(".js-load-more").removeClass("active");
- },
- timeout: 10000,
- success: function(data) {
- if(data.success) {
- if(data.data.total>0){
- $("#patCount").html(data.data.total)
- }else if(data.data.total>99){
- $("#patCount").html("99+")
- }
- var dataStr=data.data.data;
- if(dataStr.length > 0){
- $("#showPatent").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- for(var i = 0; i < dataStr.length; i++) {
- if(!dataStr[i].reqPerson){
- dataStr[i].reqPerson="";
- }
- var strAdd = '';
- strAdd += '<li><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>';
-
- var $strAdd = $(strAdd);
- $("#proPatent").append( $strAdd);
- if(isbind==true && i==0){
- var $strAddO=$(strAdd);
- $("#showPatent").html("");
- $("#showPatent").append($strAddO);
- }
- }
-
- if(isbind==true){
-
-
-
-
-
-
-
-
-
- $("#proPatent").parent().find(".js-load-more").on("click", function () {
- getPatent(10,++pageNo,false);
- });
- }
- if (pageNo >= Math.ceil(data.data.total / 10)) {
- console.log("xmtt");
- $("#proPatent").parent().find(".js-load-more").unbind("click");
- $("#proPatent").parent().find(".js-load-more").hide();
- }
- }else{
- $("#proPatent + .nodatabox").show();
- $("#proPatent + .nodatabox").find(".noContip").text("用户尚未发布任何专利");
- if(isbind==true) {
- $("#proPatent").parent().find(".js-load-more").hide();
- }
- }
- }
- },
- error: function() {
- return;
- }
- });
- }
-
- function getPaper(pageSize, pageNo,isbind){
- $.ajax({
- url: "/ajax/ppaper/byProfessor",
- dataType: 'json',
- type: 'GET',
- data: {
- "id": professorId,
- "pageSize": pageSize,
- "pageNo": pageNo
- },
- beforeSend: function() {
-
- $("#proPaper").parent().find(".js-load-more").attr("disabled",true);
- $("#proPaper").parent().find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#proPaper").parent().find(".js-load-more").removeAttr("disabled");
- $("#proPaper").parent().find(".js-load-more").removeClass("active");
- },
- timeout: 10000,
- success: function(data) {
- if(data.success) {
- if(data.data.total>0){
- $("#parCount").html(data.data.total)
- }else if(data.data.total>99){
- $("#parCount").html("99+")
- }
- var dataStr=data.data.data;
- if(dataStr.length > 0){
- $("#showPaper").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- for(var i = 0; i < dataStr.length; i++) {
- var moreInf=""
- if(!dataStr[i].cn4periodical){
- dataStr[i].cn4periodical="";
- }
- if(!dataStr[i].en4periodical){
- dataStr[i].en4periodical="";
- }
- if(!dataStr[i].pubDay){
- dataStr[i].pubDay="";
- }
- moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
-
- var strAdd = '';
- strAdd += '<li><a target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
- strAdd += '<div class="madiaHead paperHead"></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">期刊:'+ moreInf +'</p>';
- strAdd += '</div>';
- strAdd += '</a></li>';
-
- var $strAdd = $(strAdd);
- $("#proPaper").append( $strAdd);
- if(isbind==true && i==0){
- var $strAddO=$(strAdd);
- $("#showPaper").html();
- $("#showPaper").append($strAddO);
- }
- }
-
- if(isbind==true){
-
-
-
-
-
-
-
-
-
- $("#proPaper").parent().find(".js-load-more").on("click", function () {
- getPaper(10,++pageNo,false);
- });
- }
- if (pageNo >= Math.ceil(data.data.total / 10)) {
- $("#proPaper").parent().find(".js-load-more").unbind("click");
- $("#proPaper").parent().find(".js-load-more").hide();
- }
- }else{
- $("#proPaper + .nodatabox").show();
- $("#proPaper + .nodatabox").find(".noContip").text("用户尚未发布任何论文");
- if(isbind) {
- $("#proPaper").parent().find(".js-load-more").hide();
- }
- }
- }
- },
- error: function() {
- return;
- }
- });
- }
-
- function getMyAnswer(id,isbind) {
- $.ajax({
- url: "/ajax/question/answer/bySelf",
- dataType: 'json',
- type: 'GET',
- data: {
- "time":ATime,
- "id":AId,
- "rows":rows,
- "uid":id
- },
- beforeSend: function() {
-
- $("#proA").parent().find(".js-load-more").attr("disabled",true);
- $("#proA").parent().find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#proA").parent().find(".js-load-more").removeAttr("disabled");
- $("#proA").parent().find(".js-load-more").removeClass("active");
- },
- success: function(data) {
- if(data.success) {
-
-
-
-
-
- var dataStr=data.data;
- if(dataStr.length > 0){
- $("#showAnswer").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- ATime = dataStr[dataStr.length - 1].createTime;
- AId = dataStr[dataStr.length - 1].id;
- for(var i = 0; i < dataStr.length; i++) {
- var listLi = $('<li class="mui-table-view-cell">').appendTo($("#proA"));
- answer(dataStr[i], listLi);
- if(isbind==true && i==0){
- var li = listLi.clone();
- $("#showAnswer").html();
- $("#showAnswer").append(li);
- questioninfo(dataStr[i].qid, li);
- proinfo(dataStr[i].uid, li);
- leaveMsgCount(dataStr[i].id, li);
- }
- }
- if(isbind==true){
- $("#proA").parent().find(".js-load-more").on("click", function () {
- getMyAnswer(id,false);
- });
- }
- if (dataStr.length < rows) {
- $("#proA").parent().find(".js-load-more").unbind("click");
- $("#proA").parent().find(".js-load-more").hide();
- }
- }else{
- $("#proA + .nodatabox").show();
- $("#proA + .nodatabox").find(".noContip").text("用户尚未回答任何问题");
- }
- }
- },
- error: function() {
- return;
- }
- });
- }
-
- function getMyQuestion(id,isbind) {
- $.ajax({
- url: "/ajax/question/my",
- dataType: 'json',
- type: 'GET',
- data: {
- "time":QTime,
- "id":QId,
- "rows":rows,
- "uid":id
- },
- beforeSend: function() {
-
- $("#proQ").parent().find(".js-load-more").attr("disabled",true);
- $("#proQ").parent().find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#proQ").parent().find(".js-load-more").removeAttr("disabled");
- $("#proQ").parent().find(".js-load-more").removeClass("active");
- },
- success: function(data) {
- if(data.success) {
-
-
-
-
-
- var dataStr=data.data;
- if(dataStr.length > 0){
- QTime = dataStr[dataStr.length - 1].createTime;
- QId = dataStr[dataStr.length - 1].id;
- for(var i = 0; i < dataStr.length; i++) {
- var listLi = $('<li class="mui-table-view-cell">').appendTo($("#proQ"));
- question(dataStr[i], listLi);
- if(isbind==true && i==0){
- $("#proQ").html();
- }
- }
- if(isbind==true){
- $("#proQ").parent().find(".js-load-more").on("click", function () {
- getMyQuestion(id,false);
- });
- }
- if (dataStr.length < rows) {
- $("#proQ").parent().find(".js-load-more").unbind("click");
- $("#proQ").parent().find(".js-load-more").hide();
- }
- }else{
- $("#proQ + .nodatabox").show();
- $("#proQ + .nodatabox").find(".noContip").text("用户尚未提出任何问题");
- }
- }
- },
- error: function() {
- return;
- }
- });
- }
-
- function getMyWatchQ(id,isbind) {
- $.ajax({
- url: "/ajax/question/watch",
- dataType: 'json',
- type: 'GET',
- data: {
- "time":WTime,
- "id":WId,
- "rows":rows,
- "uid":id
- },
- beforeSend: function() {
-
- $("#item8user").find(".js-load-more").attr("disabled",true);
- $("#item8user").find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#item8user").find(".js-load-more").removeAttr("disabled");
- $("#item8user").find(".js-load-more").removeClass("active");
- },
- success: function(data) {
- if(data.success) {
-
-
-
-
-
- var dataStr=data.data;
- if(dataStr.length > 0){
- WTime = dataStr[dataStr.length - 1].createTime;
- WId = dataStr[dataStr.length - 1].id;
- for(var i = 0; i < dataStr.length; i++) {
- var listLi = $('<li class="mui-table-view-cell">').appendTo($("#attendQuestion"));
- question(dataStr[i], listLi);
- if(isbind==true && i==0){
- var li = listLi.clone();
- $("#showAnswer").html();
- $("#showAnswer").append(li);
- questioninfo(dataStr[i].qid, li);
- proinfo(dataStr[i].uid, li);
- leaveMsgCount(dataStr[i].id, li);
- }
- }
- if(isbind==true){
- $("#item8user").append('<button class="js-load-more"></button>');
- $("#item8user").find(".js-load-more").on("click", function () {
- getMyWatchQ(id,false);
- });
- }
- if (dataStr.length < rows) {
- $("#item8user").parent().find(".js-load-more").unbind("click");
- $("#item8user").parent().find(".js-load-more").hide();
- }
- }else{
- $("#attendQuestion + .nodatabox").show();
- $("#attendQuestion + .nodatabox").find(".noContip").text("用户尚未回答任何问题");
- }
- }
- },
- error: function() {
- return;
- }
- });
- }
-
- function getMyWatchA(id,isbind) {
- $.ajax({
- url: "/ajax/question/answer/byWatch",
- dataType: 'json',
- type: 'GET',
- data: {
- "time":WTime,
- "id":WId,
- "rows":rows,
- "uid":id
- },
- beforeSend: function() {
-
- $("#item8user").find(".js-load-more").attr("disabled",true);
- $("#item8user").find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#item8user").find(".js-load-more").removeAttr("disabled");
- $("#item8user").find(".js-load-more").removeClass("active");
- },
- success: function(data) {
- if(data.success) {
-
-
-
-
-
- var dataStr=data.data;
- if(dataStr.length > 0){
- WTime = dataStr[dataStr.length - 1].createTime;
- WId = dataStr[dataStr.length - 1].id;
- for(var i = 0; i < dataStr.length; i++) {
- var listLi = $('<li class="mui-table-view-cell">').appendTo($("#attendAnswer"));
- answer(dataStr[i], listLi);
- }
- if(isbind==true){
- $("#item8user").append('<button class="js-load-more"></button>');
- $("#item8user").find(".js-load-more").on("click", function () {
- getMyWatchA(id,false);
- });
- }
- if (dataStr.length < rows) {
- $("#item8user").parent().find(".js-load-more").unbind("click");
- $("#item8user").parent().find(".js-load-more").hide();
- }
- }else{
- $("#attendAnswer + .nodatabox").show();
- $("#attendAnswer + .nodatabox").find(".noContip").text("用户尚未回答任何问题");
- }
- }
- },
- error: function() {
- return;
- }
- });
- }
-
- function commentnum(articleId, $itemlist) {
- $.ajax({
- "url": "/ajax/leaveWord/lwCount",
- "type": "GET",
- "dataType": "json",
- "async": false,
- "data": {
- "articleId": articleId
- },
- "success": function(data) {
- if(data.success) {
- if(data.data>0){
- $itemlist.find(".comment").text("留言 " + data.data);
- }
- }
- },
- "error": function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- });
- }
-
- function relevantExperts(){
- $.ajax({
- "url": "/ajax/professor/coadjutant",
- "type": "get",
- "dataType" : "json",
- "data" :{"id":professorId},
- "success": function(data) {
- if(data.success && data.data) {
- console.log(data)
- for(var i = 0; i < data.data.length; i++) {
- var ExpId = data.data[i].professorId;
- var paperN=data.data[i].paperCount;
- var patentN=data.data[i].patentCount;
- var liItem=$('<li class="flexCenter"></li>').appendTo($("#relatePro"));
- relExpertsList(ExpId,paperN,patentN,liItem);
- }
-
- }
- },
- "error": function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- });
- }
-
- function relExpertsList(Id,numL,numZ,liItem){
- $.ajax({
- "url" : "/ajax/professor/info/"+Id,
- "type" : "GET" ,
- "dataType" : "json",
- "success" : function(data) {
- if (data.success && data.data!=""){
- $("#relatePro").parents(".conBlock").removeClass("displayNone");
- var itemlist = '<a target="_blank" 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 += '<p class="h2Font ellipsisSty" id="copNum"></p>';
- itemlist += '</div></a>';
- $(itemlist).appendTo(liItem);
- var $itemlist =liItem;
- if(numL){
- if(numZ){
- $itemlist.find("#copNum").text("合作:"+numZ+"项专利,"+numL+"篇论文")
- }else{
- $itemlist.find("#copNum").text("合作:"+numL+"篇论文")
- }
- }else{
- if(numZ){
- $itemlist.find("#copNum").text("合作:"+numZ+"项专利")
- }else{
-
- }
- }
- 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", "userInforShow.html?professorId="+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('提示','链接服务器超时')
- }
- });
- }
-
- function relevantarticalList(){
- $.ajax({
- "url" : "/ajax/article/byAssProfessor",
- "type" : "GET" ,
- "dataType" : "json",
- "data" :{"id":professorId},
- "traditional": true,
- "success" : function(data) {
- console.log(data);
- if (data.success && data.data!=""){
- $("#relateArt").parents(".conBlock").removeClass("displayNone");
- var itemlist = '';
- $("#relateArt").html("");
- for(var i = 0; i < data.data.length; i++) {
- var itemlist = '<li class="flexCenter"><a target="_blank" href="/'+ pageUrl('a',data.data[i]) +'" class="urlgo">';
- itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
- itemlist += '</a></li>';
- $itemlist = $(itemlist);
- $("#relateArt").append($itemlist);
- }
- }
- },
- "error":function(){
- $.MsgBox.Alert('提示','链接服务器超时')
- }
- });
- }
-
- function likeExperts(){
- $.ajax({
- "url": "/ajax/professor/ralateProfessors",
- "type": "get",
- "dataType" : "json",
- "data" :{"professorId":professorId},
- "success": function(data) {
- if(data.success && data.data) {
- console.log(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(ExpId){
- $.ajax({
- "url" : "/ajax/professor/info/"+ExpId,
- "type" : "GET" ,
- "dataType" : "json",
- "success" : function(data) {
- if (data.success && data.data!=""){
- console.log(data)
- $("#likePro").parents(".conBlock").removeClass("displayNone");
- var itemlist = '<li class="flexCenter"><a target="_blank" 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", "userInforShow.html?professorId="+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('提示','链接服务器超时')
- }
- });
- }
-
-
- function getDemands(pageSize, pageNo,isbind) {
- $.ajax({
- url: "/ajax/demand/pq",
- type: "GET",
- timeout: 10000,
- dataType: "json",
- data: {
- "state":'1',
- "uid":professorId,
- "pageNo": pageNo,
- "pageSize":pageSize
- },
- beforeSend: function() {
- $("#showDemand").append('<img src="../images/loading.gif" class="loading" />');
- },
- success: function(data) {
- if(data.success) {
- $("#showDemand").html(" ");
- var $info = data.data.data;
- if($info.length > 0){
- $("#showDemand").parents(".needinfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- for(var i = 0; i < $info.length; i++) {
- var liStr=$("<li></li>").appendTo("#showDemand");
- demandHtml($info[i],liStr);
- }
- }else{
- $("#showDemand").parents(".needinfobox").addClass("displayNone");
- }
- }
- $(".loading").remove();
- },
- error: function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- })
- }
- function demandHtml(dataStr,liStr) {
- var sowU="";
- if(dataStr.pageViews!=0){
- sowU='<li><span>浏览量 '+dataStr.pageViews +'</span></li>'
- }
- var strCon='';
- strCon+='<a class="" target="_blank" href="demandShow.html?demandId='+dataStr.id+'" class="madiaInfo">'
- strCon+='<p class="h1Font ellipsisSty">'+ dataStr.title +'</p>'
- strCon+='<ul class="showliTop h3Font clearfix">'
- strCon+='<li><span>发布于 '+commenTime(dataStr.createTime)+'</span></li>'
- strCon+= sowU
- strCon+='</ul>'
- strCon+='<p class="h2Font ellipsisSty-2">'+dataStr.descp+'</p>'
- strCon+='<ul class="showli clearfix h3Font">'
-
- if(dataStr.city){ strCon+='<li>所在城市:'+dataStr.city+'</li>' }
- if(dataStr.duration!=0){ strCon+='<li>预期时长:'+demandDuration[dataStr.duration]+'</li>' }
- if(dataStr.cost!=0){ strCon+='<li>费用预算:'+demandCost[dataStr.cost]+'</li>' }
- if(dataStr.invalidDay){ strCon+='<li>有效期至:'+TimeTr(dataStr.invalidDay)+'</li>' }
-
- strCon+='</ul>'
- strCon+='</a>'
- $(strCon).appendTo(liStr);
- }
-
-
- function attentMy(){
- var num=watchType;
- $.ajax({
- url: "/ajax/watch/qaWatch",
- dataType: 'json',
- type: 'GET',
- data: {
- "watchObject": professorId,
- },
- timeout: 10000,
- success: function(data) {
- if(data.success) {
- document.getElementById("attendMy").innerHTML="";
- document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.add("displayNone");
- if(data.data.length>0){
- var datalist = data.data;
- for(var i = 0; i < datalist.length; i++) {
- var liItem = document.createElement("li");
- liItem.className="mui-table-view-cell";
- document.getElementById("attendMy").appendChild(liItem);
- detailPro(datalist[i],liItem);
- }
- }else{
- document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
- }
- }
- },
- error: function() {
- return;
- }
- });
- }
- function collAttent(pageSize, pageNo,isbind,num){
- if(!num){
- var num=watchType;
- }
- $.ajax({
- url: "/ajax/watch/qaPro",
- dataType: 'json',
- type: 'GET',
- data: {
- "professorId": professorId,
- "watchType": num,
- "pageNo": pageNo,
- "pageSize":pageSize
- },
- beforeSend: function() {
-
- $("#item8user").find(".js-load-more").attr("disabled",true);
- $("#item8user").find(".js-load-more").addClass("active");
- },
- complete:function () {
- $("#item8user").find(".js-load-more").removeAttr("disabled");
- $("#item8user").find(".js-load-more").removeClass("active");
- },
- timeout: 10000,
- success: function(data) {
- console.log(data)
- var tcdPage;
- if(data.success && data.data.data != "") {
- var datalist = data.data.data;
- if(num==1){
-
- for(var i = 0; i < datalist.length; i++) {
- var liItem = document.createElement("li");
- liItem.className="mui-table-view-cell";
- document.getElementById("attendPro").appendChild(liItem);
- detailPro(datalist[i],liItem);
- }
- }else if(num==2){
- detailRes(datalist);
- }else if(num==3){
- detailArt(datalist);
- }else if(num==4){
- detailPat(datalist);
- }else if(num==5){
- detailPer(datalist);
- }else if(num==6){
- detailCmp(datalist);
- }else if(num==7){
- detailDemand(datalist);
- }
- if(isbind==true){
-
-
-
-
-
-
-
-
- $("#item8user").append('<button class="js-load-more"></button>');
- $("#item8user").find(".js-load-more").on("click", function () {
- collAttent(10,++pageNo,false,num);
- });
- }
- if (pageNo >= Math.ceil(data.data.total / 10)) {
- $("#item8user").find(".js-load-more").unbind("click");
- $("#item8user").find(".js-load-more").hide();
- }
- }else{
- if(num==1){
- document.getElementById("attendPro").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
- if(isbind==true) {
- $("#attendPro").parent().find(".js-load-more").hide()
- }
- }else if(num==2){
- document.getElementById("attendRes").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
- if(isbind==true) {
- $("#attendRes").parent().find(".js-load-more").hide()
- }
- }else if(num==3){
- document.getElementById("attendArt").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
- if(isbind==true) {
- $("#attendArt").parent().find(".js-load-more").hide()
- }
- }else if(num==4){
- document.getElementById("attendPatent").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
- if(isbind==true) {
- $("#attendPatent").parent().find(".js-load-more").hide()
- }
- }else if(num==5){
- document.getElementById("attendPaper").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
- if(isbind==true) {
- $("#attendPaper").parent().find(".js-load-more").hide()
- }
- }else if(num==6){
- document.getElementById("attendCmp").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
- if(isbind==true) {
- $("#attendCmp").parent().find(".js-load-more").hide()
- }
- }else if(num==7){
- document.getElementById("attendDemand").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
- if(isbind==true) {
- $("#attendDemand").parent().find(".js-load-more").hide()
- }
- }
- }
- },
- error: function() {
- return;
- }
- });
- }
- function detailPro(datalist,liItem) {
- var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
- var os = "";
- if(datalist.professor.title) {
- if(datalist.professor.orgName) {
- os = datalist.professor.title + "," + datalist.professor.orgName;
- } else {
- os = datalist.professor.title;
- }
- } else {
- if(datalist.professor.office) {
- if(datalist.professor.orgName) {
- os = datalist.professor.office + "," + datalist.professor.orgName;
- } else {
- os = datalist.professor.office;
- }
- } else {
- if(datalist.professor.orgName) {
- os = datalist.professor.orgName;
- }
- }
- }
- var baImg = "../images/default-photo.jpg";
- if(datalist.professor.hasHeadImage == 1) {
- baImg = "/images/head/" + datalist.professor.id + "_l.jpg";
- }
- var strAdd = '';
- strAdd += '<a target="_blank" href="userInforShow.html?professorId='+ datalist.professor.id +'" class="flexCenter urlgo">';
- strAdd += '<div class="madiaHead useHead" style="width: 80px;height: 80px;margin-top: -40px;background-image:url(' + baImg + ')"></div>';
- strAdd += '<div class="madiaInfo" style="padding-left:92px"><p class="h1Font ellipsisSty">' + datalist.professor.name + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>';
- strAdd += '<p class="h2Font ellipsisSty">' + os + '</p>';
- strAdd += '</div>';
- strAdd += '</a>';
- liItem.innerHTML = strAdd
- }
- function detailCmp(datalist) {
-
- var arr=[];
- for(var i in datalist) {
- arr[i]=datalist[i].watchObject;
- }
- $.ajax({
- url:"/ajax/org/qm",
- data: {
- id:arr,
- },
- dataType: 'json',
- type: 'get',
- traditional: true,
- success: function(data) {
- if(data.success && data.data != "") {
- var dataStr=data.data;
- for(var i = 0; i < dataStr.length; i++) {
- var li = document.createElement("li");
- li.setAttribute("data-id", dataStr[i].id);
- var oimg = (dataStr[i].hasOrgLogo) ?"/images/org/" + dataStr[i].id + ".jpg" : "../images/default-icon.jpg";
- var oAuth = (dataStr[i].authStatus == 3) ? 'authicon-com-ok' : '';
- var orgName = (dataStr[i].forShort) ? dataStr[i].forShort : dataStr[i].name;
- var orgType = (dataStr[i].orgType == '2') ? "上市企业" : "";
- var orgOther = (dataStr[i].industry) ? dataStr[i].industry.replace(/,/gi, " | ") : "";
- li.className = "mui-table-view-cell";
- var itemlist=''
- itemlist += '<a class="flexCenter" target="_blank" href="cmpInforShow.html?orgId='+dataStr[i].id+'"><div class="madiaHead cmpHead">';
- itemlist += '<div class="boxBlock"><img class="boxBlockimg" src="' + oimg + '"></div></div>';
- itemlist += '<div class="madiaInfo">';
- itemlist += '<p class="h1Font"><span>' + orgName + '</span><em class="authiconNew ' + oAuth + '" title="科袖认证企业"></em></p>';
- itemlist += '<p class="h2Font ellipsisSty"><span>' + orgType + '</span> <span>' + orgOther + '</span></p>';
- itemlist += '</div></a>';
- li.innerHTML = itemlist
- document.getElementById("attendCmp").appendChild(li);
- }
- }
- },
- error: function() {
- }
- });
- }
- function detailPat(datalist) {
-
- if(datalist.length<0){
- $("#attendPatent + .nodatabox").removeClass("displayNone");
- return;
- }
- var arr=[];
- for(var i in datalist) {
- arr[i]=datalist[i].watchObject;
- }
- $.ajax({
- url:"/ajax/ppatent/qm",
- data: {
- id:arr,
- },
- dataType: 'json',
- type: 'get',
- traditional: true,
- success: function(data) {
- if(data.success && data.data != "") {
- var dataStr=data.data;
- for(var i = 0; i < dataStr.length; i++) {
- var li = document.createElement("li");
- li.className = "mui-table-view-cell";
- var strAdd = '';
- strAdd += '<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.innerHTML = strAdd
- document.getElementById("attendPatent").appendChild(li);
- }
- }
- },
- error: function() {
- }
- });
- }
- function detailPer(datalist) {
-
- var arr=[];
- for(var i in datalist) {
- arr[i]=datalist[i].watchObject;
- }
- $.ajax({
- url:"/ajax/ppaper/qm",
- data: {
- id:arr,
- },
- dataType: 'json',
- type: 'get',
- traditional: true,
- success: function(data) {
- if(data.success && data.data != "") {
- var dataStr=data.data;
- for(var i = 0; i < dataStr.length; i++) {
- var moreInf=""
- if(!dataStr[i].cn4periodical){
- dataStr[i].cn4periodical="";
- }
- if(!dataStr[i].en4periodical){
- dataStr[i].en4periodical="";
- }
- if(!dataStr[i].pubDay){
- dataStr[i].pubDay="";
- }
- moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
-
- var li = document.createElement("li");
- li.className = "mui-table-view-cell";
- var strAdd = '';
- strAdd += '<a target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
- strAdd += '<div class="madiaHead paperHead"></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">期刊:'+ moreInf +'</p>';
- strAdd += '</div>';
- strAdd += '</a>';
- li.innerHTML = strAdd
- document.getElementById("attendPaper").appendChild(li);
- }
- }
- },
- error: function() {
- }
- });
- }
- function detailRes(datalist) {
-
- for(var i = 0; i < datalist.length; i++) {
- var dataStr = datalist[i].resource;
- var namepo, userType;
- if(dataStr.resourceType == 1) {
- namepo = dataStr.editProfessor.name;
- userType = autho(dataStr.editProfessor.authType, dataStr.editProfessor.orgAuth, dataStr.editProfessor.authStatus);
- } else {
- if(dataStr.organization.forShort){
- namepo = dataStr.organization.forShort;
- }else{
- namepo = dataStr.organization.name;
- }
- userType={}
- if(dataStr.organization.authStatus==3){
- userType.sty="authicon-com-ok"
- userType.title="科袖认证企业"
- }
- }
- var rImg = "../images/default-resource.jpg";
- if(dataStr.images.length) {
- rImg = "/data/resource/" + dataStr.images[0].imageSrc;
- }
- var li = document.createElement("li");
- li.className = "mui-table-view-cell";
- var strAdd = '';
- strAdd += '<a target="_blank" href="resourceShow.html?resourceId='+ dataStr.resourceId +'" class="flexCenter urlgo">';
- strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ rImg +')"></div>';
- strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.resourceName +'</p>';
- strAdd += '<p class="h1Font ellipsisSty">'+ namepo +'<em class="authiconNew ' + userType.sty + '" title="'+userType.title+'"></em></p>';
- strAdd += '<p class="h2Font ellipsisSty-2">用途:'+ dataStr.supportedServices+'</p></div>';
- strAdd += '</a>';
- li.innerHTML =strAdd
- document.getElementById("attendRes").appendChild(li);
- }
- }
- function detailArt(datalist) {
-
- for(var i = 0; i < datalist.length; i++) {
- var dataItem = datalist[i].article;
- var arImg = "../images/default-artical.jpg";
- if(dataItem.articleImg) {
- arImg ="/data/article/" + dataItem.articleImg
- }
- var title = dataItem.articleTitle;
- var name = ""
- var li = document.createElement("li");
- if( dataItem.articleType == 1) {
- name = dataItem.professor.name;
- } else {
- if(dataItem.organization.forShort){
- name = dataItem.organization.forShort;
- }else{
- name = dataItem.organization.name;
- }
- }
- li.className = "mui-table-view-cell";
- var strAdd = '';
- strAdd += '<a target="_blank" href="/'+ pageUrl('a',dataItem) +'" class="flexCenter urlgo">';
- strAdd += '<div class="madiaHead artHead" style="background-image:url('+ arImg +')"></div>';
- strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataItem.articleTitle +'</p>';
- strAdd += '<ul class="h2Font clearfix">';
- strAdd += '<li><span>'+ name +'</span></li>';
- strAdd += '<li><span class="time">'+ commenTime(dataItem.publishTime) +'</span></li>';
- strAdd += '<li><span class="comment"></span></li>';
- strAdd += '</ul></div>';
- strAdd += '</a>';
- li.innerHTML = strAdd
- document.getElementById("attendArt").appendChild(li);
- }
- }
- function detailDemand(datalist) {
-
- var arr=[];
- for(var i in datalist) {
- arr[i]=datalist[i].watchObject;
- }
- $.ajax({
- url:"/ajax/demand/qm",
- data: {
- id:arr,
- },
- dataType: 'json',
- type: 'get',
- traditional: true,
- success: function(data) {
- if(data.success && data.data != "") {
- var dataStr=data.data;
- for(var i = 0; i < dataStr.length; i++) {
- var li = document.createElement("li");
- li.className = "mui-table-view-cell";
- var strCon='<a target="_blank" href="demandShow.html?demandId='+ dataStr[i].id +'" class="flexCenter urlgo">';
- strCon+='<div class="madiaInfo" style="padding-left:0">'
- strCon+='<p class="h1Font ellipsisSty">'+ dataStr[i].title +'</p>'
- strCon+='<ul class="showli clearfix h3Font">'
-
- if(dataStr[i].city){ strCon+='<li>'+dataStr[i].city+'</li>' }
- if(dataStr[i].duration!=0){ strCon+='<li>预期 '+demandDuration[dataStr[i].duration]+'</li>' }
- if(dataStr[i].cost!=0){ strCon+='<li>预算 '+demandCost[dataStr[i].cost]+'</li>' }
- if(dataStr[i].invalidDay){ strCon+='<li>有效期至 '+TimeTr(dataStr[i].invalidDay)+'</li>' }
-
- strCon+='</ul></div></a>'
-
- li.innerHTML = strCon
- document.getElementById("attendDemand").appendChild(li);
- }
- }
- },
- error: function() {
- }
- });
- }
- function answer(dataStr,listLi){
- var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.qid+'&topid='+dataStr.id+'">'+
- '<div class="madiaInfo" style="padding-left: 0">' +
- '<div class="ellipsisSty qa-question"></div>' +
- '<div class="flexCenter qa-owner">' +
- '</div>' +
- '<p class="qa-con ellipsisSty-3">' + (dataStr.cnt).replace(/\n/g,"<br />") +'</p>' +
- '<div class="showspan">' +
- '<span>'+commenTime(dataStr.createTime)+'</span>' +
- '<span class="agree"></span>' +
- '<span class="leaveMsgCount"></span>' +
- '</div>' +
- '</div></a>';
- var $strAdd = $(strAdd);
- listLi.append( $strAdd);
- if(dataStr.agree > 0) {
- $strAdd.find(".agree").html("赞 "+dataStr.agree);
- }
- questioninfo(dataStr.qid, $strAdd);
- proinfo(dataStr.uid, $strAdd);
- leaveMsgCount(dataStr.id, $strAdd);
- }
- function question(dataStr,listLi) {
- var baImg = "../images/default-q&a.jpg";
- var subs = new Array();
- if(dataStr.img) {
- if(dataStr.img.indexOf(',')) {
- subs = dataStr.img.split(',');
- } else {
- subs[0] = dataStr.img;
- }
- baImg = "/data/question"+ subs[0];
- }
- var hd = "";
- if (dataStr.replyCount > 0) {
- hd = '<li><span>回答 ' + dataStr.replyCount + '</span></li>'
- }
- var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.id+'" class="flexCenter urlgo">'
- strAdd += '<div class="madiaHead qa-Head" style="background-image:url('+ baImg +')"></div>';
- strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr.title +'</p>';
- strAdd += '<ul class="h2Font clearfix">'
- strAdd += '<li><span class="time">'+commenTime(dataStr.createTime)+'</span></li><li><span class="qaPageview"></span></li>'+hd+'<li><span class="attendCount"></span></li>'
- strAdd += '</ul></div></a>'
- var $str = $(strAdd);
- listLi.append($str);
- attendCount(dataStr.id, $str);
- questioninfo(dataStr.id, $str);
- }
- function proinfo(pid, $str) {
- $.ajax({
- "url":"/ajax/professor/baseInfo/" + pid,
- "type": "GET",
- "dataType": "json",
- "data": {},
- "success": function(data) {
- if(data.success) {
- 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="authicon ' + userType.sty + '" title="' + userType.title + '"></em></div>' +
- '<div class="owner-tit mui-ellipsis h2Font">' + os + '</div>' +
- '</div>'
- $str.find(".qa-owner").html(str)
- }
- },
- "error": function() {
- }
- });
- }
- function questioninfo(qid, $str) {
- $.ajax({
- "url":"/ajax/question/qo",
- "type": "GET",
- "dataType": "json",
- "data": {
- id:qid
- },
- "success": function(data) {
- if(data.success) {
- $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()
- }
- }
- },
- "error": function() {
- }
- });
- }
- function leaveMsgCount(id, $str) {
- $.ajax({
- "url":"/ajax/leavemsg/count",
- "type": "GET",
- "dataType": "json",
- "data": {
- sid:id,
- stype: "4"
- },
- "success": function(data) {
- if(data.success) {
- if(data.data > 0) {
- $str.find(".leaveMsgCount").html("留言 " + data.data);
- }
- }
- },
- "error": function() {
- }
- });
- }
- function attendCount(id, $str) {
- $.ajax({
- "url":"/ajax/watch/countProfessor",
- "type": "GET",
- "dataType": "json",
- "data": {
- id:id,
- type: 8
- },
- "success": function(data) {
- if(data.success) {
- if(data.data > 0) {
- $str.find(".attendCount").html("关注 "+data.data);
- }
- }
- },
- "error": function() {
- }
- });
- }
-
- $(".correctSubmit").on("click",function(){
- var cntCon=$(this).siblings(".correctCon").val();
- var cntUser="";
- if(userid && userid != null && userid != "null") {
- cntUser = userid;
- }
- if(cntCon.length>500){
- $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
- return;
- }else{
- $.ajax({
- "url": "/ajax/feedback/error/professor",
- "type": "POST",
- "dataType": "json",
- "async": true,
- "data": {
- "id": professorId,
- "cnt":cntCon,
- "user":cntUser
- },
- "success": function(data) {
- if(data.success) {
- backSuccessed();
- }
- },
- "error": function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- });
- }
- })
-
- })
|