portal html css js resource

cmpInforShow.js 24KB

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