portal html css js resource

userInforShow.js 74KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126
  1. $(function() {
  2. loginStatus();//判断个人是否登录
  3. var userid = $.cookie("userid");
  4. var professorId = GetQueryString("professorId");
  5. if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
  6. location.href="http://" + window.location.host + "/e/p.html?id="+professorId;
  7. }
  8. var oArray=[];
  9. function subjectShow(data) {
  10. if(data != undefined && data.length != 0) {
  11. var subs=strToAry(data)
  12. if(subs.length > 0) {
  13. for(var i = 0; i < subs.length; i++) {
  14. $("#subjectShow").append("<li>" + subs[i] + "</li>");
  15. };
  16. }
  17. }
  18. }
  19. function researchAreaShow(dataStrs, dataStrrecords) {
  20. if(dataStrs != undefined && dataStrs.length != 0) {
  21. var html = [];
  22. for(var i = 0; i < dataStrs.length; ++i) {
  23. var dataStr = dataStrs[i];
  24. var $photos = [];
  25. //获取头像
  26. if(dataStrrecords.length > 0) {
  27. $photos = getRecords(dataStrrecords, dataStr.caption);
  28. }
  29. var isAgree = -1;
  30. for(var j = 0; j < $photos.length; j++) {
  31. if(userid == $photos[j].id)
  32. isAgree++;
  33. }
  34. oArray[i]=dataStr.caption;
  35. if(professorId != userid) {
  36. if(isAgree) {
  37. 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 +'">';
  38. } else {
  39. 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 +'">';
  40. }
  41. } else {
  42. var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><div class="favorCount" caption="'+ dataStr.caption +'">';
  43. }
  44. if($photos.length < 6) {
  45. for(var j = 0; j < $photos.length; ++j) {
  46. if($photos[j].img) {
  47. showDiv += '<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
  48. } else {
  49. showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
  50. }
  51. }
  52. } else {
  53. for(var j = $photos.length - 5; j < $photos.length; ++j) {
  54. if($photos[j].img) {
  55. showDiv +='<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
  56. } else {
  57. showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
  58. }
  59. }
  60. showDiv += '<span class="like-people like-more"></span>';
  61. }
  62. showDiv += "</div></li>";
  63. html.push(showDiv);
  64. }
  65. document.getElementById("researchAreaShow").innerHTML = html.join('');
  66. }
  67. }
  68. function industryShow(data) {
  69. if(data != undefined && data.length != 0) {
  70. var subs=strToAry(data)
  71. if(subs.length > 0) {
  72. for(var i = 0; i < subs.length; i++) {
  73. $("#industryShow").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
  74. };
  75. }
  76. }
  77. }
  78. function projectShow(data) {
  79. if(data.length > 0) {
  80. for(var i = 0; i < data.length; i++) {
  81. if(!data[i].descp) {
  82. data[i].descp = "";
  83. }
  84. var sDate = "";
  85. var eDate = "";
  86. if(data[i].startMonth) {
  87. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
  88. sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
  89. if(data[i].stopMonth) {
  90. eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  91. } else {
  92. eDate = " - "+ "至今";
  93. }
  94. }
  95. var projectHtml = '<li>';
  96. projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + sDate + eDate + '</small></div>';
  97. projectHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  98. projectHtml += '</li>';
  99. $("#projectShow").append(projectHtml);
  100. }
  101. }
  102. }
  103. function honorShow(data) {
  104. if(data.length > 0) {
  105. for(var i = 0; i < data.length; i++) {
  106. var timeho="";
  107. if(data[i].year){
  108. timeho = data[i].year+'年';
  109. }else{
  110. data[i].year="";
  111. }
  112. if(!data[i].descp) {
  113. data[i].descp = "";
  114. }
  115. var honorHtml = '<li>';
  116. honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + timeho + '</small></div>';
  117. honorHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  118. honorHtml += '</li>';
  119. $("#honorShow").append(honorHtml);
  120. }
  121. }
  122. }
  123. function timeJobShow(data) {
  124. if(data.length > 0) {
  125. for(var i = 0; i < data.length; i++) {
  126. if(data[i].department) {
  127. var dep = " - " + data[i].department;
  128. } else {
  129. var dep = ""
  130. }
  131. var sDate = "";
  132. var eDate = "";
  133. if(data[i].startMonth) {
  134. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
  135. sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
  136. if(data[i].stopMonth) {
  137. eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  138. } else {
  139. eDate = " - "+ "至今";
  140. }
  141. }
  142. var JobHtml = '<li>';
  143. JobHtml += '<div class="h4Font h4tit">' + data[i].company + dep + ' - ' + data[i].title + '<small class="h6Font">' + sDate + eDate + '</small></div>';
  144. JobHtml += '</li>';
  145. $("#timeJobShow").append(JobHtml);
  146. }
  147. }
  148. }
  149. function eduBgShow(data) {
  150. if(data.length > 0) {
  151. for(var i = 0; i < data.length; i++) {
  152. var college="",major="",degree=""
  153. if(data[i].college){
  154. college =' - ' + data[i].college
  155. }else{
  156. data[i].college="";
  157. }
  158. if(data[i].major){
  159. major =' - ' + data[i].major
  160. }else{
  161. data[i].major="";
  162. }
  163. if(data[i].degree){
  164. degree =' - ' + data[i].degree
  165. if(data[i].degree==0){
  166. degree =""
  167. }
  168. }else{
  169. data[i].degree="";
  170. }
  171. var timebiye="";
  172. if(data[i].year){
  173. if(data[i].year.trim()=="至今"){
  174. timebiye=data[i].year;
  175. }else{
  176. timebiye=data[i].year+'年';
  177. }
  178. }else{
  179. timebiye="";
  180. }
  181. var showHtml = '<li><div class="h4Font h4tit">'
  182. showHtml += data[i].school + college + major + degree;
  183. showHtml +='<small class="h6Font">' + timebiye + '</small></div></li>';
  184. $("#eduBgShow").append(showHtml);
  185. }
  186. }
  187. }
  188. //判断点赞的用户是否有头像
  189. function getRecords($researchAreaLogs, caption) {
  190. var ret = [];
  191. var t = 0;
  192. for(var i = 0; i < $researchAreaLogs.length; i++) {
  193. if(caption == $researchAreaLogs[i].caption) {
  194. ret[t] = {
  195. id: $researchAreaLogs[i].opreteProfessorId,
  196. img: $researchAreaLogs[i].hasHeadImage
  197. }
  198. t++;
  199. }
  200. }
  201. return ret;
  202. }
  203. function openAttend(){//打开收藏与关注
  204. $(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
  205. $(".navconBox .moreBu").show();
  206. $(".wendaNav").hide();
  207. $("#item8user").show().siblings().hide();
  208. $(".moreBuUl li.attentType").eq(0).addClass("liNow").siblings().removeClass("liNow");
  209. $("#item8drop1").show().siblings().hide();
  210. watchO={
  211. watchTime:"",
  212. watchObjId:"",
  213. };
  214. var pa=$(".moreNavUl.moreBuUl>li.liNow").attr("rel")
  215. $("#"+pa).find("ul").html("")
  216. $("#"+pa).find(".js-load-more").show();
  217. collectSorts(1,true);
  218. }
  219. function researchAlert(cap){
  220. $.ajax({
  221. "url": "/ajax/researchAreaLog/ql",
  222. "type": "get",
  223. "data": {
  224. "professorId": professorId,
  225. "caption": cap,
  226. "rows": 1000
  227. },
  228. "success": function(data) {
  229. if(data.success) {
  230. console.log(data)
  231. $("#areaCon").html("");
  232. var $info = data.data;
  233. $("#subArea").text(cap);
  234. $(".resAreaCover").fadeIn();
  235. $(".resAreaTip").addClass("displayNone")
  236. $(".resAreaCon").show()
  237. if($info.length == 0) {
  238. $(".resAreaCon").hide();
  239. $(".resAreaTip").removeClass("displayNone")
  240. return;
  241. }
  242. var arr=[];
  243. for(var i in $info) {
  244. arr[i]=$info[i].opreteProfessorId;
  245. }
  246. detailPro(arr,"areaCon");
  247. }
  248. }
  249. });
  250. }
  251. var rows = 20,
  252. dataO = {
  253. artPublishTime:"",
  254. artShareId:"",
  255. resPublishTime:"",
  256. resShareId:"",
  257. serModifyTime: "",
  258. serId: "",
  259. patTime:"",
  260. patId:"",
  261. parTime:"",
  262. parId:"",
  263. AnsTime:"",
  264. AnsId:"",
  265. QuTime:"",
  266. QuId:"",
  267. },
  268. watchO={
  269. beiTime:"",
  270. beiProId:"",
  271. watchTime:"",
  272. watchObjId:"",
  273. WATime:"",
  274. WAId:"",
  275. WQTime:"",
  276. WQId:"",
  277. };
  278. var oAjax = function(url, dataS, otype, oFun,beforeFun,completeFun) {
  279. $.ajax({
  280. url:url,
  281. dataType: 'json',
  282. type: otype,
  283. data: dataS,
  284. traditional: true,
  285. beforeSend: beforeFun,
  286. success: function(res) {
  287. if(res.success) {
  288. oFun(res)
  289. }
  290. },
  291. complete:completeFun
  292. });
  293. },
  294. insertNodata = function (targetE,newStr) {
  295. var parent = document.getElementById(targetE).parentNode;
  296. var kong = document.createElement("div");
  297. kong.className = "con-kong";
  298. kong.innerHTML ='<div class="picbox picNull"></div>'+
  299. '<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
  300. if(newStr){
  301. kong.querySelector(".txtbox").innerHTML = newStr;
  302. }
  303. if (parent.firstChild.className == "con-kong") {
  304. return
  305. } else {
  306. parent.insertBefore(kong,parent.firstChild);
  307. }
  308. },
  309. removeNodata = function (targetE) {
  310. var parent = document.getElementById(targetE).parentNode;
  311. if (parent.firstChild.className == "con-kong") {
  312. parent.removeChild(parent.firstChild);
  313. } else {
  314. return
  315. }
  316. },
  317. getUserInfo=function() {
  318. oAjax("/ajax/professor/info/"+ professorId,{}, "get", function(data){
  319. var $info = data.data;
  320. if($info.hasHeadImage){
  321. $("#proHead").css("background-image","url(/images/head/"+ $info.id +"_l.jpg)");
  322. }
  323. $("#proName").text($info.name);
  324. var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
  325. $("#proAuth").addClass(oStyS.sty); $("#proAuth").attr("title",oStyS.title);
  326. if($info.address){
  327. $("#proAddress").html($info.address + "<span style='margin-right:10px;'></span>");
  328. }
  329. var proOther="";
  330. if($info.orgName){
  331. if($info.department){
  332. if($info.office){
  333. proOther = $info.orgName + "," + $info.department + "," + $info.office
  334. }else{
  335. proOther = $info.orgName + "," + $info.department
  336. }
  337. }else{
  338. if($info.office){
  339. proOther = $info.orgName +"," + $info.office
  340. }else{
  341. proOther = $info.orgName
  342. }
  343. }
  344. }else{
  345. if($info.department){
  346. if($info.office){
  347. proOther = $info.department + "," + $info.office
  348. }else{
  349. proOther = $info.department
  350. }
  351. }else{
  352. if($info.office){
  353. proOther = $info.office
  354. }
  355. }
  356. }
  357. $("#proOther").text(proOther);
  358. var llqtitle=$info.name + "-" + proOther.replace(/,/gi,"-") + "-科袖网";//修改浏览器title信息
  359. if($info.title){
  360. $("#proTit").html($info.title + "<span style='margin-right:10px;'></span>");
  361. llqtitle = $info.name + "-" + $info.title + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
  362. }
  363. document.title = llqtitle;
  364. //主页浏览量
  365. $("#viewNums").text($info.pageViews);
  366. //个人简介
  367. if($info.descp) {
  368. $("#descpS").parents(".coninfobox").removeClass("displayNone");
  369. $("#item1user>.nodatabox").addClass("displayNone");
  370. $("#descpS").text($info.descp);
  371. }
  372. //学术领域
  373. if($info.subject) {
  374. $("#subjectShow").parents(".coninfobox").removeClass("displayNone");
  375. $("#item1user>.nodatabox").addClass("displayNone");
  376. subjectShow($info.subject);
  377. }
  378. //研究方向
  379. if($info.researchAreas.length) {
  380. $("#researchAreaShow").parents(".coninfobox").removeClass("displayNone");
  381. $("#item1user>.nodatabox").addClass("displayNone");
  382. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  383. }
  384. //行业领域
  385. if($info.industry) {
  386. $("#industryShow").parents(".coninfobox").removeClass("displayNone");
  387. $("#item1user>.nodatabox").addClass("displayNone");
  388. industryShow($info.industry);
  389. }
  390. //教育背景
  391. if($info.edus.length) {
  392. eduBgShow($info.edus);
  393. } else {
  394. $("#eduBgShow").parents(".coninfobox").hide();
  395. }
  396. //兼职
  397. if($info.jobs.length) {
  398. timeJobShow($info.jobs);
  399. } else {
  400. $("#timeJobShow").parents(".coninfobox").hide();
  401. }
  402. //项目
  403. if($info.projects.length) {
  404. projectShow($info.projects)
  405. } else {
  406. $("#projectShow").parents(".coninfobox").hide();
  407. }
  408. //荣誉
  409. if($info.honors.length) {
  410. honorShow($info.honors);
  411. } else {
  412. $("#honorShow").parents(".coninfobox").hide();
  413. }
  414. if($info.honors.length == 0 && $info.projects.length == 0 && $info.jobs.length == 0 && $info.edus.length == 0){
  415. $("#item7user>.nodatabox").show();
  416. $("#item7user>.nodatabox").find(".noContip").text("用户尚未完善详细资料")
  417. }
  418. var weibotitle = $info.name;
  419. var weibourl = window.location.href;
  420. var weibopic ="http://"+window.location.host+"/images/head/"+ $info.id +"_l.jpg";
  421. $("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
  422. });
  423. },
  424. demandListVal=function(isbind) {
  425. oAjax("/ajax/demand/pq",{
  426. "state":'1',
  427. "uid":professorId,
  428. "pageSize":5
  429. }, "get", function(data){
  430. var $info = data.data.data;
  431. if($info.length > 0){
  432. $("#showDemand").parents(".coninfobox").removeClass("displayNone");
  433. $("#item1user>.nodatabox").addClass("displayNone");
  434. for(var i = 0; i < $info.length; i++) {
  435. var liStr=$("<li></li>").appendTo("#showDemand");
  436. var $data=$info[i];
  437. var sowU="";
  438. if($data.pageViews!=0){
  439. sowU='<li><span>浏览量 '+$data.pageViews +'</span></li>'
  440. }
  441. var strCon='';
  442. strCon+='<a class="" target="_blank" href="demandShow.html?demandId='+$data.id+'" class="madiaInfo">'
  443. strCon+='<p class="h1Font ellipsisSty">'+ $data.title +'</p>'
  444. strCon+='<ul class="showliTop h3Font clearfix">'
  445. strCon+='<li><span>发布于 '+TimeTr($data.createTime)+'</span></li>'
  446. strCon+= sowU
  447. strCon+='</ul>'
  448. strCon+='<p class="h2Font ellipsisSty-2">'+$data.descp+'</p>'
  449. strCon+='<ul class="showli clearfix h3Font">'
  450. if($data.city){ strCon+='<li>所在城市:'+$data.city+'</li>' }
  451. if($data.duration!=0){ strCon+='<li>预计周期:'+demandDuration[$data.duration]+'</li>' }
  452. if($data.cost!=0){ strCon+='<li>费用预算:'+demandCost[$data.cost]+'</li>' }
  453. if($data.invalidDay){ strCon+='<li>有效期至:'+TimeTr($data.invalidDay)+'</li>' }
  454. strCon+='</ul>'
  455. strCon+='</a>'
  456. $(strCon).appendTo(liStr);
  457. }
  458. }else{
  459. $("#showDemand").parents(".needinfobox").addClass("displayNone");
  460. }
  461. })
  462. },
  463. articalListVal=function(isbind){
  464. var aimId="proArticel",aimIdF="showArticle",newStr="用户尚未发布任何文章"
  465. oAjax("/ajax/article/publish",{
  466. "category": "1",
  467. "owner":professorId,
  468. "publishTime":dataO.artPublishTime,
  469. "shareId": dataO.artShareId,
  470. "rows": rows
  471. }, "get", function(res){
  472. var $info = res.data;
  473. if($info.length > 0) {
  474. $("#"+aimId).show()
  475. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  476. $("#"+aimIdF).parents(".coninfobox").removeClass("displayNone");
  477. dataO.artPublishTime = $info[$info.length - 1].publishTime;
  478. dataO.artShareId = $info[$info.length - 1].shareId;
  479. for(var i = 0; i < $info.length; i++) {
  480. var sowU="",hasImg="/images/default-artical.jpg"
  481. if($info[i].articleImg) {
  482. hasImg="/data/article/" + $info[i].articleImg
  483. }
  484. if($info[i].pageViews!=0){
  485. if($info[i].articleAgree!=0){
  486. sowU='<li><span>阅读量 '+$info[i].pageViews+'</span></li><li><span>赞 '+$info[i].articleAgree+'</span></li>'
  487. }else{
  488. sowU='<li><span>阅读量 '+$info[i].pageViews+'</span></li>'
  489. }
  490. }
  491. var itemlist = '<li>';
  492. itemlist += '<a href="/'+pageUrl('a',$info[i])+'" class="flexCenter urlgo">';
  493. itemlist += '<div class="madiaHead artHead" style="background-image:url(' + hasImg + ')"></div>';
  494. itemlist += '<div class="madiaInfo">';
  495. itemlist += '<p class="h1Font ellipsisSty-2">'+$info[i].articleTitle+'</p>';
  496. itemlist += '<ul class="h2Font clearfix">';
  497. itemlist += '<li><span class="time">' + commenTime($info[i].publishTime) + '</span></li>';
  498. itemlist += sowU
  499. itemlist += '<li><span class="leaveMsgCount"></span></li>';
  500. itemlist += '</ul></div>';
  501. itemlist += '</a></li>';
  502. var $itemlist = $(itemlist);
  503. $("#"+aimId).append($itemlist)
  504. leaveMsgCount($info[i].articleId,1,$itemlist);
  505. if(isbind && i==0){
  506. var $itemlist = $(itemlist);
  507. $("#"+aimIdF).append($itemlist);
  508. leaveMsgCount($info[0].articleId,1,$itemlist);
  509. }
  510. }
  511. }
  512. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  513. removeNodata(aimId);
  514. if($info.length == 0 && liLen == 0 ){
  515. $("#"+aimId).hide()
  516. insertNodata(aimId,newStr);
  517. }
  518. if(isbind){
  519. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  520. articalListVal(false)
  521. })
  522. }
  523. if ($info.length < rows) {
  524. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  525. $("#"+aimId).parent().find(".js-load-more").hide();
  526. }
  527. },function(){
  528. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  529. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  530. },function(){
  531. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  532. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  533. })
  534. },
  535. resourceListVal=function(isbind){
  536. var aimId="proResource",aimIdF="showResource",newStr="用户尚未发布任何资源"
  537. oAjax("/ajax/resource/publish",{
  538. "category": "1",
  539. "owner":professorId,
  540. "publishTime":dataO.resPublishTime,
  541. "shareId": dataO.resShareId,
  542. "rows": rows
  543. }, "get", function(res){
  544. var $info = res.data;
  545. if($info.length > 0) {
  546. $("#"+aimId).show()
  547. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  548. $("#"+aimIdF).parents(".form-item").removeClass("displayNone");
  549. $("#"+aimIdF).parents(".coninfobox").show();
  550. dataO.resPublishTime = $info[$info.length - 1].publishTime;
  551. dataO.resShareId = $info[$info.length - 1].shareId;
  552. for(var i = 0; i < $info.length; i++) {
  553. var hasImg='/images/default-resource.jpg'
  554. if($info[i].images.length) {
  555. hasImg="/data/resource/" + $info[i].images[0].imageSrc
  556. }
  557. var itemlist = '<li>';
  558. itemlist += '<a href="resourceShow.html?resourceId=' + $info[i].resourceId + '" class="flexCenter urlgo">';
  559. itemlist += '<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>';
  560. itemlist += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">' + $info[i].resourceName + '</p><p class="h2Font ellipsisSty">应用用途:' + $info[i].supportedServices + '</p></div>';
  561. itemlist += '</a></li>';
  562. var $itemlist = $(itemlist);
  563. $("#"+aimId).append($itemlist)
  564. if(isbind && i==0){
  565. var $itemlist = $(itemlist);
  566. $("#"+aimIdF).append($itemlist);
  567. }
  568. }
  569. }
  570. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  571. removeNodata(aimId);
  572. if($info.length == 0 && liLen == 0 ){
  573. $("#"+aimId).hide()
  574. insertNodata(aimId,newStr);
  575. }
  576. if(isbind){
  577. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  578. resourceListVal(false)
  579. })
  580. }
  581. if ($info.length < rows) {
  582. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  583. $("#"+aimId).parent().find(".js-load-more").hide();
  584. }
  585. },function(){
  586. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  587. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  588. },function(){
  589. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  590. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  591. })
  592. },
  593. serviceListVal=function(isbind){
  594. var aimId="proService",aimIdF="showService",newStr="用户尚未发布任何服务"
  595. oAjax("/ajax/ware/publish",{
  596. "category":"1",
  597. "owner":professorId,
  598. "modifyTime":dataO.serModifyTime,
  599. "rows": rows
  600. }, "get", function(res){
  601. var $info = res.data;
  602. if($info.length > 0) {
  603. $("#"+aimId).show()
  604. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  605. $("#"+aimIdF).parents(".form-item").removeClass("displayNone");
  606. $("#"+aimIdF).parents(".coninfobox").show();
  607. dataO.serModifyTime = $info[$info.length - 1].modifyTime;
  608. for(var i = 0; i < $info.length; i++) {
  609. var cnt="", hasImg="../images/default-service.jpg";
  610. if($info[i].cnt) {
  611. cnt = "内容:" + $info[i].cnt
  612. }
  613. if($info[i].images) {
  614. var subs = strToAry($info[i].images)
  615. if(subs.length > 0) {
  616. hasImg="/data/ware" + subs[0]
  617. }
  618. }
  619. var itemlist = '<li>';
  620. itemlist += '<a href="sevriceShow.html?sevriceId=' + $info[i].id + '" class="flexCenter urlgo">';
  621. itemlist += '<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>';
  622. itemlist += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">' + $info[i].name + '</p><p class="h2Font ellipsisSty">' + cnt+ '</p></div>';
  623. itemlist += '</a></li>';
  624. var $itemlist = $(itemlist);
  625. $("#"+aimId).append($itemlist)
  626. if(isbind && i==0){
  627. var $itemlist = $(itemlist);
  628. $("#"+aimIdF).append($itemlist);
  629. }
  630. }
  631. }
  632. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  633. removeNodata(aimId);
  634. if($info.length == 0 && liLen == 0 ){
  635. $("#"+aimId).hide()
  636. insertNodata(aimId,newStr);
  637. }
  638. if(isbind){
  639. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  640. serviceListVal(false)
  641. })
  642. }
  643. if ($info.length < rows) {
  644. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  645. $("#"+aimId).parent().find(".js-load-more").hide();
  646. }
  647. },function(){
  648. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  649. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  650. },function(){
  651. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  652. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  653. })
  654. },
  655. patentListVal=function(isbind){
  656. var aimId="proPatent",aimIdF="showPatent",newStr="用户尚未发布任何专利"
  657. oAjax("/ajax/ppatent/professor",{
  658. "owner":professorId,
  659. "assTime":dataO.patTime,
  660. "id":dataO.patId,
  661. "rows": rows
  662. }, "get", function(res){
  663. var $info = res.data;
  664. if($info.length > 0) {
  665. $("#"+aimId).show()
  666. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  667. $("#"+aimIdF).parents(".form-item").removeClass("displayNone");
  668. $("#"+aimIdF).parents(".coninfobox").show();
  669. dataO.patTime = $info[$info.length - 1].assTime;
  670. dataO.patId = $info[$info.length - 1].id;
  671. for(var i = 0; i < $info.length; i++) {
  672. var dataStr= $info
  673. if(!dataStr[i].reqPerson){
  674. dataStr[i].reqPerson="";
  675. }
  676. var strAdd = '';
  677. strAdd += '<li><a target="_blank" href="/'+ pageUrl("pt",dataStr[i]) +'" class="flexCenter urlgo">';
  678. strAdd += '<div class="madiaHead patentHead"></div>';
  679. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  680. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  681. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  682. strAdd += '</div>';
  683. strAdd += '</a></li>';
  684. var $itemlist = $(strAdd);
  685. $("#"+aimId).append($itemlist)
  686. if(isbind && i==0){
  687. var $itemlist = $(strAdd);
  688. $("#"+aimIdF).append($itemlist);
  689. }
  690. }
  691. }
  692. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  693. removeNodata(aimId);
  694. if($info.length == 0 && liLen == 0 ){
  695. $("#"+aimId).hide()
  696. insertNodata(aimId,newStr);
  697. }
  698. if(isbind){
  699. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  700. patentListVal(false)
  701. })
  702. }
  703. if ($info.length < rows) {
  704. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  705. $("#"+aimId).parent().find(".js-load-more").hide();
  706. }
  707. },function(){
  708. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  709. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  710. },function(){
  711. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  712. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  713. })
  714. },
  715. paperListVal=function(isbind){
  716. var aimId="proPaper",aimIdF="showPaper",newStr="用户尚未发布任何论文"
  717. oAjax("/ajax/ppaper/professor",{
  718. "owner":professorId,
  719. "assTime":dataO.parTime,
  720. "id":dataO.parId,
  721. "rows": rows
  722. }, "get", function(res){
  723. var $info = res.data;
  724. if($info.length > 0) {
  725. $("#"+aimId).show()
  726. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  727. $("#"+aimIdF).parents(".form-item").removeClass("displayNone");
  728. $("#"+aimIdF).parents(".coninfobox").show();
  729. dataO.parTime = $info[$info.length - 1].assTime;
  730. dataO.parId = $info[$info.length - 1].id;
  731. for(var i = 0; i < $info.length; i++) {
  732. var dataStr= $info
  733. var moreInf=""
  734. if(!dataStr[i].cn4periodical){
  735. dataStr[i].cn4periodical="";
  736. }
  737. if(!dataStr[i].en4periodical){
  738. dataStr[i].en4periodical="";
  739. }
  740. if(!dataStr[i].pubDay){
  741. dataStr[i].pubDay="";
  742. }
  743. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  744. var strAdd = '';
  745. strAdd += '<li><a target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
  746. strAdd += '<div class="madiaHead paperHead"></div>';
  747. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  748. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  749. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  750. strAdd += '</div>';
  751. strAdd += '</a></li>';
  752. var $itemlist = $(strAdd);
  753. $("#"+aimId).append($itemlist)
  754. if(isbind && i==0){
  755. var $itemlist = $(strAdd);
  756. $("#"+aimIdF).append($itemlist);
  757. }
  758. }
  759. }
  760. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  761. removeNodata(aimId);
  762. if($info.length == 0 && liLen == 0 ){
  763. $("#"+aimId).hide()
  764. insertNodata(aimId,newStr);
  765. }
  766. if(isbind){
  767. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  768. paperListVal(false)
  769. })
  770. }
  771. if ($info.length < rows) {
  772. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  773. $("#"+aimId).parent().find(".js-load-more").hide();
  774. }
  775. },function(){
  776. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  777. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  778. },function(){
  779. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  780. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  781. })
  782. },
  783. answerListVal=function(isbind){//获取问答
  784. var aimId="proA",aimIdF="showAnswer",newStr="用户尚未任何回答"
  785. oAjax("/ajax/question/answer/bySelf",{
  786. "time":dataO.AnsTime,
  787. "id":dataO.AnsId,
  788. "uid":professorId,
  789. "rows":rows
  790. }, "get", function(res){
  791. var $info = res.data;
  792. if($info.length > 0) {
  793. $("#"+aimId).show()
  794. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  795. $("#"+aimIdF).parents(".form-item").removeClass("displayNone");
  796. $("#"+aimIdF).parents(".coninfobox").show();
  797. dataO.AnsTime = $info[$info.length - 1].createTime;
  798. dataO.AnsId = $info[$info.length - 1].id;
  799. for(var i = 0; i < $info.length; i++) {
  800. var listLi = $('<li>')
  801. listLi.appendTo($("#"+aimId));
  802. detailAnswer($info[i], listLi);
  803. if(isbind && i==0){
  804. var li = listLi.clone();
  805. li.appendTo($("#"+aimIdF));
  806. questioninfo($info[i].qid, li);
  807. proinfo($info[i].uid, li);
  808. leaveMsgCount($info[i].id,4, li);
  809. }
  810. }
  811. }
  812. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  813. removeNodata(aimId);
  814. if($info.length == 0 && liLen == 0 ){
  815. $("#"+aimId).hide()
  816. insertNodata(aimId,newStr);
  817. }
  818. if(isbind){
  819. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  820. answerListVal(false)
  821. })
  822. }
  823. if ($info.length < rows) {
  824. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  825. $("#"+aimId).parent().find(".js-load-more").hide();
  826. }
  827. },function(){
  828. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  829. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  830. },function(){
  831. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  832. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  833. })
  834. },
  835. questionListVal=function(isbind) {
  836. var aimId="proQ",newStr="用户尚未发布任何问题"
  837. oAjax("/ajax/question/my",{
  838. "uid":professorId,
  839. "time":dataO.QuTime,
  840. "id":dataO.QuId,
  841. "rows":rows,
  842. }, "get", function(res){
  843. var $info = res.data;
  844. if($info.length > 0) {
  845. $("#"+aimId).show()
  846. dataO.QuTime = $info[$info.length - 1].createTime;
  847. dataO.QuId = $info[$info.length - 1].id;
  848. for(var i = 0; i < $info.length; i++) {
  849. var listLi = $('<li class="mui-table-view-cell">').appendTo($("#proQ"));
  850. detailQuestion($info[i], listLi);
  851. if(isbind && i==0){
  852. $("#"+aimId).html();
  853. }
  854. }
  855. }
  856. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  857. removeNodata(aimId);
  858. if($info.length == 0 && liLen == 0 ){
  859. $("#"+aimId).hide()
  860. insertNodata(aimId,newStr);
  861. }
  862. if(isbind){
  863. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  864. questionListVal(false)
  865. })
  866. }
  867. if ($info.length < rows) {
  868. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  869. $("#"+aimId).parent().find(".js-load-more").hide();
  870. }
  871. },function(){
  872. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  873. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  874. },function(){
  875. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  876. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  877. })
  878. },
  879. relevantarticalList=function(){//相关文章信息
  880. oAjax("/ajax/article/byAssProfessor",{
  881. "id":professorId
  882. }, "get", function(data){
  883. if(data.data.length>0){
  884. $("#relateArt").parents(".conBlock").removeClass("displayNone");
  885. var itemlist = '';
  886. $("#relateArt").html("");
  887. for(var i = 0; i < data.data.length; i++) {
  888. var itemlist = '<li class="flexCenter"><a target="_blank" href="/'+ pageUrl('a',data.data[i]) +'" class="urlgo">';
  889. itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
  890. itemlist += '</a></li>';
  891. $itemlist = $(itemlist);
  892. $("#relateArt").append($itemlist);
  893. }
  894. }
  895. });
  896. },
  897. likeExperts=function(){//感兴趣
  898. oAjax("/ajax/professor/ralateProfessors",{
  899. "professorId":professorId
  900. }, "get", function(data){
  901. var lengthT;
  902. if(data.data.length>5){
  903. lengthT=5;
  904. }else{
  905. lengthT=data.data.length
  906. }
  907. for(var i = 0; i < lengthT; i++) {
  908. var ExpId = data.data[i].id;
  909. (function(Id){
  910. oAjax("/ajax/professor/info/"+Id,{}, "get", function(data){
  911. $("#likePro").parents(".conBlock").removeClass("displayNone");
  912. var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
  913. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  914. itemlist += '<div class="madiaInfo">';
  915. itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
  916. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  917. itemlist += '</div></a></li>';
  918. var $itemlist = $(itemlist);
  919. $("#likePro").append($itemlist);
  920. if(data.data.title) {
  921. if(data.data.orgName) {
  922. $itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
  923. }else{
  924. $itemlist.find("#usertitle").text(data.data.title);
  925. }
  926. }else{
  927. if(data.data.office) {
  928. if(data.data.orgName) {
  929. $itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
  930. }else{
  931. $itemlist.find("#usertitle").text(data.data.office);
  932. }
  933. }else{
  934. if(data.data.orgName) {
  935. $itemlist.find("#usertitle").text(data.data.orgName);
  936. }
  937. }
  938. }
  939. $itemlist.find("#userName").text(data.data.name);
  940. $itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
  941. if(data.data.hasHeadImage == 1) {
  942. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
  943. }
  944. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  945. $itemlist.find(".authiconNew").attr("title", userType.title);
  946. $itemlist.find(".authiconNew").addClass(userType.sty);
  947. })
  948. })(ExpId)
  949. }
  950. });
  951. },
  952. relevantExperts=function(){
  953. oAjax("/ajax/professor/coadjutant",{
  954. "id":professorId
  955. }, "get", function(data){
  956. var lengthT;
  957. if(data.data.length>5){
  958. lengthT=5;
  959. }else{
  960. lengthT=data.data.length
  961. }
  962. for(var i = 0; i < lengthT; i++) {
  963. var ExpId = data.data[i].professorId;
  964. var paperN=data.data[i].paperCount;
  965. var patentN=data.data[i].patentCount;
  966. (function(Id,numL,numZ){
  967. oAjax("/ajax/professor/info/"+Id,{}, "get", function(data){
  968. $("#relatePro").parents(".conBlock").removeClass("displayNone");
  969. var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
  970. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  971. itemlist += '<div class="madiaInfo">';
  972. itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
  973. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  974. itemlist += '<p class="h2Font ellipsisSty" id="copNum"></p>';
  975. itemlist += '</div></a></li>';
  976. var $itemlist = $(itemlist);
  977. $("#relatePro").append($itemlist);
  978. if(numL){
  979. if(numZ){
  980. $itemlist.find("#copNum").text("合作:"+numZ+"项专利,"+numL+"篇论文")
  981. }else{
  982. $itemlist.find("#copNum").text("合作:"+numL+"篇论文")
  983. }
  984. }else{
  985. if(numZ){
  986. $itemlist.find("#copNum").text("合作:"+numZ+"项专利")
  987. }else{
  988. }
  989. }
  990. if(data.data.title) {
  991. if(data.data.orgName) {
  992. $itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
  993. }else{
  994. $itemlist.find("#usertitle").text(data.data.title);
  995. }
  996. }else{
  997. if(data.data.office) {
  998. if(data.data.orgName) {
  999. $itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
  1000. }else{
  1001. $itemlist.find("#usertitle").text(data.data.office);
  1002. }
  1003. }else{
  1004. if(data.data.orgName) {
  1005. $itemlist.find("#usertitle").text(data.data.orgName);
  1006. }
  1007. }
  1008. }
  1009. $itemlist.find("#userName").text(data.data.name);
  1010. $itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
  1011. if(data.data.hasHeadImage == 1) {
  1012. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
  1013. }
  1014. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  1015. $itemlist.find(".authiconNew").attr("title", userType.title);
  1016. $itemlist.find(".authiconNew").addClass(userType.sty);
  1017. })
  1018. })(ExpId,paperN,patentN)
  1019. }
  1020. });
  1021. },
  1022. isActUser=function(){
  1023. oAjax("/ajax/baseUserInfo",{
  1024. "id": professorId
  1025. }, "get", function(data){
  1026. if(!data.data.activeTime){
  1027. $(".last_meg").removeClass("displayNone");
  1028. $(".message_b").on("click",function(){
  1029. $(".meg_md5").toggle();
  1030. if(data.data.email && data.data.mobilePhone){
  1031. $("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号或邮箱 '+data.data.email);
  1032. }else if(data.data.mobilePhone && !data.data.email){
  1033. $("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号');
  1034. }else if(data.data.email && !data.data.mobilePhone){
  1035. $("#wayTel").text('邮箱 '+data.data.email);
  1036. }
  1037. })
  1038. }else{
  1039. $(".last_meg").addClass("displayNone");
  1040. }
  1041. })
  1042. },
  1043. queryPubCount=function(){
  1044. oAjax("/ajax/watch/countProfessor",{//关注我的
  1045. "id": professorId,
  1046. "type":"1"
  1047. }, "GET", function(data){
  1048. $("#focusMe").text(data.data);
  1049. });
  1050. oAjax("/ajax/watch/countObject",{//我关注的
  1051. "id": professorId,
  1052. "type":"1"
  1053. }, "GET", function(data){
  1054. $("#myFocus").text(data.data);
  1055. });
  1056. oAjax("/ajax/professor/agree/sum",{//总获赞
  1057. "id": professorId,
  1058. }, "GET", function(data){
  1059. $("#agreeMecount").text(data.data);
  1060. });
  1061. oAjax("/ajax/article/count/publish",{//文章总数
  1062. "owner": professorId,
  1063. "category":"1"
  1064. }, "GET", function(data){
  1065. if(data.data>0 && data.data<99){
  1066. $("#artCount").text(data.data);
  1067. }
  1068. if(data.data>99){
  1069. $("#artCount").text("99+");
  1070. }
  1071. });
  1072. oAjax("/ajax/resource/count/publish",{//资源总数
  1073. "owner": professorId,
  1074. "category":"1"
  1075. }, "GET", function(data){
  1076. if(data.data>0 && data.data<99){
  1077. $("#resCount").text(data.data);
  1078. }
  1079. if(data.data>99){
  1080. $("#resCount").text("99+");
  1081. }
  1082. });
  1083. oAjax("/ajax/ware/count/publish",{//服务总数
  1084. "owner": professorId,
  1085. "category":"1"
  1086. }, "GET", function(data){
  1087. if(data.data>0 && data.data<99){
  1088. $("#serCount").text(data.data);
  1089. }
  1090. if(data.data>99){
  1091. $("#serCount").text("99+");
  1092. }
  1093. });
  1094. oAjax("/ajax/ppatent/count/publish",{//专利总数
  1095. "owner": professorId,
  1096. }, "GET", function(data){
  1097. if(data.data>0 && data.data<99){
  1098. $("#patCount").text(data.data);
  1099. }
  1100. if(data.data>99){
  1101. $("#patCount").text("99+");
  1102. }
  1103. });
  1104. oAjax("/ajax/ppaper/count/publish",{//论文总数
  1105. "owner": professorId,
  1106. }, "GET", function(data){
  1107. if(data.data>0 && data.data<99){
  1108. $("#parCount").text(data.data);
  1109. }
  1110. if(data.data>99){
  1111. $("#parCount").text("99+");
  1112. }
  1113. });
  1114. },
  1115. attentMyself=function(isbind){
  1116. var aimId="attendMy",newStr="用户尚未被任何人关注"
  1117. oAjax("/ajax/watch/watchList",{//关注我的列表
  1118. "watchObject": professorId,
  1119. "createTime": watchO.beiTime,
  1120. "professorId":watchO.beiProId,
  1121. "rows":rows
  1122. }, "GET", function(res){
  1123. console.log(res)
  1124. var $info = res.data;
  1125. if($info.length > 0) {
  1126. $("#"+aimId).show()
  1127. watchO.beiTime = $info[$info.length - 1].createTime;
  1128. watchO.beiProId = $info[$info.length - 1].professorId;
  1129. var arr=[];
  1130. for(var i in $info) {
  1131. arr[i]=$info[i].professorId;
  1132. }
  1133. detailPro(arr,aimId);
  1134. }
  1135. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  1136. removeNodata(aimId);
  1137. if($info.length == 0 && liLen == 0 ){
  1138. $("#"+aimId).hide()
  1139. insertNodata(aimId,newStr);
  1140. }
  1141. if(isbind){
  1142. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  1143. attentMyself(false)
  1144. })
  1145. }
  1146. if ($info.length < rows) {
  1147. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  1148. $("#"+aimId).parent().find(".js-load-more").hide();
  1149. }
  1150. },function(){
  1151. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  1152. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  1153. },function(){
  1154. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  1155. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  1156. })
  1157. },
  1158. collectAnswer=function(isbind){
  1159. var aimId="attendAnswer",newStr="用户还未收藏任何回答"
  1160. oAjax("/ajax/question/answer/byWatch",{
  1161. "time":watchO.WATime,
  1162. "id":watchO.WAId,
  1163. "uid":professorId,
  1164. "rows":rows
  1165. }, "get", function(res){
  1166. var $info = res.data;
  1167. if($info.length > 0) {
  1168. $("#"+aimId).show()
  1169. watchO.WATime = $info[$info.length - 1].createTime;
  1170. watchO.WAId = $info[$info.length - 1].id;
  1171. for(var i = 0; i < $info.length; i++) {
  1172. var listLi = $('<li>')
  1173. listLi.appendTo($("#"+aimId));
  1174. detailAnswer($info[i], listLi);
  1175. }
  1176. }
  1177. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  1178. removeNodata(aimId);
  1179. if($info.length == 0 && liLen == 0 ){
  1180. $("#"+aimId).hide()
  1181. insertNodata(aimId,newStr);
  1182. }
  1183. if(isbind){
  1184. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  1185. collectAnswer(false)
  1186. })
  1187. }
  1188. if ($info.length < rows) {
  1189. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  1190. $("#"+aimId).parent().find(".js-load-more").hide();
  1191. }
  1192. },function(){
  1193. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  1194. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  1195. },function(){
  1196. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  1197. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  1198. })
  1199. },
  1200. collectQuestion=function(isbind){
  1201. var aimId="attendQuestion",newStr="用户还未关注任何问题"
  1202. oAjax("/ajax/question/watch",{
  1203. "time":watchO.WQTime,
  1204. "id":watchO.WQId,
  1205. "uid":professorId,
  1206. "rows":rows
  1207. }, "get", function(res){
  1208. var $info = res.data;
  1209. if($info.length > 0) {
  1210. $("#"+aimId).show()
  1211. watchO.WQTime = $info[$info.length - 1].createTime;
  1212. watchO.WQId = $info[$info.length - 1].id;
  1213. for(var i = 0; i < $info.length; i++) {
  1214. var listLi = $('<li>')
  1215. listLi.appendTo($("#"+aimId));
  1216. detailQuestion($info[i], listLi);
  1217. }
  1218. }
  1219. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  1220. removeNodata(aimId);
  1221. if($info.length == 0 && liLen == 0 ){
  1222. $("#"+aimId).hide()
  1223. insertNodata(aimId,newStr);
  1224. }
  1225. if(isbind){
  1226. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  1227. collectQuestion(false)
  1228. })
  1229. }
  1230. if ($info.length < rows) {
  1231. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  1232. $("#"+aimId).parent().find(".js-load-more").hide();
  1233. }
  1234. },function(){
  1235. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  1236. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  1237. },function(){
  1238. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  1239. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  1240. })
  1241. },
  1242. collectSorts=function(type,isbind){
  1243. var aimId="",newStr=""
  1244. oAjax("/ajax/watch/proList",{//我关注的列表
  1245. "professorId": professorId,
  1246. "watchType":type,
  1247. "createTime": watchO.watchTime,
  1248. "watchObject":watchO.watchObjId,
  1249. "rows":rows
  1250. }, "GET", function(res){
  1251. var $info = res.data;
  1252. var arr=[];
  1253. if($info.length > 0) {
  1254. $("#"+aimId).show()
  1255. watchO.watchTime = $info[$info.length - 1].createTime;
  1256. watchO.watchObjId = $info[$info.length - 1].watchObject;
  1257. for(var i in $info) {
  1258. arr[i]=$info[i].watchObject;
  1259. }
  1260. }
  1261. if(type==1){
  1262. aimId="attendPro"
  1263. newStr="用户还未关注任何专家"
  1264. detailPro(arr,aimId);
  1265. }else if(type==2){
  1266. aimId="attendRes"
  1267. newStr="用户还未收藏任何资源"
  1268. detailRes(arr,aimId);
  1269. }else if(type==3){
  1270. aimId="attendArt"
  1271. newStr="用户还未收藏任何文章"
  1272. detailArt(arr,aimId);
  1273. }else if(type==4){
  1274. aimId="attendPatent"
  1275. newStr="用户还未收藏任何专利"
  1276. detailPat(arr,aimId);
  1277. }else if(type==5){
  1278. aimId="attendPaper"
  1279. newStr="用户还未收藏任何论文"
  1280. detailPer(arr,aimId);
  1281. }else if(type==6){
  1282. aimId="attendCmp"
  1283. newStr="用户还未关注任何企业"
  1284. detailCmp(arr,aimId);
  1285. }else if(type==7){
  1286. aimId="attendDemand"
  1287. newStr="用户还未收藏任何需求"
  1288. detailDemand(arr,aimId);
  1289. }else if(type==10){
  1290. aimId="attendSer"
  1291. newStr="用户还未收藏任何服务"
  1292. detailService(arr,aimId);
  1293. }
  1294. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  1295. removeNodata(aimId);
  1296. if($info.length == 0 && liLen == 0 ){
  1297. $("#"+aimId).hide()
  1298. insertNodata(aimId,newStr);
  1299. }
  1300. if(isbind){
  1301. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  1302. collectSorts(type,false)
  1303. })
  1304. }
  1305. if ($info.length < rows) {
  1306. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  1307. $("#"+aimId).parent().find(".js-load-more").hide();
  1308. }
  1309. },function(){
  1310. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  1311. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  1312. },function(){
  1313. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  1314. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  1315. })
  1316. },
  1317. detailPro=function(arr,obj) {
  1318. oAjax("/ajax/professor/qm",{
  1319. id:arr,
  1320. },"get",function(data){
  1321. var dataStr=data.data;
  1322. for(var i = 0; i < dataStr.length; i++) {
  1323. var li = document.createElement("li");
  1324. li.className = "mui-table-view-cell";
  1325. var userType = autho(dataStr[i].authType, dataStr[i].orgAuth, dataStr[i].authStatus);
  1326. var os = "";
  1327. if(dataStr[i].title) {
  1328. if(dataStr[i].orgName) {
  1329. os = dataStr[i].title + "," + dataStr[i].orgName;
  1330. } else {
  1331. os = dataStr[i].title;
  1332. }
  1333. } else {
  1334. if(dataStr[i].office) {
  1335. if(dataStr[i].orgName) {
  1336. os = dataStr[i].office + "," + dataStr[i].orgName;
  1337. } else {
  1338. os = dataStr[i].office;
  1339. }
  1340. } else {
  1341. if(dataStr[i].orgName) {
  1342. os = dataStr[i].orgName;
  1343. }
  1344. }
  1345. }
  1346. var baImg = "../images/default-photo.jpg";
  1347. if(dataStr[i].hasHeadImage == 1) {
  1348. baImg = "/images/head/" + dataStr[i].id + "_l.jpg";
  1349. }
  1350. var strAdd = '';
  1351. strAdd += '<a target="_blank" href="userInforShow.html?professorId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  1352. strAdd += '<div class="madiaHead useHead" style="width: 80px;height: 80px;margin-top: -40px;background-image:url(' + baImg + ')"></div>';
  1353. strAdd += '<div class="madiaInfo" style="padding-left:92px"><p class="h1Font ellipsisSty">' + dataStr[i].name + '</span><em class="authicon ' + userType.sty + '" title="'+userType.title+'"></em></p>';
  1354. strAdd += '<p class="h2Font ellipsisSty">' + os + '</p>';
  1355. strAdd += '</div>';
  1356. strAdd += '</a>'
  1357. li.innerHTML = strAdd
  1358. document.getElementById(obj).appendChild(li);
  1359. }
  1360. });
  1361. },
  1362. detailCmp=function(arr,obj) {
  1363. oAjax("/ajax/org/qm",{
  1364. id:arr,
  1365. },"get",function(data){
  1366. var dataStr=data.data;
  1367. for(var i = 0; i < dataStr.length; i++) {
  1368. var li = document.createElement("li");
  1369. li.setAttribute("data-id", dataStr[i].id);
  1370. var oimg = (dataStr[i].hasOrgLogo) ?"/images/org/" + dataStr[i].id + ".jpg" : "../images/default-icon.jpg";
  1371. var oAuth = (dataStr[i].authStatus == 3) ? 'authicon-com-ok' : '';
  1372. var orgName = (dataStr[i].forShort) ? dataStr[i].forShort : dataStr[i].name;
  1373. var orgType = (dataStr[i].orgType == '2') ? "上市企业" : "";
  1374. var orgOther = (dataStr[i].industry) ? dataStr[i].industry.replace(/,/gi, " | ") : "";
  1375. li.className = "mui-table-view-cell";
  1376. var itemlist=''
  1377. itemlist += '<a class="flexCenter" target="_blank" href="cmpInforShow.html?orgId='+dataStr[i].id+'"><div class="madiaHead cmpHead">';
  1378. itemlist += '<div class="boxBlock"><img class="boxBlockimg" src="' + oimg + '"></div></div>';
  1379. itemlist += '<div class="madiaInfo">';
  1380. itemlist += '<p class="h1Font"><span>' + orgName + '</span><em class="authiconNew ' + oAuth + '" title="科袖认证企业"></em></p>';
  1381. itemlist += '<p class="h2Font ellipsisSty"><span>' + orgType + '</span> <span>' + orgOther + '</span></p>';
  1382. itemlist += '</div></a>';
  1383. li.innerHTML = itemlist
  1384. document.getElementById(obj).appendChild(li);
  1385. }
  1386. });
  1387. },
  1388. detailPat=function(arr,obj) {
  1389. oAjax("/ajax/ppatent/qm",{
  1390. id:arr,
  1391. },"get",function(data){
  1392. var dataStr=data.data;
  1393. for(var i = 0; i < dataStr.length; i++) {
  1394. var li = document.createElement("li");
  1395. li.className = "mui-table-view-cell";
  1396. var strAdd = '';
  1397. strAdd += '<a target="_blank" href="/'+ pageUrl("pt",dataStr[i]) +'" class="flexCenter urlgo">';
  1398. strAdd += '<div class="madiaHead patentHead"></div>';
  1399. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  1400. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  1401. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  1402. strAdd += '</div>';
  1403. strAdd += '</a>';
  1404. li.innerHTML = strAdd
  1405. document.getElementById(obj).appendChild(li);
  1406. }
  1407. });
  1408. },
  1409. detailPer=function(arr,obj) {
  1410. oAjax("/ajax/ppaper/qm",{
  1411. id:arr,
  1412. },"get",function(data){
  1413. var dataStr=data.data;
  1414. for(var i = 0; i < dataStr.length; i++) {
  1415. var moreInf=""
  1416. if(!dataStr[i].cn4periodical){
  1417. dataStr[i].cn4periodical="";
  1418. }
  1419. if(!dataStr[i].en4periodical){
  1420. dataStr[i].en4periodical="";
  1421. }
  1422. if(!dataStr[i].pubDay){
  1423. dataStr[i].pubDay="";
  1424. }
  1425. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  1426. var li = document.createElement("li");
  1427. li.className = "mui-table-view-cell";
  1428. var strAdd = '';
  1429. strAdd += '<a target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
  1430. strAdd += '<div class="madiaHead paperHead"></div>';
  1431. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  1432. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  1433. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  1434. strAdd += '</div>';
  1435. strAdd += '</a>';
  1436. li.innerHTML = strAdd
  1437. document.getElementById(obj).appendChild(li);
  1438. }
  1439. });
  1440. },
  1441. detailRes=function(arr,obj) {
  1442. oAjax("/ajax/resource/qm",{
  1443. id:arr,
  1444. },"get",function(data){
  1445. console.log(data)
  1446. var dataItem=data.data;
  1447. for(var i = 0; i < dataItem.length; i++) {
  1448. var dataStr=dataItem[i]
  1449. var rImg = "../images/default-resource.jpg";
  1450. if(dataStr.images.length) {
  1451. rImg = "/data/resource/" + dataStr.images[0].imageSrc;
  1452. }
  1453. var li = document.createElement("li");
  1454. li.className = "mui-table-view-cell";
  1455. var strAdd = '';
  1456. strAdd += '<a target="_blank" href="resourceShow.html?resourceId='+ dataStr.resourceId +'" class="flexCenter urlgo">';
  1457. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ rImg +')"></div>';
  1458. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.resourceName +'</p>';
  1459. strAdd += '<p class="h1Font ellipsisSty"><span class="ownerName"></span><em class="authiconNew ownerSty"></em></p>';
  1460. strAdd += '<p class="h2Font ellipsisSty-2">用途:'+ dataStr.supportedServices+'</p></div>';
  1461. strAdd += '</a>';
  1462. li.innerHTML =strAdd
  1463. var $itemlist = $(li);
  1464. document.getElementById(obj).appendChild(li);
  1465. if(dataStr.resourceType=="1"){
  1466. (function(mo){
  1467. cacheModel.getProfessor(dataStr.professorId,function(sc,value){
  1468. if(sc){
  1469. mo.find(".ownerName").html(value.name)
  1470. var userType = autho(value.authType, value.orgAuth, value.authStatus);
  1471. mo.find(".ownerSty").addClass(userType.sty).attr("title",userType.title)
  1472. }else{
  1473. console.log("error")
  1474. }
  1475. })
  1476. })($itemlist);
  1477. }else if(dataStr.resourceType=="2"){
  1478. (function(mo){
  1479. cacheModel.getCompany(dataStr.orgId,function(sc,value){
  1480. if(sc){
  1481. if(value.forShort){
  1482. mo.find(".ownerName").html(value.forShort)
  1483. }else{
  1484. mo.find(".ownerName").html(value.name)
  1485. }
  1486. if(value.authStatus==3) {
  1487. mo.find(".ownerSty").addClass("authicon-com-ok").attr("title","科袖认证企业")
  1488. }
  1489. }else{
  1490. console.log("error")
  1491. }
  1492. })
  1493. })($itemlist);
  1494. }
  1495. }
  1496. });
  1497. },
  1498. detailArt=function (arr,obj) {
  1499. oAjax("/ajax/article/qm",{
  1500. id:arr,
  1501. },"get",function(data){
  1502. var dataStr=data.data;
  1503. for(var i = 0; i < dataStr.length; i++) {
  1504. var dataItem=dataStr[i]
  1505. var arImg = "../images/default-artical.jpg";
  1506. if(dataItem.articleImg) {
  1507. arImg ="/data/article/" + dataItem.articleImg
  1508. }
  1509. var li = document.createElement("li");
  1510. li.className = "mui-table-view-cell";
  1511. var strAdd = '';
  1512. strAdd += '<a target="_blank" href="/'+ pageUrl('a',dataItem) +'" class="flexCenter urlgo">';
  1513. strAdd += '<div class="madiaHead artHead" style="background-image:url('+ arImg +')"></div>';
  1514. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataItem.articleTitle +'</p>';
  1515. strAdd += '<ul class="h2Font clearfix">';
  1516. strAdd += '<li><span class="ownerName"></span></li>';
  1517. strAdd += '<li><span class="time">'+ commenTime(dataItem.publishTime) +'</span></li>';
  1518. strAdd += '<li><span class="comment"></span></li>';
  1519. strAdd += '</ul></div>';
  1520. strAdd += '</a>';
  1521. li.innerHTML =strAdd
  1522. var $itemlist = $(li);
  1523. document.getElementById(obj).appendChild(li);
  1524. if(dataItem.articleType=="1"){
  1525. (function(mo){
  1526. cacheModel.getProfessor(dataItem.ownerId,function(sc,value){
  1527. if(sc){
  1528. mo.find(".ownerName").html(value.name)
  1529. }else{
  1530. console.log("error")
  1531. }
  1532. })
  1533. })($itemlist);
  1534. }else if(dataItem.articleType=="2"){
  1535. (function(mo){
  1536. cacheModel.getCompany(dataItem.ownerId,function(sc,value){
  1537. if(sc){
  1538. if(value.forShort){
  1539. mo.find(".ownerName").html(value.forShort)
  1540. }else{
  1541. mo.find(".ownerName").html(value.name)
  1542. }
  1543. }else{
  1544. console.log("error")
  1545. }
  1546. })
  1547. })($itemlist);
  1548. }else if(dataItem.articleType=="3"){
  1549. (function(mo){
  1550. cacheModel.getPlatform(dataItem.ownerId,function(sc,value){
  1551. if(sc){
  1552. mo.find(".ownerName").html(value.name)
  1553. }else{
  1554. console.log("error")
  1555. }
  1556. })
  1557. })($itemlist);
  1558. }
  1559. }
  1560. });
  1561. },
  1562. detailDemand=function(arr,obj) {
  1563. oAjax("/ajax/demand/qm",{
  1564. id:arr,
  1565. },"get",function(data){
  1566. var dataStr=data.data;
  1567. for(var i = 0; i < dataStr.length; i++) {
  1568. var li = document.createElement("li");
  1569. li.className = "mui-table-view-cell";
  1570. var strCon='<a target="_blank" href="demandShow.html?demandId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  1571. strCon+='<div class="madiaInfo" style="padding-left:0">'
  1572. strCon+='<p class="h1Font ellipsisSty">'+ dataStr[i].title +'</p>'
  1573. strCon+='<ul class="showli clearfix h3Font">'
  1574. if(dataStr[i].city){ strCon+='<li>'+dataStr[i].city+'</li>' }
  1575. if(dataStr[i].duration!=0){ strCon+='<li>预期 '+demandDuration[dataStr[i].duration]+'</li>' }
  1576. if(dataStr[i].cost!=0){ strCon+='<li>预算 '+demandCost[dataStr[i].cost]+'</li>' }
  1577. if(dataStr[i].invalidDay){ strCon+='<li>有效期至 '+TimeTr(dataStr[i].invalidDay)+'</li>' }
  1578. strCon+='</ul></div></a>'
  1579. li.innerHTML = strCon
  1580. document.getElementById(obj).appendChild(li);
  1581. }
  1582. });
  1583. },
  1584. detailAnswer=function(dataStr,listLi){
  1585. var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.qid+'&topid='+dataStr.id+'">'+
  1586. '<div class="madiaInfo" style="padding-left: 0">' +
  1587. '<div class="ellipsisSty qa-question"></div>' +
  1588. '<div class="flexCenter qa-owner">' +
  1589. '</div>' +
  1590. '<div class="qa-con ellipsisSty-3">' + listConCut(dataStr.cnt) +'</div>' +
  1591. '<div class="showspan">' +
  1592. '<span>'+commenTime(dataStr.createTime)+'</span>' +
  1593. '<span class="agree"></span>' +
  1594. '<span class="leaveMsgCount"></span>' +
  1595. '</div>' +
  1596. '</div></a>';
  1597. var $strAdd = $(strAdd);
  1598. listLi.append( $strAdd);
  1599. if(dataStr.agree > 0) {
  1600. $strAdd.find(".agree").html("赞 "+dataStr.agree);
  1601. }
  1602. questioninfo(dataStr.qid, $strAdd);
  1603. proinfo(dataStr.uid, $strAdd);
  1604. leaveMsgCount(dataStr.id,4, $strAdd);
  1605. },
  1606. detailQuestion=function(dataStr,listLi) {
  1607. var baImg = "../images/default-q&a.jpg";
  1608. var subs = new Array();
  1609. if(dataStr.img) {
  1610. var subs=strToAry(dataStr.img)
  1611. baImg = "/data/question"+ subs[0];
  1612. }
  1613. var hd = "";
  1614. if (dataStr.replyCount > 0) {
  1615. hd = '<li><span>回答 ' + dataStr.replyCount + '</span></li>'
  1616. }
  1617. var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.id+'" class="flexCenter urlgo">'
  1618. strAdd += '<div class="madiaHead qa-Head" style="background-image:url('+ baImg +')"></div>';
  1619. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr.title +'</p>';
  1620. strAdd += '<ul class="h2Font clearfix">'
  1621. strAdd += '<li><span class="time">'+commenTime(dataStr.createTime)+'</span></li><li><span class="qaPageview"></span></li>'+hd+'<li><span class="attendCount"></span></li>'
  1622. strAdd += '</ul></div></a>'
  1623. var $str = $(strAdd);
  1624. listLi.append($str);
  1625. },
  1626. detailService=function(arr,obj) {
  1627. oAjax("/ajax/ware/qm",{
  1628. id:arr,
  1629. },"get",function(data){
  1630. console.log(data)
  1631. var dataItem=data.data;
  1632. for(var i = 0; i < dataItem.length; i++) {
  1633. var dataStr=dataItem[i]
  1634. var li = document.createElement("li");
  1635. li.className = "mui-table-view-cell";
  1636. var cnt="", rImg = "../images/default-service.jpg";
  1637. if(dataStr.images) {
  1638. var subs = strToAry(dataStr.images)
  1639. if(subs.length > 0) {
  1640. rImg="/data/ware" + subs[0]
  1641. }
  1642. }
  1643. if(dataStr.cnt){
  1644. cnt="内容:"+dataStr.cnt
  1645. }
  1646. var strAdd = '';
  1647. strAdd += '<a target="_blank" href="sevriceShow.html?sevriceId='+dataStr.id+'" class="flexCenter urlgo">';
  1648. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ rImg +')"></div>';
  1649. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.name +'</p>';
  1650. strAdd += '<p class="h1Font ellipsisSty"><span class="ownerName"></span><em class="authiconNew ownerSty"></em></p>';
  1651. strAdd += '<p class="h2Font ellipsisSty-2">'+ cnt+'</p></div>';
  1652. strAdd += '</a>';
  1653. li.innerHTML = strAdd
  1654. var $itemlist = $(li);
  1655. document.getElementById(obj).appendChild(li);
  1656. if(dataStr.category=="1"){
  1657. (function(mo){
  1658. cacheModel.getProfessor(dataStr.owner,function(sc,value){
  1659. if(sc){
  1660. mo.find(".ownerName").html(value.name)
  1661. var userType = autho(value.authType, value.orgAuth, value.authStatus);
  1662. mo.find(".ownerSty").addClass(userType.sty).attr("title",userType.title)
  1663. }else{
  1664. console.log("error")
  1665. }
  1666. })
  1667. })($itemlist);
  1668. }else if(dataStr.category=="2"){
  1669. (function(mo){
  1670. cacheModel.getCompany(dataStr.owner,function(sc,value){
  1671. if(sc){
  1672. if(value.forShort){
  1673. mo.find(".ownerName").html(value.forShort)
  1674. }else{
  1675. mo.find(".ownerName").html(value.name)
  1676. }
  1677. if(value.authStatus==3) {
  1678. mo.find(".ownerSty").addClass("authicon-com-ok").attr("title","科袖认证企业")
  1679. }
  1680. }else{
  1681. console.log("error")
  1682. }
  1683. })
  1684. })($itemlist);
  1685. }
  1686. }
  1687. });
  1688. },
  1689. proinfo=function(pid, $str) {
  1690. oAjax("/ajax/professor/baseInfo/" + pid,{}, "get", function(data){
  1691. var dataStr = data.data
  1692. var baImg = "../images/default-photo.jpg";
  1693. if (dataStr.hasHeadImage == 1) {
  1694. baImg = "/images/head/" + dataStr.id + "_l.jpg";
  1695. }
  1696. var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
  1697. var os = "";
  1698. if (dataStr.title) {
  1699. if (dataStr.orgName) {
  1700. os = dataStr.title + "," + dataStr.orgName;
  1701. } else {
  1702. os = dataStr.title;
  1703. }
  1704. } else {
  1705. if (dataStr.office) {
  1706. if (dataStr.orgName) {
  1707. os = dataStr.office + "," + dataStr.orgName;
  1708. } else {
  1709. os = dataStr.office;
  1710. }
  1711. } else {
  1712. if (dataStr.orgName) {
  1713. os = dataStr.orgName;
  1714. }
  1715. }
  1716. }
  1717. var str = '<div class="owner-head useHead" style="background-image:url(' + baImg + ')"></div>' +
  1718. '<div class="owner-info">' +
  1719. '<div class="owner-name"><span class="h1Font">' + dataStr.name + '</span><em class="authiconNew ' + userType.sty + '" title="' + userType.title + '"></em></div>' +
  1720. '<div class="owner-tit mui-ellipsis h2Font">' + os + '</div>' +
  1721. '</div>'
  1722. $str.find(".qa-owner").html(str)
  1723. });
  1724. },
  1725. questioninfo=function(qid, $str) {
  1726. oAjax("/ajax/question/qo",{
  1727. id:qid
  1728. }, "get", function(data){
  1729. $str.find(".qa-question").html(data.data.title);
  1730. if(data.data.pageViews>0){
  1731. $str.find(".qaPageview").html("阅读量 "+data.data.pageViews);
  1732. }else{
  1733. $str.find(".qaPageview").hide()
  1734. }
  1735. });
  1736. },
  1737. attendCount=function(id, $str) {
  1738. oAjax("/ajax/watch/countProfessor",{
  1739. id:id,
  1740. type: "8"
  1741. }, "get", function(data){
  1742. if(data.data > 0) {
  1743. $str.find(".attendCount").html("关注 "+data.data);
  1744. }
  1745. });
  1746. },
  1747. bindClickFun=function(){
  1748. $("#myAttends").unbind("click").on("click",function(){//关注与收藏
  1749. openAttend()
  1750. })
  1751. $("#tab8user").unbind("click").on("click",function(){//点击更多
  1752. watchO={
  1753. beiTime:"",
  1754. beiProId:"",
  1755. watchTime:"",
  1756. watchObjId:"",
  1757. };
  1758. var pa=$(".moreNavUl.moreBuUl>li.liNow").attr("rel")
  1759. $("#"+pa).find("ul").html("")
  1760. $("#"+pa).find(".js-load-more").show();
  1761. if(userid!=professorId){
  1762. //关注他的人
  1763. $(".moreNavUl.moreBuUl>li.attentType").hide();
  1764. $(".moreNavUl.moreBuUl>li.attendMy").addClass("liNow").text("关注他的人");
  1765. $("#item8drop5").show().siblings().hide();
  1766. attentMyself(true);
  1767. }else{
  1768. $("#item8drop1").show().siblings().hide();
  1769. collectSorts(1,true);
  1770. }
  1771. collectSorts(3,true);
  1772. })
  1773. $("#tab6user").unbind("click").on("click",function(){//点击问答
  1774. dataO = {
  1775. AnsTime:"",
  1776. AnsId:"",
  1777. QuTime:"",
  1778. QuId:"",
  1779. };
  1780. var pa=$(".moreNavUl.wendaUl>li.liNow").attr("rel")
  1781. $("#"+pa).find("ul").html("")
  1782. $("#"+pa).find(".js-load-more").show();
  1783. if(userid!=professorId){
  1784. //他的回答
  1785. $(".moreNavUl.wendaUl>li").eq(0).hide().siblings().addClass("liNow").text("他的回答");
  1786. $("#item6drop2").show().siblings().hide();
  1787. answerListVal(true);
  1788. }else{
  1789. $(".wendaNav li").eq(0).addClass("liNow").siblings().removeClass("liNow");
  1790. $("#item6drop1").show().siblings().hide();
  1791. questionListVal(true);
  1792. }
  1793. })
  1794. $(".moreNavUl.wendaUl").on("click","li",function(){//问答tab切换
  1795. var pa=$(this).attr("rel")
  1796. $("#"+pa).find("ul").html("")
  1797. $("#"+pa).find(".js-load-more").show();
  1798. var sortN=$(this).attr("data-num");
  1799. dataO = {
  1800. AnsTime:"",
  1801. AnsId:"",
  1802. QuTime:"",
  1803. QuId:"",
  1804. };
  1805. if(sortN==1){
  1806. questionListVal(true);
  1807. }else if(sortN==2){
  1808. answerListVal(true);
  1809. }
  1810. })
  1811. $(".moreNavUl.moreBuUl").on("click","li.attentType:not(.rightbtn)",function(){//关注tab切换
  1812. var pa=$(this).attr("rel")
  1813. $("#"+pa).find("ul").html("")
  1814. $("#"+pa).find(".js-load-more").show();
  1815. var sortN=$(this).attr("data-num");
  1816. watchO={
  1817. watchTime:"",
  1818. watchObjId:"",
  1819. WATime:"",
  1820. WAId:"",
  1821. WQTime:"",
  1822. WQId:"",
  1823. };
  1824. if(sortN==8){
  1825. collectQuestion(true)
  1826. }else if(sortN==9){
  1827. collectAnswer(true)
  1828. }else{
  1829. collectSorts(sortN,true);
  1830. }
  1831. })
  1832. $("#tabAttendMy").unbind("click").on("click",function(){//关注我的人
  1833. var pa=$(this).attr("rel")
  1834. $("#"+pa).find("ul").html("")
  1835. $("#"+pa).find(".js-load-more").show();
  1836. watchO={
  1837. beiTime:"",
  1838. beiProId:"",
  1839. }
  1840. attentMyself(true);
  1841. })
  1842. $("#attendmyGo").unbind("click").on("click",function(){
  1843. if(userid!=professorId){
  1844. $(".moreNavUl.moreBuUl>li.attentType").hide();//关注他的人
  1845. $(".moreNavUl.moreBuUl>li.attendMy").addClass("liNow").text("关注他的人");
  1846. }
  1847. $(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
  1848. $(".moreNav").hide()
  1849. $("#item8more").fadeIn();
  1850. $("#item8user").show().siblings().hide();
  1851. $(".moreBuUl li.attendMy").addClass("liNow").siblings().removeClass("liNow");
  1852. $("#item8drop5").show().siblings().hide();
  1853. watchO={
  1854. beiTime:"",
  1855. beiProId:"",
  1856. }
  1857. $("#item8drop5").find("ul").html("")
  1858. $("#item8drop5").find(".js-load-more").show();
  1859. attentMyself(true);
  1860. })
  1861. /*研究方向点赞*/
  1862. var clFlag = 1;
  1863. $("#researchAreaShow").on("click", ".plus", function() {
  1864. if(userid && userid != null && userid != "null") {
  1865. //点赞变化样式
  1866. if(clFlag) {
  1867. clFlag = 0;
  1868. } else {
  1869. return;
  1870. }
  1871. if($(this).data("isagree") > -1) {
  1872. $(this).stop(true, true).animate({
  1873. backgroundPositionY: 0
  1874. }, 300); //变成未点赞样式
  1875. } else {
  1876. $(this).stop(true, true).animate({
  1877. backgroundPositionY: -26
  1878. }, 300); //变成点赞样式
  1879. }
  1880. $.ajax({
  1881. "url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
  1882. "type": "POST",
  1883. "data": {
  1884. "targetId": $(this).data("pid"),
  1885. "targetCaption": oArray[$(this).data("caption")],
  1886. "opId": userid,
  1887. "uname":$.cookie("userName")
  1888. },
  1889. "contentType": "application/x-www-form-urlencoded",
  1890. "success": function(dataStr) {
  1891. if(dataStr.success) {
  1892. $.get("/ajax/professor/info/" + professorId, function(dataStr) {
  1893. if(dataStr.success) {
  1894. clFlag = 1;
  1895. var $info = dataStr.data;
  1896. if($info) {
  1897. $("#researchAreaShow").empty("")
  1898. if($info.researchAreas) {
  1899. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  1900. }
  1901. }
  1902. }
  1903. })
  1904. } else {
  1905. $.MsgBox.Alert("提示", dataStr.msg);
  1906. }
  1907. }
  1908. });
  1909. } else {
  1910. quickLog();
  1911. operatTab();
  1912. closeLog();
  1913. }
  1914. })
  1915. //点击每个研究方向弹出研究方向详情窗口
  1916. $("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
  1917. var cap = $(this).attr("caption");
  1918. researchAlert(cap)
  1919. });
  1920. //关闭按钮
  1921. $("#workclose").click(function() {
  1922. $(".resAreaCover").fadeOut();
  1923. $("body").css("position", "");
  1924. });
  1925. //点击查看全部资源
  1926. $(".coninfobox").on("click","#seeMoreR",function(){
  1927. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1928. $("#tab2user").addClass("liNow").siblings().removeClass("liNow");
  1929. $("#item1user").hide();
  1930. $("#item2user").show();
  1931. })
  1932. //点击查看全部服务
  1933. $(".coninfobox").on("click","#seeMoreS",function(){
  1934. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1935. $("#tab9user").addClass("liNow").siblings().removeClass("liNow");
  1936. $("#item1user").hide();
  1937. $("#item9user").show();
  1938. })
  1939. //点击查看全部文章
  1940. $(".coninfobox").on("click","#seeMoreA",function(){
  1941. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1942. $("#tab3user").addClass("liNow").siblings().removeClass("liNow");
  1943. $("#item1user").hide();
  1944. $("#item3user").show();
  1945. })
  1946. //点击查看全部专利
  1947. $(".coninfobox").on("click","#seeMoreP",function(){
  1948. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1949. $("#tab4user").addClass("liNow").siblings().removeClass("liNow");
  1950. $("#item1user").hide();
  1951. $("#item4user").show();
  1952. })
  1953. //点击查看全部论文
  1954. $(".coninfobox").on("click","#seeMoreL",function(){
  1955. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1956. $("#tab5user").addClass("liNow").siblings().removeClass("liNow");
  1957. $("#item1user").hide();
  1958. $("#item5user").show();
  1959. })
  1960. //点击查看全部问题
  1961. $(".coninfobox").on("click","#seeMoreQA",function(){
  1962. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1963. $("#tab6user").addClass("liNow").siblings().removeClass("liNow");
  1964. $("#item1user").hide();
  1965. $("#item6user").show();
  1966. if(userid === professorId) {
  1967. $(".wendaNav").show();
  1968. }
  1969. $(".wendaNav li").eq(1).addClass("liNow").siblings().removeClass("liNow");
  1970. $("#item6drop2").show().siblings().hide();
  1971. })
  1972. //点击关注按钮
  1973. $("#attentBtn").on('click', function() {
  1974. if(userid && userid != null && userid != "null") {
  1975. if($(this).is('.attenedSpan')){
  1976. cancelCollectionAbout(professorId,$(this),1)
  1977. } else {
  1978. collectionAbout(professorId,$(this), 1);
  1979. }
  1980. queryPubCount();
  1981. watchO={
  1982. beiTime:"",
  1983. beiProId:"",
  1984. }
  1985. $("#item8drop5").find("ul").html("")
  1986. $("#item8drop5").find(".js-load-more").show();
  1987. attentMyself(true);
  1988. }else{
  1989. quickLog();
  1990. operatTab();
  1991. closeLog();
  1992. }
  1993. });
  1994. //点击联系按钮
  1995. $("#conbtn").on('click', function(){
  1996. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  1997. location.href="tidings.html?id="+professorId
  1998. } else {
  1999. quickLog();
  2000. operatTab();
  2001. closeLog();
  2002. }
  2003. });
  2004. //纠错反馈
  2005. $(".correctSubmit").on("click",function(){
  2006. var cntCon=$(this).siblings(".correctCon").val();
  2007. var cntUser="";
  2008. if(userid && userid != null && userid != "null") {
  2009. cntUser = userid;
  2010. }
  2011. if(cntCon.length>500){
  2012. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  2013. return;
  2014. }else{
  2015. oAjax("/ajax/feedback/error/professor",{
  2016. "id": professorId,
  2017. "cnt":cntCon,
  2018. "user":cntUser
  2019. }, "POST", function(data){
  2020. backSuccessed();
  2021. });
  2022. }
  2023. })
  2024. }
  2025. if(GetQueryString("flag")) {
  2026. researchAlert(GetQueryString("flag"))
  2027. }
  2028. if(GetQueryString("iLike")){
  2029. openAttend();
  2030. }
  2031. if(userid!=professorId){
  2032. pageViewLog(professorId,1)
  2033. relevantExperts();//合作专家
  2034. relevantarticalList();//相关文章
  2035. likeExperts();//感兴趣专家
  2036. isActUser();//判断用户是否被激活
  2037. ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
  2038. $(".goSpan").show();
  2039. }else{
  2040. $(".goSpanTo").show();
  2041. $(".myoneself").show();
  2042. }
  2043. queryPubCount();
  2044. getUserInfo(); //获取详细信息
  2045. demandListVal(true);
  2046. articalListVal(true);
  2047. resourceListVal(true);
  2048. serviceListVal(true);
  2049. patentListVal(true);
  2050. paperListVal(true);
  2051. answerListVal(true);
  2052. bindClickFun();
  2053. })