Geen omschrijving

information.brow.js 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. $(function(){
  2. loginStatus();//读取用户头像
  3. var userid = $.cookie("userid");
  4. var professorId = GetQueryString("professorId");
  5. var name;
  6. if(professorId){
  7. var subjectShow = function (data){
  8. if(data != undefined && data.length != 0 ){
  9. var subs = new Array();
  10. if(data.indexOf(',')){
  11. subs = data.split(',');
  12. }else{
  13. subs[0] = data;
  14. }
  15. if(subs.length>0){
  16. for (var i = 0; i < subs.length; i++) {
  17. $("#subjectShow").append("<div class='acad'>"+subs[i]+"</div>");
  18. };
  19. }
  20. }
  21. }
  22. var industryShow = function (data){
  23. if(data != undefined && data.length != 0 ){
  24. var subs = new Array();
  25. if(data.indexOf(',')){
  26. subs = data.split(',');
  27. }else{
  28. subs[0] = data;
  29. }
  30. if(subs.length>0){
  31. for (var i = 0; i < subs.length; i++) {
  32. $("#industryShow").append("<li>"+subs[i]+"</li>");
  33. };
  34. }
  35. }
  36. }
  37. // var eduBgShow = function (data){
  38. // if(data != undefined && data.length != 0 ){
  39. // var subs = new Array();
  40. // if(data.indexOf(',')){
  41. // subs = data.split(',');
  42. // }else{
  43. // subs[0] = data;
  44. // }
  45. // if(subs.length>0){
  46. // for (var i = 0; i < subs.length; i++) {
  47. // $("#industryList").append("<div class='acad'>"+ subs[i] +"<span class='remove'><img src='images/move.png'></span></div>");
  48. // $("#industryShow").append("<li>"+subs[i]+"</li>");
  49. // };
  50. // }
  51. // }
  52. // }
  53. var eduBgShow = function(data) {
  54. if(data.length>0){
  55. for (var i = 0; i < data.length; i++) {
  56. var showHtml = "<li>";
  57. if(typeof(data[i].school) !== "undefined"){
  58. showHtml += data[i].school;
  59. }else{
  60. showHtml += "不详";
  61. }
  62. showHtml += "-";
  63. if(typeof(data[i].college) !== "undefined"){
  64. showHtml += data[i].college;
  65. }else{
  66. showHtml += "不详";
  67. }
  68. showHtml += "-";
  69. if(typeof(data[i].major) !== "undefined"){
  70. showHtml += data[i].major;
  71. }else{
  72. showHtml += "不详";
  73. }
  74. showHtml += "-";
  75. if(typeof(data[i].degree) !== "undefined"){
  76. showHtml += data[i].degree;
  77. }else{
  78. showHtml += "不详";
  79. }
  80. showHtml += "-";
  81. if(typeof(data[i].year) !== "undefined"){
  82. showHtml += data[i].year;
  83. }else{
  84. showHtml += "不详";
  85. }
  86. showHtml += "</li>";
  87. $("#eduBgShow").append(showHtml);
  88. // $("#eduBgShow").append("<li>"+data[i].school+"-"+data[i].college+"-"+data[i].major+"-"+data[i].degree+"-"+data[i].year+"</li>");
  89. }
  90. }
  91. }
  92. var timeJobShow = function(data) {
  93. if(data.length>0){
  94. for (var i = 0; i < data.length; i++) {
  95. $("#timeJobShow").append("<li>"+data[i].company+"-"+data[i].title+"-"+data[i].startMonth+"-"+data[i].stopMonth+"</li>");
  96. }
  97. }
  98. }
  99. var projectShow = function(data){
  100. if(data.length>0){
  101. for (var i = 0; i < data.length; i++) {
  102. if(data[i].descp=="undefined"){
  103. $('.spancon').css({display:"none"});
  104. }
  105. $("#projectShow").append("<li>名称:"+data[i].name+"<br><span class='spancon'>内容:"+data[i].descp+"</span></li>");
  106. }
  107. }
  108. }
  109. var paperShow = function(data){
  110. if(data.length>0){
  111. for (var i = 0; i < data.length; i++) {
  112. $("#paperShow").append("<li>"+data[i].name+"</li>");
  113. }
  114. }
  115. }
  116. var patentShow = function(data){
  117. if(data.length>0){
  118. for (var i = 0; i < data.length; i++) {
  119. $("#patentShow").append("<li>"+data[i].name+"</li>");
  120. }
  121. }
  122. }
  123. var honorShow = function(data){
  124. if(data.length>0){
  125. for (var i = 0; i < data.length; i++) {
  126. $("#honorShow").append("<li>"+data[i].name+"</li>");
  127. }
  128. }
  129. }
  130. var researchAreaShow = function ($datas,$datarecords){
  131. if($datas != undefined && $datas.length != 0 ){
  132. for(var i =0 ; i< $datas.length;++i){
  133. var $data = $datas[i];
  134. var $photos = [];
  135. //获取头像
  136. if($datarecords.length>0){
  137. $photos = getRecords($datarecords,$data.caption);
  138. }
  139. var isAgree = $.inArray(userid, $photos);
  140. var showDiv= "<div class='listbox listbox-browse clear'><div class='list-browse'><span class='like'>"+$data.count+"</span>"+$data.caption+"</div><span class='plus' data-pid='"+$data.professorId+"' data-caption='"+$data.caption+"' data-isagree='"+isAgree+"'></span><div class='like-num'>";
  141. if($photos.length>10){
  142. showDiv += "<div class='triangleR'></div>";
  143. }
  144. if($photos.length>0){
  145. for(var j =0 ; j< $photos.length;++j){
  146. showDiv += "<span class='like-people headRadius'><img class='like-h' src='/images/head/"+$photos[j]+"_s.jpg'></span>";
  147. }
  148. }
  149. showDiv += "</div></div>";
  150. $("#researchAreaShow").append(showDiv);
  151. $(".like-h").load(function(){
  152. })
  153. .error(function(){
  154. $(this).attr("src","/images/default-photo.jpg");
  155. });
  156. }
  157. }
  158. }
  159. var getRecords = function ($researchAreaLogs,caption){
  160. var ret=[];
  161. for(var i = 0 ;i < $researchAreaLogs.length ; i++){
  162. if(caption==$researchAreaLogs[i].caption){
  163. ret.push($researchAreaLogs[i].opreteProfessorId);
  164. }
  165. }
  166. return ret;
  167. }
  168. $("#researchAreaShow").on("click",".plus",function(){
  169. if(userid && userid != null && userid != "null"){
  170. $.ajax({
  171. "url" : $(this).data("isagree")>-1?"/ajax/researchArea/unAgree":"/ajax/researchArea/agree",
  172. "type" : "POST",
  173. "data" : {"targetId":$(this).data("pid"),"targetCaption":$(this).data("caption"),"opId":userid},
  174. "contentType" : "application/x-www-form-urlencoded",
  175. "success" : function($data) {
  176. if ($data.success) {
  177. $.get("/ajax/professor/info/" + professorId, function($data) {
  178. if ($data.success)
  179. {
  180. var $info = $data.data;
  181. if ($info)
  182. {
  183. $("#researchAreaShow").empty("")
  184. if ($info.researchAreas)
  185. {
  186. researchAreaShow($info.researchAreas,$info.researchAreaLogs);
  187. }
  188. }
  189. }
  190. })
  191. } else {
  192. $.MsgBox.Alert("message",$data.msg);
  193. }
  194. }
  195. });
  196. }else{
  197. $.MsgBox.Alert("消息","请登录后点赞");
  198. /*location.href="login.html"*/
  199. }
  200. })
  201. $.get("/ajax/professor/info/" + professorId, function($data) {
  202. if ($data.success) {
  203. var $info = $data.data;
  204. if ($info) {
  205. //展示专家的信息
  206. console.log($data);
  207. if($info.authentication==false) {
  208. $(".modify").css("background-image","url(../images/icon-unauth.png)");
  209. }
  210. $("#nameS").text($info.name);
  211. if($info.office) {
  212. $("#office").text($info.office+",");
  213. }
  214. if($info.title) {
  215. $("#titleS").text($info.title);
  216. }
  217. if($info.department) {
  218. $("#industryS").text($info.department+",");
  219. }
  220. if($info.orgName) {
  221. $("#orgNameS").text($info.orgName);
  222. }
  223. if($info.address) {
  224. $("#address").text($info.address);
  225. }
  226. $("#headImage").attr("src","/images/head/"+professorId+"_l.jpg");
  227. $("#headImage").load(function(){
  228. })
  229. .error(function(){
  230. $("#headImage").attr("src","/images/default-photo.jpg");
  231. });
  232. $("#orgImage").attr("src","/images/org/"+$info.orgId+".jpg");
  233. $("#orgImage").load(function(){
  234. })
  235. .error(function(){
  236. $("#orgImage").attr("src","/images/default-icon.jpg");
  237. });
  238. $("#descpS").text($info.descp);
  239. //显示专家信息到保存数据
  240. name=$info.name;
  241. $("#name").val($info.name);
  242. $("#title").val($info.title);
  243. $("#orgId").val($info.orgId);
  244. //$("#organ").attr("href","organization-brow.html?orgId="+$info.orgId+"");
  245. //console.log($info.orgId);
  246. $("#orgName").val($info.orgName);
  247. $("#department").val($info.department);
  248. if($info.descp==undefined&&$info.subject==undefined&&$info.researchAreas.length ==0&&$info.industry==undefined&&$info.edus.length ==0&&$info.jobs.length ==0&&$info.projects.length==0&&$info.papers.length ==0&&$info.patents.length ==0&&$info.honors.length ==0){
  249. $("div:contains('专家信息')").parents(".menublock").hide();
  250. }
  251. if($info.descp){
  252. $("#descp").val($info.descp);
  253. }else{
  254. $("span:contains('个人简介')").parents(".introduction").hide();
  255. $("a:contains('个人简介')").hide();
  256. }
  257. //展示专家的学科
  258. if($info.subject){
  259. subjectShow($info.subject);
  260. }else{
  261. $("span:contains('学术领域')").parents(".introduction").hide();
  262. $("a:contains('学术领域')").hide();
  263. }
  264. //研究方向
  265. if ($info.researchAreas.length) {
  266. researchAreaShow($info.researchAreas,$info.editResearchAreaLogs);
  267. }else{
  268. $("span:contains('研究方向')").parents(".introduction").hide();
  269. $("a:contains('研究方向')").hide();
  270. }
  271. //展示专家的行业
  272. if($info.industry){
  273. industryShow($info.industry);
  274. }else{
  275. $("span:contains('应用行业')").parents(".introduction").hide();
  276. $("a:contains('应用行业')").hide();
  277. }
  278. //教育北京
  279. if ($info.edus.length) {
  280. eduBgShow($info.edus);
  281. }
  282. else{
  283. $("span:contains('教育背景')").parents(".introduction").hide();
  284. $("a:contains('教育背景')").hide();
  285. }
  286. //兼职
  287. if ($info.jobs.length) {
  288. timeJobShow($info.jobs);
  289. }else{
  290. $("span:contains('工作经历')").parents(".introduction").hide();
  291. $("a:contains('工作经历')").hide();
  292. }
  293. //项目
  294. if ($info.projects.length) {
  295. projectShow($info.projects)
  296. }else{
  297. $("span:contains('项目经历')").parents(".introduction").hide();
  298. $("a:contains('项目经历')").hide();
  299. }
  300. //论文
  301. if ($info.papers.length) {
  302. paperShow($info.papers);
  303. }else{
  304. $("span:contains('著作、论文、文章')").parents(".introduction").hide();
  305. $("a:contains('著作、论文、文章')").hide();
  306. }
  307. //专利
  308. if ($info.patents.length) {
  309. patentShow($info.patents);
  310. }else{
  311. $("span:contains('专利')").parents(".introduction").hide();
  312. $("a:contains('专利')").hide();
  313. }
  314. //荣誉
  315. if ($info.honors.length) {
  316. honorShow($info.honors);
  317. }else{
  318. $("span:contains('荣誉及奖项')").parents(".introduction").hide();
  319. $("a:contains('荣誉及奖项')").hide();
  320. }
  321. //下滑滚动不覆盖底部
  322. var d;
  323. var t;
  324. $(function(){
  325. /*向下滚动时,header背景变半透明*/
  326. var top5=$(".content-left").height();
  327. var top4=$("#container").height();
  328. var top3=$(window).height();
  329. $(document).scroll(function(){
  330. var top1 =$(document).scrollTop();
  331. var top2=$("#container").height()-top3+(top3-80-top5)-10;//变成绝对定位
  332. if(top1>=300){
  333. $(".content-left").css({"position":"fixed","top":"80px"});
  334. if(top1>=top2)
  335. {
  336. $('.information-content').css("position","static");
  337. $(".content-left").css("position", "absolute");
  338. $(".content-left").css("top", top4-top5-10+"px");
  339. }
  340. else{
  341. $('.information-content').css("position","relative");
  342. $(".content-left").css({"position":"fixed","top":"80px"});
  343. }
  344. }
  345. else{
  346. $(".content-left").css({"position":"static"});
  347. }
  348. //咨询框弹出
  349. var foot_height = $(".footerblock").height();
  350. if (top1 >= 180 && top1 < top4-top3) {
  351. $(".coulstblock").slideDown();
  352. $(".coulstblock").css({"bottom":"0"});
  353. } else if(top1 >= top4-top3){
  354. $(".coulstblock").css({"bottom":-(top4-top3-top1)+"px"});
  355. }else{
  356. $(".coulstblock").slideUp();
  357. $(".coulstblock").css({"bottom":"0"});
  358. }
  359. })
  360. });
  361. //下滑滚动不覆盖底部 结束
  362. }
  363. }
  364. }
  365. );
  366. }
  367. $("#hsearch").on("click",function (){
  368. var searchContent = $("#hsearchContent").val();
  369. location.href = "search.html?searchContent="+searchContent;
  370. });
  371. //进入自己的页面,上传图像部分
  372. $(".head-left").hover(function(){
  373. $(".replace-photo").animate({"bottom":"0px"});
  374. },function(){
  375. $(".replace-photo").animate({"bottom":"-50px"});
  376. })
  377. //专家信息点击换背景颜色
  378. $(".subsidebar").click(function(){
  379. $(".subsidebar").removeClass("subcolor");
  380. $(".subsidebar").eq($(".subsidebar").index(this)).addClass("subcolor");
  381. });
  382. //拿到点击的顺序,然后求出局文档的距离
  383. $(".subsidebar").click(function(){
  384. var index=$(".subsidebar").index(this);
  385. var offset=$(".introduction").eq(index).offset();
  386. $("body").animate({
  387. scrollTop:offset.top-80 //��body��scrollTop����pos��top����ʵ���˹���
  388. },1000);
  389. })
  390. var resou;
  391. //科研资源
  392. $.ajax({
  393. "url":"/ajax/resource/qapro",
  394. "type":"get",
  395. "data":{"professorId":professorId},
  396. "async": false,
  397. "success":function(data){
  398. // console.log(data);
  399. resou=data.data.length;
  400. if(data.data.length==0){
  401. $("#infor-browse").css("display","none");
  402. $("span:contains('科研资源')").parents(".introduction").hide();
  403. $("a:contains('科研资源')").hide();
  404. }
  405. if(data.data.length > 3){
  406. $("#infor-browse").css("display","block");
  407. $(".resoubtn").css("display","block");
  408. }
  409. var add="";
  410. if(data.success)
  411. {
  412. for(var i=0;i<data.data.length;i++){
  413. add='<div class="sharesrc">'
  414. add+='<div class="shareshow">'
  415. add+='<a class="remess" resourceId='+data.data[i].resourceId+'><img src="/images/resource/'+data.data[i].resourceId+'.jpg" width="100%" height="100%" class="resourceImg"></a>'
  416. add+='<div class="shareopeart"><a class="sharebtn resourceConsult" professorId='+data.data[i]["professorId"]+'>咨询</a><a class="sharebtn applicant">申请</a></div>'
  417. add+='</div>'
  418. add+='<p class="restit">资源名称:<span class="presou consultTitleVal" resourceConsultTitle = "">'+ data.data[i].resourceName+'</span></p>'
  419. add+='<p class="briefinfor">简介:'+data.data[i].supportedServices+'</p>'
  420. add+='</div>'
  421. $("#sharescrollbox").append(add);
  422. $('.applicant').eq(i).attr("resourceId",data.data[i].resourceId);
  423. $(".resourceImg").eq(i).attr("src","/images/resource/"+data.data[i].resourceId+".jpg");
  424. $(".resourceImg").load(function(){})
  425. .error(function(){
  426. $(this).attr("src","/images/default-resource.jpg");
  427. });
  428. add="";
  429. }
  430. //资源轮播
  431. var $content = $(".sharescrollbox");
  432. var childcount = $content.find(".sharesrc").length;
  433. Carousel(3,3,3,childcount, $content, $(".resounext"), $(".resouprev"));
  434. //科研资源中点咨询
  435. $(".introduction").find(".resourceConsult").bind("click",clickResourceConsult);
  436. }
  437. else
  438. {
  439. $.MsgBox.Alert("消息","系统异常!");
  440. }
  441. },
  442. "error":function(){$.MsgBox.Alert('message','failddd')}
  443. });
  444. function getIdentity(professorId){
  445. $.ajax({
  446. "url":"ajax/professor/"+professorId,
  447. "type":"get",
  448. "async": false,
  449. "success":function(data){
  450. if(data.success)
  451. {
  452. //console.log(data);
  453. $("option")[0].value=data.data.name;
  454. $("option")[1].value=data.data.organization.name;
  455. //console.log($("option")[0].value);
  456. //console.log($("option")[1].value);
  457. }
  458. else
  459. {
  460. $.MsgBox.Alert("消息","系统异常!");
  461. }
  462. },
  463. "error":function(){$.MsgBox.Alert('message','failddd')}
  464. })
  465. }
  466. //查看资源详细信息
  467. $('#sharescrollbox').on("click",'.remess',function(){
  468. var resourceID=$(this).attr("resourceId");
  469. ResourceMessage();
  470. $.ajax({
  471. "url":"/ajax/resource/"+resourceID,
  472. "type":"get",
  473. "async": true,
  474. "success":function(info){
  475. if(info.success)
  476. {
  477. console.log(info);
  478. $("#resourceName").text(info.data.resourceName);
  479. $("#supportedServices").text(info.data.supportedServices);
  480. $("#hopePayMethod").text(info.data.hopePayMethod) ;
  481. $("#cooperationNotes").text(info.data.cooperationNotes) ;
  482. $("#subject").text(info.data.subject);
  483. $("#industry").text(info.data.industry);
  484. $("#descp").text(info.data.descp);
  485. $("#professor").text(name);
  486. $(".resouImage").attr("src","/images/resource/"+resourceID+".jpg");
  487. $(".resouImage").load(function(){})
  488. .error(function(){
  489. $(this).attr("src","/images/default-resource.jpg");
  490. });
  491. }
  492. else
  493. {
  494. $.MsgBox.Alert('message',"系统异常!");
  495. }
  496. },
  497. "error":function(){$.MsgBox.Alert('message','failed')}
  498. });
  499. })
  500. //资源申请入口
  501. $('.introduction').on("click",'.applicant',function(){
  502. if(userid && userid != null && userid != "null"){
  503. ResourceApply();//调用资源申请HTML创建函数
  504. $(".limitBox").removeClass("limitBox");
  505. $(".limitwords").removeClass("limitwords");
  506. $(".limitwordbox").removeClass("limitwordbox");
  507. //获取当前时间并且格式化时间
  508. var myDate = new Date();
  509. var nowYear = myDate.getFullYear();
  510. var nowMonth = myDate.getMonth()+1;
  511. var nowDate = myDate.getDate();
  512. if(nowMonth<10){
  513. nowMonth="0"+nowMonth.toString();
  514. }
  515. if(nowDate<10){
  516. nowDate="0"+nowDate.toString();
  517. }
  518. var now = nowYear + "-" + nowMonth + "-" + nowDate;
  519. $( "#datepicker").val(now);
  520. $( "#datepicker" ).datepicker({ "dateFormat":" yy-mm-dd"});
  521. $(".timelo").css("display","none");
  522. $(".namecon").text(name);
  523. $(".applysure").hide();
  524. $(".btnboxup").hide();
  525. var index1=$(this).parent().parent().parent().index();
  526. var resName=$('.presou').eq(index1).text();
  527. var resourceID=$(this).attr("resourceId");
  528. $.ajax({
  529. "url":"/ajax/resource/"+resourceID,
  530. "type":"get",
  531. "async": false,
  532. "success":function(info)
  533. {
  534. if(info.success)
  535. {
  536. if(info.data.images.length)
  537. {
  538. $(".resouImage").attr("src","/images/resource/"+resourceID+".jpg");
  539. }
  540. else{
  541. $(".resouImage").attr("src","/images/default-resource.jpg");
  542. }
  543. }
  544. }
  545. })
  546. $(".log").text(resName);
  547. getIdentity(userid);
  548. $("#deliver").on("click",function()
  549. {
  550. var $data = {};
  551. $data.demandId = userid;
  552. $data.resourceId=resourceID;
  553. $data.detailDemand=$(".detail").val();
  554. //去除时间里面的- 和字符串前后的空格
  555. $data.deliverTime=replaceStr($.trim($(".dealTime").val()));
  556. //alert(replaceStr($.trim($(".dealTime").val())));
  557. //alert(replaceStr($.trim($(".dealTime").val())).length);
  558. $data.operationStatus=1;
  559. $data.applysquare=$("select option:selected").val();
  560. //console.log($data.applysquare);
  561. $.ajax({
  562. "url" : "/ajax/operation",
  563. "type" : "POST",
  564. "success" : function(rdata) {
  565. if (rdata.success) {
  566. $.MsgBox.Alert('message','资源"'+ resName +'"申请发送成功!');
  567. $(".blackcover").remove();
  568. $("body").css("position","static");
  569. //location.reload(true);
  570. } else {
  571. $.MsgBox.Alert('message','资源"'+ resName +'"申请发送失败,请重新申请!');
  572. }
  573. },
  574. "data" : $data,
  575. "beforeSend":function(){/*console.log(this.data)*/},
  576. "contentType" : "application/x-www-form-urlencoded",
  577. dataType : "json"
  578. });
  579. });
  580. }else{
  581. $.MsgBox.Alert("消息","您还未登录,请登录之后进行资源申请");
  582. }
  583. });
  584. //科研资源中的咨询
  585. function clickResourceConsult(){
  586. var professorId = $(this).attr("professorId");
  587. consultHandler();
  588. $("ul.menucon").children().eq(1).addClass("clicknow");
  589. var consultTitleVal = $(this).parent().parent().parent().find(".consultTitleVal").text();
  590. $("#consultTitle").val("关于"+consultTitleVal+"的咨询");
  591. };
  592. //===============点击咨询==============
  593. var userid = $.cookie("userid");//登陆人id====重复代码
  594. var professorId = GetQueryString("professorId");//专家id====重复代码
  595. //点击科研资源的咨询
  596. $("#consultbtn,#conbtn").bind('click',consultHandler);
  597. function consultHandler() {
  598. if(userid){
  599. ConsultApply();
  600. concultProInfo(professorId);
  601. //点击的发送
  602. $("#sendConsultBtn").click(function(){
  603. sendConsultHandler($(this).attr("proId"));
  604. });
  605. }else {
  606. $.MsgBox.Alert("message","请登录");
  607. var aele = document.createElement('a');
  608. $("#mb_btnbox").append(aele);
  609. $("#mb_btnbox a").css({
  610. 'display':"block",
  611. 'width':'100%',
  612. 'height':'40px',
  613. 'position':'relative',
  614. 'bottom':'40px',
  615. 'left':0
  616. });
  617. aele.setAttribute('href', '../login.html');
  618. }
  619. };
  620. //合作历史及评价
  621. var ass;
  622. $.ajax({
  623. "url":"/ajax/consult/pqAssessHis",
  624. "type":"get",
  625. "data":{"professorId":professorId},
  626. "async": false,
  627. "success":function(response) {
  628. if(response.success) {
  629. var $data=response.data.data;
  630. ass=$data.length;
  631. if($data.length==0) {
  632. $("span:contains('合作历史及评价')").parents(".introduction").hide();
  633. $("a:contains('合作历史及评价')").hide();
  634. }
  635. for(var i=0;i<$data.length;i++) {
  636. var add="";
  637. var assessTime=$data[i]["assessTime"].substr(0,4) + "-" + $data[i].assessTime.substr(4,2) + "-" + $data[i].assessTime.substr(6,2) + " "
  638. + $data[i].assessTime.substr(8,2)+ ":" + $data[i].assessTime.substr(10,2);
  639. add+='<div class="evaluate2">'
  640. add+='<div class="lefteva">'
  641. add+='<a class="evaimg headRadius">'
  642. if($data[i].professor.hasHeadImage) {
  643. add+='<img src="/images/head/'+$data[i].professor.id+'_m.jpg" width="100%" height="100%">'
  644. }else{
  645. add+='<img src="/images/default-photo.jpg" width="100%" height="100%">'
  646. }
  647. add+='</a>'
  648. add+='<p>'+$data[i].professor.name+'</p><p>'
  649. // if($data[i].professor.office) {
  650. // add+='<span>'+$data[i].professor.office+' ,</span>'
  651. // }
  652. // if($data[i].professor.title) {
  653. // add+='<span>'+$data[i].professor.title+'</span>'
  654. // }
  655. add+='</p><p>'
  656. // if($data[i].professor.department) {
  657. // add+='<span>'+$data[i].professor.department+' ,</span>'
  658. // }
  659. // if($data[i].professor.orgName) {
  660. // add+='<span>'+$data[i].professor.orgName+'</span>'
  661. // }
  662. add+='</p>'
  663. add+='</div>'
  664. add+='<div class="righteva">'
  665. add+='<ul class="evasort">'
  666. add+='<li>咨询时间:<span>'+assessTime+'</span></li>'
  667. add+='<li>咨询主题:<span>'+$data[i].consultTitle+'</span></li>'
  668. add+='</ul>'
  669. add+='<div class="evastarbox" id="evastarboxx">'
  670. add+='<span class="evastar"></span>'
  671. add+='<span class="evastar"></span>'
  672. add+='<span class="evastar"></span>'
  673. add+='<span class="evastar"></span>'
  674. add+='<span class="evastar"></span>'
  675. add+='</div>'
  676. if($data[i].assessContant){
  677. add+='<p class="evabrief">'+$data[i].assessContant+' </p>'
  678. }
  679. add+='</div>'
  680. add+='</div>'
  681. var $add=$(add);
  682. $(".shareabout2").append($add);
  683. $add.find(".evastar:lt("+$data[i].assessStar+")").addClass('staspan');
  684. }
  685. }
  686. }
  687. })
  688. if(resou==0&&ass==0){
  689. $('div:contains("合作机会")').parents(".menublock").hide();
  690. }
  691. proinfo (professorId);
  692. //底部咨询申请入口专家信息
  693. function proinfo (professorId) {
  694. $.ajax({
  695. url:"/ajax/professor/editBaseInfo/"+professorId,
  696. type:"get",
  697. data : {"id":professorId},
  698. contentType : "application/x-www-form-urlencoded",
  699. success:function(response){
  700. var myData = response["data"];
  701. console.log(myData);
  702. $("#foot_proname").html(myData["name"]);
  703. if(myData["address"]){
  704. $("#foot_proaddress").html(' | '+myData["address"]);
  705. }
  706. if(myData["title"]) {
  707. $("#foot_protitle").html(myData["title"]);
  708. }
  709. if(myData["department"]){
  710. $("#foot_prodepar").html(myData["department"]);
  711. }
  712. if(myData["orgName"]){
  713. if(myData["department"] == null || myData["department"] ==''){
  714. $("#foot_proorgname").html(myData["orgName"]);
  715. }else {
  716. $("#foot_proorgname").html(','+myData["orgName"]);
  717. }
  718. }
  719. //是否认证
  720. if(myData["authentication"] == true){
  721. $("#foot_promodify").addClass("authicon");
  722. }else {
  723. $("#foot_promodify").addClass("unauthicon");
  724. }
  725. //头像
  726. if(myData["hasHeadImage"] == 0){
  727. $("#foot_proimg").attr("src","images/default-photo.jpg");
  728. }
  729. else {
  730. $("#foot_proimg").attr("src","images/head/"+myData["id"]+"_m.jpg");
  731. }
  732. },
  733. error:function(error){
  734. $.MsgBox.Alert("message","请求数据失败");
  735. }
  736. });
  737. }
  738. })