portal html css js resource

cmpInforShow.js 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  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="leaveMsgCount"></span></li>';
  322. strAdd += '</ul></div>';
  323. strAdd += '</a></li>';
  324. var $strAdd = $(strAdd);
  325. $("#proArticel").append($strAdd);
  326. leaveMsgCount(data.data.data[i].articleId,1,$strAdd);
  327. if(isbind==true && i==0){
  328. var $strAddO = $(strAdd);
  329. $("#showArticle").append($strAddO);
  330. leaveMsgCount(data.data.data[0].articleId,1,$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 guanzhuNum() {
  368. $.ajax({
  369. "url": "/ajax/watch/countProfessor",
  370. "type": "GET",
  371. "dataType": "json",
  372. "async": true,
  373. "data": {
  374. "id": orgId,
  375. "type": 6
  376. },
  377. "success": function(data) {
  378. if(data.success) {
  379. $("#attenNum").text(data.data);
  380. }
  381. },
  382. "error": function() {
  383. $.MsgBox.Alert('提示', '链接服务器超时')
  384. }
  385. });
  386. }
  387. guanzhuNum();
  388. function comNum() {
  389. $.ajax({
  390. "url": "/ajax/org/regInfo",
  391. "type": "get",
  392. "dataType": "json",
  393. "data": {
  394. "name": oName
  395. },
  396. "success": function(data) {
  397. if(data.success) {
  398. if(data.data) {
  399. var $data = data.data;
  400. var str = "";
  401. if($data.num) {
  402. str += "<li>工商注册号:" + $data.num + "</li>"
  403. }
  404. if($data.code) {
  405. str += "<li>组织机构代码:" + $data.code + "</li>"
  406. }
  407. if($data.creditCode) {
  408. str += "<li>统一信用代码:" + $data.creditCode + "</li>"
  409. }
  410. if($data.type) {
  411. str += "<li>企业类型:" + $data.type + "</li>"
  412. }
  413. if($data.industry) {
  414. str += "<li>行业:" + $data.industry + "</li>"
  415. }
  416. if($data.operatingPeriod) {
  417. str += "<li>营业期限:" + $data.operatingPeriod + "</li>"
  418. }
  419. if($data.dayOfApproval) {
  420. str += "<li>核准日期:" + $data.dayOfApproval + "</li>"
  421. }
  422. if($data.manager) {
  423. str += "<li>登记机关:" + $data.manager + "</li>"
  424. }
  425. if($data.addr) {
  426. str += "<li>注册地址:" + $data.addr + "</li>"
  427. }
  428. if($data.scopeOfBusiness) {
  429. str += "<li>经营范围:" + $data.scopeOfBusiness + "</li>"
  430. }
  431. $("#comMes").html(str);
  432. }else {
  433. $("#comMes").parents(".coninfobox").hide();
  434. }
  435. }else{
  436. $("#comMes").parents(".coninfobox").hide();
  437. }
  438. },
  439. "error": function() {
  440. $.MsgBox.Alert('提示', '链接服务器超时')
  441. }
  442. });
  443. }
  444. comNum();
  445. industryCommerce();
  446. function industryCommerce() {
  447. $.ajax({
  448. "url": "/ajax/org/incPageViews",
  449. "type": "POST",
  450. "dataType": "json",
  451. "async": true,
  452. "data": {
  453. "id": orgId,
  454. },
  455. "success": function(data) {
  456. if(data.success) {
  457. console.log(data);
  458. }
  459. },
  460. "error": function() {
  461. $.MsgBox.Alert('提示', '链接服务器超时')
  462. }
  463. });
  464. }
  465. //相关文章信息
  466. function relevantarticalList(){
  467. $.ajax({
  468. "url" : "/ajax/article/byAssOrg",
  469. "type" : "GET" ,
  470. "dataType" : "json",
  471. "data" :{"id":orgId},
  472. //"async":false,
  473. "traditional": true, //传数组必须加这个
  474. "success" : function(data) {
  475. console.log(data);
  476. if (data.success && data.data!=""){
  477. $("#relateArt").parents(".conBlock").removeClass("displayNone");
  478. var itemlist = '';
  479. $("#relateArt").html("");
  480. for(var i = 0; i < data.data.length; i++) {
  481. var itemlist = '<li class="flexCenter"><a target="_blank" href="/'+ pageUrl('a',data.data[i]) +'" class="urlgo">';
  482. itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
  483. itemlist += '</a></li>';
  484. $itemlist = $(itemlist);
  485. $("#relateArt").append($itemlist);
  486. }
  487. }
  488. },
  489. "error":function(){
  490. $.MsgBox.Alert('提示','链接服务器超时')
  491. }
  492. });
  493. }
  494. //感兴趣
  495. function likeExperts(){
  496. $.ajax({
  497. "url": "/ajax/org/ralateOrgs",
  498. "type": "get",
  499. "dataType" : "json",
  500. "data" :{"orgId":orgId},
  501. "success": function(data) {
  502. if(data.success && data.data) {
  503. console.log(data)
  504. var lengthT;
  505. if(data.data.length>5){
  506. lengthT=5;
  507. }else{
  508. lengthT=data.data.length
  509. }
  510. for(var i = 0; i < lengthT; i++) {
  511. var ExpId = data.data[i].id;
  512. likeExpertsList(ExpId);
  513. }
  514. }
  515. },
  516. "error": function() {
  517. $.MsgBox.Alert('提示', '链接服务器超时')
  518. }
  519. });
  520. }
  521. //感兴趣信息
  522. function likeExpertsList(Id){
  523. $.ajax({
  524. "url" : "/ajax/org/"+Id,
  525. "type" : "GET" ,
  526. "dataType" : "json",
  527. "success" : function(data) {
  528. if (data.success && data.data!=""){
  529. $("#relateCmp").parents(".conBlock").removeClass("displayNone");
  530. var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
  531. itemlist += '<div class="madiaHead cmpHead cmpHead2"><div class="boxBlock">';
  532. itemlist += '<img class="boxBlockimg" id="userimg" src="" /></div></div>';
  533. itemlist += '<div class="madiaInfo">';
  534. 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>';
  535. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  536. itemlist += '</div></a></li>';
  537. $itemlist = $(itemlist);
  538. $("#relateCmp").append($itemlist);
  539. if(data.data.forShort){
  540. $itemlist.find("#userName").text(data.data.forShort);
  541. }else{
  542. $itemlist.find("#userName").text(data.data.name);
  543. }
  544. $itemlist.find(".urlgo").attr("href", "cmpInforShow.html?orgId="+data.data.id);
  545. if(data.data.authStatus==3){
  546. $itemlist.find(".authiconNew").addClass("authicon-com-ok");
  547. $itemlist.find(".authiconNew").attr("title","科袖认证企业")
  548. }
  549. if(data.data.industry){
  550. $itemlist.find("#usertitle").text(data.data.industry.replace(/,/gi, " | "));
  551. }
  552. if(data.data.hasOrgLogo == 1) {
  553. $itemlist.find("#userimg").attr("src", "/images/org/" + data.data.id + ".jpg");
  554. }else{
  555. $itemlist.find("#userimg").attr("src","images/default-icon.jpg");
  556. }
  557. }
  558. },
  559. "error":function(){
  560. $.MsgBox.Alert('提示','链接服务器超时')
  561. }
  562. });
  563. }
  564. //获取需求
  565. function getDemands(pageSize, pageNo,isbind) {
  566. $.ajax({
  567. url: "/ajax/demand/pq",
  568. type: "GET",
  569. timeout: 10000,
  570. dataType: "json",
  571. data: {
  572. "state":'1',
  573. "oid":orgId,
  574. "pageNo": pageNo,
  575. "pageSize":pageSize
  576. },
  577. beforeSend: function() {
  578. $("#showDemand").append('<img src="../images/loading.gif" class="loading" />');
  579. },
  580. success: function(data) {
  581. if(data.success) {
  582. $("#showDemand").html(" ");
  583. var $info = data.data.data;
  584. if($info.length > 0){
  585. $("#showDemand").parents(".needinfobox").removeClass("displayNone");
  586. $("#item1user>.nodatabox").addClass("displayNone");
  587. for(var i = 0; i < $info.length; i++) {
  588. var liStr=$("<li></li>").appendTo("#showDemand");
  589. demandHtml($info[i],liStr);
  590. }
  591. }else{
  592. $("#showDemand").parents(".needinfobox").addClass("displayNone");
  593. }
  594. }
  595. $(".loading").remove();
  596. },
  597. error: function() {
  598. $.MsgBox.Alert('提示', '链接服务器超时')
  599. }
  600. })
  601. }
  602. function demandHtml($data,liStr) {
  603. var sowU="";
  604. if($data.pageViews!=0){
  605. sowU='<li><span>浏览量 '+$data.pageViews +'</span></li>'
  606. }
  607. var strCon='';
  608. strCon+='<a class="" target="_blank" href="demandShow.html?demandId='+$data.id+'" class="madiaInfo">'
  609. strCon+='<p class="h1Font ellipsisSty">'+ $data.title +'</p>'
  610. strCon+='<ul class="showliTop h3Font clearfix">'
  611. strCon+='<li><span>发布于 '+TimeTr($data.createTime)+'</span></li>'
  612. strCon+= sowU
  613. strCon+='</ul>'
  614. strCon+='<p class="h2Font ellipsisSty-2">'+$data.descp+'</p>'
  615. strCon+='<ul class="showli clearfix h3Font">'
  616. if($data.city){ strCon+='<li>所在城市:'+$data.city+'</li>' }
  617. if($data.duration!=0){ strCon+='<li>预期时长:'+demandDuration[$data.duration]+'</li>' }
  618. if($data.cost!=0){ strCon+='<li>费用预算:'+demandCost[$data.cost]+'</li>' }
  619. if($data.invalidDay){ strCon+='<li>有效期至:'+TimeTr($data.invalidDay)+'</li>' }
  620. strCon+='</ul>'
  621. strCon+='</a>'
  622. $(strCon).appendTo(liStr);
  623. }
  624. //收藏与关注
  625. function attentMy(){
  626. var num=watchType;
  627. $.ajax({
  628. url: "/ajax/watch/qaWatch",
  629. dataType: 'json', //数据格式类型
  630. type: 'GET', //http请求类型
  631. data: {
  632. "watchObject": orgId,
  633. },
  634. timeout: 10000, //超时设置
  635. success: function(data) {
  636. if(data.success) {
  637. document.getElementById("attendMy").innerHTML="";
  638. document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.add("displayNone");
  639. if(data.data.length>0){
  640. var datalist = data.data;
  641. for(var i = 0; i < datalist.length; i++) {
  642. var liItem = document.createElement("li");
  643. liItem.className="mui-table-view-cell";
  644. document.getElementById("attendMy").appendChild(liItem);
  645. detailPro(datalist[i],liItem);
  646. }
  647. }else{
  648. document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  649. }
  650. }
  651. },
  652. error: function() {
  653. return;
  654. }
  655. });
  656. }
  657. function detailPro(datalist,liItem) {
  658. var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
  659. var os = "";
  660. if(datalist.professor.title) {
  661. if(datalist.professor.orgName) {
  662. os = datalist.professor.title + "," + datalist.professor.orgName;
  663. } else {
  664. os = datalist.professor.title;
  665. }
  666. } else {
  667. if(datalist.professor.office) {
  668. if(datalist.professor.orgName) {
  669. os = datalist.professor.office + "," + datalist.professor.orgName;
  670. } else {
  671. os = datalist.professor.office;
  672. }
  673. } else {
  674. if(datalist.professor.orgName) {
  675. os = datalist.professor.orgName;
  676. }
  677. }
  678. }
  679. var baImg = "../images/default-photo.jpg";
  680. if(datalist.professor.hasHeadImage == 1) {
  681. baImg = "/images/head/" + datalist.professor.id + "_l.jpg";
  682. }
  683. var strAdd = '';
  684. strAdd += '<a target="_blank" href="userInforShow.html?professorId='+ datalist.professor.id +'" class="flexCenter urlgo">';
  685. strAdd += '<div class="madiaHead useHead" style="width: 80px;height: 80px;margin-top: -40px;background-image:url(' + baImg + ')"></div>';
  686. strAdd += '<div class="madiaInfo" style="padding-left:92px"><p class="h1Font ellipsisSty">' + datalist.professor.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>';
  687. strAdd += '<p class="h2Font ellipsisSty">' + os + '</p>';
  688. strAdd += '</div>';
  689. strAdd += '</a>';
  690. liItem.innerHTML = strAdd
  691. }
  692. //纠错反馈
  693. $(".correctSubmit").on("click",function(){
  694. var cntCon=$(this).siblings(".correctCon").val();
  695. var cntUser="";
  696. if(userid && userid != null && userid != "null") {
  697. cntUser = userid;
  698. }
  699. if(cntCon.length>500){
  700. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  701. return;
  702. }else{
  703. $.ajax({
  704. "url": "/ajax/feedback/error/org",
  705. "type": "POST",
  706. "dataType": "json",
  707. "async": true,
  708. "data": {
  709. "id": orgId,
  710. "cnt":cntCon,
  711. "user":cntUser
  712. },
  713. "success": function(data) {
  714. if(data.success) {
  715. backSuccessed();
  716. }
  717. },
  718. "error": function() {
  719. $.MsgBox.Alert('提示', '链接服务器超时')
  720. }
  721. });
  722. }
  723. })
  724. })