portal html css js resource

userInforShow.js 74KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123
  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].images) {
  611. var subs = strToAry($info[i].images)
  612. if(subs.length > 0) {
  613. hasImg="/data/ware" + subs[0]
  614. }
  615. }
  616. var itemlist = '<li>';
  617. itemlist += '<a href="sevriceShow.html?sevriceId=' + $info[i].id + '" class="flexCenter urlgo">';
  618. itemlist += '<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>';
  619. itemlist += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">' + $info[i].name + '</p><p class="h2Font ellipsisSty">' + cnt+ '</p></div>';
  620. itemlist += '</a></li>';
  621. var $itemlist = $(itemlist);
  622. $("#"+aimId).append($itemlist)
  623. if(isbind && i==0){
  624. var $itemlist = $(itemlist);
  625. $("#"+aimIdF).append($itemlist);
  626. }
  627. }
  628. }
  629. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  630. removeNodata(aimId);
  631. if($info.length == 0 && liLen == 0 ){
  632. $("#"+aimId).hide()
  633. insertNodata(aimId,newStr);
  634. }
  635. if(isbind){
  636. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  637. serviceListVal(false)
  638. })
  639. }
  640. if ($info.length < rows) {
  641. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  642. $("#"+aimId).parent().find(".js-load-more").hide();
  643. }
  644. },function(){
  645. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  646. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  647. },function(){
  648. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  649. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  650. })
  651. },
  652. patentListVal=function(isbind){
  653. var aimId="proPatent",aimIdF="showPatent",newStr="用户尚未发布任何专利"
  654. oAjax("/ajax/ppatent/professor",{
  655. "owner":professorId,
  656. "assTime":dataO.patTime,
  657. "id":dataO.patId,
  658. "rows": rows
  659. }, "get", function(res){
  660. var $info = res.data;
  661. if($info.length > 0) {
  662. $("#"+aimId).show()
  663. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  664. $("#"+aimIdF).parents(".form-item").removeClass("displayNone");
  665. $("#"+aimIdF).parents(".coninfobox").show();
  666. dataO.patTime = $info[$info.length - 1].assTime;
  667. dataO.patId = $info[$info.length - 1].id;
  668. for(var i = 0; i < $info.length; i++) {
  669. var dataStr= $info
  670. if(!dataStr[i].reqPerson){
  671. dataStr[i].reqPerson="";
  672. }
  673. var strAdd = '';
  674. strAdd += '<li><a target="_blank" href="/'+ pageUrl("pt",dataStr[i]) +'" class="flexCenter urlgo">';
  675. strAdd += '<div class="madiaHead patentHead"></div>';
  676. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  677. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  678. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  679. strAdd += '</div>';
  680. strAdd += '</a></li>';
  681. var $itemlist = $(strAdd);
  682. $("#"+aimId).append($itemlist)
  683. if(isbind && i==0){
  684. var $itemlist = $(strAdd);
  685. $("#"+aimIdF).append($itemlist);
  686. }
  687. }
  688. }
  689. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  690. removeNodata(aimId);
  691. if($info.length == 0 && liLen == 0 ){
  692. $("#"+aimId).hide()
  693. insertNodata(aimId,newStr);
  694. }
  695. if(isbind){
  696. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  697. patentListVal(false)
  698. })
  699. }
  700. if ($info.length < rows) {
  701. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  702. $("#"+aimId).parent().find(".js-load-more").hide();
  703. }
  704. },function(){
  705. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  706. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  707. },function(){
  708. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  709. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  710. })
  711. },
  712. paperListVal=function(isbind){
  713. var aimId="proPaper",aimIdF="showPaper",newStr="用户尚未发布任何论文"
  714. oAjax("/ajax/ppaper/professor",{
  715. "owner":professorId,
  716. "assTime":dataO.parTime,
  717. "id":dataO.parId,
  718. "rows": rows
  719. }, "get", function(res){
  720. var $info = res.data;
  721. if($info.length > 0) {
  722. $("#"+aimId).show()
  723. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  724. $("#"+aimIdF).parents(".form-item").removeClass("displayNone");
  725. $("#"+aimIdF).parents(".coninfobox").show();
  726. dataO.parTime = $info[$info.length - 1].assTime;
  727. dataO.parId = $info[$info.length - 1].id;
  728. for(var i = 0; i < $info.length; i++) {
  729. var dataStr= $info
  730. var moreInf=""
  731. if(!dataStr[i].cn4periodical){
  732. dataStr[i].cn4periodical="";
  733. }
  734. if(!dataStr[i].en4periodical){
  735. dataStr[i].en4periodical="";
  736. }
  737. if(!dataStr[i].pubDay){
  738. dataStr[i].pubDay="";
  739. }
  740. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  741. var strAdd = '';
  742. strAdd += '<li><a target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
  743. strAdd += '<div class="madiaHead paperHead"></div>';
  744. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  745. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  746. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  747. strAdd += '</div>';
  748. strAdd += '</a></li>';
  749. var $itemlist = $(strAdd);
  750. $("#"+aimId).append($itemlist)
  751. if(isbind && i==0){
  752. var $itemlist = $(strAdd);
  753. $("#"+aimIdF).append($itemlist);
  754. }
  755. }
  756. }
  757. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  758. removeNodata(aimId);
  759. if($info.length == 0 && liLen == 0 ){
  760. $("#"+aimId).hide()
  761. insertNodata(aimId,newStr);
  762. }
  763. if(isbind){
  764. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  765. paperListVal(false)
  766. })
  767. }
  768. if ($info.length < rows) {
  769. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  770. $("#"+aimId).parent().find(".js-load-more").hide();
  771. }
  772. },function(){
  773. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  774. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  775. },function(){
  776. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  777. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  778. })
  779. },
  780. answerListVal=function(isbind){//获取问答
  781. var aimId="proA",aimIdF="showAnswer",newStr="用户尚未任何回答"
  782. oAjax("/ajax/question/answer/bySelf",{
  783. "time":dataO.AnsTime,
  784. "id":dataO.AnsId,
  785. "uid":professorId,
  786. "rows":rows
  787. }, "get", function(res){
  788. var $info = res.data;
  789. if($info.length > 0) {
  790. $("#"+aimId).show()
  791. $("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
  792. $("#"+aimIdF).parents(".form-item").removeClass("displayNone");
  793. $("#"+aimIdF).parents(".coninfobox").show();
  794. dataO.AnsTime = $info[$info.length - 1].createTime;
  795. dataO.AnsId = $info[$info.length - 1].id;
  796. for(var i = 0; i < $info.length; i++) {
  797. var listLi = $('<li>')
  798. listLi.appendTo($("#"+aimId));
  799. detailAnswer($info[i], listLi);
  800. if(isbind && i==0){
  801. var li = listLi.clone();
  802. li.appendTo($("#"+aimIdF));
  803. questioninfo($info[i].qid, li);
  804. proinfo($info[i].uid, li);
  805. leaveMsgCount($info[i].id,4, li);
  806. }
  807. }
  808. }
  809. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  810. removeNodata(aimId);
  811. if($info.length == 0 && liLen == 0 ){
  812. $("#"+aimId).hide()
  813. insertNodata(aimId,newStr);
  814. }
  815. if(isbind){
  816. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  817. answerListVal(false)
  818. })
  819. }
  820. if ($info.length < rows) {
  821. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  822. $("#"+aimId).parent().find(".js-load-more").hide();
  823. }
  824. },function(){
  825. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  826. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  827. },function(){
  828. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  829. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  830. })
  831. },
  832. questionListVal=function(isbind) {
  833. var aimId="proQ",newStr="用户尚未发布任何问题"
  834. oAjax("/ajax/question/my",{
  835. "uid":professorId,
  836. "time":dataO.QuTime,
  837. "id":dataO.QuId,
  838. "rows":rows,
  839. }, "get", function(res){
  840. var $info = res.data;
  841. if($info.length > 0) {
  842. $("#"+aimId).show()
  843. dataO.QuTime = $info[$info.length - 1].createTime;
  844. dataO.QuId = $info[$info.length - 1].id;
  845. for(var i = 0; i < $info.length; i++) {
  846. var listLi = $('<li class="mui-table-view-cell">').appendTo($("#proQ"));
  847. detailQuestion($info[i], listLi);
  848. if(isbind && i==0){
  849. $("#"+aimId).html();
  850. }
  851. }
  852. }
  853. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  854. removeNodata(aimId);
  855. if($info.length == 0 && liLen == 0 ){
  856. $("#"+aimId).hide()
  857. insertNodata(aimId,newStr);
  858. }
  859. if(isbind){
  860. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  861. questionListVal(false)
  862. })
  863. }
  864. if ($info.length < rows) {
  865. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  866. $("#"+aimId).parent().find(".js-load-more").hide();
  867. }
  868. },function(){
  869. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  870. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  871. },function(){
  872. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  873. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  874. })
  875. },
  876. relevantarticalList=function(){//相关文章信息
  877. oAjax("/ajax/article/byAssProfessor",{
  878. "id":professorId
  879. }, "get", function(data){
  880. if(data.data.length>0){
  881. $("#relateArt").parents(".conBlock").removeClass("displayNone");
  882. var itemlist = '';
  883. $("#relateArt").html("");
  884. for(var i = 0; i < data.data.length; i++) {
  885. var itemlist = '<li class="flexCenter"><a target="_blank" href="/'+ pageUrl('a',data.data[i]) +'" class="urlgo">';
  886. itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
  887. itemlist += '</a></li>';
  888. $itemlist = $(itemlist);
  889. $("#relateArt").append($itemlist);
  890. }
  891. }
  892. });
  893. },
  894. likeExperts=function(){//感兴趣
  895. oAjax("/ajax/professor/ralateProfessors",{
  896. "professorId":professorId
  897. }, "get", function(data){
  898. var lengthT;
  899. if(data.data.length>5){
  900. lengthT=5;
  901. }else{
  902. lengthT=data.data.length
  903. }
  904. for(var i = 0; i < lengthT; i++) {
  905. var ExpId = data.data[i].id;
  906. (function(Id){
  907. oAjax("/ajax/professor/info/"+Id,{}, "get", function(data){
  908. $("#likePro").parents(".conBlock").removeClass("displayNone");
  909. var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
  910. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  911. itemlist += '<div class="madiaInfo">';
  912. itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
  913. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  914. itemlist += '</div></a></li>';
  915. var $itemlist = $(itemlist);
  916. $("#likePro").append($itemlist);
  917. if(data.data.title) {
  918. if(data.data.orgName) {
  919. $itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
  920. }else{
  921. $itemlist.find("#usertitle").text(data.data.title);
  922. }
  923. }else{
  924. if(data.data.office) {
  925. if(data.data.orgName) {
  926. $itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
  927. }else{
  928. $itemlist.find("#usertitle").text(data.data.office);
  929. }
  930. }else{
  931. if(data.data.orgName) {
  932. $itemlist.find("#usertitle").text(data.data.orgName);
  933. }
  934. }
  935. }
  936. $itemlist.find("#userName").text(data.data.name);
  937. $itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
  938. if(data.data.hasHeadImage == 1) {
  939. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
  940. }
  941. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  942. $itemlist.find(".authiconNew").attr("title", userType.title);
  943. $itemlist.find(".authiconNew").addClass(userType.sty);
  944. })
  945. })(ExpId)
  946. }
  947. });
  948. },
  949. relevantExperts=function(){
  950. oAjax("/ajax/professor/coadjutant",{
  951. "id":professorId
  952. }, "get", function(data){
  953. var lengthT;
  954. if(data.data.length>5){
  955. lengthT=5;
  956. }else{
  957. lengthT=data.data.length
  958. }
  959. for(var i = 0; i < lengthT; i++) {
  960. var ExpId = data.data[i].professorId;
  961. var paperN=data.data[i].paperCount;
  962. var patentN=data.data[i].patentCount;
  963. (function(Id,numL,numZ){
  964. oAjax("/ajax/professor/info/"+Id,{}, "get", function(data){
  965. $("#relatePro").parents(".conBlock").removeClass("displayNone");
  966. var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
  967. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  968. itemlist += '<div class="madiaInfo">';
  969. itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
  970. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  971. itemlist += '<p class="h2Font ellipsisSty" id="copNum"></p>';
  972. itemlist += '</div></a></li>';
  973. var $itemlist = $(itemlist);
  974. $("#relatePro").append($itemlist);
  975. if(numL){
  976. if(numZ){
  977. $itemlist.find("#copNum").text("合作:"+numZ+"项专利,"+numL+"篇论文")
  978. }else{
  979. $itemlist.find("#copNum").text("合作:"+numL+"篇论文")
  980. }
  981. }else{
  982. if(numZ){
  983. $itemlist.find("#copNum").text("合作:"+numZ+"项专利")
  984. }else{
  985. }
  986. }
  987. if(data.data.title) {
  988. if(data.data.orgName) {
  989. $itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
  990. }else{
  991. $itemlist.find("#usertitle").text(data.data.title);
  992. }
  993. }else{
  994. if(data.data.office) {
  995. if(data.data.orgName) {
  996. $itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
  997. }else{
  998. $itemlist.find("#usertitle").text(data.data.office);
  999. }
  1000. }else{
  1001. if(data.data.orgName) {
  1002. $itemlist.find("#usertitle").text(data.data.orgName);
  1003. }
  1004. }
  1005. }
  1006. $itemlist.find("#userName").text(data.data.name);
  1007. $itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
  1008. if(data.data.hasHeadImage == 1) {
  1009. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
  1010. }
  1011. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  1012. $itemlist.find(".authiconNew").attr("title", userType.title);
  1013. $itemlist.find(".authiconNew").addClass(userType.sty);
  1014. })
  1015. })(ExpId,paperN,patentN)
  1016. }
  1017. });
  1018. },
  1019. isActUser=function(){
  1020. oAjax("/ajax/baseUserInfo",{
  1021. "id": professorId
  1022. }, "get", function(data){
  1023. if(!data.data.activeTime){
  1024. $(".last_meg").removeClass("displayNone");
  1025. $(".message_b").on("click",function(){
  1026. $(".meg_md5").toggle();
  1027. if(data.data.email && data.data.mobilePhone){
  1028. $("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号或邮箱 '+data.data.email);
  1029. }else if(data.data.mobilePhone && !data.data.email){
  1030. $("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号');
  1031. }else if(data.data.email && !data.data.mobilePhone){
  1032. $("#wayTel").text('邮箱 '+data.data.email);
  1033. }
  1034. })
  1035. }else{
  1036. $(".last_meg").addClass("displayNone");
  1037. }
  1038. })
  1039. },
  1040. queryPubCount=function(){
  1041. oAjax("/ajax/watch/countProfessor",{//关注我的
  1042. "id": professorId,
  1043. "type":"1"
  1044. }, "GET", function(data){
  1045. $("#focusMe").text(data.data);
  1046. });
  1047. oAjax("/ajax/watch/countObject",{//我关注的
  1048. "id": professorId,
  1049. "type":"1"
  1050. }, "GET", function(data){
  1051. $("#myFocus").text(data.data);
  1052. });
  1053. oAjax("/ajax/professor/agree/sum",{//总获赞
  1054. "id": professorId,
  1055. }, "GET", function(data){
  1056. $("#agreeMecount").text(data.data);
  1057. });
  1058. oAjax("/ajax/article/count/publish",{//文章总数
  1059. "owner": professorId,
  1060. "category":"1"
  1061. }, "GET", function(data){
  1062. if(data.data>0 && data.data<99){
  1063. $("#artCount").text(data.data);
  1064. }
  1065. if(data.data>99){
  1066. $("#artCount").text("99+");
  1067. }
  1068. });
  1069. oAjax("/ajax/resource/count/publish",{//资源总数
  1070. "owner": professorId,
  1071. "category":"1"
  1072. }, "GET", function(data){
  1073. if(data.data>0 && data.data<99){
  1074. $("#resCount").text(data.data);
  1075. }
  1076. if(data.data>99){
  1077. $("#resCount").text("99+");
  1078. }
  1079. });
  1080. oAjax("/ajax/ware/count/publish",{//服务总数
  1081. "owner": professorId,
  1082. "category":"1"
  1083. }, "GET", function(data){
  1084. if(data.data>0 && data.data<99){
  1085. $("#serCount").text(data.data);
  1086. }
  1087. if(data.data>99){
  1088. $("#serCount").text("99+");
  1089. }
  1090. });
  1091. oAjax("/ajax/ppatent/count/publish",{//专利总数
  1092. "owner": professorId,
  1093. }, "GET", function(data){
  1094. if(data.data>0 && data.data<99){
  1095. $("#patCount").text(data.data);
  1096. }
  1097. if(data.data>99){
  1098. $("#patCount").text("99+");
  1099. }
  1100. });
  1101. oAjax("/ajax/ppaper/count/publish",{//论文总数
  1102. "owner": professorId,
  1103. }, "GET", function(data){
  1104. if(data.data>0 && data.data<99){
  1105. $("#parCount").text(data.data);
  1106. }
  1107. if(data.data>99){
  1108. $("#parCount").text("99+");
  1109. }
  1110. });
  1111. },
  1112. attentMyself=function(isbind){
  1113. var aimId="attendMy",newStr="用户尚未被任何人关注"
  1114. oAjax("/ajax/watch/watchList",{//关注我的列表
  1115. "watchObject": professorId,
  1116. "createTime": watchO.beiTime,
  1117. "professorId":watchO.beiProId,
  1118. "rows":rows
  1119. }, "GET", function(res){
  1120. console.log(res)
  1121. var $info = res.data;
  1122. if($info.length > 0) {
  1123. $("#"+aimId).show()
  1124. watchO.beiTime = $info[$info.length - 1].createTime;
  1125. watchO.beiProId = $info[$info.length - 1].professorId;
  1126. var arr=[];
  1127. for(var i in $info) {
  1128. arr[i]=$info[i].professorId;
  1129. }
  1130. detailPro(arr,aimId);
  1131. }
  1132. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  1133. removeNodata(aimId);
  1134. if($info.length == 0 && liLen == 0 ){
  1135. $("#"+aimId).hide()
  1136. insertNodata(aimId,newStr);
  1137. }
  1138. if(isbind){
  1139. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  1140. attentMyself(false)
  1141. })
  1142. }
  1143. if ($info.length < rows) {
  1144. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  1145. $("#"+aimId).parent().find(".js-load-more").hide();
  1146. }
  1147. },function(){
  1148. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  1149. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  1150. },function(){
  1151. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  1152. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  1153. })
  1154. },
  1155. collectAnswer=function(isbind){
  1156. var aimId="attendAnswer",newStr="用户还未收藏任何回答"
  1157. oAjax("/ajax/question/answer/byWatch",{
  1158. "time":watchO.WATime,
  1159. "id":watchO.WAId,
  1160. "uid":professorId,
  1161. "rows":rows
  1162. }, "get", function(res){
  1163. var $info = res.data;
  1164. if($info.length > 0) {
  1165. $("#"+aimId).show()
  1166. watchO.WATime = $info[$info.length - 1].createTime;
  1167. watchO.WAId = $info[$info.length - 1].id;
  1168. for(var i = 0; i < $info.length; i++) {
  1169. var listLi = $('<li>')
  1170. listLi.appendTo($("#"+aimId));
  1171. detailAnswer($info[i], listLi);
  1172. }
  1173. }
  1174. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  1175. removeNodata(aimId);
  1176. if($info.length == 0 && liLen == 0 ){
  1177. $("#"+aimId).hide()
  1178. insertNodata(aimId,newStr);
  1179. }
  1180. if(isbind){
  1181. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  1182. collectAnswer(false)
  1183. })
  1184. }
  1185. if ($info.length < rows) {
  1186. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  1187. $("#"+aimId).parent().find(".js-load-more").hide();
  1188. }
  1189. },function(){
  1190. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  1191. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  1192. },function(){
  1193. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  1194. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  1195. })
  1196. },
  1197. collectQuestion=function(isbind){
  1198. var aimId="attendQuestion",newStr="用户还未关注任何问题"
  1199. oAjax("/ajax/question/watch",{
  1200. "time":watchO.WQTime,
  1201. "id":watchO.WQId,
  1202. "uid":professorId,
  1203. "rows":rows
  1204. }, "get", function(res){
  1205. var $info = res.data;
  1206. if($info.length > 0) {
  1207. $("#"+aimId).show()
  1208. watchO.WQTime = $info[$info.length - 1].createTime;
  1209. watchO.WQId = $info[$info.length - 1].id;
  1210. for(var i = 0; i < $info.length; i++) {
  1211. var listLi = $('<li>')
  1212. listLi.appendTo($("#"+aimId));
  1213. detailQuestion($info[i], listLi);
  1214. }
  1215. }
  1216. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  1217. removeNodata(aimId);
  1218. if($info.length == 0 && liLen == 0 ){
  1219. $("#"+aimId).hide()
  1220. insertNodata(aimId,newStr);
  1221. }
  1222. if(isbind){
  1223. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  1224. collectQuestion(false)
  1225. })
  1226. }
  1227. if ($info.length < rows) {
  1228. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  1229. $("#"+aimId).parent().find(".js-load-more").hide();
  1230. }
  1231. },function(){
  1232. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  1233. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  1234. },function(){
  1235. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  1236. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  1237. })
  1238. },
  1239. collectSorts=function(type,isbind){
  1240. var aimId="",newStr=""
  1241. oAjax("/ajax/watch/proList",{//我关注的列表
  1242. "professorId": professorId,
  1243. "watchType":type,
  1244. "createTime": watchO.watchTime,
  1245. "watchObject":watchO.watchObjId,
  1246. "rows":rows
  1247. }, "GET", function(res){
  1248. var $info = res.data;
  1249. var arr=[];
  1250. if($info.length > 0) {
  1251. $("#"+aimId).show()
  1252. watchO.watchTime = $info[$info.length - 1].createTime;
  1253. watchO.watchObjId = $info[$info.length - 1].watchObject;
  1254. for(var i in $info) {
  1255. arr[i]=$info[i].watchObject;
  1256. }
  1257. }
  1258. if(type==1){
  1259. aimId="attendPro"
  1260. newStr="用户还未关注任何专家"
  1261. detailPro(arr,aimId);
  1262. }else if(type==2){
  1263. aimId="attendRes"
  1264. newStr="用户还未收藏任何资源"
  1265. detailRes(arr,aimId);
  1266. }else if(type==3){
  1267. aimId="attendArt"
  1268. newStr="用户还未收藏任何文章"
  1269. detailArt(arr,aimId);
  1270. }else if(type==4){
  1271. aimId="attendPatent"
  1272. newStr="用户还未收藏任何专利"
  1273. detailPat(arr,aimId);
  1274. }else if(type==5){
  1275. aimId="attendPaper"
  1276. newStr="用户还未收藏任何论文"
  1277. detailPer(arr,aimId);
  1278. }else if(type==6){
  1279. aimId="attendCmp"
  1280. newStr="用户还未关注任何企业"
  1281. detailCmp(arr,aimId);
  1282. }else if(type==7){
  1283. aimId="attendDemand"
  1284. newStr="用户还未收藏任何需求"
  1285. detailDemand(arr,aimId);
  1286. }else if(type==10){
  1287. aimId="attendSer"
  1288. newStr="用户还未收藏任何服务"
  1289. detailService(arr,aimId);
  1290. }
  1291. var liLen=document.getElementById(aimId).querySelectorAll("li").length;
  1292. removeNodata(aimId);
  1293. if($info.length == 0 && liLen == 0 ){
  1294. $("#"+aimId).hide()
  1295. insertNodata(aimId,newStr);
  1296. }
  1297. if(isbind){
  1298. $("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
  1299. collectSorts(type,false)
  1300. })
  1301. }
  1302. if ($info.length < rows) {
  1303. $("#"+aimId).parent().find(".js-load-more").unbind("click");
  1304. $("#"+aimId).parent().find(".js-load-more").hide();
  1305. }
  1306. },function(){
  1307. $("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
  1308. $("#"+aimId).parent().find(".js-load-more").addClass("active");
  1309. },function(){
  1310. $("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
  1311. $("#"+aimId).parent().find(".js-load-more").removeClass("active");
  1312. })
  1313. },
  1314. detailPro=function(arr,obj) {
  1315. oAjax("/ajax/professor/qm",{
  1316. id:arr,
  1317. },"get",function(data){
  1318. var dataStr=data.data;
  1319. for(var i = 0; i < dataStr.length; i++) {
  1320. var li = document.createElement("li");
  1321. li.className = "mui-table-view-cell";
  1322. var userType = autho(dataStr[i].authType, dataStr[i].orgAuth, dataStr[i].authStatus);
  1323. var os = "";
  1324. if(dataStr[i].title) {
  1325. if(dataStr[i].orgName) {
  1326. os = dataStr[i].title + "," + dataStr[i].orgName;
  1327. } else {
  1328. os = dataStr[i].title;
  1329. }
  1330. } else {
  1331. if(dataStr[i].office) {
  1332. if(dataStr[i].orgName) {
  1333. os = dataStr[i].office + "," + dataStr[i].orgName;
  1334. } else {
  1335. os = dataStr[i].office;
  1336. }
  1337. } else {
  1338. if(dataStr[i].orgName) {
  1339. os = dataStr[i].orgName;
  1340. }
  1341. }
  1342. }
  1343. var baImg = "../images/default-photo.jpg";
  1344. if(dataStr[i].hasHeadImage == 1) {
  1345. baImg = "/images/head/" + dataStr[i].id + "_l.jpg";
  1346. }
  1347. var strAdd = '';
  1348. strAdd += '<a target="_blank" href="userInforShow.html?professorId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  1349. strAdd += '<div class="madiaHead useHead" style="width: 80px;height: 80px;margin-top: -40px;background-image:url(' + baImg + ')"></div>';
  1350. 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>';
  1351. strAdd += '<p class="h2Font ellipsisSty">' + os + '</p>';
  1352. strAdd += '</div>';
  1353. strAdd += '</a>'
  1354. li.innerHTML = strAdd
  1355. document.getElementById(obj).appendChild(li);
  1356. }
  1357. });
  1358. },
  1359. detailCmp=function(arr,obj) {
  1360. oAjax("/ajax/org/qm",{
  1361. id:arr,
  1362. },"get",function(data){
  1363. var dataStr=data.data;
  1364. for(var i = 0; i < dataStr.length; i++) {
  1365. var li = document.createElement("li");
  1366. li.setAttribute("data-id", dataStr[i].id);
  1367. var oimg = (dataStr[i].hasOrgLogo) ?"/images/org/" + dataStr[i].id + ".jpg" : "../images/default-icon.jpg";
  1368. var oAuth = (dataStr[i].authStatus == 3) ? 'authicon-com-ok' : '';
  1369. var orgName = (dataStr[i].forShort) ? dataStr[i].forShort : dataStr[i].name;
  1370. var orgType = (dataStr[i].orgType == '2') ? "上市企业" : "";
  1371. var orgOther = (dataStr[i].industry) ? dataStr[i].industry.replace(/,/gi, " | ") : "";
  1372. li.className = "mui-table-view-cell";
  1373. var itemlist=''
  1374. itemlist += '<a class="flexCenter" target="_blank" href="cmpInforShow.html?orgId='+dataStr[i].id+'"><div class="madiaHead cmpHead">';
  1375. itemlist += '<div class="boxBlock"><img class="boxBlockimg" src="' + oimg + '"></div></div>';
  1376. itemlist += '<div class="madiaInfo">';
  1377. itemlist += '<p class="h1Font"><span>' + orgName + '</span><em class="authiconNew ' + oAuth + '" title="科袖认证企业"></em></p>';
  1378. itemlist += '<p class="h2Font ellipsisSty"><span>' + orgType + '</span> <span>' + orgOther + '</span></p>';
  1379. itemlist += '</div></a>';
  1380. li.innerHTML = itemlist
  1381. document.getElementById(obj).appendChild(li);
  1382. }
  1383. });
  1384. },
  1385. detailPat=function(arr,obj) {
  1386. oAjax("/ajax/ppatent/qm",{
  1387. id:arr,
  1388. },"get",function(data){
  1389. var dataStr=data.data;
  1390. for(var i = 0; i < dataStr.length; i++) {
  1391. var li = document.createElement("li");
  1392. li.className = "mui-table-view-cell";
  1393. var strAdd = '';
  1394. strAdd += '<a target="_blank" href="/'+ pageUrl("pt",dataStr[i]) +'" class="flexCenter urlgo">';
  1395. strAdd += '<div class="madiaHead patentHead"></div>';
  1396. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  1397. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  1398. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  1399. strAdd += '</div>';
  1400. strAdd += '</a>';
  1401. li.innerHTML = strAdd
  1402. document.getElementById(obj).appendChild(li);
  1403. }
  1404. });
  1405. },
  1406. detailPer=function(arr,obj) {
  1407. oAjax("/ajax/ppaper/qm",{
  1408. id:arr,
  1409. },"get",function(data){
  1410. var dataStr=data.data;
  1411. for(var i = 0; i < dataStr.length; i++) {
  1412. var moreInf=""
  1413. if(!dataStr[i].cn4periodical){
  1414. dataStr[i].cn4periodical="";
  1415. }
  1416. if(!dataStr[i].en4periodical){
  1417. dataStr[i].en4periodical="";
  1418. }
  1419. if(!dataStr[i].pubDay){
  1420. dataStr[i].pubDay="";
  1421. }
  1422. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  1423. var li = document.createElement("li");
  1424. li.className = "mui-table-view-cell";
  1425. var strAdd = '';
  1426. strAdd += '<a target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
  1427. strAdd += '<div class="madiaHead paperHead"></div>';
  1428. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  1429. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  1430. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  1431. strAdd += '</div>';
  1432. strAdd += '</a>';
  1433. li.innerHTML = strAdd
  1434. document.getElementById(obj).appendChild(li);
  1435. }
  1436. });
  1437. },
  1438. detailRes=function(arr,obj) {
  1439. oAjax("/ajax/resource/qm",{
  1440. id:arr,
  1441. },"get",function(data){
  1442. console.log(data)
  1443. var dataItem=data.data;
  1444. for(var i = 0; i < dataItem.length; i++) {
  1445. var dataStr=dataItem[i]
  1446. var rImg = "../images/default-resource.jpg";
  1447. if(dataStr.images.length) {
  1448. rImg = "/data/resource/" + dataStr.images[0].imageSrc;
  1449. }
  1450. var li = document.createElement("li");
  1451. li.className = "mui-table-view-cell";
  1452. var strAdd = '';
  1453. strAdd += '<a target="_blank" href="resourceShow.html?resourceId='+ dataStr.resourceId +'" class="flexCenter urlgo">';
  1454. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ rImg +')"></div>';
  1455. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.resourceName +'</p>';
  1456. strAdd += '<p class="h1Font ellipsisSty"><span class="ownerName"></span><em class="authiconNew ownerSty"></em></p>';
  1457. strAdd += '<p class="h2Font ellipsisSty-2">用途:'+ dataStr.supportedServices+'</p></div>';
  1458. strAdd += '</a>';
  1459. li.innerHTML =strAdd
  1460. var $itemlist = $(li);
  1461. document.getElementById(obj).appendChild(li);
  1462. if(dataStr.resourceType=="1"){
  1463. (function(mo){
  1464. cacheModel.getProfessor(dataStr.professorId,function(sc,value){
  1465. if(sc){
  1466. mo.find(".ownerName").html(value.name)
  1467. var userType = autho(value.authType, value.orgAuth, value.authStatus);
  1468. mo.find(".ownerSty").addClass(userType.sty).attr("title",userType.title)
  1469. }else{
  1470. console.log("error")
  1471. }
  1472. })
  1473. })($itemlist);
  1474. }else if(dataStr.resourceType=="2"){
  1475. (function(mo){
  1476. cacheModel.getCompany(dataStr.orgId,function(sc,value){
  1477. if(sc){
  1478. if(value.forShort){
  1479. mo.find(".ownerName").html(value.forShort)
  1480. }else{
  1481. mo.find(".ownerName").html(value.name)
  1482. }
  1483. if(value.authStatus==3) {
  1484. mo.find(".ownerSty").addClass("authicon-com-ok").attr("title","科袖认证企业")
  1485. }
  1486. }else{
  1487. console.log("error")
  1488. }
  1489. })
  1490. })($itemlist);
  1491. }
  1492. }
  1493. });
  1494. },
  1495. detailArt=function (arr,obj) {
  1496. oAjax("/ajax/article/qm",{
  1497. id:arr,
  1498. },"get",function(data){
  1499. var dataStr=data.data;
  1500. for(var i = 0; i < dataStr.length; i++) {
  1501. var dataItem=dataStr[i]
  1502. var arImg = "../images/default-artical.jpg";
  1503. if(dataItem.articleImg) {
  1504. arImg ="/data/article/" + dataItem.articleImg
  1505. }
  1506. var li = document.createElement("li");
  1507. li.className = "mui-table-view-cell";
  1508. var strAdd = '';
  1509. strAdd += '<a target="_blank" href="/'+ pageUrl('a',dataItem) +'" class="flexCenter urlgo">';
  1510. strAdd += '<div class="madiaHead artHead" style="background-image:url('+ arImg +')"></div>';
  1511. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataItem.articleTitle +'</p>';
  1512. strAdd += '<ul class="h2Font clearfix">';
  1513. strAdd += '<li><span class="ownerName"></span></li>';
  1514. strAdd += '<li><span class="time">'+ commenTime(dataItem.publishTime) +'</span></li>';
  1515. strAdd += '<li><span class="comment"></span></li>';
  1516. strAdd += '</ul></div>';
  1517. strAdd += '</a>';
  1518. li.innerHTML =strAdd
  1519. var $itemlist = $(li);
  1520. document.getElementById(obj).appendChild(li);
  1521. if(dataItem.articleType=="1"){
  1522. (function(mo){
  1523. cacheModel.getProfessor(dataItem.ownerId,function(sc,value){
  1524. if(sc){
  1525. mo.find(".ownerName").html(value.name)
  1526. }else{
  1527. console.log("error")
  1528. }
  1529. })
  1530. })($itemlist);
  1531. }else if(dataItem.articleType=="2"){
  1532. (function(mo){
  1533. cacheModel.getCompany(dataItem.ownerId,function(sc,value){
  1534. if(sc){
  1535. if(value.forShort){
  1536. mo.find(".ownerName").html(value.forShort)
  1537. }else{
  1538. mo.find(".ownerName").html(value.name)
  1539. }
  1540. }else{
  1541. console.log("error")
  1542. }
  1543. })
  1544. })($itemlist);
  1545. }else if(dataItem.articleType=="3"){
  1546. (function(mo){
  1547. cacheModel.getPlatform(dataItem.ownerId,function(sc,value){
  1548. if(sc){
  1549. mo.find(".ownerName").html(value.name)
  1550. }else{
  1551. console.log("error")
  1552. }
  1553. })
  1554. })($itemlist);
  1555. }
  1556. }
  1557. });
  1558. },
  1559. detailDemand=function(arr,obj) {
  1560. oAjax("/ajax/demand/qm",{
  1561. id:arr,
  1562. },"get",function(data){
  1563. var dataStr=data.data;
  1564. for(var i = 0; i < dataStr.length; i++) {
  1565. var li = document.createElement("li");
  1566. li.className = "mui-table-view-cell";
  1567. var strCon='<a target="_blank" href="demandShow.html?demandId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  1568. strCon+='<div class="madiaInfo" style="padding-left:0">'
  1569. strCon+='<p class="h1Font ellipsisSty">'+ dataStr[i].title +'</p>'
  1570. strCon+='<ul class="showli clearfix h3Font">'
  1571. if(dataStr[i].city){ strCon+='<li>'+dataStr[i].city+'</li>' }
  1572. if(dataStr[i].duration!=0){ strCon+='<li>预期 '+demandDuration[dataStr[i].duration]+'</li>' }
  1573. if(dataStr[i].cost!=0){ strCon+='<li>预算 '+demandCost[dataStr[i].cost]+'</li>' }
  1574. if(dataStr[i].invalidDay){ strCon+='<li>有效期至 '+TimeTr(dataStr[i].invalidDay)+'</li>' }
  1575. strCon+='</ul></div></a>'
  1576. li.innerHTML = strCon
  1577. document.getElementById(obj).appendChild(li);
  1578. }
  1579. });
  1580. },
  1581. detailAnswer=function(dataStr,listLi){
  1582. var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.qid+'&topid='+dataStr.id+'">'+
  1583. '<div class="madiaInfo" style="padding-left: 0">' +
  1584. '<div class="ellipsisSty qa-question"></div>' +
  1585. '<div class="flexCenter qa-owner">' +
  1586. '</div>' +
  1587. '<div class="qa-con ellipsisSty-3">' + listConCut(dataStr.cnt) +'</div>' +
  1588. '<div class="showspan">' +
  1589. '<span>'+commenTime(dataStr.createTime)+'</span>' +
  1590. '<span class="agree"></span>' +
  1591. '<span class="leaveMsgCount"></span>' +
  1592. '</div>' +
  1593. '</div></a>';
  1594. var $strAdd = $(strAdd);
  1595. listLi.append( $strAdd);
  1596. if(dataStr.agree > 0) {
  1597. $strAdd.find(".agree").html("赞 "+dataStr.agree);
  1598. }
  1599. questioninfo(dataStr.qid, $strAdd);
  1600. proinfo(dataStr.uid, $strAdd);
  1601. leaveMsgCount(dataStr.id,4, $strAdd);
  1602. },
  1603. detailQuestion=function(dataStr,listLi) {
  1604. var baImg = "../images/default-q&a.jpg";
  1605. var subs = new Array();
  1606. if(dataStr.img) {
  1607. var subs=strToAry(dataStr.img)
  1608. baImg = "/data/question"+ subs[0];
  1609. }
  1610. var hd = "";
  1611. if (dataStr.replyCount > 0) {
  1612. hd = '<li><span>回答 ' + dataStr.replyCount + '</span></li>'
  1613. }
  1614. var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.id+'" class="flexCenter urlgo">'
  1615. strAdd += '<div class="madiaHead qa-Head" style="background-image:url('+ baImg +')"></div>';
  1616. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr.title +'</p>';
  1617. strAdd += '<ul class="h2Font clearfix">'
  1618. strAdd += '<li><span class="time">'+commenTime(dataStr.createTime)+'</span></li><li><span class="qaPageview"></span></li>'+hd+'<li><span class="attendCount"></span></li>'
  1619. strAdd += '</ul></div></a>'
  1620. var $str = $(strAdd);
  1621. listLi.append($str);
  1622. },
  1623. detailService=function(arr,obj) {
  1624. oAjax("/ajax/ware/qm",{
  1625. id:arr,
  1626. },"get",function(data){
  1627. console.log(data)
  1628. var dataItem=data.data;
  1629. for(var i = 0; i < dataItem.length; i++) {
  1630. var dataStr=dataItem[i]
  1631. var li = document.createElement("li");
  1632. li.className = "mui-table-view-cell";
  1633. var cnt="", rImg = "../images/default-service.jpg";
  1634. if(dataStr.images) {
  1635. var subs = strToAry(dataStr.images)
  1636. if(subs.length > 0) {
  1637. rImg="/data/ware" + subs[0]
  1638. }
  1639. }
  1640. if(dataStr.cnt){
  1641. cnt="内容:"+dataStr.cnt
  1642. }
  1643. var strAdd = '';
  1644. strAdd += '<a target="_blank" href="sevriceShow.html?sevriceId='+dataStr.id+'" class="flexCenter urlgo">';
  1645. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ rImg +')"></div>';
  1646. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.name +'</p>';
  1647. strAdd += '<p class="h1Font ellipsisSty"><span class="ownerName"></span><em class="authiconNew ownerSty"></em></p>';
  1648. strAdd += '<p class="h2Font ellipsisSty-2">'+ cnt+'</p></div>';
  1649. strAdd += '</a>';
  1650. li.innerHTML = strAdd
  1651. var $itemlist = $(li);
  1652. document.getElementById(obj).appendChild(li);
  1653. if(dataStr.category=="1"){
  1654. (function(mo){
  1655. cacheModel.getProfessor(dataStr.owner,function(sc,value){
  1656. if(sc){
  1657. mo.find(".ownerName").html(value.name)
  1658. var userType = autho(value.authType, value.orgAuth, value.authStatus);
  1659. mo.find(".ownerSty").addClass(userType.sty).attr("title",userType.title)
  1660. }else{
  1661. console.log("error")
  1662. }
  1663. })
  1664. })($itemlist);
  1665. }else if(dataStr.category=="2"){
  1666. (function(mo){
  1667. cacheModel.getCompany(dataStr.owner,function(sc,value){
  1668. if(sc){
  1669. if(value.forShort){
  1670. mo.find(".ownerName").html(value.forShort)
  1671. }else{
  1672. mo.find(".ownerName").html(value.name)
  1673. }
  1674. if(value.authStatus==3) {
  1675. mo.find(".ownerSty").addClass("authicon-com-ok").attr("title","科袖认证企业")
  1676. }
  1677. }else{
  1678. console.log("error")
  1679. }
  1680. })
  1681. })($itemlist);
  1682. }
  1683. }
  1684. });
  1685. },
  1686. proinfo=function(pid, $str) {
  1687. oAjax("/ajax/professor/baseInfo/" + pid,{}, "get", function(data){
  1688. var dataStr = data.data
  1689. var baImg = "../images/default-photo.jpg";
  1690. if (dataStr.hasHeadImage == 1) {
  1691. baImg = "/images/head/" + dataStr.id + "_l.jpg";
  1692. }
  1693. var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
  1694. var os = "";
  1695. if (dataStr.title) {
  1696. if (dataStr.orgName) {
  1697. os = dataStr.title + "," + dataStr.orgName;
  1698. } else {
  1699. os = dataStr.title;
  1700. }
  1701. } else {
  1702. if (dataStr.office) {
  1703. if (dataStr.orgName) {
  1704. os = dataStr.office + "," + dataStr.orgName;
  1705. } else {
  1706. os = dataStr.office;
  1707. }
  1708. } else {
  1709. if (dataStr.orgName) {
  1710. os = dataStr.orgName;
  1711. }
  1712. }
  1713. }
  1714. var str = '<div class="owner-head useHead" style="background-image:url(' + baImg + ')"></div>' +
  1715. '<div class="owner-info">' +
  1716. '<div class="owner-name"><span class="h1Font">' + dataStr.name + '</span><em class="authiconNew ' + userType.sty + '" title="' + userType.title + '"></em></div>' +
  1717. '<div class="owner-tit mui-ellipsis h2Font">' + os + '</div>' +
  1718. '</div>'
  1719. $str.find(".qa-owner").html(str)
  1720. });
  1721. },
  1722. questioninfo=function(qid, $str) {
  1723. oAjax("/ajax/question/qo",{
  1724. id:qid
  1725. }, "get", function(data){
  1726. $str.find(".qa-question").html(data.data.title);
  1727. if(data.data.pageViews>0){
  1728. $str.find(".qaPageview").html("阅读量 "+data.data.pageViews);
  1729. }else{
  1730. $str.find(".qaPageview").hide()
  1731. }
  1732. });
  1733. },
  1734. attendCount=function(id, $str) {
  1735. oAjax("/ajax/watch/countProfessor",{
  1736. id:id,
  1737. type: "8"
  1738. }, "get", function(data){
  1739. if(data.data > 0) {
  1740. $str.find(".attendCount").html("关注 "+data.data);
  1741. }
  1742. });
  1743. },
  1744. bindClickFun=function(){
  1745. $("#myAttends").unbind("click").on("click",function(){//关注与收藏
  1746. openAttend()
  1747. })
  1748. $("#tab8user").unbind("click").on("click",function(){//点击更多
  1749. watchO={
  1750. beiTime:"",
  1751. beiProId:"",
  1752. watchTime:"",
  1753. watchObjId:"",
  1754. };
  1755. var pa=$(".moreNavUl.moreBuUl>li.liNow").attr("rel")
  1756. $("#"+pa).find("ul").html("")
  1757. $("#"+pa).find(".js-load-more").show();
  1758. if(userid!=professorId){
  1759. //关注他的人
  1760. $(".moreNavUl.moreBuUl>li.attentType").hide();
  1761. $(".moreNavUl.moreBuUl>li.attendMy").addClass("liNow").text("关注他的人");
  1762. $("#item8drop5").show().siblings().hide();
  1763. attentMyself(true);
  1764. }else{
  1765. $("#item8drop1").show().siblings().hide();
  1766. collectSorts(1,true);
  1767. }
  1768. collectSorts(3,true);
  1769. })
  1770. $("#tab6user").unbind("click").on("click",function(){//点击问答
  1771. dataO = {
  1772. AnsTime:"",
  1773. AnsId:"",
  1774. QuTime:"",
  1775. QuId:"",
  1776. };
  1777. var pa=$(".moreNavUl.wendaUl>li.liNow").attr("rel")
  1778. $("#"+pa).find("ul").html("")
  1779. $("#"+pa).find(".js-load-more").show();
  1780. if(userid!=professorId){
  1781. //他的回答
  1782. $(".moreNavUl.wendaUl>li").eq(0).hide().siblings().addClass("liNow").text("他的回答");
  1783. $("#item6drop2").show().siblings().hide();
  1784. answerListVal(true);
  1785. }else{
  1786. $(".wendaNav li").eq(0).addClass("liNow").siblings().removeClass("liNow");
  1787. $("#item6drop1").show().siblings().hide();
  1788. questionListVal(true);
  1789. }
  1790. })
  1791. $(".moreNavUl.wendaUl").on("click","li",function(){//问答tab切换
  1792. var pa=$(this).attr("rel")
  1793. $("#"+pa).find("ul").html("")
  1794. $("#"+pa).find(".js-load-more").show();
  1795. var sortN=$(this).attr("data-num");
  1796. dataO = {
  1797. AnsTime:"",
  1798. AnsId:"",
  1799. QuTime:"",
  1800. QuId:"",
  1801. };
  1802. if(sortN==1){
  1803. questionListVal(true);
  1804. }else if(sortN==2){
  1805. answerListVal(true);
  1806. }
  1807. })
  1808. $(".moreNavUl.moreBuUl").on("click","li.attentType:not(.rightbtn)",function(){//关注tab切换
  1809. var pa=$(this).attr("rel")
  1810. $("#"+pa).find("ul").html("")
  1811. $("#"+pa).find(".js-load-more").show();
  1812. var sortN=$(this).attr("data-num");
  1813. watchO={
  1814. watchTime:"",
  1815. watchObjId:"",
  1816. WATime:"",
  1817. WAId:"",
  1818. WQTime:"",
  1819. WQId:"",
  1820. };
  1821. if(sortN==8){
  1822. collectQuestion(true)
  1823. }else if(sortN==9){
  1824. collectAnswer(true)
  1825. }else{
  1826. collectSorts(sortN,true);
  1827. }
  1828. })
  1829. $("#tabAttendMy").unbind("click").on("click",function(){//关注我的人
  1830. var pa=$(this).attr("rel")
  1831. $("#"+pa).find("ul").html("")
  1832. $("#"+pa).find(".js-load-more").show();
  1833. watchO={
  1834. beiTime:"",
  1835. beiProId:"",
  1836. }
  1837. attentMyself(true);
  1838. })
  1839. $("#attendmyGo").unbind("click").on("click",function(){
  1840. if(userid!=professorId){
  1841. $(".moreNavUl.moreBuUl>li.attentType").hide();//关注他的人
  1842. $(".moreNavUl.moreBuUl>li.attendMy").addClass("liNow").text("关注他的人");
  1843. }
  1844. $(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
  1845. $(".moreNav").hide()
  1846. $("#item8more").fadeIn();
  1847. $("#item8user").show().siblings().hide();
  1848. $(".moreBuUl li.attendMy").addClass("liNow").siblings().removeClass("liNow");
  1849. $("#item8drop5").show().siblings().hide();
  1850. watchO={
  1851. beiTime:"",
  1852. beiProId:"",
  1853. }
  1854. $("#item8drop5").find("ul").html("")
  1855. $("#item8drop5").find(".js-load-more").show();
  1856. attentMyself(true);
  1857. })
  1858. /*研究方向点赞*/
  1859. var clFlag = 1;
  1860. $("#researchAreaShow").on("click", ".plus", function() {
  1861. if(userid && userid != null && userid != "null") {
  1862. //点赞变化样式
  1863. if(clFlag) {
  1864. clFlag = 0;
  1865. } else {
  1866. return;
  1867. }
  1868. if($(this).data("isagree") > -1) {
  1869. $(this).stop(true, true).animate({
  1870. backgroundPositionY: 0
  1871. }, 300); //变成未点赞样式
  1872. } else {
  1873. $(this).stop(true, true).animate({
  1874. backgroundPositionY: -26
  1875. }, 300); //变成点赞样式
  1876. }
  1877. $.ajax({
  1878. "url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
  1879. "type": "POST",
  1880. "data": {
  1881. "targetId": $(this).data("pid"),
  1882. "targetCaption": oArray[$(this).data("caption")],
  1883. "opId": userid,
  1884. "uname":$.cookie("userName")
  1885. },
  1886. "contentType": "application/x-www-form-urlencoded",
  1887. "success": function(dataStr) {
  1888. if(dataStr.success) {
  1889. $.get("/ajax/professor/info/" + professorId, function(dataStr) {
  1890. if(dataStr.success) {
  1891. clFlag = 1;
  1892. var $info = dataStr.data;
  1893. if($info) {
  1894. $("#researchAreaShow").empty("")
  1895. if($info.researchAreas) {
  1896. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  1897. }
  1898. }
  1899. }
  1900. })
  1901. } else {
  1902. $.MsgBox.Alert("提示", dataStr.msg);
  1903. }
  1904. }
  1905. });
  1906. } else {
  1907. quickLog();
  1908. operatTab();
  1909. closeLog();
  1910. }
  1911. })
  1912. //点击每个研究方向弹出研究方向详情窗口
  1913. $("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
  1914. var cap = $(this).attr("caption");
  1915. researchAlert(cap)
  1916. });
  1917. //关闭按钮
  1918. $("#workclose").click(function() {
  1919. $(".resAreaCover").fadeOut();
  1920. $("body").css("position", "");
  1921. });
  1922. //点击查看全部资源
  1923. $(".coninfobox").on("click","#seeMoreR",function(){
  1924. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1925. $("#tab2user").addClass("liNow").siblings().removeClass("liNow");
  1926. $("#item1user").hide();
  1927. $("#item2user").show();
  1928. })
  1929. //点击查看全部服务
  1930. $(".coninfobox").on("click","#seeMoreS",function(){
  1931. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1932. $("#tab9user").addClass("liNow").siblings().removeClass("liNow");
  1933. $("#item1user").hide();
  1934. $("#item9user").show();
  1935. })
  1936. //点击查看全部文章
  1937. $(".coninfobox").on("click","#seeMoreA",function(){
  1938. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1939. $("#tab3user").addClass("liNow").siblings().removeClass("liNow");
  1940. $("#item1user").hide();
  1941. $("#item3user").show();
  1942. })
  1943. //点击查看全部专利
  1944. $(".coninfobox").on("click","#seeMoreP",function(){
  1945. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1946. $("#tab4user").addClass("liNow").siblings().removeClass("liNow");
  1947. $("#item1user").hide();
  1948. $("#item4user").show();
  1949. })
  1950. //点击查看全部论文
  1951. $(".coninfobox").on("click","#seeMoreL",function(){
  1952. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1953. $("#tab5user").addClass("liNow").siblings().removeClass("liNow");
  1954. $("#item1user").hide();
  1955. $("#item5user").show();
  1956. })
  1957. //点击查看全部问题
  1958. $(".coninfobox").on("click","#seeMoreQA",function(){
  1959. document.body.scrollTop = document.documentElement.scrollTop = 0;
  1960. $("#tab6user").addClass("liNow").siblings().removeClass("liNow");
  1961. $("#item1user").hide();
  1962. $("#item6user").show();
  1963. if(userid === professorId) {
  1964. $(".wendaNav").show();
  1965. }
  1966. $(".wendaNav li").eq(1).addClass("liNow").siblings().removeClass("liNow");
  1967. $("#item6drop2").show().siblings().hide();
  1968. })
  1969. //点击关注按钮
  1970. $("#attentBtn").on('click', function() {
  1971. if(userid && userid != null && userid != "null") {
  1972. if($(this).is('.attenedSpan')){
  1973. cancelCollectionAbout(professorId,$(this),1)
  1974. } else {
  1975. collectionAbout(professorId,$(this), 1);
  1976. }
  1977. queryPubCount();
  1978. watchO={
  1979. beiTime:"",
  1980. beiProId:"",
  1981. }
  1982. $("#item8drop5").find("ul").html("")
  1983. $("#item8drop5").find(".js-load-more").show();
  1984. attentMyself(true);
  1985. }else{
  1986. quickLog();
  1987. operatTab();
  1988. closeLog();
  1989. }
  1990. });
  1991. //点击联系按钮
  1992. $("#conbtn").on('click', function(){
  1993. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  1994. location.href="tidings.html?id="+professorId
  1995. } else {
  1996. quickLog();
  1997. operatTab();
  1998. closeLog();
  1999. }
  2000. });
  2001. //纠错反馈
  2002. $(".correctSubmit").on("click",function(){
  2003. var cntCon=$(this).siblings(".correctCon").val();
  2004. var cntUser="";
  2005. if(userid && userid != null && userid != "null") {
  2006. cntUser = userid;
  2007. }
  2008. if(cntCon.length>500){
  2009. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  2010. return;
  2011. }else{
  2012. oAjax("/ajax/feedback/error/professor",{
  2013. "id": professorId,
  2014. "cnt":cntCon,
  2015. "user":cntUser
  2016. }, "POST", function(data){
  2017. backSuccessed();
  2018. });
  2019. }
  2020. })
  2021. }
  2022. if(GetQueryString("flag")) {
  2023. researchAlert(GetQueryString("flag"))
  2024. }
  2025. if(GetQueryString("iLike")){
  2026. openAttend();
  2027. }
  2028. if(userid!=professorId){
  2029. pageViewLog(professorId,1)
  2030. relevantExperts();//合作专家
  2031. relevantarticalList();//相关文章
  2032. likeExperts();//感兴趣专家
  2033. isActUser();//判断用户是否被激活
  2034. ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
  2035. $(".goSpan").show();
  2036. }else{
  2037. $(".goSpanTo").show();
  2038. $(".myoneself").show();
  2039. }
  2040. queryPubCount();
  2041. getUserInfo(); //获取详细信息
  2042. demandListVal(true);
  2043. articalListVal(true);
  2044. resourceListVal(true);
  2045. serviceListVal(true);
  2046. patentListVal(true);
  2047. paperListVal(true);
  2048. answerListVal(true);
  2049. bindClickFun();
  2050. })