portal html css js resource

needList.js 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. $(document).ready(function() {
  2. $(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
  3. $(".workmenu>ul>li:contains('需求')").addClass("nowLi");
  4. loginStatus();//判断个人是否登录
  5. valUser();
  6. demandList(true, 5, 1);
  7. /*需求列表*/
  8. function demandList(isbind, pageSize, pageNo) {
  9. $.ajax({
  10. url: "/ajax/demand/pq",
  11. type: "GET",
  12. timeout: 10000,
  13. dataType: "json",
  14. data: {
  15. "pageNo": pageNo,
  16. "pageSize":pageSize,
  17. },
  18. beforeSend: function() {
  19. $("#demandList").append('<img src="../images/loading.gif" class="loading" />');
  20. },
  21. success: function(data) {
  22. if(data.success) {
  23. $("#demandList").html(" ");
  24. var $info = data.data.data;
  25. if($info.length > 0){
  26. for(var i = 0; i < $info.length; i++) {
  27. var liStr=$("<li></li>").appendTo("#demandList");
  28. demandHtml($info[i],liStr);
  29. cmpFun($info[i].orgId,liStr);
  30. }
  31. if(isbind == true) {
  32. $(".tcdPageCode").createPage({
  33. pageCount: Math.ceil(data.data.total / pageSize),
  34. current: data.data.data.pageNo,
  35. backFn: function(p) {
  36. demandList(false, 5, p);
  37. }
  38. });
  39. }
  40. }else{
  41. $("#demandList").parent().find(".nodatabox").removeClass("displayNone")
  42. }
  43. }
  44. $(".loading").remove();
  45. },
  46. error: function() {
  47. $.MsgBox.Alert('提示', '链接服务器超时')
  48. }
  49. })
  50. }
  51. function demandHtml($data,liStr) {
  52. var sowU="";
  53. if($data.pageViews!=0){
  54. sowU='<li><span>浏览量 '+$data.pageViews +'</span></li>'
  55. }
  56. var strCon='';
  57. strCon+='<a class="" target="_blank" href="" class="madiaInfo">'
  58. strCon+='<p class="h1Font ellipsisSty">'+ $data.title +'</p>'
  59. strCon+='<ul class="showliTop h3Font clearfix">'
  60. strCon+='<li><span class="cmpName"></span></li><li><span>发布于 '+commenTime($data.createTime)+'</span></li>'
  61. strCon+= sowU
  62. strCon+='</ul>'
  63. strCon+='<p class="h2Font ellipsisSty-2">'+$data.descp+'</p>'
  64. strCon+='<ul class="showli clearfix h3Font">'
  65. if($data.city){ strCon+='<li>所在城市:'+$data.city+'</li>' }
  66. if($data.duration){ strCon+='<li>预期时长:'+demandDuration[$data.duration]+'</li>' }
  67. if($data.cost){ strCon+='<li>费用预算:'+demandCost[$data.cost]+'</li>' }
  68. if($data.invalidDay){ strCon+='<li>有效期至:'+TimeTr($data.invalidDay)+'</li>' }
  69. strCon+='</ul>'
  70. strCon+='</a>'
  71. $(strCon).appendTo(liStr);
  72. }
  73. /*企业用户信息*/
  74. function cmpFun(id,$listItem) {
  75. $.ajax({
  76. "url": "/ajax/org/" + id,
  77. "type": "get",
  78. "async": true,
  79. "success": function(data) {
  80. if(data.success && data.data) {
  81. if(data.data.forShort) {
  82. $listItem.find(".cmpName").text(data.data.forShort);
  83. }else{
  84. $listItem.find(".cmpName").text(data.data.name);
  85. }
  86. }
  87. },
  88. "error": function() {
  89. $.MsgBox.Alert('提示', '链接服务器超时')
  90. }
  91. });
  92. }
  93. // function demandHtml($data) {
  94. // for(var i = 0; i < $data.length; i++) {
  95. // var $obje = $data[i].professor;
  96. // var personStr = personalInformation($obje);
  97. // var demandAim = "技术咨询",
  98. // demandType = "企业需求";
  99. // var oImg = "",
  100. // oTime = "";
  101. // if($data[i].demandAim == 2) {
  102. // demandAim = "寻找资源"
  103. // } else if($data[i].demandAim == 3) {
  104. // demandAim = "其他需求"
  105. // }
  106. // if($data[i].demandType == 1) {
  107. // demandType = "个人需求"
  108. // }
  109. // if($obje.hasHeadImage) {
  110. // oImg = "/images/head/" + $obje.id + "_l.jpg";
  111. // } else {
  112. // oImg = "images/default-photo.jpg"
  113. // }
  114. // //认证
  115. // var oSty=autho($obje.authType,$obje.orgAuth,$obje.authStatus);
  116. // typeTname = oSty.sty;
  117. //
  118. // oTime = $data[i]["createTime"].substr(0, 4) + "年" + $data[i].createTime.substr(4, 2) + "月" + $data[i].createTime.substr(6, 2) + "日" +
  119. // $data[i].createTime.substr(8, 2) + ":" + $data[i].createTime.substr(10, 2);
  120. // var dataString = "<div class='workselectitem'><table width='100%'>"
  121. // dataString += "<tbody><tr><td width='14%' class='messagebox'>"
  122. // dataString += "<a class='workhead workitimg userRadius'>"
  123. // dataString += "<img class='headPhoto' src='" + oImg + "' width='100%' height='100%'></a></td>"
  124. // dataString += "<td style='position:relative;top:20px;' width='86%'>"
  125. // dataString += "<div class='workinfor worksitcon'><h4><a class='named'>" + $obje.name + "</a>"
  126. // dataString += "<a class='authiconNew " + typeTname + "' title='"+oSty.title+"' style='top:9px;'></a><input type='text' class='assessStar' style='display: none;'></h4><h6 class='h3Font'>"
  127. // dataString += "<span>" + personStr + "</span>"
  128. // dataString += "<h6 style='position:relative;'>"
  129. // dataString += "<div class='titList'>需求主题:<em class='h4Font'>" + $data[i].demandTitle + "</em></div>"
  130. // dataString += "<span class='lasttime rightTime'>" + oTime + "</span>"
  131. // dataString += "<div style='height:70px;'><p class='ellipsisSty-2 rebackcon' >" + $data[i].demandContent + "</p></div></div>"
  132. // dataString += "<div class='workhandle'><div class='rightopert floatR'>"
  133. // dataString += "<span class='replybtn' demanid='" + $data[i].demandId + "'>查看</span></div>"
  134. // dataString += "<div class='leftstate floatR'>"
  135. // dataString += "<span class='coultstate status-4'><i>" + demandAim + "</i></span></div>"
  136. // dataString += "<div class='leftstate floatR'>"
  137. // dataString += "<span class='coultstate coulstAim status-4'><i>" + demandType + "</i></span>"
  138. // dataString += "</div></div></td></tr></tbody></table></div>"
  139. // $("#demandList").append(dataString);
  140. // }
  141. // }
  142. /*职位职称所在机构,部门,地址等等*/
  143. // function personalInformation($person) {
  144. // var arr1 = [$person.title, $person.office, $person.department, $person.orgName, $person.address];
  145. // var arr = new Array();
  146. // var arr2 = new Array();
  147. // var n = 0;
  148. // for(var i = 0; i < arr1.length; i++) {
  149. // if(arr1[i]) {
  150. // arr.push(arr1[i]);
  151. // if(arr1[i] == arr1[arr1.length - 1]) {
  152. // n = 1;
  153. // }
  154. // }
  155. // }
  156. // if(n == 1) {
  157. // for(var i = 0; i < arr.length-1; i++) {
  158. // arr2.push(arr[i]);
  159. // }
  160. // return arr2.join()+ " | " + arr[arr.length - 1];
  161. // } else {
  162. // return arr.join();
  163. // }
  164. //
  165. // }
  166. /*检索排序*/
  167. // function selcet(i) {
  168. // $(".selcet" + i).on('click', function(e) {
  169. // var option = $(this).find(".option" + i);
  170. // option.css("display", "block")
  171. // var o_this = $(this);
  172. // o_this.find("li").click(function() {
  173. // o_this.find("li").removeClass("workcurrent");
  174. // $(this).addClass("workcurrent");
  175. // o_this.find("span").text($(this).text());
  176. // option.css("display", "none");
  177. // if($(this).text() == "技术咨询") {
  178. // oDemandAim = 1;
  179. // $(".tcdPageCode").remove();
  180. // $("#shoudao").append('<div class="tcdPageCode"></div>');
  181. // demandList(true, 5, 1, oDemandAim, oSortType);
  182. // } else if($(this).text() == "资源合作") {
  183. // oDemandAim = 2;
  184. // $(".tcdPageCode").remove();
  185. // $("#shoudao").append('<div class="tcdPageCode"></div>');
  186. // demandList(true, 5, 1, oDemandAim, oSortType);
  187. // } else if($(this).text() == "其他需求") {
  188. // oDemandAim = 3;
  189. // $(".tcdPageCode").remove();
  190. // $("#shoudao").append('<div class="tcdPageCode"></div>');
  191. // demandList(true, 5, 1, oDemandAim, oSortType);
  192. // } else if($(this).text() == "不限") {
  193. // oDemandAim = "";
  194. // $(".tcdPageCode").remove();
  195. // $("#shoudao").append('<div class="tcdPageCode"></div>');
  196. // demandList(true, 5, 1, oDemandAim, oSortType);
  197. // } else if($(this).text() == "按最早发布时间排序") {
  198. // oSortType = 1;
  199. // $(".tcdPageCode").remove();
  200. // $("#shoudao").append('<div class="tcdPageCode"></div>');
  201. // demandList(true, 5, 1, oDemandAim, oSortType);
  202. // } else if($(this).text() == "按最新发布时间排序") {
  203. // oSortType = 0;
  204. // $(".tcdPageCode").remove();
  205. // $("#shoudao").append('<div class="tcdPageCode"></div>');
  206. // demandList(true, 5, 1, oDemandAim, oSortType);
  207. // }
  208. // return false;
  209. // });
  210. // $("body").click(function(e) {
  211. // if($(".option4")[0].style.display == "block" || $(".option3")[0].style.display == "block") {
  212. // $(".option4")[0].style.display = "none";
  213. // $(".option3")[0].style.display = "none";
  214. // }
  215. // });
  216. // return false;
  217. // })
  218. // }
  219. // selcet(3);
  220. // selcet(4);
  221. // /*进入needSure.html*/
  222. // $("#demandList").on("click", ".replybtn", function() {
  223. // var demand = $(this).attr("demanid");
  224. // location.href = "needSure.html?demandId=" + demand;
  225. // })
  226. })