portal html css js resource

cmpInforShow.js 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. $(function() {
  2. loginStatus(); //判断个人是否登录
  3. var userid = $.cookie("userid");
  4. var orgId = GetQueryString("orgId");
  5. if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
  6. location.href="http://" + window.location.host + "/e/c.html?id="+orgId;
  7. }
  8. var oName = "";
  9. var watchType=0;
  10. if(orgId) {
  11. getCmpInfo(orgId); //获取详细信息
  12. getResource( 10,1, true); //获取发布的资源
  13. getArticle(10, 1, true); //获取发布的文章
  14. getDemands(10,1,true)//获取发布的需求
  15. relevantarticalList();//相关文章
  16. likeExperts();//感兴趣专家
  17. attentMy();
  18. ifcollectionAbout(orgId,$(".goSpan").find(".attenSpan"),6);
  19. $(".navconBox").on("click","li",function(){
  20. $(this).addClass("liNow").siblings().removeClass("liNow");
  21. $(".leftconBox .leftconItem").eq($(".navconBox li").index(this)).show().siblings().hide();
  22. })
  23. $(".navconBox>.mainNavUl").on("click","li:not('.rightbtn')",function(){
  24. $(".moreNav").hide();
  25. })
  26. $(".navconBox>.mainNavUl").on("click","li.rightbtn",function(){
  27. $(".moreNav").show();
  28. })
  29. $(".moreNavUl").on("click","li",function(){//获取关注对象类型标志
  30. watchType=$(this).attr("data-num");
  31. $("#item7user>.coninfobox").show();
  32. attentMy()
  33. })
  34. $("#attendmyGo").on("click",function(){
  35. $(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
  36. $(".navconBox .moreNav").show();
  37. $("#item7user").show().siblings().hide();
  38. $(".moreNavUl li.attendMy").addClass("liNow").siblings().removeClass("liNow");
  39. $("#item7user>.coninfobox").eq(7).show().siblings().hide();
  40. attentMy();
  41. })
  42. //点击关注按钮
  43. $("#attentBtn").on('click', function() {
  44. if(userid && userid != null && userid != "null") {
  45. if($(this).is('.attenedSpan')){
  46. cancelCollectionAbout(orgId,$(this),6)
  47. } else {
  48. collectionAbout(orgId,$(this), 6);
  49. }
  50. guanzhuNum();
  51. attentMy();
  52. }else{
  53. quickLog();
  54. operatTab();
  55. closeLog();
  56. }
  57. });
  58. //点击查看全部资源
  59. $(".coninfobox").on("click", "#seeMoreR", function() {
  60. document.body.scrollTop = document.documentElement.scrollTop = 0;
  61. $(".navconBox ul>li").eq(1).addClass("liNow").siblings().removeClass("liNow");
  62. $("#item1user").hide();
  63. $("#item2user").show();
  64. })
  65. //点击查看全部文章
  66. $(".coninfobox").on("click", "#seeMoreA", function() {
  67. document.body.scrollTop = document.documentElement.scrollTop = 0;
  68. $(".navconBox ul>li").eq(2).addClass("liNow").siblings().removeClass("liNow");
  69. $("#item1user").hide();
  70. $("#item3user").show();
  71. })
  72. }
  73. function subjectShow(data) {
  74. console.log(data)
  75. if(data != undefined && data.length != 0) {
  76. var subs = new Array();
  77. if(data.indexOf(',')) {
  78. subs = data.split(',');
  79. } else {
  80. subs[0] = data;
  81. }
  82. if(subs.length > 0) {
  83. for(var i = 0; i < subs.length; i++) {
  84. $("#subjectShow").append("<li>" + subs[i] + "</li>");
  85. };
  86. }
  87. }
  88. }
  89. function qualificationShow(data) {
  90. if(data != undefined && data.length != 0) {
  91. var subs = new Array();
  92. if(data.indexOf(',')) {
  93. subs = data.split(',');
  94. } else {
  95. subs[0] = data;
  96. }
  97. if(subs.length > 0) {
  98. for(var i = 0; i < subs.length; i++) {
  99. $("#qualification").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
  100. };
  101. }
  102. }
  103. }
  104. //企业详细信息
  105. function getCmpInfo(orgId) {
  106. $.ajax({
  107. type: "get",
  108. url: "/ajax/org/" + orgId,
  109. async: false,
  110. success: function(data) {
  111. var $info = data.data;
  112. //console.log($info)
  113. if(data.success) {
  114. if($info.hasOrgLogo) {
  115. $("#proHead").attr("src", "/images/org/" + $info.id + ".jpg");
  116. }else{
  117. $("#proHead").attr("src", "/images/default-icon.jpg");
  118. }
  119. if($info.forShort) {
  120. $("#proName").text($info.forShort);
  121. } else {
  122. $("#proName").text($info.name);
  123. }
  124. oName = $info.name;
  125. if($info.authStatus == "3") {
  126. $("#proAuth").addClass("authicon-com-ok");
  127. $("#proAuth").attr("title", "科袖认证企业");
  128. }
  129. if($info.city) {
  130. $("#proAddress").html($info.city + "<span style='margin-right:10px;'></span>");
  131. }
  132. var proOther = "";
  133. if($info.industry) {
  134. proOther = $info.industry.replace(/,/gi, " | ");
  135. }
  136. $("#proOther").text(proOther);
  137. if($info.orgType == "2") {
  138. $("#proTit").html(orgTypeShow[$info.orgType] + "<span style='margin-right:10px;'></span>");
  139. }
  140. var llqtitle = $info.name + "-" + proOther + "科袖网"; //修改浏览器title信息
  141. document.title = llqtitle;
  142. //简介
  143. if($info.descp) {
  144. $("#item1user>.nodatabox").addClass("displayNone");
  145. $("#descpS").parents(".coninfobox").removeClass("displayNone");
  146. $("#descpS").text($info.descp);
  147. } else {
  148. $("#descpS").parents(".coninfobox").addClass("displayNone");
  149. }
  150. //学术领域
  151. if($info.subject) {
  152. $("#item1user>.nodatabox").addClass("displayNone");
  153. $("#subjectShow").parents(".coninfobox").removeClass("displayNone");
  154. subjectShow($info.subject);
  155. } else {
  156. $("#subjectShow").parents(".coninfobox").addClass("displayNone");
  157. }
  158. //企业资质
  159. if($info.qualification) {
  160. qualificationShow($info.qualification);
  161. } else {
  162. $("#qualification").parents(".coninfobox").hide();
  163. }
  164. //企业详情
  165. $("#orgName").text($info.name);
  166. if($info.orgSize) {
  167. //console.log(typeof($info.orgSize),orgSizeShow[$info.orgSize])
  168. $("#orgSize").text(orgSizeShow[$info.orgSize]);
  169. } else {
  170. $("#orgSize").parent("li").hide();
  171. }
  172. if($info.industry) {
  173. $("#orgIndustry").text($info.industry);
  174. } else {
  175. $("#orgIndustry").parent("li").hide();
  176. }
  177. if($info.city) {
  178. $("#orgCity").text($info.city);
  179. } else {
  180. $("#orgCity").parent("li").hide();
  181. }
  182. if($info.orgType) {
  183. $("#orgType").text(orgTypeShow[$info.orgType]);
  184. } else {
  185. $("#orgType").parent("li").hide();
  186. }
  187. if($info.foundTime) {
  188. $("#foundTime").text(TimeTr($info.foundTime));
  189. } else {
  190. $("#foundTime").parent("li").hide();
  191. }
  192. if($info.orgUrl) {
  193. $("#orgUrl").text($info.orgUrl);
  194. } else {
  195. $("#orgUrl").parent("li").hide();
  196. }
  197. if($info.addr) {
  198. $("#cmpAddress").text($info.addr);
  199. } else {
  200. $("#cmpAddress").parent("li").hide();
  201. }
  202. var weibotitle = $info.name;
  203. var weibourl = window.location.href;
  204. var weibopic = "http://" + window.location.host + "/images/org/" + $info.id + ".jpg";
  205. $("#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");
  206. }
  207. },
  208. error: function() {
  209. $.MsgBox.Alert('提示', '链接服务器超时')
  210. }
  211. });
  212. }
  213. //获取资源
  214. function getResource(pageSize, pageNo, isbind) {
  215. $.ajax({
  216. "url": "/ajax/resource/pqOrgPublish",
  217. "type": "get",
  218. "async": false,
  219. "data": {
  220. "orgId": orgId,
  221. "pageSize": pageSize,
  222. "pageNo": pageNo
  223. },
  224. "success": function(data) {
  225. //console.log(data);
  226. if(data.success) {
  227. $("#proResource").html("");
  228. if(data.data.data.length > 0) {
  229. $("#showResource").parents(".coninfobox").removeClass("displayNone");
  230. $("#item1user>.nodatabox").addClass("displayNone");
  231. for(var i = 0; i < data.data.data.length; i++) {
  232. var madiaHead = '';
  233. if(data.data.data[i].images.length) {
  234. madiaHead = '/data/resource/' + data.data.data[i].images[0].imageSrc;
  235. } else {
  236. madiaHead = '/images/default-resource.jpg';
  237. }
  238. var strAdd = '';
  239. strAdd += '<li><a href="resourceShow.html?resourceId=' + data.data.data[i].resourceId + '" class="flexCenter urlgo">';
  240. strAdd += '<div class="madiaHead resouseHead" style="background-image:url(' + madiaHead + ')"></div>';
  241. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">' + data.data.data[i].resourceName + '</p><p class="h2Font ellipsisSty">应用用途:' + data.data.data[i].supportedServices + '</p></div>';
  242. strAdd += '</a></li>';
  243. var $strAdd = $(strAdd);
  244. $("#proResource").append(strAdd);
  245. if(isbind==true && i==0){
  246. var $strAddO=$(strAdd);
  247. $("#showResource").html("");
  248. $("#showResource").append($strAddO);
  249. }
  250. }
  251. if(isbind == true) {
  252. $(".resoucePageCode").off("click").createPage({
  253. pageCount: Math.ceil(data.data.total / 10),
  254. current: data.data.pageNo,
  255. backFn: function(p) {
  256. $("#proResource").html("");
  257. getResource(10, p, false);
  258. //document.body.scrollTop = document.documentElement.scrollTop = 0;
  259. }
  260. });
  261. }
  262. } else {
  263. $("#item2user .nodatabox").show();
  264. $("#item2user .nodatabox").find(".noContip").text("企业尚未发布任何资源");
  265. }
  266. }
  267. },
  268. "error": function() {
  269. $.MsgBox.Alert("提示", "服务器连接超时")
  270. }
  271. });
  272. }
  273. //获取文章
  274. function getArticle(pageSize, pageNo, isbind) {
  275. $.ajax({
  276. url: "/ajax/article/pqOrgPublish",
  277. dataType: 'json', //数据格式类型
  278. type: 'GET', //http请求类型
  279. data: {
  280. "orgId": orgId,
  281. "pageSize": pageSize,
  282. "pageNo": pageNo
  283. },
  284. timeout: 10000, //超时设置
  285. success: function(data) {
  286. if(data.success) {
  287. $("#proArticel").html("");
  288. if(data.data.data.length > 0) {
  289. $("#showArticle").parents(".coninfobox").removeClass("displayNone");
  290. $("#item1user>.nodatabox").addClass("displayNone");
  291. for(var i = 0; i < data.data.data.length; i++) {
  292. var madiaHead = '/images/default-artical.jpg';
  293. if(data.data.data[i].articleImg) {
  294. madiaHead = '/data/article/' + data.data.data[i].articleImg;
  295. }
  296. var sowU='';
  297. if(data.data.data[i].pageViews!=0){
  298. if(data.data.data[i].articleAgree!=0){
  299. sowU='<li><span>阅读量 '+data.data.data[i].pageViews+'</span></li><li><span>赞 '+data.data.data[i].articleAgree+'</span></li>'
  300. }else{
  301. sowU='<li><span>阅读量 '+data.data.data[i].pageViews+'</span></li>'
  302. }
  303. }
  304. var strAdd = '';
  305. strAdd += '<li><a href="/' + pageUrl('a',data.data.data[i]) + '" class="flexCenter urlgo">';
  306. strAdd += '<div class="madiaHead artHead" style="background-image:url(' + madiaHead + ')"></div>';
  307. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">' + data.data.data[i].articleTitle + '</p>';
  308. strAdd += '<ul class="h2Font clearfix">';
  309. strAdd += '<li><span class="time">' + commenTime(data.data.data[i].publishTime) + '</span></li>';
  310. strAdd += sowU
  311. strAdd += '<li><span class="comment"></span></li>';
  312. strAdd += '</ul></div>';
  313. strAdd += '</a></li>';
  314. var $strAdd = $(strAdd);
  315. $("#proArticel").append($strAdd);
  316. commentnum(data.data.data[i].articleId, $strAdd) //文章评论数
  317. if(isbind==true && i==0){
  318. var $strAddO = $(strAdd);
  319. $("#showArticle").append($strAddO);
  320. commentnum(data.data.data[0].articleId,$strAddO)
  321. }
  322. }
  323. if(isbind == true) {
  324. $(".expertPageCode").off("click").createPage({
  325. pageCount: Math.ceil(data.data.total / 10),
  326. current: data.data.pageNo,
  327. backFn: function(p) {
  328. $("#proArticel").html("");
  329. getArticle(10, p, false);
  330. //document.body.scrollTop = document.documentElement.scrollTop = 0;
  331. }
  332. });
  333. }
  334. } else {
  335. $("#item3user .nodatabox").show();
  336. $("#item3user .nodatabox").find(".noContip").text("企业尚未发布任何文章");
  337. var i = 0;
  338. $("#item1user").find('.coninfobox').each(function() {
  339. if($(this).css("display") == "none") {
  340. i++;
  341. }
  342. })
  343. if(i == 4) {
  344. $("#item1user").hide();
  345. $(".navconBox ul>li").eq(3).addClass("liNow").siblings().removeClass("liNow");
  346. $("#item6user").show();
  347. }
  348. }
  349. }
  350. },
  351. error: function() {
  352. return;
  353. }
  354. });
  355. }
  356. //查文章评论数
  357. function commentnum(articleId, $itemlist) {
  358. $.ajax({
  359. "url": "/ajax/leaveWord/lwCount",
  360. "type": "GET",
  361. "dataType": "json",
  362. "async": false,
  363. "data": {
  364. "articleId": articleId
  365. },
  366. "success": function(data) {
  367. if(data.success) {
  368. if(data.data>0){
  369. $itemlist.find(".comment").text("留言 " + data.data);
  370. }
  371. }
  372. },
  373. "error": function() {
  374. $.MsgBox.Alert('提示', '链接服务器超时')
  375. }
  376. });
  377. }
  378. //关注企业数量
  379. function guanzhuNum() {
  380. $.ajax({
  381. "url": "/ajax/watch/countProfessor",
  382. "type": "GET",
  383. "dataType": "json",
  384. "async": true,
  385. "data": {
  386. "id": orgId,
  387. "type": 6
  388. },
  389. "success": function(data) {
  390. if(data.success) {
  391. $("#attenNum").text(data.data);
  392. }
  393. },
  394. "error": function() {
  395. $.MsgBox.Alert('提示', '链接服务器超时')
  396. }
  397. });
  398. }
  399. guanzhuNum();
  400. function comNum() {
  401. $.ajax({
  402. "url": "/ajax/org/regInfo",
  403. "type": "get",
  404. "dataType": "json",
  405. "data": {
  406. "name": oName
  407. },
  408. "success": function(data) {
  409. if(data.success) {
  410. if(data.data) {
  411. var $data = data.data;
  412. var str = "";
  413. if($data.num) {
  414. str += "<li>工商注册号:" + $data.num + "</li>"
  415. }
  416. if($data.code) {
  417. str += "<li>组织机构代码:" + $data.code + "</li>"
  418. }
  419. if($data.creditCode) {
  420. str += "<li>统一信用代码:" + $data.creditCode + "</li>"
  421. }
  422. if($data.type) {
  423. str += "<li>企业类型:" + $data.type + "</li>"
  424. }
  425. if($data.industry) {
  426. str += "<li>行业:" + $data.industry + "</li>"
  427. }
  428. if($data.operatingPeriod) {
  429. str += "<li>营业期限:" + $data.operatingPeriod + "</li>"
  430. }
  431. if($data.dayOfApproval) {
  432. str += "<li>核准日期:" + $data.dayOfApproval + "</li>"
  433. }
  434. if($data.manager) {
  435. str += "<li>登记机关:" + $data.manager + "</li>"
  436. }
  437. if($data.addr) {
  438. str += "<li>注册地址:" + $data.addr + "</li>"
  439. }
  440. if($data.scopeOfBusiness) {
  441. str += "<li>经营范围:" + $data.scopeOfBusiness + "</li>"
  442. }
  443. $("#comMes").html(str);
  444. }else {
  445. $("#comMes").parents(".coninfobox").hide();
  446. }
  447. }else{
  448. $("#comMes").parents(".coninfobox").hide();
  449. }
  450. },
  451. "error": function() {
  452. $.MsgBox.Alert('提示', '链接服务器超时')
  453. }
  454. });
  455. }
  456. comNum();
  457. industryCommerce();
  458. function industryCommerce() {
  459. $.ajax({
  460. "url": "/ajax/org/incPageViews",
  461. "type": "POST",
  462. "dataType": "json",
  463. "async": true,
  464. "data": {
  465. "id": orgId,
  466. },
  467. "success": function(data) {
  468. if(data.success) {
  469. console.log(data);
  470. }
  471. },
  472. "error": function() {
  473. $.MsgBox.Alert('提示', '链接服务器超时')
  474. }
  475. });
  476. }
  477. //相关文章信息
  478. function relevantarticalList(){
  479. $.ajax({
  480. "url" : "/ajax/article/byAssOrg",
  481. "type" : "GET" ,
  482. "dataType" : "json",
  483. "data" :{"id":orgId},
  484. //"async":false,
  485. "traditional": true, //传数组必须加这个
  486. "success" : function(data) {
  487. console.log(data);
  488. if (data.success && data.data!=""){
  489. $("#relateArt").parents(".conBlock").removeClass("displayNone");
  490. var itemlist = '';
  491. $("#relateArt").html("");
  492. for(var i = 0; i < data.data.length; i++) {
  493. var itemlist = '<li class="flexCenter"><a target="_blank" href="/'+ pageUrl('a',data.data[i]) +'" class="urlgo">';
  494. itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
  495. itemlist += '</a></li>';
  496. $itemlist = $(itemlist);
  497. $("#relateArt").append($itemlist);
  498. }
  499. }
  500. },
  501. "error":function(){
  502. $.MsgBox.Alert('提示','链接服务器超时')
  503. }
  504. });
  505. }
  506. //感兴趣
  507. function likeExperts(){
  508. $.ajax({
  509. "url": "/ajax/org/ralateOrgs",
  510. "type": "get",
  511. "dataType" : "json",
  512. "data" :{"orgId":orgId},
  513. "success": function(data) {
  514. if(data.success && data.data) {
  515. console.log(data)
  516. var lengthT;
  517. if(data.data.length>5){
  518. lengthT=5;
  519. }else{
  520. lengthT=data.data.length
  521. }
  522. for(var i = 0; i < lengthT; i++) {
  523. var ExpId = data.data[i].id;
  524. likeExpertsList(ExpId);
  525. }
  526. }
  527. },
  528. "error": function() {
  529. $.MsgBox.Alert('提示', '链接服务器超时')
  530. }
  531. });
  532. }
  533. //感兴趣信息
  534. function likeExpertsList(Id){
  535. $.ajax({
  536. "url" : "/ajax/org/"+Id,
  537. "type" : "GET" ,
  538. "dataType" : "json",
  539. "success" : function(data) {
  540. if (data.success && data.data!=""){
  541. $("#relateCmp").parents(".conBlock").removeClass("displayNone");
  542. var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
  543. itemlist += '<div class="madiaHead cmpHead cmpHead2"><div class="boxBlock">';
  544. itemlist += '<img class="boxBlockimg" id="userimg" src="" /></div></div>';
  545. itemlist += '<div class="madiaInfo">';
  546. itemlist += '<p class="clearfix"><span class="h1Font ellipsisSty floatL" style="display:block;max-width:136px" id="userName"></span><em class="authiconNew floatL" title=""></em></p>';
  547. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  548. itemlist += '</div></a></li>';
  549. $itemlist = $(itemlist);
  550. $("#relateCmp").append($itemlist);
  551. if(data.data.forShort){
  552. $itemlist.find("#userName").text(data.data.forShort);
  553. }else{
  554. $itemlist.find("#userName").text(data.data.name);
  555. }
  556. $itemlist.find(".urlgo").attr("href", "cmpInforShow.html?orgId="+data.data.id);
  557. if(data.data.authStatus==3){
  558. $itemlist.find(".authiconNew").addClass("authicon-com-ok");
  559. $itemlist.find(".authiconNew").attr("title","科袖认证企业")
  560. }
  561. if(data.data.industry){
  562. $itemlist.find("#usertitle").text(data.data.industry.replace(/,/gi, " | "));
  563. }
  564. if(data.data.hasOrgLogo == 1) {
  565. $itemlist.find("#userimg").attr("src", "/images/org/" + data.data.id + ".jpg");
  566. }else{
  567. $itemlist.find("#userimg").attr("src","images/default-icon.jpg");
  568. }
  569. }
  570. },
  571. "error":function(){
  572. $.MsgBox.Alert('提示','链接服务器超时')
  573. }
  574. });
  575. }
  576. //获取需求
  577. function getDemands(pageSize, pageNo,isbind) {
  578. $.ajax({
  579. url: "/ajax/demand/pq",
  580. type: "GET",
  581. timeout: 10000,
  582. dataType: "json",
  583. data: {
  584. "state":'1',
  585. "oid":orgId,
  586. "pageNo": pageNo,
  587. "pageSize":pageSize
  588. },
  589. beforeSend: function() {
  590. $("#showDemand").append('<img src="../images/loading.gif" class="loading" />');
  591. },
  592. success: function(data) {
  593. if(data.success) {
  594. $("#showDemand").html(" ");
  595. var $info = data.data.data;
  596. if($info.length > 0){
  597. $("#showDemand").parents(".needinfobox").removeClass("displayNone");
  598. $("#item1user>.nodatabox").addClass("displayNone");
  599. for(var i = 0; i < $info.length; i++) {
  600. var liStr=$("<li></li>").appendTo("#showDemand");
  601. demandHtml($info[i],liStr);
  602. }
  603. }else{
  604. $("#showDemand").parents(".needinfobox").addClass("displayNone");
  605. }
  606. }
  607. $(".loading").remove();
  608. },
  609. error: function() {
  610. $.MsgBox.Alert('提示', '链接服务器超时')
  611. }
  612. })
  613. }
  614. function demandHtml($data,liStr) {
  615. var sowU="";
  616. if($data.pageViews!=0){
  617. sowU='<li><span>浏览量 '+$data.pageViews +'</span></li>'
  618. }
  619. var strCon='';
  620. strCon+='<a class="" target="_blank" href="demandShow.html?demandId='+$data.id+'" class="madiaInfo">'
  621. strCon+='<p class="h1Font ellipsisSty">'+ $data.title +'</p>'
  622. strCon+='<ul class="showliTop h3Font clearfix">'
  623. strCon+='<li><span>发布于 '+TimeTr($data.createTime)+'</span></li>'
  624. strCon+= sowU
  625. strCon+='</ul>'
  626. strCon+='<p class="h2Font ellipsisSty-2">'+$data.descp+'</p>'
  627. strCon+='<ul class="showli clearfix h3Font">'
  628. if($data.city){ strCon+='<li>所在城市:'+$data.city+'</li>' }
  629. if($data.duration!=0){ strCon+='<li>预期时长:'+demandDuration[$data.duration]+'</li>' }
  630. if($data.cost!=0){ strCon+='<li>费用预算:'+demandCost[$data.cost]+'</li>' }
  631. if($data.invalidDay){ strCon+='<li>有效期至:'+TimeTr($data.invalidDay)+'</li>' }
  632. strCon+='</ul>'
  633. strCon+='</a>'
  634. $(strCon).appendTo(liStr);
  635. }
  636. //收藏与关注
  637. function attentMy(){
  638. var num=watchType;
  639. $.ajax({
  640. url: "/ajax/watch/qaWatch",
  641. dataType: 'json', //数据格式类型
  642. type: 'GET', //http请求类型
  643. data: {
  644. "watchObject": orgId,
  645. },
  646. timeout: 10000, //超时设置
  647. success: function(data) {
  648. if(data.success) {
  649. document.getElementById("attendMy").innerHTML="";
  650. document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.add("displayNone");
  651. if(data.data.length>0){
  652. var datalist = data.data;
  653. for(var i = 0; i < datalist.length; i++) {
  654. var liItem = document.createElement("li");
  655. liItem.className="mui-table-view-cell";
  656. document.getElementById("attendMy").appendChild(liItem);
  657. detailPro(datalist[i],liItem);
  658. }
  659. }else{
  660. document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  661. }
  662. }
  663. },
  664. error: function() {
  665. return;
  666. }
  667. });
  668. }
  669. function detailPro(datalist,liItem) {
  670. var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
  671. var os = "";
  672. if(datalist.professor.title) {
  673. if(datalist.professor.orgName) {
  674. os = datalist.professor.title + "," + datalist.professor.orgName;
  675. } else {
  676. os = datalist.professor.title;
  677. }
  678. } else {
  679. if(datalist.professor.office) {
  680. if(datalist.professor.orgName) {
  681. os = datalist.professor.office + "," + datalist.professor.orgName;
  682. } else {
  683. os = datalist.professor.office;
  684. }
  685. } else {
  686. if(datalist.professor.orgName) {
  687. os = datalist.professor.orgName;
  688. }
  689. }
  690. }
  691. var baImg = "../images/default-photo.jpg";
  692. if(datalist.professor.hasHeadImage == 1) {
  693. baImg = "/images/head/" + datalist.professor.id + "_l.jpg";
  694. }
  695. var strAdd = '';
  696. strAdd += '<a target="_blank" href="userInforShow.html?professorId='+ datalist.professor.id +'" class="flexCenter urlgo">';
  697. strAdd += '<div class="madiaHead useHead" style="width: 80px;height: 80px;margin-top: -40px;background-image:url(' + baImg + ')"></div>';
  698. strAdd += '<div class="madiaInfo" style="padding-left:92px"><p class="h1Font ellipsisSty">' + datalist.professor.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>';
  699. strAdd += '<p class="h2Font ellipsisSty">' + os + '</p>';
  700. strAdd += '</div>';
  701. strAdd += '</a>';
  702. liItem.innerHTML = strAdd
  703. }
  704. //纠错反馈
  705. $(".correctSubmit").on("click",function(){
  706. var cntCon=$(this).siblings(".correctCon").val();
  707. var cntUser="";
  708. if(userid && userid != null && userid != "null") {
  709. cntUser = userid;
  710. }
  711. if(cntCon.length>500){
  712. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  713. return;
  714. }else{
  715. $.ajax({
  716. "url": "/ajax/feedback/error/org",
  717. "type": "POST",
  718. "dataType": "json",
  719. "async": true,
  720. "data": {
  721. "id": orgId,
  722. "cnt":cntCon,
  723. "user":cntUser
  724. },
  725. "success": function(data) {
  726. if(data.success) {
  727. backSuccessed();
  728. }
  729. },
  730. "error": function() {
  731. $.MsgBox.Alert('提示', '链接服务器超时')
  732. }
  733. });
  734. }
  735. })
  736. })