portal html css js resource

sevriceShow.js 21KB

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