portal html css js resource

sevriceShow.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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].professorId, {}, "get", function(data) {
  352. $str.find(".name").text(data.data.name);
  353. })
  354. }else{
  355. ajaxRequist("/ajax/org/" + $data[i].orgId, {}, "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. }
  363. /*if($data[i].articleAgree) {
  364. $str.find(".zan").text('赞 ' + $data[i].articleAgree);
  365. }
  366. ajaxRequist("/ajax/leavemsg/count" , {sid:$data[i].articleId,stype:1}, "get", function(data) {
  367. if(data.data) {
  368. $str.find(".leword").text('留言 ' + data.data);
  369. }
  370. })*/
  371. })($str,i)
  372. }
  373. }
  374. }
  375. },
  376. 'error': function() {
  377. $.MsgBox.Alert('提示', '服务器连接超时!');
  378. }
  379. });
  380. }
  381. /*文章跳转*/
  382. $("#oArticle").on("click", "li", function() {
  383. var oArticle = {
  384. shareId: $(this).attr("data-shareId"),
  385. createTime: $(this).attr("data-createTime")
  386. };
  387. location.href = "/" + pageUrl('a', oArticle)
  388. })
  389. /*感兴趣的服务*/
  390. function interestingResources() {
  391. $.ajax({
  392. "url": "/ajax/ware/ralateWare",
  393. "type": "GET",
  394. "data": {
  395. "id": sevriceId,
  396. "rows": 5
  397. },
  398. "traditional": true,
  399. dataType: "json",
  400. "success": function(data) {
  401. if(data.success) {
  402. if(data.data.length == 0) {
  403. return;
  404. }
  405. $("#relateArt").parents(".otherShow").removeClass("displayNone");
  406. var arr = [];
  407. for(var i = 0; i < data.data.length; i++) {
  408. arr.push(data.data[i].id)
  409. }
  410. ajaxRequist("/ajax/ware/qm", {
  411. "id": arr
  412. }, "get", function(data) {
  413. for(var i = 0; i < data.data.length; i++)
  414. (function(i) {
  415. interestingResourcesHtml(data.data[i]);
  416. })(i)
  417. })
  418. }
  419. },
  420. 'error': function() {
  421. $.MsgBox.Alert('提示', '服务器连接超时!');
  422. }
  423. });
  424. }
  425. /*感兴趣资源的html*/
  426. function interestingResourcesHtml($respond) {
  427. var imgL = "../images/default-service.jpg";
  428. if($respond.images) {
  429. if($respond.images.split(",").length) {
  430. imgL = '/data/ware' + $respond.images.split(",")[0]
  431. }
  432. }
  433. var oURL;
  434. if($respond.category == 1) {
  435. oURL = "/ajax/professor/baseInfo/" + $respond.owner;
  436. } else {
  437. oURL = "/ajax/org/" + $respond.owner;
  438. }
  439. $.ajax({
  440. "url": oURL,
  441. "type": "GET",
  442. 'dataType': "json",
  443. "success": function(data) {
  444. if(data.success) {
  445. var thisName, userType, thisAuth, thisTitle
  446. if(data.data.forShort) {
  447. thisName = data.data.forShort;
  448. } else {
  449. thisName = data.data.name;
  450. }
  451. if($respond.resourceType == 1) {
  452. userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  453. thisTitle = userType.title;
  454. thisAuth = userType.sty;
  455. } else {
  456. if(data.data.authStatus == 3) {
  457. thisTitle = "科袖认证企业";
  458. thisAuth = "authicon-com-ok";
  459. }
  460. }
  461. if($respond.cnt) {
  462. var cnt = "内容:" + $respond.cnt;
  463. } else {
  464. var cnt = ""
  465. }
  466. var add = document.createElement("li");
  467. add.className = "mui-table-view-cell";
  468. add.setAttribute("data-id", $respond.id);
  469. var itemlist = '<a class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url(' + imgL + ')"></div>';
  470. itemlist += '<div class="madiaInfo OmadiaInfo">';
  471. itemlist += '<p class="ellipsisSty h1Font" id="usertitle">' + $respond.name + '</p>';
  472. itemlist += '<p><span class="h2Font">' + thisName + '</span><em class="authiconNew ' + thisAuth + '" title="' + thisTitle + '"></em></p>';
  473. itemlist += '<p class="ellipsisSty-2 h2Font ">' + cnt + '</p>';
  474. itemlist += '</div></a>';
  475. add.innerHTML = itemlist;
  476. document.getElementById("relateArt").appendChild(add);
  477. }
  478. },
  479. 'error': function() {
  480. $.MsgBox.Alert('提示', '服务器连接超时!');
  481. }
  482. });
  483. }
  484. /*点击资源列表*/
  485. $("#relateArt").on("click", "li", function() {
  486. location.href = "sevriceShow.html?sevriceId=" + $(this).attr("data-id");
  487. })
  488. /*点击咨询*/
  489. $("#consultin").on('click', function() {
  490. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  491. location.href = "tidings.html?id=" + professorId
  492. } else {
  493. quickLog();
  494. operatTab();
  495. closeLog();
  496. }
  497. });
  498. $("#expertli").on("click", ".addbtn", function() {
  499. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  500. var id = $(this).attr("data-id");
  501. location.href = "tidings.html?id=" + id;
  502. } else {
  503. quickLog();
  504. operatTab();
  505. closeLog();
  506. }
  507. });
  508. //点击专家关注
  509. $("#person").on("click", '.attenSpan', function() {
  510. if(userid && userid != "null" && userid != null) {
  511. if($(this).is('.attenedSpan')) {
  512. cancelCollectionAbout(professorId, $(this), 1)
  513. } else {
  514. collectionAbout(professorId, $(this), 1);
  515. }
  516. } else {
  517. quickLog();
  518. operatTab();
  519. closeLog();
  520. }
  521. });
  522. $("#enterprise").on("click", '.attenSpan', function() {
  523. if(userid && userid != "null" && userid != null) {
  524. if($(this).is('.attenedSpan')) {
  525. cancelCollectionAbout($(".qiyego").attr('dataid'), $(this), 6)
  526. } else {
  527. collectionAbout($(".qiyego").attr('dataid'), $(this), 6);
  528. }
  529. } else {
  530. quickLog();
  531. operatTab();
  532. closeLog();
  533. }
  534. })
  535. //点击资源收藏
  536. $('#attention em').click(function() {
  537. if(userid && userid != "null" && userid != null) {
  538. if($(this).is('.icon-collected')) {
  539. cancelCollectionAbout(sevriceId, $(this), 10)
  540. } else {
  541. collectionAbout(sevriceId, $(this), 10)
  542. }
  543. } else {
  544. quickLog();
  545. operatTab();
  546. closeLog();
  547. }
  548. })
  549. selUse();
  550. function selUse() {
  551. $.ajax({
  552. url: "/ajax/ware/pro",
  553. type: "GET",
  554. timeout: 10000,
  555. dataType: "json",
  556. async: true,
  557. data: {
  558. "id": sevriceId,
  559. },
  560. success: function(data, textState) {
  561. if(data.success) {
  562. if(data.data.length > 0) {
  563. $("#expertli").parents(".currentBlock").removeClass("displayNone");
  564. unauthUser(data.data);
  565. } else {
  566. $("#expertli").parents(".currentBlock").addClass("displayNone");
  567. }
  568. }
  569. },
  570. error: function(XMLHttpRequest, textStats, errorThrown) {
  571. $.MsgBox.Alert('提示', '服务器请求失败')
  572. }
  573. })
  574. }
  575. function unauthUser(data) {
  576. for(var i = 0; i < data.length; i++) {
  577. (function(i) {
  578. ajaxRequist("/ajax/professor/baseInfo/" + data[i].professor, {}, "get", function(data) {
  579. var $res=data.data;
  580. var osting = ""
  581. var img;
  582. var styC = "";
  583. var oClass = autho($res.authType, $res.orgAuth, $res.authStatus);
  584. var oTitle = "";
  585. if($res.title) {
  586. oTitle = $res.title;
  587. } else {
  588. if($res.office) {
  589. oTitle = $res.office;
  590. }
  591. }
  592. if($res.hasHeadImage) {
  593. img = "/images/head/" + $res.id + "_l.jpg";
  594. } else {
  595. img = "../images/default-photo.jpg"
  596. }
  597. var oSt = '<li class="flexCenter">'
  598. oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url(' + img + ');"></div>'
  599. oSt += '<div class = "madiaInfo">'
  600. oSt += '<p class = "ellipsisSty">'
  601. oSt += '<span class = "h1Font" id="name">' + $res.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em >'
  602. oSt += '</p>'
  603. oSt += '<p class="h2Font ellipsisSty">' + oTitle + '</p>'
  604. oSt += '</div>'
  605. oSt += '<span class="addbtn" data-id="' + $res.id + '">联系</span>'
  606. oSt += '</li>'
  607. osting += oSt;
  608. $("#expertli").html(osting);
  609. })
  610. })(i)
  611. }
  612. }
  613. //纠错反馈
  614. $(".correctSubmit").on("click", function() {
  615. var cntCon = $(this).siblings(".correctCon").val();
  616. var cntUser = "";
  617. if(userid && userid != null && userid != "null") {
  618. cntUser = userid;
  619. }
  620. if(cntCon.length > 500) {
  621. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  622. return;
  623. } else {
  624. $.ajax({
  625. "url": "/ajax/feedback/error/ware",
  626. "type": "POST",
  627. "dataType": "json",
  628. "async": true,
  629. "data": {
  630. "id": sevriceId,
  631. "cnt": cntCon,
  632. "user": cntUser
  633. },
  634. "success": function(data) {
  635. if(data.success) {
  636. backSuccessed();
  637. }
  638. },
  639. "error": function() {
  640. $.MsgBox.Alert('提示', '链接服务器超时')
  641. }
  642. });
  643. }
  644. })
  645. })