portal html css js resource

resourceShow.js 21KB

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