portal html css js resource

userInforShow.js 40KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269
  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. "pageNo": pageNo,
  1134. "pageSize":pageSize,
  1135. },
  1136. beforeSend: function() {
  1137. $("#showDemand").append('<img src="../images/loading.gif" class="loading" />');
  1138. },
  1139. success: function(data) {
  1140. if(data.success) {
  1141. $("#showDemand").html(" ");
  1142. var $info = data.data.data;
  1143. if($info.length > 0){
  1144. $("#showDemand").parents(".needinfobox").removeClass("displayNone");
  1145. $("#item1user>.nodatabox").addClass("displayNone");
  1146. for(var i = 0; i < $info.length; i++) {
  1147. var liStr=$("<li></li>").appendTo("#showDemand");
  1148. demandHtml($info[i],liStr);
  1149. }
  1150. // if(isbind == true) {
  1151. // $("#showDemand").siblings(".tcdPageCode").off("click").createPage({
  1152. // pageCount: Math.ceil(data.data.total / pageSize),
  1153. // current: data.data.data.pageNo,
  1154. // backFn: function(p) {
  1155. // demandList(false, 5, p);
  1156. // }
  1157. // });
  1158. // }
  1159. }else{
  1160. $("#showDemand").parents(".needinfobox").addClass("displayNone");
  1161. }
  1162. }
  1163. $(".loading").remove();
  1164. },
  1165. error: function() {
  1166. $.MsgBox.Alert('提示', '链接服务器超时')
  1167. }
  1168. })
  1169. }
  1170. function demandHtml($data,liStr) {
  1171. var sowU="";
  1172. if($data.pageViews!=0){
  1173. sowU='<li><span>浏览量 '+$data.pageViews +'</span></li>'
  1174. }
  1175. var strCon='';
  1176. strCon+='<a class="" target="_blank" href="" class="madiaInfo">'
  1177. strCon+='<p class="h1Font ellipsisSty">'+ $data.title +'</p>'
  1178. strCon+='<ul class="showliTop h3Font clearfix">'
  1179. strCon+='<li><span class="cmpName"></span></li><li><span>发布于 '+commenTime($data.createTime)+'</span></li>'
  1180. strCon+= sowU
  1181. strCon+='</ul>'
  1182. strCon+='<p class="h2Font ellipsisSty-2">'+$data.descp+'</p>'
  1183. strCon+='<ul class="showli clearfix h3Font">'
  1184. if($data.city){ strCon+='<li>所在城市:'+$data.city+'</li>' }
  1185. if($data.duration){ strCon+='<li>预期时长:'+demandDuration[$data.duration]+'</li>' }
  1186. if($data.cost){ strCon+='<li>费用预算:'+demandCost[$data.cost]+'</li>' }
  1187. if($data.invalidDay){ strCon+='<li>有效期至:'+TimeTr($data.invalidDay)+'</li>' }
  1188. strCon+='</ul>'
  1189. strCon+='</a>'
  1190. $(strCon).appendTo(liStr);
  1191. }
  1192. //纠错反馈
  1193. $(".correctSubmit").on("click",function(){
  1194. var cntCon=$(this).siblings(".correctCon").val();
  1195. var cntUser="";
  1196. if(userid && userid != null && userid != "null") {
  1197. cntUser = userid;
  1198. }
  1199. if(cntCon.length>500){
  1200. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  1201. return;
  1202. }else{
  1203. $.ajax({
  1204. "url": "/ajax/feedback/error/professor",
  1205. "type": "POST",
  1206. "dataType": "json",
  1207. "async": true,
  1208. "data": {
  1209. "id": professorId,
  1210. "cnt":cntCon,
  1211. "user":cntUser
  1212. },
  1213. "success": function(data) {
  1214. if(data.success) {
  1215. backSuccessed();
  1216. }
  1217. },
  1218. "error": function() {
  1219. $.MsgBox.Alert('提示', '链接服务器超时')
  1220. }
  1221. });
  1222. }
  1223. })
  1224. })