portal html css js resource

resourceShow.js 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. $(document).ready(function() {
  2. loginStatus(); //判断个人是否登录
  3. var userid = $.cookie("userid");
  4. $(".jqzoom").imagezoom();
  5. $("#thumblist").on("click", "li a", function() {
  6. $(this).parents("li").addClass("tb-selected").siblings().removeClass("tb-selected");
  7. $(".jqzoom").attr('src', $(this).find("img").attr("src"));
  8. $(".jqzoom").attr('rel', $(this).find("img").attr("src"));
  9. });
  10. $('.shareWeixin').hover(function() {
  11. $('.shareCode').stop(true, false).fadeToggle();
  12. });
  13. var resourceId = GetQueryString("resourceId");
  14. ifCollection(resourceId, 2)
  15. var professorId = "";
  16. getRecourceMe();
  17. /*获取资源信息*/
  18. function getRecourceMe() {
  19. $.ajax({
  20. "url": "/ajax/resource/queryOne",
  21. "type": "GET",
  22. "success": function(data) {
  23. console.log(data);
  24. if(data.success) {
  25. resourceHtml(data.data);
  26. var resourceName = data.data.resourceName + "-科袖网";
  27. window.setTimeout(function() {
  28. document.title = resourceName;
  29. }, 500);
  30. }
  31. },
  32. "data": {
  33. "resourceId": resourceId
  34. },
  35. dataType: "json",
  36. 'error': function() {
  37. $.MsgBox.Alert('提示', '服务器连接超时!');
  38. }
  39. });
  40. }
  41. /*合作备注及性能参数存储换行格式*/
  42. function outHTML(selecter) {
  43. var getValue = selecter;
  44. var aa = "";
  45. if(getValue) {
  46. var endValue = ((getValue.replace(/<(.+?)>/gi, "&lt;$1&gt;")).replace(/ /gi, "&nbsp;")).replace(/\n/gi, "|");
  47. var cc = endValue.split("|");
  48. for(var i = 0; i < cc.length; i++) {
  49. aa += cc[i] + '<br/>'
  50. }
  51. }
  52. return aa;
  53. }
  54. /*处理资源html代码*/
  55. function resourceHtml($da) {
  56. $("#resourceName").text($da.resourceName); //名字
  57. $("#application").text($da.supportedServices); //应用用途
  58. if($da.editProfessor) {
  59. $("#person").show();
  60. if($da.orgName) { //所属机构
  61. $("#organizationName").text($da.orgName).parents("li").show();
  62. }
  63. $("#nameS").text($da.editProfessor.name);
  64. if($da.editProfessor.title) {
  65. $("#titleOffice").text($da.editProfessor.title);
  66. } else {
  67. if($da.editProfessor.office) {
  68. $("#titleOffice").text($da.editProfessor.office);
  69. }
  70. }
  71. if($da.editProfessor.orgName) {
  72. $("#orgType").text($da.editProfessor.orgName);
  73. }
  74. professorId = $da.editProfessor.id;
  75. console.log(professorId);
  76. console.log(userid);
  77. if(userid != professorId) {
  78. ifCollection(professorId, 1)
  79. $(".goSpan").show();
  80. }
  81. var professorFlag = autho($da.editProfessor.authType, $da.editProfessor.orgAuth, $da.editProfessor.authStatus);
  82. $("#authFlag").addClass(professorFlag.sty).attr("title", professorFlag.title);
  83. if($da.editProfessor.hasHeadImage == 1) {
  84. $("#headImg").css("background-image", 'url(/images/head/' + $da.editProfessor.id + '_l.jpg)');
  85. }
  86. }else{
  87. $("#enterprise,#resPerson").show();
  88. $(".qiyego").attr("href","cmpInforShow.html?orgId="+$da.organization.id);
  89. if($da.organization.hasOrgLogo) {
  90. $("#companyImg").attr("src", "/images/org/" + $da.organization.id + ".jpg");
  91. }else{
  92. $("#companyImg").attr("src", "/images/default-icon.jpg");
  93. }
  94. if($da.organization.authStatus==3){
  95. $("#QauthFlag").addClass("authicon-com-ok").attr("title", "认证企业");
  96. }
  97. if($da.organization.forShort) {
  98. $("#Qname").text($da.organization.forShort).attr("href","cmpInforShow.html?orgId="+$da.organization.id);
  99. }else{
  100. $("#Qname").text($da.organization.name).attr("href","cmpInforShow.html?orgId="+$da.organization.id);
  101. }
  102. $("#Qindustry").text($da.organization.subject);
  103. $("#QorgType").text(orgTypeShow[$da.organization.orgType])
  104. }
  105. if($da.spec) { //厂商型号
  106. $("#modelNumber").text($da.spec).parents("li").show();
  107. }
  108. if($da.parameter) { //性能参数
  109. $("#performancePa").html(outHTML($da.parameter)).parents("li").show();
  110. }
  111. if($da.cooperationNotes) { //合作备注
  112. $("#remarkContent").html(outHTML($da.cooperationNotes)).parents("li").show();
  113. }
  114. if($da.subject) {
  115. var oSub = $da.subject.split(",");
  116. if($da.resourceType==1) {
  117. interestingResources(oSub,$da.professorId,0);
  118. }else{
  119. interestingResources(oSub,$da.orgId,1);
  120. }
  121. var oSt = "";
  122. for(var i = 0; i < oSub.length; i++) {
  123. oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
  124. }
  125. $(".tagList").html(oSt);
  126. } else {
  127. $(".aboutTit:contains('您可能感兴趣的资源')").parent().hide();
  128. }
  129. if($da.descp) { //编辑器
  130. $("#descp").html($da.descp).parents("li").show();
  131. }
  132. var weibotitle = $da.resourceName;
  133. var weibourl = window.location.href;
  134. //return;
  135. if($da.images.length) {
  136. var weibopic = "http://" + window.location.host + "/data/resource/" + $da.images[0].imageSrc;
  137. $("#firstFigure").attr({
  138. "src": "/data/resource/" + $da.images[0].imageSrc,
  139. "rel": "/data/resource/" + $da.images[0].imageSrc
  140. }).parent().attr("href", "/data/resource/" + $da.images[0].imageSrc);
  141. var arr = "";
  142. for(var i = 0; i < $da.images.length; i++) {
  143. if($da.images[i] == $da.images[0]) {
  144. var oString = '<li class="tb-selected">' +
  145. '<div class="tb-pic tb-s66">' +
  146. '<a href="javascript:void(0);">' +
  147. '<img src="/data/resource/' + $da.images[i].imageSrc + '"/>' +
  148. '</a>' +
  149. '</div>' +
  150. '</li>'
  151. } else {
  152. var oString = '<li >' +
  153. '<div class="tb-pic tb-s66">' +
  154. '<a href="javascript:void(0);">' +
  155. '<img src="/data/resource/' + $da.images[i].imageSrc + '"/>' +
  156. '</a>' +
  157. '</div>' +
  158. '</li>'
  159. }
  160. arr += oString;
  161. }
  162. $("#thumblist").html(arr);
  163. } else {
  164. var weibopic = "http://" + window.location.host + "../images/default-resource.jpg";
  165. $("#firstFigure").attr({
  166. "src": '../images/default-resource.jpg',
  167. "rel": '../images/default-resource.jpg'
  168. });
  169. }
  170. $("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+encodeURIComponent(weibotitle)+"&url="+encodeURIComponent(weibourl)+"&pic="+encodeURIComponent(weibopic)+"&content=utf-8"+"&ralateUid=6242830109&searchPic=false&style=simple");
  171. }
  172. /*点击名字及头像跳转个人浏览页面*/
  173. $("#nameS,#headImg").click(function() {
  174. location.href = "userInforShow.html?professorId=" + professorId;
  175. })
  176. //关键词标签点击进去搜索
  177. $(".tagList").on("click","li",function(){
  178. var tagText = $(this).find("p").text();
  179. location.href = "searchNew.html?searchContent=" + tagText + "&tagflag=2";
  180. })
  181. /*资源里面相关文章*/
  182. function relatedArticles() {
  183. $.ajax({
  184. "url": "/ajax/resource/articles",
  185. "type": "GET",
  186. "success": function(data) {
  187. console.log(data);
  188. if(data.success) {
  189. if(data.data.length == 0) {
  190. $("#oArticle").parent().hide();
  191. $(".aboutTit:contains('相关文章')").hide();
  192. return;
  193. }
  194. relatedArticlesHtml(data.data);
  195. }
  196. },
  197. "data": {
  198. "resourceId": resourceId,
  199. "rows": 5
  200. },
  201. dataType: "json",
  202. 'error': function() {
  203. $.MsgBox.Alert('提示', '服务器连接超时!');
  204. }
  205. });
  206. }
  207. relatedArticles();
  208. /*资源相关文章html*/
  209. function relatedArticlesHtml($html) {
  210. for(var i = 0; i < $html.length; i++) {
  211. (function(n) {
  212. var oURL;
  213. if($html[i].article.articleType==1) {
  214. oURL="/ajax/professor/baseInfo/" + $html[i].article.professorId;
  215. }else{
  216. oURL="/ajax/org/" + $html[i].article.orgId;
  217. }
  218. $.ajax({
  219. "url":oURL,
  220. "type": "GET",
  221. "success": function(data) {
  222. if(data.success) {
  223. var cmpname="";
  224. if(data.data.forShort){
  225. cmpname=data.data.forShort;
  226. }else{
  227. cmpname=data.data.name;
  228. }
  229. if($html[n].article.articleType==1) {
  230. var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  231. }else {
  232. var stl={};
  233. stl.sty="";
  234. stl.title="";
  235. if(data.data.authStatus==3) {
  236. stl.sty="authicon-com-ok";
  237. stl.title="认证企业";
  238. }
  239. }
  240. var str = ""
  241. str += '<li data-id="' + $html[n].article.articleId + '">'
  242. if($html[n].article.articleImg) {
  243. str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html[n].article.articleImg + ')"></div>'
  244. } else {
  245. str += '<div class="madiaHead artHead"></div>'
  246. }
  247. str += '<div class="madiaInfo" style="margin-top:18px;padding-bottom:8px">'
  248. str += '<p class="h1Font ellipsisSty">' + $html[n].article.articleTitle + '</p>'
  249. str += '<p><span class="h2Font">' + cmpname + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
  250. str += '</div></li>'
  251. $("#oArticle").append(str);
  252. }
  253. },
  254. 'dataType': "json",
  255. 'error': function() {
  256. $.MsgBox.Alert('提示', '服务器连接超时!');
  257. }
  258. });
  259. })(i);
  260. }
  261. }
  262. /*文章跳转*/
  263. $("#oArticle").on("click", "li", function() {
  264. location.href = "articalShow.html?articleId=" + $(this).attr("data-id");
  265. })
  266. /*感兴趣的资源*/
  267. function interestingResources(arry,oId,oNu) {
  268. var oUrl;
  269. var $in={};
  270. $in.keys= arry;
  271. $in.resourceId= resourceId;
  272. if(oNu==0) {
  273. $in.professorId= oId;
  274. oUrl="/ajax/resource/ralateRes";
  275. }else {
  276. $in.orgId= oId;
  277. oUrl="/ajax/resource/orgRalateRes";
  278. }
  279. $.ajax({
  280. "url": oUrl,
  281. "type": "GET",
  282. "success": function(data) {
  283. console.log(data);
  284. if(data.success) {
  285. if(data.data.length == 0) {
  286. $(".aboutTit:contains('您可能感兴趣的资源')").parent().hide();
  287. return;
  288. }
  289. interestingResourcesHtml(data.data);
  290. }
  291. },
  292. "data":$in,
  293. "traditional": true,
  294. dataType: "json",
  295. 'error': function() {
  296. $.MsgBox.Alert('提示', '服务器连接超时!');
  297. }
  298. });
  299. }
  300. /*感兴趣资源的html*/
  301. function interestingResourcesHtml($respond) {
  302. for(var i = 0; i < $respond.length; i++) {
  303. if($respond[i].organization) {
  304. var stl={};
  305. stl.sty="";
  306. stl.title="";
  307. if($respond[i].organization.authStatus==3) {
  308. stl.sty="authicon-com-ok";
  309. stl.title="认证企业";
  310. }
  311. var name="";
  312. if($respond[i].organization.forShort){
  313. name=$respond[i].organization.forShort;
  314. }else{
  315. name=$respond[i].organization.name;
  316. }
  317. }else {
  318. var stl = autho($respond[i].editProfessor.authType, $respond[i].editProfessor.orgAuth, $respond[i].editProfessor.authStatus);
  319. var name= $respond[i].editProfessor.name;
  320. }
  321. var oStr = '';
  322. if($respond[i].images.length) {
  323. oStr += '<li data-id="' + $respond[i].resourceId + '"><div class="madiaHead resouseHead"style="background-image: url(/data/resource/' + $respond[i].images[0].imageSrc + ')"></div>'
  324. } else {
  325. oStr += '<li data-id="' + $respond[i].resourceId + '"><div class="madiaHead resouseHead"></div>'
  326. }
  327. oStr += '<div class="madiaInfo">'
  328. oStr += '<p class="h1Font">' + $respond[i].resourceName + '</p>'
  329. oStr += '<p class="h2Font ellipsisSty">用途:<span>' + $respond[i].supportedServices + '</span></p>'
  330. oStr += '<p><span class="h2Font">' + name + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
  331. oStr += '</div></li>'
  332. $("#resourceList").append(oStr);
  333. }
  334. }
  335. /*点击资源列表*/
  336. $("#resourceList").on("click", "li", function() {
  337. location.href = "resourceShow.html?resourceId=" + $(this).attr("data-id");
  338. })
  339. /*点击咨询*/
  340. $("#consultin").on("click", function() {
  341. clickResouceConsultHandler();
  342. });
  343. $("#expertli").on("click", ".addbtn", function() {
  344. var $this = $(this);
  345. clickResouceConsultHandler($this);
  346. })
  347. /*咨询函数*/
  348. function clickResouceConsultHandler($this) {
  349. if(userid && userid != "null" && userid != null) {
  350. ConsultApply();
  351. if(!professorId) {
  352. concultProInfo($this.attr("data-id")); //专家信息common.js中
  353. } else {
  354. concultProInfo(professorId); //专家信息common.js中
  355. }
  356. //默认选中资源咨询和标题
  357. for(var i = 0; i < $("ul.menucon").children().length; i++) {
  358. $("ul.menucon").children().eq(i).removeClass("clicknow");
  359. $("ul.menucon").children().eq(1).addClass("clicknow");
  360. }
  361. var consultTitleVal = $("#resourceName").text();
  362. $("#consultTitle").val("关于" + consultTitleVal + "的咨询");
  363. //点击的发送
  364. $("#sendConsultBtn").click(function() {
  365. sendConsultHandler(professorId); //common.js中
  366. });
  367. } else {
  368. $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
  369. $("#mb_btn_ok").val("去登录");
  370. var aele = document.createElement('a');
  371. $("#mb_btnbox").append(aele);
  372. $("#mb_btnbox a").css({
  373. 'display': "block",
  374. 'width': '100%',
  375. 'height': '40px',
  376. 'position': 'absolute',
  377. 'bottom': '-6px',
  378. 'left': '0'
  379. });
  380. aele.setAttribute('href', '../login.html');
  381. }
  382. };
  383. //点击专家关注
  384. $('.attenSpan').click(function() {
  385. if(userid && userid != "null" && userid != null) {
  386. if($(this).is('.attenSpanyes')) {
  387. cancelCollectionExpert(professorId, 1)
  388. } else {
  389. collectionExpert(professorId, 1);
  390. }
  391. } else {
  392. $.MsgBox.Alert('提示', "请先登录再进行关注");
  393. $("#mb_btn_ok").val("去登录");
  394. var aele = document.createElement('a');
  395. $("#mb_btnbox").append(aele);
  396. $("#mb_btnbox a").css({
  397. 'display': "block",
  398. 'width': '100%',
  399. 'height': '40px',
  400. 'position': 'absolute',
  401. 'bottom': '-6px',
  402. 'left': '0'
  403. });
  404. aele.setAttribute('href', '../login.html');
  405. }
  406. })
  407. //点击资源收藏
  408. $('#attention em').click(function() {
  409. if(userid && userid != "null" && userid != null) {
  410. if($(this).is('.icon-collected')) {
  411. cancelCollectionExpert(resourceId, 2)
  412. } else {
  413. collectionExpert(resourceId, 2);
  414. }
  415. } else {
  416. $.MsgBox.Alert('提示', "请先登录再进行收藏");
  417. $("#mb_btn_ok").val("去登录");
  418. var aele = document.createElement('a');
  419. $("#mb_btnbox").append(aele);
  420. $("#mb_btnbox a").css({
  421. 'display': "block",
  422. 'width': '100%',
  423. 'height': '40px',
  424. 'position': 'absolute',
  425. 'bottom': '-6px',
  426. 'left': '0'
  427. });
  428. aele.setAttribute('href', '../login.html');
  429. }
  430. })
  431. /*判断是非关注专家*/
  432. function ifCollection(getid, num) {
  433. var data = {
  434. "professorId": userid,
  435. "watchObject": getid
  436. }
  437. //alert(JSON.stringify(data))
  438. $.ajax({
  439. url: "/ajax/watch/hasWatch",
  440. data: data,
  441. dataType: 'json', //数据格式类型
  442. type: 'get', //http请求类型
  443. timeout: 10000,
  444. async: true,
  445. success: function(data) {
  446. if(num == 1) {
  447. if(data.success && data.data != null) {
  448. $('.attenSpan').addClass("attenSpanyes");
  449. $('.attenSpan').addClass("attenedSpan");
  450. $('.attenSpan').text('已关注');
  451. zjreturnId = data.data.watchObject;
  452. } else {
  453. $('.attenSpan').removeClass("attenSpanyes");
  454. $('.attenSpan').removeClass("attenedSpan");
  455. $('.attenSpan').text('关注');
  456. }
  457. }
  458. if(num == 2) {
  459. if(data.success && data.data != null) {
  460. $('#attention em').addClass("icon-collected").removeClass("icon-collect");
  461. wzreturnId = data.data.watchObject;
  462. } else {
  463. $('#attention em').removeClass("icon-collected").addClass("icon-collect");
  464. }
  465. }
  466. },
  467. error: function() {
  468. $.MsgBox.Alert('提示', "服务器链接超时");
  469. }
  470. });
  471. }
  472. /*关注专家*/
  473. function collectionExpert(watchObject, num) {
  474. if(num == 1) {
  475. var data = {
  476. "professorId": userid,
  477. "watchObject": watchObject,
  478. "watchType": 1
  479. }
  480. } else {
  481. var data = {
  482. "professorId": userid,
  483. "watchObject": watchObject,
  484. "watchType": 2
  485. }
  486. }
  487. $.ajax({
  488. url: "/ajax/watch",
  489. data: data,
  490. dataType: 'json', //数据格式类型
  491. type: 'POST', //http请求类型
  492. timeout: 10000,
  493. async: false,
  494. success: function(data) {
  495. if(num == 1) {
  496. if(data.success) {
  497. $('.attenSpan').addClass("attenSpanyes");
  498. $('.attenSpan').addClass("attenedSpan");
  499. $('.attenSpan').text('已关注');
  500. zjreturnId = data.data.watchObject;
  501. }
  502. }
  503. if(num == 2) {
  504. if(data.success) {
  505. $('#attention em').addClass("icon-collected").removeClass("icon-collect");
  506. wzreturnId = data.data.watchObject;
  507. }
  508. }
  509. },
  510. error: function() {
  511. $.MsgBox.Alert('提示', "服务器链接超时");
  512. }
  513. });
  514. }
  515. /*取消收藏专家*/
  516. function cancelCollectionExpert(watchObject, num) {
  517. $.ajax({
  518. url: "/ajax/watch/delete",
  519. data: {
  520. professorId: userid,
  521. watchObject: watchObject
  522. },
  523. dataType: 'json', //数据格式类型
  524. type: 'post', //http请求类型
  525. timeout: 10000,
  526. async: true,
  527. success: function(data) {
  528. console.log(data.success)
  529. if(num == 1) {
  530. if(data.success) {
  531. $('.attenSpan').removeClass("attenSpanyes");
  532. $('.attenSpan').removeClass("attenedSpan");
  533. $('.attenSpan').text('关注');
  534. }
  535. }
  536. if(num == 2) {
  537. if(data.success) {
  538. $('#attention em').removeClass("icon-collected").addClass("icon-collect");
  539. }
  540. }
  541. },
  542. error: function(data) {
  543. $.MsgBox.Alert('提示', "服务器链接超时");
  544. }
  545. });
  546. }
  547. //资源浏览量
  548. function pageViewsVal() {
  549. $.ajax({
  550. "url": "/ajax/resource/pageViews",
  551. "type": "POST",
  552. "dataType": "json",
  553. "data": {
  554. "resourceId": resourceId
  555. },
  556. "success": function(data) {
  557. console.log(data);
  558. if(data.success) {}
  559. },
  560. "error": function() {
  561. $.MsgBox.Alert('提示', '链接服务器超时')
  562. }
  563. });
  564. }
  565. pageViewsVal();
  566. selUse();
  567. function selUse() {
  568. $.ajax({
  569. url: "/ajax/resource/qaLinkman",
  570. type: "GET",
  571. timeout: 10000,
  572. dataType: "json",
  573. async: true,
  574. data: {
  575. "resourceId": resourceId,
  576. },
  577. success: function(data, textState) {
  578. console.log(data)
  579. if(data.success) {
  580. unauthUser(data.data);
  581. }
  582. },
  583. error: function(XMLHttpRequest, textStats, errorThrown) {
  584. $.MsgBox.Alert('提示', '服务器请求失败')
  585. }
  586. })
  587. }
  588. function unauthUser($res) {
  589. var osting = ""
  590. for(var i = 0; i < $res.length; i++) {
  591. var img;
  592. var styC = "";
  593. var oClass = autho($res[i].professor.authType, $res[i].professor.orgAuth, $res[i].professor.authStatus);
  594. var oTitle = "";
  595. if($res[i].professor.title) {
  596. oTitle = $res[i].professor.title;
  597. } else {
  598. if($res[i].professor.office) {
  599. oTitle = $res[i].professor.office;
  600. }
  601. }
  602. if($res[i].professor.hasHeadImage) {
  603. img = "/images/head/" + $res[i].professor.id + "_l.jpg";
  604. } else {
  605. img = "../images/default-photo.jpg"
  606. }
  607. var oSt = '<li class="flexCenter">'
  608. oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url(' + img + ');"></div>'
  609. oSt += '<div class = "madiaInfo">'
  610. oSt += '<p class = "ellipsisSty">'
  611. oSt += '<span class = "h1Font" id="name">' + $res[i].professor.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em >'
  612. oSt += '</p>'
  613. oSt += '<p class="h2Font ellipsisSty">' + oTitle + '</p>'
  614. oSt += '</div>'
  615. oSt += '<span class="addbtn" data-id="' + $res[i].professor.id + '">咨询</span>'
  616. oSt += '</li>'
  617. osting += oSt;
  618. }
  619. $("#expertli").html(osting);
  620. }
  621. //纠错反馈
  622. $(".correctSubmit").on("click",function(){
  623. var cntCon=$(this).siblings(".correctCon").val();
  624. var cntUser="";
  625. if(userid && userid != null && userid != "null") {
  626. cntUser = userid;
  627. }
  628. if(cntCon.length>500){
  629. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  630. return;
  631. }else{
  632. $.ajax({
  633. "url": "/ajax/feedback/error/resource",
  634. "type": "POST",
  635. "dataType": "json",
  636. "async": true,
  637. "data": {
  638. "id": resourceId,
  639. "cnt":cntCon,
  640. "user":cntUser
  641. },
  642. "success": function(data) {
  643. if(data.success) {
  644. backSuccessed();
  645. }
  646. },
  647. "error": function() {
  648. $.MsgBox.Alert('提示', '链接服务器超时')
  649. }
  650. });
  651. }
  652. })
  653. })