portal html css js resource

userInforShow.js 40KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271
  1. $(function() {
  2. loginStatus();//判断个人是否登录
  3. var userid = $.cookie("userid");
  4. var professorId = GetQueryString("professorId");
  5. var oArray=[];
  6. if(userid != professorId) {
  7. ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
  8. $(".goSpan").show();
  9. }
  10. if(professorId) {
  11. getUserInfo(professorId);//获取个人详细信息
  12. historyEvaluate();//获取历史合作及评价
  13. getResource(10,1,true);//获取个人发布的资源
  14. getArticle(10,1,true);//获取个人发布的文章
  15. getPaper(10,1,true);//获取个人发布的论文
  16. getPatent(10,1,true);//获取个人发布的专利
  17. getDemands(5,1,true);//获取个人发布的需求
  18. relevantExperts();//合作专家
  19. relevantarticalList();//相关文章
  20. likeExperts();//感兴趣专家
  21. $.ajax({//我关注的
  22. type:"get",
  23. url:"/ajax/watch/countObject",
  24. data: {
  25. id: professorId,
  26. type: 1, //1:专家 2:资源 3:文章
  27. },
  28. async:true,
  29. success:function(data){
  30. if(data.success){
  31. if(data.data){
  32. $("#myFocus").html(data.data)
  33. }else{
  34. $("#myFocus").html("0")
  35. }
  36. }
  37. }
  38. });
  39. $.ajax({//关注我的
  40. type:"get",
  41. url:"/ajax/watch/countProfessor",
  42. data: {
  43. id: professorId,
  44. type: 1,
  45. },
  46. async:true,
  47. success:function(data){
  48. if(data.success){
  49. if(data.data){
  50. $("#focusMe").html(data.data)
  51. }else{
  52. $("#focusMe").html("0")
  53. }
  54. }
  55. }
  56. });
  57. //点击咨询按钮
  58. $("#conbtn").on('click', function(){
  59. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  60. ConsultApply();
  61. concultProInfo(professorId);
  62. //点击的发送
  63. $("#sendConsultBtn").click(function() {
  64. sendConsultHandler($(this).attr("proId"));
  65. });
  66. } else {
  67. $.MsgBox.Alert("提示", "请先登录再进行咨询");
  68. $("#mb_btn_ok").val("去登录");
  69. var aele = document.createElement('a');
  70. $("#mb_btnbox").append(aele);
  71. $("#mb_btnbox a").css({
  72. 'display': "block",
  73. 'width': '100%',
  74. 'height': '40px',
  75. 'position': 'absolute',
  76. 'bottom': '-6px',
  77. 'left': '0'
  78. });
  79. aele.setAttribute('href', '../login.html');
  80. }
  81. });
  82. //点击关注按钮
  83. $("#attentBtn").on('click', function() {
  84. if(userid && userid != null && userid != "null") {
  85. if($(this).is('.attenedSpan')){
  86. cancelCollectionAbout(professorId,$(this), 1)
  87. } else {
  88. collectionAbout(professorId,$(this), 1);
  89. }
  90. }else{
  91. $.MsgBox.Alert("提示", "请先登录再进行关注");
  92. $("#mb_btn_ok").val("去登录");
  93. var aele = document.createElement('a');
  94. $("#mb_btnbox").append(aele);
  95. $("#mb_btnbox a").css({
  96. 'display': "block",
  97. 'width': '100%',
  98. 'height': '40px',
  99. 'position': 'absolute',
  100. 'bottom': '-6px',
  101. 'left': '0'
  102. });
  103. aele.setAttribute('href', '../login.html');
  104. }
  105. });
  106. /*研究方向点赞*/
  107. var clFlag = 1;
  108. $("#researchAreaShow").on("click", ".plus", function() {
  109. if(userid && userid != null && userid != "null") {
  110. //点赞变化样式
  111. if(clFlag) {
  112. clFlag = 0;
  113. } else {
  114. return;
  115. }
  116. if($(this).data("isagree") > -1) {
  117. $(this).stop(true, true).animate({
  118. backgroundPositionY: 0
  119. }, 300); //变成未点赞样式
  120. } else {
  121. $(this).stop(true, true).animate({
  122. backgroundPositionY: -26
  123. }, 300); //变成点赞样式
  124. }
  125. $.ajax({
  126. "url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
  127. "type": "POST",
  128. "data": {
  129. "targetId": $(this).data("pid"),
  130. "targetCaption": oArray[$(this).data("caption")],
  131. "opId": userid
  132. },
  133. "contentType": "application/x-www-form-urlencoded",
  134. "success": function($data) {
  135. if($data.success) {
  136. $.get("/ajax/professor/info/" + professorId, function($data) {
  137. if($data.success) {
  138. clFlag = 1;
  139. var $info = $data.data;
  140. if($info) {
  141. $("#researchAreaShow").empty("")
  142. if($info.researchAreas) {
  143. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  144. }
  145. }
  146. }
  147. })
  148. } else {
  149. $.MsgBox.Alert("提示", $data.msg);
  150. }
  151. }
  152. });
  153. } else {
  154. $.MsgBox.Alert("提示", "请登录后点赞");
  155. }
  156. })
  157. //点击每个研究方向弹出研究方向详情窗口
  158. $("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
  159. var cap = $(this).attr("caption");
  160. $.ajax({
  161. url: "/ajax/researchAreaLog/ql",
  162. dataType: 'json', //数据格式类型
  163. type: 'GET', //http请求类型
  164. timeout: 10000, //超时设置
  165. data: {
  166. "professorId": professorId,
  167. 'caption': cap,
  168. "rows": 10
  169. },
  170. success: function(data) {
  171. console.log(data)
  172. if(data.success) {
  173. $(".listitemdiv").html("");
  174. var $info = data.data;
  175. $("#subArea").text(cap);
  176. $(".resAreaCover").fadeIn();
  177. $(".resAreaCon").show()
  178. if($info.length == 0) {
  179. $(".resAreaCon").hide();
  180. return;
  181. }
  182. for(var i = 0; i < $info.length; i++) {
  183. if($info[i].professor.hasHeadImage == 1) {
  184. var imgbg = "/images/head/" + $info[i].professor.id + "_l.jpg";
  185. } else {
  186. var imgbg = "../images/default-photo.jpg";
  187. }
  188. //认证
  189. var oSty=autho($info[i].professor.authType,$info[i].professor.orgAuth,$info[i].professor.authStatus);
  190. var title = $info[i].professor.title || "";
  191. var orgName = $info[i].professor.orgName || "";
  192. var office = $info[i].professor.office || "";
  193. if(title != "") {
  194. var ttitle = title + ",";
  195. }else{
  196. if(office!=""){
  197. var ttitle = office + ",";
  198. }else{
  199. var ttitle = office;
  200. }
  201. }
  202. if(orgName != "") {
  203. orgName = orgName;
  204. }
  205. var addw ='<li class="flexCenter" data-id="'+$info[i].professor.id+'">'
  206. addw +='<a href="userInforShow.html?professorId='+ $info[i].professor.id +'" class="expertUrl linkhref">'
  207. addw +='<div class="lefthead userheadt userRadius" id="expertImg" style="background-image: url('+ imgbg +');"></div>'
  208. addw +='<div class="centercon" style="padding-right:0;">'
  209. addw +='<p class="h1font"><span class="nameSpan" id="Name">' + $info[i].professor.name + '</span><em class="authiconNew ' + oSty.sty + '" title="'+ oSty.title +'"></em></p>'
  210. addw +='<p class="h2font ellipsisSty">'+ ttitle + orgName + '</p>'
  211. addw +='</div></a></li>';
  212. $(".listitemdiv").append(addw);
  213. }
  214. $("body").css("position", "fixed");
  215. }
  216. },
  217. error: function() {}
  218. });
  219. });
  220. //关闭按钮
  221. $("#workclose").click(function() {
  222. $(".resAreaCover").fadeOut();
  223. $("body").css("position", "");
  224. });
  225. //点击查看全部资源
  226. $(".coninfobox").on("click","#seeMoreR",function(){
  227. document.body.scrollTop = document.documentElement.scrollTop = 0;
  228. $(".navconBox ul>li").eq(1).addClass("liNow").siblings().removeClass("liNow");
  229. $("#item1user").hide();
  230. $("#item2user").show();
  231. })
  232. //点击查看全部文章
  233. $(".coninfobox").on("click","#seeMoreA",function(){
  234. document.body.scrollTop = document.documentElement.scrollTop = 0;
  235. $(".navconBox ul>li").eq(2).addClass("liNow").siblings().removeClass("liNow");
  236. $("#item1user").hide();
  237. $("#item3user").show();
  238. })
  239. //点击查看全部专利
  240. $(".coninfobox").on("click","#seeMoreP",function(){
  241. document.body.scrollTop = document.documentElement.scrollTop = 0;
  242. $(".navconBox ul>li").eq(3).addClass("liNow").siblings().removeClass("liNow");
  243. $("#item1user").hide();
  244. $("#item4user").show();
  245. })
  246. //点击查看全部论文
  247. $(".coninfobox").on("click","#seeMoreL",function(){
  248. document.body.scrollTop = document.documentElement.scrollTop = 0;
  249. $(".navconBox ul>li").eq(4).addClass("liNow").siblings().removeClass("liNow");
  250. $("#item1user").hide();
  251. $("#item5user").show();
  252. })
  253. }
  254. liulanNum();
  255. function liulanNum() {
  256. $.ajax({
  257. "url": "/ajax/professor/incPageViews",
  258. "type": "POST",
  259. "dataType": "json",
  260. "async": true,
  261. "data": {
  262. "id": professorId,
  263. },
  264. "success": function(data) {
  265. if(data.success) {
  266. console.log(data);
  267. }
  268. },
  269. "error": function() {
  270. $.MsgBox.Alert('提示', '链接服务器超时')
  271. }
  272. });
  273. }
  274. //用户详细信息
  275. function getUserInfo(professorId){
  276. $.ajax({
  277. type:"get",
  278. url:"/ajax/professor/info/"+ professorId,
  279. async:true,
  280. success: function(data) {
  281. var $info = data.data;
  282. if(data.success) {
  283. console.log(data)
  284. if($info.hasHeadImage){
  285. $("#proHead").css("background-image","url(/images/head/"+ $info.id +"_l.jpg)");
  286. }
  287. $("#proName").text($info.name);
  288. var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
  289. $("#proAuth").addClass(oStyS.sty); $("#proAuth").attr("title",oStyS.title);
  290. if($info.address){
  291. $("#proAddress").html($info.address + "<span style='margin-right:10px;'></span>");
  292. }
  293. var proOther="";
  294. if($info.orgName){
  295. if($info.department){
  296. if($info.office){
  297. proOther = $info.orgName + "," + $info.department + "," + $info.office
  298. }else{
  299. proOther = $info.orgName + "," + $info.department
  300. }
  301. }else{
  302. if($info.office){
  303. proOther = $info.orgName +"," + $info.office
  304. }else{
  305. proOther = $info.orgName
  306. }
  307. }
  308. }else{
  309. if($info.department){
  310. if($info.office){
  311. proOther = $info.department + "," + $info.office
  312. }else{
  313. proOther = $info.department
  314. }
  315. }else{
  316. if($info.office){
  317. proOther = $info.office
  318. }
  319. }
  320. }
  321. $("#proOther").text(proOther);
  322. var llqtitle=$info.name + "-" + proOther.replace(/,/gi,"-") + "-科袖网";//修改浏览器title信息
  323. if($info.title){
  324. $("#proTit").html($info.title + "<span style='margin-right:10px;'></span>");
  325. llqtitle = $info.name + "-" + $info.title + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
  326. }
  327. document.title = llqtitle;
  328. //个人简介
  329. if($info.descp) {
  330. $("#descpS").parents(".coninfobox").removeClass("displayNone");
  331. $("#item1user>.nodatabox").addClass("displayNone");
  332. $("#descpS").text($info.descp);
  333. }
  334. //学术领域
  335. if($info.subject) {
  336. $("#subjectShow").parents(".coninfobox").removeClass("displayNone");
  337. $("#item1user>.nodatabox").addClass("displayNone");
  338. subjectShow($info.subject);
  339. }
  340. //研究方向
  341. if($info.researchAreas.length) {
  342. $("#researchAreaShow").parents(".coninfobox").removeClass("displayNone");
  343. $("#item1user>.nodatabox").addClass("displayNone");
  344. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  345. }
  346. //行业领域
  347. if($info.industry) {
  348. $("#industryShow").parents(".coninfobox").removeClass("displayNone");
  349. $("#item1user>.nodatabox").addClass("displayNone");
  350. industryShow($info.industry);
  351. }
  352. //教育背景
  353. if($info.edus.length) {
  354. eduBgShow($info.edus);
  355. } else {
  356. $("#eduBgShow").parents(".coninfobox").hide();
  357. }
  358. //兼职
  359. if($info.jobs.length) {
  360. timeJobShow($info.jobs);
  361. } else {
  362. $("#timeJobShow").parents(".coninfobox").hide();
  363. }
  364. //项目
  365. if($info.projects.length) {
  366. projectShow($info.projects)
  367. } else {
  368. $("#projectShow").parents(".coninfobox").hide();
  369. }
  370. //荣誉
  371. if($info.honors.length) {
  372. honorShow($info.honors);
  373. } else {
  374. $("#honorShow").parents(".coninfobox").hide();
  375. }
  376. if($info.honors.length == 0 && $info.projects.length == 0 && $info.jobs.length == 0 && $info.edus.length == 0){
  377. $("#item6user>.nodatabox").show();
  378. $("#item6user>.nodatabox").find(".noContip").text("用户尚未完善详细资料")
  379. }
  380. var weibotitle = $info.name;
  381. var weibourl = window.location.href;
  382. var weibopic ="http://"+window.location.host+"/images/head/"+ $info.id +"_l.jpg";
  383. $("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
  384. }
  385. },
  386. error: function() {
  387. $.MsgBox.Alert('提示', '链接服务器超时')
  388. }
  389. });
  390. }
  391. function subjectShow(data) {
  392. if(data != undefined && data.length != 0) {
  393. var subs = new Array();
  394. if(data.indexOf(',')) {
  395. subs = data.split(',');
  396. } else {
  397. subs[0] = data;
  398. }
  399. if(subs.length > 0) {
  400. for(var i = 0; i < subs.length; i++) {
  401. $("#subjectShow").append("<li>" + subs[i] + "</li>");
  402. };
  403. }
  404. }
  405. }
  406. function researchAreaShow($datas, $datarecords) {
  407. if($datas != undefined && $datas.length != 0) {
  408. var html = [];
  409. for(var i = 0; i < $datas.length; ++i) {
  410. var $data = $datas[i];
  411. var $photos = [];
  412. //获取头像
  413. if($datarecords.length > 0) {
  414. $photos = getRecords($datarecords, $data.caption);
  415. }
  416. var isAgree = -1;
  417. for(var j = 0; j < $photos.length; j++) {
  418. if(userid == $photos[j].id)
  419. isAgree++;
  420. }
  421. oArray[i]=$data.caption;
  422. if(professorId != userid) {
  423. if(isAgree) {
  424. var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><span class="plus" data-pid="'+ $data.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ $data.caption +'">';
  425. } else {
  426. var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><span class="plus" style="background-position-y:-26px" data-pid="'+ $data.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ $data.caption +'">';
  427. }
  428. } else {
  429. var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><div class="favorCount" caption="'+ $data.caption +'">';
  430. }
  431. if($photos.length < 6) {
  432. for(var j = 0; j < $photos.length; ++j) {
  433. if($photos[j].img) {
  434. showDiv += '<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
  435. } else {
  436. showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
  437. }
  438. }
  439. } else {
  440. for(var j = $photos.length - 5; j < $photos.length; ++j) {
  441. if($photos[j].img) {
  442. showDiv +='<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
  443. } else {
  444. showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
  445. }
  446. }
  447. showDiv += '<span class="like-people like-more"></span>';
  448. }
  449. showDiv += "</div></li>";
  450. html.push(showDiv);
  451. }
  452. document.getElementById("researchAreaShow").innerHTML = html.join('');
  453. }
  454. }
  455. function industryShow(data) {
  456. if(data != undefined && data.length != 0) {
  457. var subs = new Array();
  458. if(data.indexOf(',')) {
  459. subs = data.split(',');
  460. } else {
  461. subs[0] = data;
  462. }
  463. if(subs.length > 0) {
  464. for(var i = 0; i < subs.length; i++) {
  465. $("#industryShow").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
  466. };
  467. }
  468. }
  469. }
  470. function projectShow(data) {
  471. if(data.length > 0) {
  472. for(var i = 0; i < data.length; i++) {
  473. if(!data[i].descp) {
  474. data[i].descp = "";
  475. }
  476. var sDate = "";
  477. var eDate = "";
  478. if(data[i].startMonth) {
  479. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
  480. sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
  481. if(data[i].stopMonth) {
  482. eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  483. } else {
  484. eDate = " - "+ "至今";
  485. }
  486. }
  487. var projectHtml = '<li>';
  488. projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + sDate + eDate + '</small></div>';
  489. projectHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  490. projectHtml += '</li>';
  491. $("#projectShow").append(projectHtml);
  492. }
  493. }
  494. }
  495. function honorShow(data) {
  496. if(data.length > 0) {
  497. for(var i = 0; i < data.length; i++) {
  498. var timeho="";
  499. if(data[i].year){
  500. timeho = data[i].year+'年';
  501. }else{
  502. data[i].year="";
  503. }
  504. if(!data[i].descp) {
  505. data[i].descp = "";
  506. }
  507. var honorHtml = '<li>';
  508. honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + timeho + '</small></div>';
  509. honorHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  510. honorHtml += '</li>';
  511. $("#honorShow").append(honorHtml);
  512. }
  513. }
  514. }
  515. function timeJobShow(data) {
  516. if(data.length > 0) {
  517. for(var i = 0; i < data.length; i++) {
  518. if(data[i].department) {
  519. var dep = " - " + data[i].department;
  520. } else {
  521. var dep = ""
  522. }
  523. var sDate = "";
  524. var eDate = "";
  525. if(data[i].startMonth) {
  526. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
  527. sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
  528. if(data[i].stopMonth) {
  529. eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  530. } else {
  531. eDate = " - "+ "至今";
  532. }
  533. }
  534. var JobHtml = '<li>';
  535. JobHtml += '<div class="h4Font h4tit">' + data[i].company + dep + ' - ' + data[i].title + '<small class="h6Font">' + sDate + eDate + '</small></div>';
  536. JobHtml += '</li>';
  537. $("#timeJobShow").append(JobHtml);
  538. }
  539. }
  540. }
  541. function eduBgShow(data) {
  542. if(data.length > 0) {
  543. for(var i = 0; i < data.length; i++) {
  544. var college="",major="",degree=""
  545. if(data[i].college){
  546. college =' - ' + data[i].college
  547. }else{
  548. data[i].college="";
  549. }
  550. if(data[i].major){
  551. major =' - ' + data[i].major
  552. }else{
  553. data[i].major="";
  554. }
  555. if(data[i].degree){
  556. degree =' - ' + data[i].degree
  557. if(data[i].degree==0){
  558. degree =""
  559. }
  560. }else{
  561. data[i].degree="";
  562. }
  563. var timebiye="";
  564. if(data[i].year){
  565. if(data[i].year.trim()=="至今"){
  566. timebiye=data[i].year;
  567. }else{
  568. timebiye=data[i].year+'年';
  569. }
  570. }else{
  571. timebiye="";
  572. }
  573. var showHtml = '<li><div class="h4Font h4tit">'
  574. showHtml += data[i].school + college + major + degree;
  575. showHtml +='<small class="h6Font">' + timebiye + '</small></div></li>';
  576. $("#eduBgShow").append(showHtml);
  577. }
  578. }
  579. }
  580. //判断点赞的用户是否有头像
  581. function getRecords($researchAreaLogs, caption) {
  582. var ret = [];
  583. var t = 0;
  584. for(var i = 0; i < $researchAreaLogs.length; i++) {
  585. if(caption == $researchAreaLogs[i].caption) {
  586. ret[t] = {
  587. id: $researchAreaLogs[i].opreteProfessorId,
  588. img: $researchAreaLogs[i].hasHeadImage
  589. }
  590. t++;
  591. }
  592. }
  593. return ret;
  594. }
  595. //合作历史及评价
  596. function historyEvaluate(){
  597. $.ajax({
  598. "url": "/ajax/consult/pqAssessHis",
  599. "type": "get",
  600. "data": {
  601. "professorId": professorId
  602. },
  603. "async": false,
  604. "success": function(response) {
  605. if(response.success) {
  606. var $data = response.data.data;
  607. if($data.length>0){
  608. $("#historyEvaluate").parents(".coninfobox").removeClass("displayNone");
  609. $("#item1user>.nodatabox").addClass("displayNone");
  610. for(var i = 0; i < $data.length; i++) {
  611. var assessTime = commenTime($data[i].assessTime);
  612. var assessContant ="";
  613. if($data[i].assessContant) {
  614. assessContant = $data[i].assessContant;
  615. }
  616. var userhed='';
  617. if($data[i].professor.hasHeadImage) {
  618. userhed = 'background-image:url(/images/head/' + $data[i].professor.id + '_l.jpg)';
  619. } else {
  620. userhed = 'background-image:url(/images/default-photo.jpg)';
  621. }
  622. var add = "";
  623. add += '<li class="flexCenter">';
  624. add += '<a href="userInforShow.html?professorId='+ $data[i].professor.id +'" class="userhref"><div class="madiaHead useHead useHeadMsg" style="'+ userhed +'"></div></a>'
  625. add += '<div class="madiaInfo"><div style="position: relative;">';
  626. add += '<a href="userInforShow.html?professorId='+ $data[i].professor.id +'" class="userhref"><span class="h1Font messageName">'+ $data[i].professor.name +'</span></a>';
  627. add += '<em class="authiconNew authicon-pro" title=" "></em><span class="commenttime">'+ assessTime +'</span>';
  628. add += '<ul class="starShow">';
  629. add += '<li></li> <li></li> <li></li> <li></li> <li></li>';
  630. add += '</ul></div>';
  631. add += '<p class="h2Font messageContent">'+ assessContant +'</p>';
  632. add += '</div></li>';
  633. var $add = $(add);
  634. $("#historyEvaluate").append($add);
  635. $add.find(".starShow>li:lt(" + $data[i].assessStar + ")").addClass('evastar');
  636. }
  637. }else{
  638. }
  639. }
  640. }
  641. })
  642. }
  643. //获取资源
  644. function getResource(pageSize, pageNo,isbind){
  645. $.ajax({
  646. "url": "/ajax/resource/pqProPublish",
  647. "type": "get",
  648. "async": false,
  649. "data": {
  650. "professorId": professorId,
  651. "pageSize": pageSize,
  652. "pageNo": pageNo
  653. },
  654. "success": function(data) {
  655. console.log(data);
  656. if(data.success) {
  657. var madiaHead ='';
  658. var dataStr=data.data.data;
  659. if(dataStr.length > 0){
  660. $("#showResource").parents(".coninfobox").removeClass("displayNone");
  661. $("#item1user>.nodatabox").addClass("displayNone");
  662. for(var i = 0; i < dataStr.length; i++) {
  663. if(dataStr[i].images.length) {
  664. madiaHead ='/data/resource/' + dataStr[i].images[0].imageSrc ;
  665. }else{
  666. madiaHead ='/images/default-resource.jpg';
  667. }
  668. var strAdd = '';
  669. strAdd += '<li><a traget="_blank" href="resourceShow.html?resourceId='+ dataStr[i].resourceId +'" class="flexCenter urlgo">';
  670. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ madiaHead +')"></div>';
  671. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].resourceName +'</p><p class="h2Font ellipsisSty-2">用途:'+ dataStr[i].supportedServices+'</p></div>';
  672. strAdd += '</a></li>';
  673. var $strAdd = $(strAdd);
  674. $("#proResource").append(strAdd);
  675. if(isbind==true && i==0){
  676. var $strAddO=$(strAdd);
  677. $("#showResource").html("");
  678. $("#showResource").append($strAddO);
  679. }
  680. }
  681. //分页
  682. if(isbind==true){
  683. $("#proResource").siblings(".tcdPageCode").off("click").createPage({
  684. pageCount: Math.ceil(data.data.total / 10),
  685. current: data.data.pageNo,
  686. backFn: function(p) {
  687. $("#proResource").html("");
  688. getResource(10, p,false);
  689. document.body.scrollTop = document.documentElement.scrollTop = 0;
  690. }
  691. });
  692. }
  693. }else{
  694. $("#proResource + .nodatabox").show();
  695. $("#proResource + .nodatabox").find(".noContip").text("用户尚未发布任何资源");
  696. }
  697. }
  698. },
  699. "error": function() {
  700. $.MsgBox.Alert("提示", "服务器连接超时")
  701. }
  702. });
  703. }
  704. //获取文章
  705. function getArticle(pageSize, pageNo,isbind){
  706. $.ajax({
  707. url: "/ajax/article/pqProPublish",
  708. dataType: 'json', //数据格式类型
  709. type: 'GET', //http请求类型
  710. data: {
  711. "professorId": professorId,
  712. "pageSize": pageSize,
  713. "pageNo": pageNo
  714. },
  715. timeout: 10000, //超时设置
  716. success: function(data) {
  717. if(data.success) {
  718. var madiaHead ='/images/default-artical.jpg';
  719. var dataStr=data.data.data;
  720. if(dataStr.length > 0){
  721. $("#showArticle").parents(".coninfobox").removeClass("displayNone");
  722. $("#item1user>.nodatabox").addClass("displayNone");
  723. for(var i = 0; i < dataStr.length; i++) {
  724. if(dataStr[i].articleImg) {
  725. madiaHead ='/data/article/' + dataStr[i].articleImg ;
  726. }
  727. var sowU="";
  728. if(dataStr[i].pageViews!=0){
  729. if(dataStr[i].articleAgree!=0){
  730. sowU='<li><span>阅读量 '+dataStr[i].pageViews+'</span></li><li><span>赞 '+dataStr[i].articleAgree+'</span></li>'
  731. }else{
  732. sowU='<li><span>阅读量 '+dataStr[i].pageViews+'</span></li>'
  733. }
  734. }
  735. var strAdd = '';
  736. strAdd += '<li><a traget="_blank" href="articalShow.html?articleId='+ dataStr[i].articleId +'" class="flexCenter urlgo">';
  737. strAdd += '<div class="madiaHead artHead" style="background-image:url('+ madiaHead +')"></div>';
  738. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr[i].articleTitle +'</p>';
  739. strAdd += '<ul class="h2Font clearfix">';
  740. strAdd += '<li><span class="time">'+ commenTime(dataStr[i].publishTime) +'</span></li>';
  741. strAdd += sowU
  742. strAdd += '<li><span class="comment"></span></li>';
  743. strAdd += '</ul></div>';
  744. strAdd += '</a></li>';
  745. var $strAdd = $(strAdd);
  746. $("#proArticel").append( $strAdd);
  747. commentnum(dataStr[i].articleId, $strAdd) //文章评论数
  748. if(isbind==true && i==0){
  749. var $strAddO = $(strAdd);
  750. $("#showArticle").html("");
  751. $("#showArticle").append($strAddO);
  752. commentnum(dataStr[0].articleId,$strAddO)
  753. }
  754. }
  755. //分页
  756. if(isbind==true){
  757. $("#proArticel").siblings(".tcdPageCode").off("click").createPage({
  758. pageCount: Math.ceil(data.data.total / 10),
  759. current: data.data.pageNo,
  760. backFn: function(p) {
  761. $("#proArticel").html("");
  762. getArticle(10, p,false);
  763. document.body.scrollTop = document.documentElement.scrollTop = 0;
  764. }
  765. });
  766. }
  767. }else{
  768. $("#proArticel + .nodatabox").show();
  769. $("#proArticel + .nodatabox").find(".noContip").text("用户尚未发布任何文章");
  770. }
  771. }
  772. },
  773. error: function() {
  774. return;
  775. }
  776. });
  777. }
  778. //获取专利
  779. function getPatent(pageSize, pageNo,isbind){
  780. $.ajax({
  781. url: "/ajax/ppatent/byProfessor",
  782. dataType: 'json', //数据格式类型
  783. type: 'GET', //http请求类型
  784. data: {
  785. "id": professorId,
  786. "pageSize": pageSize,
  787. "pageNo": pageNo
  788. },
  789. timeout: 10000, //超时设置
  790. success: function(data) {
  791. if(data.success) {
  792. var dataStr=data.data.data;
  793. if(dataStr.length > 0){
  794. $("#showPatent").parents(".coninfobox").removeClass("displayNone");
  795. $("#item1user>.nodatabox").addClass("displayNone");
  796. for(var i = 0; i < dataStr.length; i++) {
  797. if(!dataStr[i].reqPerson){
  798. dataStr[i].reqPerson="";
  799. }
  800. var strAdd = '';
  801. strAdd += '<li><a traget="_blank" href="patentShow.html?patentId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  802. strAdd += '<div class="madiaHead patentHead"></div>';
  803. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  804. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  805. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  806. strAdd += '</div>';
  807. strAdd += '</a></li>';
  808. var $strAdd = $(strAdd);
  809. $("#proPatent").append( $strAdd);
  810. if(isbind==true && i==0){
  811. var $strAddO=$(strAdd);
  812. $("#showPatent").html("");
  813. $("#showPatent").append($strAddO);
  814. }
  815. }
  816. //分页
  817. if(isbind==true){
  818. $("#proPatent").siblings(".tcdPageCode").off("click").createPage({
  819. pageCount: Math.ceil(data.data.total / 10),
  820. current: data.data.pageNo,
  821. backFn: function(p) {
  822. $("#proPatent").html("");
  823. getPatent(10, p,false);
  824. document.body.scrollTop = document.documentElement.scrollTop = 0;
  825. }
  826. });
  827. }
  828. }else{
  829. $("#proPatent + .nodatabox").show();
  830. $("#proPatent + .nodatabox").find(".noContip").text("用户尚未发布任何专利");
  831. }
  832. }
  833. },
  834. error: function() {
  835. return;
  836. }
  837. });
  838. }
  839. //获取论文
  840. function getPaper(pageSize, pageNo,isbind){
  841. $.ajax({
  842. url: "/ajax/ppaper/byProfessor",
  843. dataType: 'json', //数据格式类型
  844. type: 'GET', //http请求类型
  845. data: {
  846. "id": professorId,
  847. "pageSize": pageSize,
  848. "pageNo": pageNo
  849. },
  850. timeout: 10000, //超时设置
  851. success: function(data) {
  852. if(data.success) {
  853. var dataStr=data.data.data;
  854. if(dataStr.length > 0){
  855. $("#showPaper").parents(".coninfobox").removeClass("displayNone");
  856. $("#item1user>.nodatabox").addClass("displayNone");
  857. for(var i = 0; i < dataStr.length; i++) {
  858. var moreInf=""
  859. if(!dataStr[i].cn4periodical){
  860. dataStr[i].cn4periodical="";
  861. }
  862. if(!dataStr[i].en4periodical){
  863. dataStr[i].en4periodical="";
  864. }
  865. if(!dataStr[i].pubDay){
  866. dataStr[i].pubDay="";
  867. }
  868. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  869. var strAdd = '';
  870. strAdd += '<li><a traget="_blank" href="paperShow.html?paperId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  871. strAdd += '<div class="madiaHead paperHead"></div>';
  872. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  873. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  874. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  875. strAdd += '</div>';
  876. strAdd += '</a></li>';
  877. var $strAdd = $(strAdd);
  878. $("#proPaper").append( $strAdd);
  879. if(isbind==true && i==0){
  880. var $strAddO=$(strAdd);
  881. $("#showPaper").html();
  882. $("#showPaper").append($strAddO);
  883. }
  884. }
  885. //分页
  886. if(isbind==true){
  887. $("#proPaper").siblings(".tcdPageCode").off("click").createPage({
  888. pageCount: Math.ceil(data.data.total / 10),
  889. current: data.data.pageNo,
  890. backFn: function(p) {
  891. $("#proPaper").html("");
  892. getPaper(10, p,false);
  893. document.body.scrollTop = document.documentElement.scrollTop = 0;
  894. }
  895. });
  896. }
  897. }else{
  898. $("#proPaper + .nodatabox").show();
  899. $("#proPaper + .nodatabox").find(".noContip").text("用户尚未发布任何论文");
  900. }
  901. }
  902. },
  903. error: function() {
  904. return;
  905. }
  906. });
  907. }
  908. //查文章评论数
  909. function commentnum(articleId, $itemlist) {
  910. $.ajax({
  911. "url": "/ajax/leaveWord/lwCount",
  912. "type": "GET",
  913. "dataType": "json",
  914. "async": false,
  915. "data": {
  916. "articleId": articleId
  917. },
  918. "success": function(data) {
  919. if(data.success) {
  920. if(data.data>0){
  921. $itemlist.find(".comment").text("留言 " + data.data);
  922. }
  923. }
  924. },
  925. "error": function() {
  926. $.MsgBox.Alert('提示', '链接服务器超时')
  927. }
  928. });
  929. }
  930. //合作专家
  931. function relevantExperts(){
  932. $.ajax({
  933. "url": "/ajax/professor/coadjutant",
  934. "type": "get",
  935. "dataType" : "json",
  936. "data" :{"id":professorId},
  937. "success": function(data) {
  938. if(data.success && data.data) {
  939. console.log(data)
  940. for(var i = 0; i < data.data.length; i++) {
  941. var ExpId = data.data[i].professorId;
  942. var paperN=data.data[i].paperCount;
  943. var patentN=data.data[i].patentCount;
  944. var liItem=$('<li class="flexCenter"></li>').appendTo($("#relatePro"));
  945. relExpertsList(ExpId,paperN,patentN,liItem);
  946. }
  947. }
  948. },
  949. "error": function() {
  950. $.MsgBox.Alert('提示', '链接服务器超时')
  951. }
  952. });
  953. }
  954. //合作专家信息
  955. function relExpertsList(Id,numL,numZ,liItem){
  956. $.ajax({
  957. "url" : "/ajax/professor/info/"+Id,
  958. "type" : "GET" ,
  959. "dataType" : "json",
  960. "success" : function(data) {
  961. if (data.success && data.data!=""){
  962. $("#relatePro").parents(".conBlock").removeClass("displayNone");
  963. var itemlist = '<a traget="_blank" href="" class="urlgo">';
  964. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  965. itemlist += '<div class="madiaInfo">';
  966. itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
  967. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  968. itemlist += '<p class="h2Font ellipsisSty" id="copNum"></p>';
  969. itemlist += '</div></a>';
  970. $(itemlist).appendTo(liItem);
  971. var $itemlist =liItem;
  972. if(numL){
  973. if(numZ){
  974. $itemlist.find("#copNum").text("合作:"+numZ+"项专利,"+numL+"篇论文")
  975. }else{
  976. $itemlist.find("#copNum").text("合作:"+numL+"篇论文")
  977. }
  978. }else{
  979. if(numZ){
  980. $itemlist.find("#copNum").text("合作:"+numZ+"项专利")
  981. }else{
  982. }
  983. }
  984. if(data.data.title) {
  985. if(data.data.orgName) {
  986. $itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
  987. }else{
  988. $itemlist.find("#usertitle").text(data.data.title);
  989. }
  990. }else{
  991. if(data.data.office) {
  992. if(data.data.orgName) {
  993. $itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
  994. }else{
  995. $itemlist.find("#usertitle").text(data.data.office);
  996. }
  997. }else{
  998. if(data.data.orgName) {
  999. $itemlist.find("#usertitle").text(data.data.orgName);
  1000. }
  1001. }
  1002. }
  1003. $itemlist.find("#userName").text(data.data.name);
  1004. $itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
  1005. if(data.data.hasHeadImage == 1) {
  1006. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
  1007. }
  1008. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  1009. $itemlist.find(".authiconNew").attr("title", userType.title);
  1010. $itemlist.find(".authiconNew").addClass(userType.sty);
  1011. }
  1012. },
  1013. "error":function(){
  1014. $.MsgBox.Alert('提示','链接服务器超时')
  1015. }
  1016. });
  1017. }
  1018. //相关文章信息
  1019. function relevantarticalList(){
  1020. $.ajax({
  1021. "url" : "/ajax/article/byAssProfessor",
  1022. "type" : "GET" ,
  1023. "dataType" : "json",
  1024. "data" :{"id":professorId},
  1025. "traditional": true, //传数组必须加这个
  1026. "success" : function(data) {
  1027. console.log(data);
  1028. if (data.success && data.data!=""){
  1029. $("#relateArt").parents(".conBlock").removeClass("displayNone");
  1030. var itemlist = '';
  1031. $("#relateArt").html("");
  1032. for(var i = 0; i < data.data.length; i++) {
  1033. var itemlist = '<li class="flexCenter"><a traget="_blank" href="articalShow.html?articleId='+ data.data[i].articleId +'" class="urlgo">';
  1034. itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
  1035. itemlist += '</a></li>';
  1036. $itemlist = $(itemlist);
  1037. $("#relateArt").append($itemlist);
  1038. }
  1039. }
  1040. },
  1041. "error":function(){
  1042. $.MsgBox.Alert('提示','链接服务器超时')
  1043. }
  1044. });
  1045. }
  1046. //感兴趣
  1047. function likeExperts(){
  1048. $.ajax({
  1049. "url": "/ajax/professor/ralateProfessors",
  1050. "type": "get",
  1051. "dataType" : "json",
  1052. "data" :{"professorId":professorId},
  1053. "success": function(data) {
  1054. if(data.success && data.data) {
  1055. console.log(data)
  1056. var lengthT;
  1057. if(data.data.length>5){
  1058. lengthT=5;
  1059. }else{
  1060. lengthT=data.data.length
  1061. }
  1062. for(var i = 0; i < lengthT; i++) {
  1063. var ExpId = data.data[i].id;
  1064. likeExpertsList(ExpId);
  1065. }
  1066. }
  1067. },
  1068. "error": function() {
  1069. $.MsgBox.Alert('提示', '链接服务器超时')
  1070. }
  1071. });
  1072. }
  1073. //感兴趣专家
  1074. function likeExpertsList(ExpId){
  1075. $.ajax({
  1076. "url" : "/ajax/professor/info/"+ExpId,
  1077. "type" : "GET" ,
  1078. "dataType" : "json",
  1079. "success" : function(data) {
  1080. if (data.success && data.data!=""){
  1081. console.log(data)
  1082. $("#likePro").parents(".conBlock").removeClass("displayNone");
  1083. var itemlist = '<li class="flexCenter"><a traget="_blank" href="" class="urlgo">';
  1084. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  1085. itemlist += '<div class="madiaInfo">';
  1086. itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
  1087. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  1088. itemlist += '</div></a></li>';
  1089. $itemlist = $(itemlist);
  1090. $("#likePro").append($itemlist);
  1091. if(data.data.title) {
  1092. if(data.data.orgName) {
  1093. $itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
  1094. }else{
  1095. $itemlist.find("#usertitle").text(data.data.title);
  1096. }
  1097. }else{
  1098. if(data.data.office) {
  1099. if(data.data.orgName) {
  1100. $itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
  1101. }else{
  1102. $itemlist.find("#usertitle").text(data.data.office);
  1103. }
  1104. }else{
  1105. if(data.data.orgName) {
  1106. $itemlist.find("#usertitle").text(data.data.orgName);
  1107. }
  1108. }
  1109. }
  1110. $itemlist.find("#userName").text(data.data.name);
  1111. $itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
  1112. if(data.data.hasHeadImage == 1) {
  1113. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
  1114. }
  1115. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  1116. $itemlist.find(".authiconNew").attr("title", userType.title);
  1117. $itemlist.find(".authiconNew").addClass(userType.sty);
  1118. }
  1119. },
  1120. "error":function(){
  1121. $.MsgBox.Alert('提示','链接服务器超时')
  1122. }
  1123. });
  1124. }
  1125. //获取需求
  1126. function getDemands(pageSize, pageNo,isbind) {
  1127. $.ajax({
  1128. url: "/ajax/demand/pq",
  1129. type: "GET",
  1130. timeout: 10000,
  1131. dataType: "json",
  1132. data: {
  1133. "state":'1',
  1134. "uid":professorId,
  1135. "pageNo": pageNo,
  1136. "pageSize":pageSize
  1137. },
  1138. beforeSend: function() {
  1139. $("#showDemand").append('<img src="../images/loading.gif" class="loading" />');
  1140. },
  1141. success: function(data) {
  1142. if(data.success) {
  1143. $("#showDemand").html(" ");
  1144. var $info = data.data.data;
  1145. if($info.length > 0){
  1146. $("#showDemand").parents(".needinfobox").removeClass("displayNone");
  1147. $("#item1user>.nodatabox").addClass("displayNone");
  1148. for(var i = 0; i < $info.length; i++) {
  1149. var liStr=$("<li></li>").appendTo("#showDemand");
  1150. demandHtml($info[i],liStr);
  1151. }
  1152. // if(isbind == true) {
  1153. // $(".tcdPageCode").createPage({
  1154. // pageCount: Math.ceil(data.data.total / pageSize),
  1155. // current: data.data.data.pageNo,
  1156. // backFn: function(p) {
  1157. // demandList(false,10, p);
  1158. // }
  1159. // });
  1160. // }
  1161. }else{
  1162. $("#showDemand").parents(".needinfobox").addClass("displayNone");
  1163. }
  1164. }
  1165. $(".loading").remove();
  1166. },
  1167. error: function() {
  1168. $.MsgBox.Alert('提示', '链接服务器超时')
  1169. }
  1170. })
  1171. }
  1172. function demandHtml($data,liStr) {
  1173. var sowU="";
  1174. if($data.pageViews!=0){
  1175. sowU='<li><span>浏览量 '+$data.pageViews +'</span></li>'
  1176. }
  1177. var strCon='';
  1178. strCon+='<a class="" target="_blank" href="" class="madiaInfo">'
  1179. strCon+='<p class="h1Font ellipsisSty">'+ $data.title +'</p>'
  1180. strCon+='<ul class="showliTop h3Font clearfix">'
  1181. strCon+='<li><span>发布于 '+commenTime($data.createTime)+'</span></li>'
  1182. strCon+= sowU
  1183. strCon+='</ul>'
  1184. strCon+='<p class="h2Font ellipsisSty-2">'+$data.descp+'</p>'
  1185. strCon+='<ul class="showli clearfix h3Font">'
  1186. if($data.city){ strCon+='<li>所在城市:'+$data.city+'</li>' }
  1187. if($data.duration!=0){ strCon+='<li>预期时长:'+demandDuration[$data.duration]+'</li>' }
  1188. if($data.cost!=0){ strCon+='<li>费用预算:'+demandCost[$data.cost]+'</li>' }
  1189. if($data.invalidDay){ strCon+='<li>有效期至:'+TimeTr($data.invalidDay)+'</li>' }
  1190. strCon+='</ul>'
  1191. strCon+='</a>'
  1192. $(strCon).appendTo(liStr);
  1193. }
  1194. //纠错反馈
  1195. $(".correctSubmit").on("click",function(){
  1196. var cntCon=$(this).siblings(".correctCon").val();
  1197. var cntUser="";
  1198. if(userid && userid != null && userid != "null") {
  1199. cntUser = userid;
  1200. }
  1201. if(cntCon.length>500){
  1202. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  1203. return;
  1204. }else{
  1205. $.ajax({
  1206. "url": "/ajax/feedback/error/professor",
  1207. "type": "POST",
  1208. "dataType": "json",
  1209. "async": true,
  1210. "data": {
  1211. "id": professorId,
  1212. "cnt":cntCon,
  1213. "user":cntUser
  1214. },
  1215. "success": function(data) {
  1216. if(data.success) {
  1217. backSuccessed();
  1218. }
  1219. },
  1220. "error": function() {
  1221. $.MsgBox.Alert('提示', '链接服务器超时')
  1222. }
  1223. });
  1224. }
  1225. })
  1226. })