portal html css js resource

sevriceShow.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  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. if($da.organization.industry) {
  174. $("#Qindustry").text($da.organization.industry.replace(/,/gi, " | "));
  175. }
  176. if(userid) {
  177. ifcollectionAbout($da.organization.id, $("#enterprise").find(".attenSpan"), 6)
  178. }
  179. })
  180. }
  181. if($da.cooperation) { //合作备注
  182. $("#remarkContent").html(outHTML($da.cooperation)).parents("li").show();
  183. }
  184. if($da.keywords) {
  185. var oSub = $da.keywords.split(",");
  186. var oSt = "";
  187. for(var i = 0; i < oSub.length; i++) {
  188. oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
  189. }
  190. $(".tagList").html(oSt);
  191. }
  192. if($da.descp) { //编辑器
  193. $("#descp").html($da.descp).parents("li").show();
  194. }
  195. var weibotitle = $da.name;
  196. var weibourl = window.location.href;
  197. if($da.images) {
  198. if($da.images.split(",").length) {
  199. var weibopic = "http://" + window.location.host + "/data/ware" + $da.images.split(",")[0];
  200. $("#firstFigure").attr({
  201. "src": "/data/ware" + $da.images.split(",")[0],
  202. "rel": "/data/ware" + $da.images.split(",")[0]
  203. }).parent().attr("href", "/data/ware" + $da.images.split(",")[0]);
  204. var arr = "";
  205. for(var i = 0; i < $da.images.split(",").length; i++) {
  206. if($da.images.split(",")[i] == $da.images.split(",")[0]) {
  207. var oString = '<li class="tb-selected">' +
  208. '<div class="tb-pic tb-s66">' +
  209. '<a href="javascript:void(0);">' +
  210. '<img src="/data/ware' + $da.images.split(",")[i] + '"/>' +
  211. '</a>' +
  212. '</div>' +
  213. '</li>'
  214. } else {
  215. var oString = '<li >' +
  216. '<div class="tb-pic tb-s66">' +
  217. '<a href="javascript:void(0);">' +
  218. '<img src="/data/ware' + $da.images.split(",")[i] + '"/>' +
  219. '</a>' +
  220. '</div>' +
  221. '</li>'
  222. }
  223. arr += oString;
  224. }
  225. $("#thumblist").html(arr);
  226. }
  227. } else {
  228. var weibopic = "http://" + window.location.host + "../images/default-service.jpg";
  229. $("#firstFigure").attr({
  230. "src": '../images/default-service.jpg',
  231. "rel": '../images/default-service.jpg'
  232. });
  233. }
  234. $("#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");
  235. }
  236. /*点击名字及头像跳转个人浏览页面*/
  237. $("#nameS,#headImg").click(function() {
  238. location.href = "userInforShow.html?professorId=" + professorId;
  239. })
  240. //关键词标签点击进去搜索
  241. $(".tagList").on("click", "li", function() {
  242. var tagText = $(this).find("p").text();
  243. location.href = "searchNew.html?searchContent=" + tagText + "&tagflag=7";
  244. })
  245. seresource()
  246. /*感兴趣的资源*/
  247. function seresource() {
  248. $.ajax({
  249. "url": "/ajax/ware/res",
  250. "type": "GET",
  251. "data": {
  252. "id": sevriceId
  253. },
  254. "traditional": true,
  255. dataType: "json",
  256. "success": function(data) {
  257. if(data.success) {
  258. if(data.data.length == 0) {
  259. return;
  260. }
  261. $("#oResource").parents(".otherShow").removeClass("displayNone");
  262. for(var i = 0; i < data.data.length; i++) {
  263. (function(n) {
  264. ajaxRequist("/ajax/resource/queryOne", {
  265. "resourceId": data.data[n].resource
  266. }, "get", function(data) {
  267. sevrResource(data.data);
  268. })
  269. })(i)
  270. }
  271. }
  272. },
  273. 'error': function() {
  274. $.MsgBox.Alert('提示', '服务器连接超时!');
  275. }
  276. });
  277. }
  278. /*感兴趣资源的html*/
  279. function sevrResource($respond) {
  280. var imgL = "../images/default-resource.jpg";
  281. if($respond.images.length) {
  282. imgL = '/data/resource/' + $respond.images[0].imageSrc
  283. }
  284. var oURL;
  285. if($respond.resourceType == 1) {
  286. oURL = "/ajax/professor/baseInfo/" + $respond.professorId;
  287. } else {
  288. oURL = "/ajax/org/" + $respond.orgId;
  289. }
  290. $.ajax({
  291. "url": oURL,
  292. "type": "GET",
  293. 'dataType': "json",
  294. "success": function(data) {
  295. if(data.success) {
  296. var add = document.createElement("li");
  297. add.className = "mui-table-view-cell";
  298. add.setAttribute("data-id", $respond.resourceId);
  299. var itemlist = '<a class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url(' + imgL + ')"></div>';
  300. itemlist += '<div class="madiaInfo OmadiaInfo">';
  301. itemlist += '<p class="ellipsisSty h1Font" id="usertitle">' + $respond.resourceName + '</p>';
  302. itemlist += '<p class="ellipsisSty-2 h2Font">用途:' + $respond.supportedServices + '</p>';
  303. itemlist += '</div></a>';
  304. add.innerHTML = itemlist;
  305. document.getElementById("oResource").appendChild(add);
  306. }
  307. },
  308. 'error': function() {
  309. $.MsgBox.Alert('提示', '服务器连接超时!');
  310. }
  311. });
  312. }
  313. /*点击资源列表*/
  314. $("#oResource").on("click", "li", function() {
  315. location.href = "resourceShow.html?resourceId=" + $(this).attr("data-id");
  316. })
  317. /*服务里面相关文章*/
  318. function relatedArticles() {
  319. $.ajax({
  320. "url": "/ajax/article/lq/byWare",
  321. "type": "GET",
  322. "data": {
  323. "ware": sevriceId,
  324. "rows": 5
  325. },
  326. dataType: "json",
  327. "success": function(data) {
  328. if(data.success) {
  329. if(data.data.length > 0) {
  330. var $data=data.data;
  331. $("#oArticle").parents(".otherShow").removeClass("displayNone");
  332. for(var i = 0; i < $data.length; i++) {
  333. var str = "",ovel="";
  334. /*if($data[i].pageViews) {
  335. ovel="阅读量 "+$data[i].pageViews;
  336. }*/
  337. str += '<li data-id="' + $data[i].articleId + '" data-createTime="' + $data[i].createTime + '" data-shareId="' + $data[i].shareId + '"><a class="flexCenter OflexCenter">'
  338. if( $data[i].articleImg) {
  339. str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $data[i].articleImg + ')"></div>'
  340. } else {
  341. str += '<div class="madiaHead artHead"></div>'
  342. }
  343. str += '<div class="madiaInfo" style="margin-top:18px;padding-bottom:8px">'
  344. str += '<p class="h1Font ellipsisSty">' + $data[i].articleTitle + '</p>'
  345. 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>'
  346. str += '</div></a></li>'
  347. //<span class="yue" style="margin-right:10px">'+ovel+'</span><span class="zan" style="margin-right:10px"></span><span class="leword"></span>
  348. var $str=$(str);
  349. $("#oArticle").append($str);
  350. (function($str,i) {
  351. if($data[i].articleType=="1") {
  352. ajaxRequist("/ajax/professor/baseInfo/" + $data[i].ownerId, {}, "get", function(data) {
  353. $str.find(".name").text(data.data.name);
  354. })
  355. }else if($data[i].articleType=="2"){
  356. ajaxRequist("/ajax/org/" + $data[i].ownerId, {}, "get", function(data) {
  357. if(data.data.forShort) {
  358. $str.find(".name").text(data.data.forShort);
  359. }else{
  360. $str.find(".name").text(data.data.name);
  361. }
  362. })
  363. }else if($data[i].articleType=="3"){
  364. ajaxRequist("/ajax/platform/info", {id:$data[i].ownerId}, "get", function(data) {
  365. $str.find(".name").text(data.data.name);
  366. })
  367. }
  368. /*if($data[i].articleAgree) {
  369. $str.find(".zan").text('赞 ' + $data[i].articleAgree);
  370. }
  371. ajaxRequist("/ajax/leavemsg/count" , {sid:$data[i].articleId,stype:1}, "get", function(data) {
  372. if(data.data) {
  373. $str.find(".leword").text('留言 ' + data.data);
  374. }
  375. })*/
  376. })($str,i)
  377. }
  378. }
  379. }
  380. },
  381. 'error': function() {
  382. $.MsgBox.Alert('提示', '服务器连接超时!');
  383. }
  384. });
  385. }
  386. /*文章跳转*/
  387. $("#oArticle").on("click", "li", function() {
  388. var oArticle = {
  389. shareId: $(this).attr("data-shareId"),
  390. createTime: $(this).attr("data-createTime")
  391. };
  392. location.href = "/" + pageUrl('a', oArticle)
  393. })
  394. /*感兴趣的服务*/
  395. function interestingResources() {
  396. $.ajax({
  397. "url": "/ajax/ware/ralateWare",
  398. "type": "GET",
  399. "data": {
  400. "id": sevriceId,
  401. "rows": 5
  402. },
  403. "traditional": true,
  404. dataType: "json",
  405. "success": function(data) {
  406. if(data.success) {
  407. if(data.data.length == 0) {
  408. return;
  409. }
  410. $("#relateArt").parents(".otherShow").removeClass("displayNone");
  411. var arr = [];
  412. for(var i = 0; i < data.data.length; i++) {
  413. arr.push(data.data[i].id)
  414. }
  415. ajaxRequist("/ajax/ware/qm", {
  416. "id": arr
  417. }, "get", function(data) {
  418. for(var i = 0; i < data.data.length; i++)
  419. (function(i) {
  420. interestingResourcesHtml(data.data[i]);
  421. })(i)
  422. })
  423. }
  424. },
  425. 'error': function() {
  426. $.MsgBox.Alert('提示', '服务器连接超时!');
  427. }
  428. });
  429. }
  430. /*感兴趣资源的html*/
  431. function interestingResourcesHtml($respond) {
  432. var imgL = "../images/default-service.jpg";
  433. if($respond.images) {
  434. if($respond.images.split(",").length) {
  435. imgL = '/data/ware' + $respond.images.split(",")[0]
  436. }
  437. }
  438. var oURL;
  439. if($respond.category == 1) {
  440. oURL = "/ajax/professor/baseInfo/" + $respond.owner;
  441. } else {
  442. oURL = "/ajax/org/" + $respond.owner;
  443. }
  444. $.ajax({
  445. "url": oURL,
  446. "type": "GET",
  447. 'dataType': "json",
  448. "success": function(data) {
  449. if(data.success) {
  450. var thisName, userType, thisAuth, thisTitle
  451. if(data.data.forShort) {
  452. thisName = data.data.forShort;
  453. } else {
  454. thisName = data.data.name;
  455. }
  456. if($respond.resourceType == 1) {
  457. userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  458. thisTitle = userType.title;
  459. thisAuth = userType.sty;
  460. } else {
  461. if(data.data.authStatus == 3) {
  462. thisTitle = "科袖认证企业";
  463. thisAuth = "authicon-com-ok";
  464. }
  465. }
  466. if($respond.cnt) {
  467. var cnt = "内容:" + $respond.cnt;
  468. } else {
  469. var cnt = ""
  470. }
  471. var add = document.createElement("li");
  472. add.className = "mui-table-view-cell";
  473. add.setAttribute("data-id", $respond.id);
  474. var itemlist = '<a class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url(' + imgL + ')"></div>';
  475. itemlist += '<div class="madiaInfo OmadiaInfo">';
  476. itemlist += '<p class="ellipsisSty h1Font" id="usertitle">' + $respond.name + '</p>';
  477. itemlist += '<p><span class="h2Font">' + thisName + '</span><em class="authiconNew ' + thisAuth + '" title="' + thisTitle + '"></em></p>';
  478. itemlist += '<p class="ellipsisSty-2 h2Font ">' + cnt + '</p>';
  479. itemlist += '</div></a>';
  480. add.innerHTML = itemlist;
  481. document.getElementById("relateArt").appendChild(add);
  482. }
  483. },
  484. 'error': function() {
  485. $.MsgBox.Alert('提示', '服务器连接超时!');
  486. }
  487. });
  488. }
  489. /*点击资源列表*/
  490. $("#relateArt").on("click", "li", function() {
  491. location.href = "sevriceShow.html?sevriceId=" + $(this).attr("data-id");
  492. })
  493. /*点击咨询*/
  494. $("#consultin").on('click', function() {
  495. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  496. location.href = "tidings.html?id=" + professorId
  497. } else {
  498. quickLog();
  499. operatTab();
  500. closeLog();
  501. }
  502. });
  503. $("#expertli").on("click", ".addbtn", function(event) {
  504. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  505. var id = $(this).attr("data-id");
  506. location.href = "tidings.html?id=" + id;
  507. } else {
  508. quickLog();
  509. operatTab();
  510. closeLog();
  511. }
  512. event.stopPropagation()
  513. });
  514. $("#expertli").on("click", "li", function() {
  515. var id = $(this).attr("data-id");
  516. location.href = "userInforShow.html?professorId=" + id;
  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(sevriceId, $(this), 10)
  550. } else {
  551. collectionAbout(sevriceId, $(this), 10)
  552. }
  553. } else {
  554. quickLog();
  555. operatTab();
  556. closeLog();
  557. }
  558. })
  559. selUse();
  560. function selUse() {
  561. $.ajax({
  562. url: "/ajax/ware/pro",
  563. type: "GET",
  564. timeout: 10000,
  565. dataType: "json",
  566. async: true,
  567. data: {
  568. "id": sevriceId,
  569. },
  570. success: function(data, textState) {
  571. if(data.success) {
  572. if(data.data.length > 0) {
  573. $("#expertli").parents(".currentBlock").removeClass("displayNone");
  574. unauthUser(data.data);
  575. } else {
  576. $("#expertli").parents(".currentBlock").addClass("displayNone");
  577. }
  578. }
  579. },
  580. error: function(XMLHttpRequest, textStats, errorThrown) {
  581. $.MsgBox.Alert('提示', '服务器请求失败')
  582. }
  583. })
  584. }
  585. function unauthUser(data) {
  586. for(var i = 0; i < data.length; i++) {
  587. (function(i) {
  588. ajaxRequist("/ajax/professor/baseInfo/" + data[i].professor, {}, "get", function(data) {
  589. var $res=data.data;
  590. var osting = ""
  591. var img;
  592. var styC = "";
  593. var oClass = autho($res.authType, $res.orgAuth, $res.authStatus);
  594. var oTitle = "";
  595. if($res.title) {
  596. oTitle = $res.title;
  597. } else {
  598. if($res.office) {
  599. oTitle = $res.office;
  600. }
  601. }
  602. if($res.hasHeadImage) {
  603. img = "/images/head/" + $res.id + "_l.jpg";
  604. } else {
  605. img = "../images/default-photo.jpg"
  606. }
  607. var oSt = '<li class="flexCenter" data-id="' + $res.id + '">'
  608. oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url(' + img + ');"></div>'
  609. oSt += '<div class = "madiaInfo">'
  610. oSt += '<p class = "ellipsisSty">'
  611. oSt += '<span class = "h1Font" id="name">' + $res.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em >'
  612. oSt += '</p>'
  613. oSt += '<p class="h2Font ellipsisSty">' + oTitle + '</p>'
  614. oSt += '</div>'
  615. if(userid !=$res.id)
  616. oSt += '<span class="addbtn" data-id="' + $res.id + '">联系</span>'
  617. oSt += '</li>'
  618. osting += oSt;
  619. $("#expertli").append(osting);
  620. })
  621. })(i)
  622. }
  623. }
  624. //纠错反馈
  625. $(".correctSubmit").on("click", function() {
  626. var cntCon = $(this).siblings(".correctCon").val();
  627. var cntUser = "";
  628. if(userid && userid != null && userid != "null") {
  629. cntUser = userid;
  630. }
  631. if(cntCon.length > 500) {
  632. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  633. return;
  634. } else {
  635. $.ajax({
  636. "url": "/ajax/feedback/error/ware",
  637. "type": "POST",
  638. "dataType": "json",
  639. "async": true,
  640. "data": {
  641. "id": sevriceId,
  642. "cnt": cntCon,
  643. "user": cntUser
  644. },
  645. "success": function(data) {
  646. if(data.success) {
  647. backSuccessed();
  648. }
  649. },
  650. "error": function() {
  651. $.MsgBox.Alert('提示', '链接服务器超时')
  652. }
  653. });
  654. }
  655. })
  656. })