portal html css js resource

cmpInforShow.js 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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.total>0){
  229. $("#resCount").html(data.data.total)
  230. }else if(data.data.total>99){
  231. $("#resCount").html("99+")
  232. }
  233. if(data.data.data.length > 0) {
  234. $("#showResource").parents(".coninfobox").removeClass("displayNone");
  235. $("#item1user>.nodatabox").addClass("displayNone");
  236. for(var i = 0; i < data.data.data.length; i++) {
  237. var madiaHead = '';
  238. if(data.data.data[i].images.length) {
  239. madiaHead = '/data/resource/' + data.data.data[i].images[0].imageSrc;
  240. } else {
  241. madiaHead = '/images/default-resource.jpg';
  242. }
  243. var strAdd = '';
  244. strAdd += '<li><a href="resourceShow.html?resourceId=' + data.data.data[i].resourceId + '" class="flexCenter urlgo">';
  245. strAdd += '<div class="madiaHead resouseHead" style="background-image:url(' + madiaHead + ')"></div>';
  246. 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>';
  247. strAdd += '</a></li>';
  248. var $strAdd = $(strAdd);
  249. $("#proResource").append(strAdd);
  250. if(isbind==true && i==0){
  251. var $strAddO=$(strAdd);
  252. $("#showResource").html("");
  253. $("#showResource").append($strAddO);
  254. }
  255. }
  256. if(isbind == true) {
  257. $(".resoucePageCode").off("click").createPage({
  258. pageCount: Math.ceil(data.data.total / 10),
  259. current: data.data.pageNo,
  260. backFn: function(p) {
  261. $("#proResource").html("");
  262. getResource(10, p, false);
  263. //document.body.scrollTop = document.documentElement.scrollTop = 0;
  264. }
  265. });
  266. }
  267. } else {
  268. $("#item2user .nodatabox").show();
  269. $("#item2user .nodatabox").find(".noContip").text("企业尚未发布任何资源");
  270. }
  271. }
  272. },
  273. "error": function() {
  274. $.MsgBox.Alert("提示", "服务器连接超时")
  275. }
  276. });
  277. }
  278. //获取文章
  279. function getArticle(pageSize, pageNo, isbind) {
  280. $.ajax({
  281. url: "/ajax/article/pqOrgPublish",
  282. dataType: 'json', //数据格式类型
  283. type: 'GET', //http请求类型
  284. data: {
  285. "orgId": orgId,
  286. "pageSize": pageSize,
  287. "pageNo": pageNo
  288. },
  289. timeout: 10000, //超时设置
  290. success: function(data) {
  291. if(data.success) {
  292. $("#proArticel").html("");
  293. if(data.data.total>0){
  294. $("#artCount").html(data.data.total)
  295. }else if(data.data.total>99){
  296. $("#artCount").html("99+")
  297. }
  298. if(data.data.data.length > 0) {
  299. $("#showArticle").parents(".coninfobox").removeClass("displayNone");
  300. $("#item1user>.nodatabox").addClass("displayNone");
  301. for(var i = 0; i < data.data.data.length; i++) {
  302. var madiaHead = '/images/default-artical.jpg';
  303. if(data.data.data[i].articleImg) {
  304. madiaHead = '/data/article/' + data.data.data[i].articleImg;
  305. }
  306. var sowU='';
  307. if(data.data.data[i].pageViews!=0){
  308. if(data.data.data[i].articleAgree!=0){
  309. sowU='<li><span>阅读量 '+data.data.data[i].pageViews+'</span></li><li><span>赞 '+data.data.data[i].articleAgree+'</span></li>'
  310. }else{
  311. sowU='<li><span>阅读量 '+data.data.data[i].pageViews+'</span></li>'
  312. }
  313. }
  314. var strAdd = '';
  315. strAdd += '<li><a href="/' + pageUrl('a',data.data.data[i]) + '" class="flexCenter urlgo">';
  316. strAdd += '<div class="madiaHead artHead" style="background-image:url(' + madiaHead + ')"></div>';
  317. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">' + data.data.data[i].articleTitle + '</p>';
  318. strAdd += '<ul class="h2Font clearfix">';
  319. strAdd += '<li><span class="time">' + commenTime(data.data.data[i].publishTime) + '</span></li>';
  320. strAdd += sowU
  321. strAdd += '<li><span class="comment"></span></li>';
  322. strAdd += '</ul></div>';
  323. strAdd += '</a></li>';
  324. var $strAdd = $(strAdd);
  325. $("#proArticel").append($strAdd);
  326. commentnum(data.data.data[i].articleId, $strAdd) //文章评论数
  327. if(isbind==true && i==0){
  328. var $strAddO = $(strAdd);
  329. $("#showArticle").append($strAddO);
  330. commentnum(data.data.data[0].articleId,$strAddO)
  331. }
  332. }
  333. if(isbind == true) {
  334. $(".expertPageCode").off("click").createPage({
  335. pageCount: Math.ceil(data.data.total / 10),
  336. current: data.data.pageNo,
  337. backFn: function(p) {
  338. $("#proArticel").html("");
  339. getArticle(10, p, false);
  340. //document.body.scrollTop = document.documentElement.scrollTop = 0;
  341. }
  342. });
  343. }
  344. } else {
  345. $("#item3user .nodatabox").show();
  346. $("#item3user .nodatabox").find(".noContip").text("企业尚未发布任何文章");
  347. var i = 0;
  348. $("#item1user").find('.coninfobox').each(function() {
  349. if($(this).css("display") == "none") {
  350. i++;
  351. }
  352. })
  353. if(i == 4) {
  354. $("#item1user").hide();
  355. $(".navconBox ul>li").eq(3).addClass("liNow").siblings().removeClass("liNow");
  356. $("#item6user").show();
  357. }
  358. }
  359. }
  360. },
  361. error: function() {
  362. return;
  363. }
  364. });
  365. }
  366. //查文章评论数
  367. function commentnum(articleId, $itemlist) {
  368. $.ajax({
  369. "url": "/ajax/leaveWord/lwCount",
  370. "type": "GET",
  371. "dataType": "json",
  372. "async": false,
  373. "data": {
  374. "articleId": articleId
  375. },
  376. "success": function(data) {
  377. if(data.success) {
  378. if(data.data>0){
  379. $itemlist.find(".comment").text("留言 " + data.data);
  380. }
  381. }
  382. },
  383. "error": function() {
  384. $.MsgBox.Alert('提示', '链接服务器超时')
  385. }
  386. });
  387. }
  388. //关注企业数量
  389. function guanzhuNum() {
  390. $.ajax({
  391. "url": "/ajax/watch/countProfessor",
  392. "type": "GET",
  393. "dataType": "json",
  394. "async": true,
  395. "data": {
  396. "id": orgId,
  397. "type": 6
  398. },
  399. "success": function(data) {
  400. if(data.success) {
  401. $("#attenNum").text(data.data);
  402. }
  403. },
  404. "error": function() {
  405. $.MsgBox.Alert('提示', '链接服务器超时')
  406. }
  407. });
  408. }
  409. guanzhuNum();
  410. function comNum() {
  411. $.ajax({
  412. "url": "/ajax/org/regInfo",
  413. "type": "get",
  414. "dataType": "json",
  415. "data": {
  416. "name": oName
  417. },
  418. "success": function(data) {
  419. if(data.success) {
  420. if(data.data) {
  421. var $data = data.data;
  422. var str = "";
  423. if($data.num) {
  424. str += "<li>工商注册号:" + $data.num + "</li>"
  425. }
  426. if($data.code) {
  427. str += "<li>组织机构代码:" + $data.code + "</li>"
  428. }
  429. if($data.creditCode) {
  430. str += "<li>统一信用代码:" + $data.creditCode + "</li>"
  431. }
  432. if($data.type) {
  433. str += "<li>企业类型:" + $data.type + "</li>"
  434. }
  435. if($data.industry) {
  436. str += "<li>行业:" + $data.industry + "</li>"
  437. }
  438. if($data.operatingPeriod) {
  439. str += "<li>营业期限:" + $data.operatingPeriod + "</li>"
  440. }
  441. if($data.dayOfApproval) {
  442. str += "<li>核准日期:" + $data.dayOfApproval + "</li>"
  443. }
  444. if($data.manager) {
  445. str += "<li>登记机关:" + $data.manager + "</li>"
  446. }
  447. if($data.addr) {
  448. str += "<li>注册地址:" + $data.addr + "</li>"
  449. }
  450. if($data.scopeOfBusiness) {
  451. str += "<li>经营范围:" + $data.scopeOfBusiness + "</li>"
  452. }
  453. $("#comMes").html(str);
  454. }else {
  455. $("#comMes").parents(".coninfobox").hide();
  456. }
  457. }else{
  458. $("#comMes").parents(".coninfobox").hide();
  459. }
  460. },
  461. "error": function() {
  462. $.MsgBox.Alert('提示', '链接服务器超时')
  463. }
  464. });
  465. }
  466. comNum();
  467. industryCommerce();
  468. function industryCommerce() {
  469. $.ajax({
  470. "url": "/ajax/org/incPageViews",
  471. "type": "POST",
  472. "dataType": "json",
  473. "async": true,
  474. "data": {
  475. "id": orgId,
  476. },
  477. "success": function(data) {
  478. if(data.success) {
  479. console.log(data);
  480. }
  481. },
  482. "error": function() {
  483. $.MsgBox.Alert('提示', '链接服务器超时')
  484. }
  485. });
  486. }
  487. //相关文章信息
  488. function relevantarticalList(){
  489. $.ajax({
  490. "url" : "/ajax/article/byAssOrg",
  491. "type" : "GET" ,
  492. "dataType" : "json",
  493. "data" :{"id":orgId},
  494. //"async":false,
  495. "traditional": true, //传数组必须加这个
  496. "success" : function(data) {
  497. console.log(data);
  498. if (data.success && data.data!=""){
  499. $("#relateArt").parents(".conBlock").removeClass("displayNone");
  500. var itemlist = '';
  501. $("#relateArt").html("");
  502. for(var i = 0; i < data.data.length; i++) {
  503. var itemlist = '<li class="flexCenter"><a target="_blank" href="/'+ pageUrl('a',data.data[i]) +'" class="urlgo">';
  504. itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
  505. itemlist += '</a></li>';
  506. $itemlist = $(itemlist);
  507. $("#relateArt").append($itemlist);
  508. }
  509. }
  510. },
  511. "error":function(){
  512. $.MsgBox.Alert('提示','链接服务器超时')
  513. }
  514. });
  515. }
  516. //感兴趣
  517. function likeExperts(){
  518. $.ajax({
  519. "url": "/ajax/org/ralateOrgs",
  520. "type": "get",
  521. "dataType" : "json",
  522. "data" :{"orgId":orgId},
  523. "success": function(data) {
  524. if(data.success && data.data) {
  525. console.log(data)
  526. var lengthT;
  527. if(data.data.length>5){
  528. lengthT=5;
  529. }else{
  530. lengthT=data.data.length
  531. }
  532. for(var i = 0; i < lengthT; i++) {
  533. var ExpId = data.data[i].id;
  534. likeExpertsList(ExpId);
  535. }
  536. }
  537. },
  538. "error": function() {
  539. $.MsgBox.Alert('提示', '链接服务器超时')
  540. }
  541. });
  542. }
  543. //感兴趣信息
  544. function likeExpertsList(Id){
  545. $.ajax({
  546. "url" : "/ajax/org/"+Id,
  547. "type" : "GET" ,
  548. "dataType" : "json",
  549. "success" : function(data) {
  550. if (data.success && data.data!=""){
  551. $("#relateCmp").parents(".conBlock").removeClass("displayNone");
  552. var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
  553. itemlist += '<div class="madiaHead cmpHead cmpHead2"><div class="boxBlock">';
  554. itemlist += '<img class="boxBlockimg" id="userimg" src="" /></div></div>';
  555. itemlist += '<div class="madiaInfo">';
  556. 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>';
  557. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  558. itemlist += '</div></a></li>';
  559. $itemlist = $(itemlist);
  560. $("#relateCmp").append($itemlist);
  561. if(data.data.forShort){
  562. $itemlist.find("#userName").text(data.data.forShort);
  563. }else{
  564. $itemlist.find("#userName").text(data.data.name);
  565. }
  566. $itemlist.find(".urlgo").attr("href", "cmpInforShow.html?orgId="+data.data.id);
  567. if(data.data.authStatus==3){
  568. $itemlist.find(".authiconNew").addClass("authicon-com-ok");
  569. $itemlist.find(".authiconNew").attr("title","科袖认证企业")
  570. }
  571. if(data.data.industry){
  572. $itemlist.find("#usertitle").text(data.data.industry.replace(/,/gi, " | "));
  573. }
  574. if(data.data.hasOrgLogo == 1) {
  575. $itemlist.find("#userimg").attr("src", "/images/org/" + data.data.id + ".jpg");
  576. }else{
  577. $itemlist.find("#userimg").attr("src","images/default-icon.jpg");
  578. }
  579. }
  580. },
  581. "error":function(){
  582. $.MsgBox.Alert('提示','链接服务器超时')
  583. }
  584. });
  585. }
  586. //获取需求
  587. function getDemands(pageSize, pageNo,isbind) {
  588. $.ajax({
  589. url: "/ajax/demand/pq",
  590. type: "GET",
  591. timeout: 10000,
  592. dataType: "json",
  593. data: {
  594. "state":'1',
  595. "oid":orgId,
  596. "pageNo": pageNo,
  597. "pageSize":pageSize
  598. },
  599. beforeSend: function() {
  600. $("#showDemand").append('<img src="../images/loading.gif" class="loading" />');
  601. },
  602. success: function(data) {
  603. if(data.success) {
  604. $("#showDemand").html(" ");
  605. var $info = data.data.data;
  606. if($info.length > 0){
  607. $("#showDemand").parents(".needinfobox").removeClass("displayNone");
  608. $("#item1user>.nodatabox").addClass("displayNone");
  609. for(var i = 0; i < $info.length; i++) {
  610. var liStr=$("<li></li>").appendTo("#showDemand");
  611. demandHtml($info[i],liStr);
  612. }
  613. }else{
  614. $("#showDemand").parents(".needinfobox").addClass("displayNone");
  615. }
  616. }
  617. $(".loading").remove();
  618. },
  619. error: function() {
  620. $.MsgBox.Alert('提示', '链接服务器超时')
  621. }
  622. })
  623. }
  624. function demandHtml($data,liStr) {
  625. var sowU="";
  626. if($data.pageViews!=0){
  627. sowU='<li><span>浏览量 '+$data.pageViews +'</span></li>'
  628. }
  629. var strCon='';
  630. strCon+='<a class="" target="_blank" href="demandShow.html?demandId='+$data.id+'" class="madiaInfo">'
  631. strCon+='<p class="h1Font ellipsisSty">'+ $data.title +'</p>'
  632. strCon+='<ul class="showliTop h3Font clearfix">'
  633. strCon+='<li><span>发布于 '+TimeTr($data.createTime)+'</span></li>'
  634. strCon+= sowU
  635. strCon+='</ul>'
  636. strCon+='<p class="h2Font ellipsisSty-2">'+$data.descp+'</p>'
  637. strCon+='<ul class="showli clearfix h3Font">'
  638. if($data.city){ strCon+='<li>所在城市:'+$data.city+'</li>' }
  639. if($data.duration!=0){ strCon+='<li>预期时长:'+demandDuration[$data.duration]+'</li>' }
  640. if($data.cost!=0){ strCon+='<li>费用预算:'+demandCost[$data.cost]+'</li>' }
  641. if($data.invalidDay){ strCon+='<li>有效期至:'+TimeTr($data.invalidDay)+'</li>' }
  642. strCon+='</ul>'
  643. strCon+='</a>'
  644. $(strCon).appendTo(liStr);
  645. }
  646. //收藏与关注
  647. function attentMy(){
  648. var num=watchType;
  649. $.ajax({
  650. url: "/ajax/watch/qaWatch",
  651. dataType: 'json', //数据格式类型
  652. type: 'GET', //http请求类型
  653. data: {
  654. "watchObject": orgId,
  655. },
  656. timeout: 10000, //超时设置
  657. success: function(data) {
  658. if(data.success) {
  659. document.getElementById("attendMy").innerHTML="";
  660. document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.add("displayNone");
  661. if(data.data.length>0){
  662. var datalist = data.data;
  663. for(var i = 0; i < datalist.length; i++) {
  664. var liItem = document.createElement("li");
  665. liItem.className="mui-table-view-cell";
  666. document.getElementById("attendMy").appendChild(liItem);
  667. detailPro(datalist[i],liItem);
  668. }
  669. }else{
  670. document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  671. }
  672. }
  673. },
  674. error: function() {
  675. return;
  676. }
  677. });
  678. }
  679. function detailPro(datalist,liItem) {
  680. var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
  681. var os = "";
  682. if(datalist.professor.title) {
  683. if(datalist.professor.orgName) {
  684. os = datalist.professor.title + "," + datalist.professor.orgName;
  685. } else {
  686. os = datalist.professor.title;
  687. }
  688. } else {
  689. if(datalist.professor.office) {
  690. if(datalist.professor.orgName) {
  691. os = datalist.professor.office + "," + datalist.professor.orgName;
  692. } else {
  693. os = datalist.professor.office;
  694. }
  695. } else {
  696. if(datalist.professor.orgName) {
  697. os = datalist.professor.orgName;
  698. }
  699. }
  700. }
  701. var baImg = "../images/default-photo.jpg";
  702. if(datalist.professor.hasHeadImage == 1) {
  703. baImg = "/images/head/" + datalist.professor.id + "_l.jpg";
  704. }
  705. var strAdd = '';
  706. strAdd += '<a target="_blank" href="userInforShow.html?professorId='+ datalist.professor.id +'" class="flexCenter urlgo">';
  707. strAdd += '<div class="madiaHead useHead" style="width: 80px;height: 80px;margin-top: -40px;background-image:url(' + baImg + ')"></div>';
  708. strAdd += '<div class="madiaInfo" style="padding-left:92px"><p class="h1Font ellipsisSty">' + datalist.professor.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>';
  709. strAdd += '<p class="h2Font ellipsisSty">' + os + '</p>';
  710. strAdd += '</div>';
  711. strAdd += '</a>';
  712. liItem.innerHTML = strAdd
  713. }
  714. //纠错反馈
  715. $(".correctSubmit").on("click",function(){
  716. var cntCon=$(this).siblings(".correctCon").val();
  717. var cntUser="";
  718. if(userid && userid != null && userid != "null") {
  719. cntUser = userid;
  720. }
  721. if(cntCon.length>500){
  722. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  723. return;
  724. }else{
  725. $.ajax({
  726. "url": "/ajax/feedback/error/org",
  727. "type": "POST",
  728. "dataType": "json",
  729. "async": true,
  730. "data": {
  731. "id": orgId,
  732. "cnt":cntCon,
  733. "user":cntUser
  734. },
  735. "success": function(data) {
  736. if(data.success) {
  737. backSuccessed();
  738. }
  739. },
  740. "error": function() {
  741. $.MsgBox.Alert('提示', '链接服务器超时')
  742. }
  743. });
  744. }
  745. })
  746. })