portal html css js resource

resourceShow.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  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.ownerId;
  272. }else if($html.articleType==2) {
  273. oURL="/ajax/org/" + $html.ownerId;
  274. }else if($html.articleType==2) {
  275. oURL="/ajax/platform/info";
  276. }
  277. $.ajax({
  278. "url":oURL,
  279. "data":{id:$html.ownerId},
  280. "type": "GET",
  281. "success": function(data) {
  282. if(data.success) {
  283. var cmpname="";
  284. if(data.data.forShort){
  285. cmpname=data.data.forShort;
  286. }else{
  287. cmpname=data.data.name;
  288. }
  289. if($html.articleType==1) {
  290. var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  291. }else if($html.articleType==2){
  292. var stl={};
  293. stl.sty="";
  294. stl.title="";
  295. if(data.data.authStatus==3) {
  296. stl.sty="authicon-com-ok";
  297. stl.title="认证企业";
  298. }
  299. }else if($html.articleType==3){
  300. var stl={};
  301. stl.sty="";
  302. stl.title="";
  303. }
  304. var str = ""
  305. str += '<li data-id="' + $html.articleId + '" data-createTime="' + $html.createTime + '" data-shareId="' + $html.shareId + '"><a class="flexCenter OflexCenter">'
  306. if($html.articleImg) {
  307. str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html.articleImg + ')"></div>'
  308. } else {
  309. str += '<div class="madiaHead artHead"></div>'
  310. }
  311. str += '<div class="madiaInfo" style="margin-top:18px;padding-bottom:8px">'
  312. str += '<p class="h1Font ellipsisSty">' + $html.articleTitle + '</p>'
  313. str += '<p><span class="h2Font" style="margin-right:10px">'+ cmpname +'</span><span class="time">'+commenTime($html.publishTime)+'</span></p>'
  314. str += '</div></a></li>'
  315. $("#oArticle").append(str);
  316. }
  317. },
  318. 'dataType': "json",
  319. 'error': function() {
  320. $.MsgBox.Alert('提示', '服务器连接超时!');
  321. }
  322. });
  323. }
  324. /*文章跳转*/
  325. $("#oArticle").on("click", "li", function() {
  326. var oArticle={
  327. shareId:$(this).attr("data-shareId"),
  328. createTime:$(this).attr("data-createTime")
  329. };
  330. location.href = "/"+pageUrl('a',oArticle)
  331. })
  332. /*服务跳转*/
  333. $("#oService").on("click", "li", function() {
  334. location.href = "sevriceShow.html?sevriceId=" + $(this).attr("data-id");
  335. })
  336. /*资源里面相关服务*/
  337. function relatedServices() {
  338. $.ajax({
  339. "url": "/ajax/ware/byResourceWithModifyTime",
  340. "type": "GET",
  341. "data": {
  342. "id": resourceId,
  343. "rows":5
  344. },
  345. dataType: "json",
  346. "success": function(data) {
  347. console.log(data);
  348. if(data.success) {
  349. if(data.data.length> 0) {
  350. $("#oService").parents(".otherShow").removeClass("displayNone");
  351. var StrData = data.data
  352. var lengthT;
  353. if(StrData.length>5){
  354. lengthT=5;
  355. }else{
  356. lengthT=StrData.length
  357. }
  358. for(var i = 0; i < lengthT; i++) {
  359. var $html=StrData[i]
  360. var cnt="", img="../images/default-service.jpg"
  361. if($html.images) {
  362. var subs = strToAry($html.images)
  363. if(subs.length > 0) {
  364. img="/data/ware" + subs[0]
  365. }
  366. }
  367. if($html.cnt){
  368. cnt="内容:"+$html.cnt
  369. }
  370. var itemlist = '<li data-id="'+$html.id+'">'
  371. itemlist += '<a class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url('+img+')"></div>';
  372. itemlist += '<div class="madiaInfo OmadiaInfo">';
  373. itemlist += '<p class="ellipsisSty h1Font" id="usertitle">'+$html.name+'</p>';
  374. itemlist += '<p><span class="h2Font ownerName"></span><em class="ownerSty authiconNew"></em></p>';
  375. itemlist += '<p class="ellipsisSty-2 h2Font">'+cnt+'</p>';
  376. itemlist += '</div></a></li>';
  377. var $itemlist = $(itemlist);
  378. $("#oService").append($itemlist)
  379. if($html.category=="1"){
  380. (function(mo){
  381. cacheModel.getProfessor($html.owner,function(sc,value){
  382. if(sc){
  383. mo.find(".ownerName").html(value.name)
  384. var userType = autho(value.authType, value.orgAuth, value.authStatus);
  385. mo.find(".ownerSty").addClass(userType.sty).attr("title",userType.title)
  386. }else{
  387. console.log("error")
  388. }
  389. })
  390. })($itemlist);
  391. }else if($html.category=="2"){
  392. (function(mo){
  393. cacheModel.getCompany($html.owner,function(sc,value){
  394. if(sc){
  395. if(value.forShort){
  396. mo.find(".ownerName").html(value.forShort)
  397. }else{
  398. mo.find(".ownerName").html(value.name)
  399. }
  400. if(value.authStatus==3) {
  401. mo.find(".ownerSty").addClass("authicon-com-ok").attr("title","科袖认证企业")
  402. }
  403. }else{
  404. console.log("error")
  405. }
  406. })
  407. })($itemlist);
  408. }
  409. }
  410. }
  411. }
  412. }
  413. });
  414. }
  415. /*感兴趣的资源*/
  416. function interestingResources() {
  417. $.ajax({
  418. "url": "/ajax/resource/ralateResources",
  419. "type": "GET",
  420. "data":{"resourceId": resourceId},
  421. "traditional": true,
  422. dataType: "json",
  423. "success": function(data) {
  424. //console.log(data);
  425. if(data.success) {
  426. if(data.data.length == 0) {
  427. return;
  428. }
  429. $("#relateArt").parents(".otherShow").removeClass("displayNone");
  430. var StrData = data.data
  431. var lengthT;
  432. if(StrData.length>5){
  433. lengthT=5;
  434. }else{
  435. lengthT=StrData.length
  436. }
  437. for(var i = 0; i < lengthT; i++) {
  438. interestingResourcesHtml(StrData[i]);
  439. }
  440. }
  441. },
  442. 'error': function() {
  443. $.MsgBox.Alert('提示', '服务器连接超时!');
  444. }
  445. });
  446. }
  447. /*感兴趣资源的html*/
  448. function interestingResourcesHtml($respond) {
  449. var imgL="../images/default-resource.jpg";
  450. if($respond.images.length){
  451. imgL='/data/resource/' + $respond.images[0].imageSrc
  452. }
  453. var oURL;
  454. if($respond.resourceType==1) {
  455. oURL="/ajax/professor/baseInfo/"+$respond.professorId;
  456. }else{
  457. oURL="/ajax/org/" + $respond.orgId;
  458. }
  459. $.ajax({
  460. "url":oURL,
  461. "type": "GET",
  462. 'dataType': "json",
  463. "success": function(data) {
  464. if(data.success){
  465. //console.log(data)
  466. var thisName,userType,thisAuth,thisTitle
  467. if(data.data.forShort){
  468. thisName=data.data.forShort;
  469. }else{
  470. thisName=data.data.name;
  471. }
  472. if($respond.resourceType==1) {
  473. userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  474. thisTitle = userType.title;
  475. thisAuth = userType.sty;
  476. }else {
  477. if(data.data.authStatus==3) {
  478. thisTitle = "科袖认证企业";
  479. thisAuth = "authicon-com-ok";
  480. }
  481. }
  482. var add = document.createElement("li");
  483. add.className = "mui-table-view-cell";
  484. add.setAttribute("data-id",$respond.resourceId);
  485. var itemlist = '<a class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url('+imgL+')"></div>';
  486. itemlist += '<div class="madiaInfo OmadiaInfo">';
  487. itemlist += '<p class="ellipsisSty h1Font" id="usertitle">'+$respond.resourceName+'</p>';
  488. itemlist += '<p><span class="h2Font">'+thisName+'</span><em class="authiconNew '+thisAuth+'" title="'+thisTitle+'"></em></p>';
  489. itemlist += '<p class="ellipsisSty-2 h2Font">用途:'+$respond.supportedServices+'</p>';
  490. itemlist += '</div></a>';
  491. add.innerHTML=itemlist;
  492. document.getElementById("relateArt").appendChild(add);
  493. }
  494. },
  495. 'error': function() {
  496. $.MsgBox.Alert('提示', '服务器连接超时!');
  497. }
  498. });
  499. }
  500. /*点击资源列表*/
  501. $("#relateArt").on("click", "li", function() {
  502. location.href = "resourceShow.html?resourceId=" + $(this).attr("data-id");
  503. })
  504. /*点击咨询*/
  505. $("#consultin").on('click', function(){
  506. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  507. location.href="tidings.html?id="+professorId
  508. } else {
  509. quickLog();
  510. operatTab();
  511. closeLog();
  512. }
  513. });
  514. $("#expertli").on("click",".addbtn",function() {
  515. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  516. var id=$(this).attr("data-id");
  517. location.href="tidings.html?id="+id;
  518. } else {
  519. quickLog();
  520. operatTab();
  521. closeLog();
  522. }
  523. });
  524. //点击专家关注
  525. $("#person").on("click",'.attenSpan',function() {
  526. if(userid && userid != "null" && userid != null) {
  527. if($(this).is('.attenedSpan')){
  528. cancelCollectionAbout(professorId,$(this), 1)
  529. } else {
  530. collectionAbout(professorId,$(this),1);
  531. }
  532. } else {
  533. quickLog();
  534. operatTab();
  535. closeLog();
  536. }
  537. })
  538. $("#enterprise").on("click",'.attenSpan',function() {
  539. if(userid && userid != "null" && userid != null) {
  540. if($(this).is('.attenedSpan')){
  541. cancelCollectionAbout($(".qiyego").attr('dataid'),$(this), 6)
  542. } else {
  543. collectionAbout($(".qiyego").attr('dataid'),$(this),6);
  544. }
  545. } else {
  546. quickLog();
  547. operatTab();
  548. closeLog();
  549. }
  550. })
  551. //点击资源收藏
  552. $('#attention em').click(function() {
  553. if (userid && userid != "null" && userid != null) {
  554. if($(this).is('.icon-collected')){
  555. cancelCollectionAbout(resourceId,$(this),2)
  556. }else{
  557. collectionAbout(resourceId,$(this),2)
  558. }
  559. } else {
  560. quickLog();
  561. operatTab();
  562. closeLog();
  563. }
  564. })
  565. selUse();
  566. function selUse() {
  567. $.ajax({
  568. url: "/ajax/resource/qaLinkman",
  569. type: "GET",
  570. timeout: 10000,
  571. dataType: "json",
  572. async: true,
  573. data: {
  574. "resourceId": resourceId,
  575. },
  576. success: function(data, textState) {
  577. console.log(data)
  578. if(data.success) {
  579. if(data.data.length>0){
  580. $("#expertli").parents(".currentBlock").removeClass("displayNone");
  581. unauthUser(data.data);
  582. }else{
  583. $("#expertli").parents(".currentBlock").addClass("displayNone");
  584. }
  585. }
  586. },
  587. error: function(XMLHttpRequest, textStats, errorThrown) {
  588. $.MsgBox.Alert('提示', '服务器请求失败')
  589. }
  590. })
  591. }
  592. function unauthUser($res) {
  593. var osting = ""
  594. for(var i = 0; i < $res.length; i++) {
  595. var img;
  596. var styC = "";
  597. var oClass = autho($res[i].professor.authType, $res[i].professor.orgAuth, $res[i].professor.authStatus);
  598. var oTitle = "";
  599. if($res[i].professor.title) {
  600. oTitle = $res[i].professor.title;
  601. } else {
  602. if($res[i].professor.office) {
  603. oTitle = $res[i].professor.office;
  604. }
  605. }
  606. if($res[i].professor.hasHeadImage) {
  607. img = "/images/head/" + $res[i].professor.id + "_l.jpg";
  608. } else {
  609. img = "../images/default-photo.jpg"
  610. }
  611. var oSt = '<li class="flexCenter">'
  612. oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url(' + img + ');"></div>'
  613. oSt += '<div class = "madiaInfo">'
  614. oSt += '<p class = "ellipsisSty">'
  615. oSt += '<span class = "h1Font" id="name">' + $res[i].professor.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em >'
  616. oSt += '</p>'
  617. oSt += '<p class="h2Font ellipsisSty">' + oTitle + '</p>'
  618. oSt += '</div>'
  619. oSt += '<span class="addbtn" data-id="' + $res[i].professor.id + '">联系</span>'
  620. oSt += '</li>'
  621. osting += oSt;
  622. }
  623. $("#expertli").html(osting);
  624. }
  625. //纠错反馈
  626. $(".correctSubmit").on("click",function(){
  627. var cntCon=$(this).siblings(".correctCon").val();
  628. var cntUser="";
  629. if(userid && userid != null && userid != "null") {
  630. cntUser = userid;
  631. }
  632. if(cntCon.length>500){
  633. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  634. return;
  635. }else{
  636. $.ajax({
  637. "url": "/ajax/feedback/error/resource",
  638. "type": "POST",
  639. "dataType": "json",
  640. "async": true,
  641. "data": {
  642. "id": resourceId,
  643. "cnt":cntCon,
  644. "user":cntUser
  645. },
  646. "success": function(data) {
  647. if(data.success) {
  648. backSuccessed();
  649. }
  650. },
  651. "error": function() {
  652. $.MsgBox.Alert('提示', '链接服务器超时')
  653. }
  654. });
  655. }
  656. })
  657. })