portal html css js resource

sevriceShow.js 21KB

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