portal html css js resource

needList.js 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. $(document).ready(function() {
  2. $(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
  3. $(".workmenu>ul>li").eq(6).addClass("nowLi");
  4. loginStatus();//判断个人是否登录
  5. valUser();
  6. var oDemandAim = "",
  7. oSortType = "";
  8. /*需求列表*/
  9. function demandList(isbind, pageSize, pageNo, oDemand, oSort) {
  10. $.ajax({
  11. url: "/ajax/demand/pq",
  12. type: "GET",
  13. timeout: 10000,
  14. dataType: "json",
  15. data: {
  16. "pageNo": pageNo,
  17. "demandAim": oDemand,
  18. "sortType": oSort
  19. },
  20. beforeSend: function() {},
  21. success: function(data, textState) {
  22. if(data.success) {
  23. //console.log(data);
  24. $("#demandList").html(" ");
  25. var $info = data.data.data;
  26. demandHtml($info);
  27. if(isbind == true) {
  28. $(".tcdPageCode").createPage({
  29. pageCount: Math.ceil(data.data.total / pageSize),
  30. current: data.data.data.pageNo,
  31. backFn: function(p) {
  32. demandList(false, 5, p, oDemandAim, oSortType);
  33. }
  34. });
  35. }
  36. }
  37. },
  38. error: function(XMLHttpRequest, textStats, errorThrown) {
  39. }
  40. })
  41. }
  42. function demandHtml($data) {
  43. for(var i = 0; i < $data.length; i++) {
  44. var $obje = $data[i].professor;
  45. var personStr = personalInformation($obje);
  46. var demandAim = "技术咨询",
  47. demandType = "企业需求";
  48. var oImg = "",
  49. oTime = "";
  50. if($data[i].demandAim == 2) {
  51. demandAim = "寻找资源"
  52. } else if($data[i].demandAim == 3) {
  53. demandAim = "其他需求"
  54. }
  55. if($data[i].demandType == 1) {
  56. demandType = "个人需求"
  57. }
  58. if($obje.hasHeadImage) {
  59. oImg = "/images/head/" + $obje.id + "_l.jpg";
  60. } else {
  61. oImg = "images/default-photo.jpg"
  62. }
  63. //认证
  64. var oSty=autho($obje.authType,$obje.orgAuth,$obje.authStatus);
  65. typeTname = oSty.sty;
  66. oTime = $data[i]["createTime"].substr(0, 4) + "年" + $data[i].createTime.substr(4, 2) + "月" + $data[i].createTime.substr(6, 2) + "日" +
  67. $data[i].createTime.substr(8, 2) + ":" + $data[i].createTime.substr(10, 2);
  68. var dataString = "<div class='workselectitem'><table width='100%'>"
  69. dataString += "<tbody><tr><td width='14%' class='messagebox'>"
  70. dataString += "<a class='workhead workitimg userRadius'>"
  71. dataString += "<img class='headPhoto' src='" + oImg + "' width='100%' height='100%'></a></td>"
  72. dataString += "<td style='position:relative;top:20px;' width='86%'>"
  73. dataString += "<div class='workinfor worksitcon'><h4><a class='named'>" + $obje.name + "</a>"
  74. dataString += "<a class='authiconNew " + typeTname + "' title='"+oSty.title+"' style='top:9px;'></a><input type='text' class='assessStar' style='display: none;'></h4><h6 class='h3Font'>"
  75. dataString += "<span>" + personStr + "</span>"
  76. dataString += "<h6 style='position:relative;'>"
  77. dataString += "<div class='titList'>需求主题:<em class='h4Font'>" + $data[i].demandTitle + "</em></div>"
  78. dataString += "<span class='lasttime rightTime'>" + oTime + "</span>"
  79. dataString += "<div style='height:70px;'><p class='ellipsisSty-2 rebackcon' >" + $data[i].demandContent + "</p></div></div>"
  80. dataString += "<div class='workhandle'><div class='rightopert floatR'>"
  81. dataString += "<span class='replybtn' demanid='" + $data[i].demandId + "'>查看</span></div>"
  82. dataString += "<div class='leftstate floatR'>"
  83. dataString += "<span class='coultstate status-4'><i>" + demandAim + "</i></span></div>"
  84. dataString += "<div class='leftstate floatR'>"
  85. dataString += "<span class='coultstate coulstAim status-4'><i>" + demandType + "</i></span>"
  86. dataString += "</div></div></td></tr></tbody></table></div>"
  87. $("#demandList").append(dataString);
  88. }
  89. }
  90. /*职位职称所在机构,部门,地址等等*/
  91. function personalInformation($person) {
  92. var arr1 = [$person.title, $person.office, $person.department, $person.orgName, $person.address];
  93. var arr = new Array();
  94. var arr2 = new Array();
  95. var n = 0;
  96. for(var i = 0; i < arr1.length; i++) {
  97. if(arr1[i]) {
  98. arr.push(arr1[i]);
  99. if(arr1[i] == arr1[arr1.length - 1]) {
  100. n = 1;
  101. }
  102. }
  103. }
  104. if(n == 1) {
  105. for(var i = 0; i < arr.length-1; i++) {
  106. arr2.push(arr[i]);
  107. }
  108. return arr2.join()+ " | " + arr[arr.length - 1];
  109. } else {
  110. return arr.join();
  111. }
  112. }
  113. demandList(true, 5, 1, oDemandAim, oSortType);
  114. /*检索排序*/
  115. function selcet(i) {
  116. $(".selcet" + i).on('click', function(e) {
  117. var option = $(this).find(".option" + i);
  118. option.css("display", "block")
  119. var o_this = $(this);
  120. o_this.find("li").click(function() {
  121. o_this.find("li").removeClass("workcurrent");
  122. $(this).addClass("workcurrent");
  123. o_this.find("span").text($(this).text());
  124. option.css("display", "none");
  125. if($(this).text() == "技术咨询") {
  126. oDemandAim = 1;
  127. $(".tcdPageCode").remove();
  128. $("#shoudao").append('<div class="tcdPageCode"></div>');
  129. demandList(true, 5, 1, oDemandAim, oSortType);
  130. } else if($(this).text() == "资源合作") {
  131. oDemandAim = 2;
  132. $(".tcdPageCode").remove();
  133. $("#shoudao").append('<div class="tcdPageCode"></div>');
  134. demandList(true, 5, 1, oDemandAim, oSortType);
  135. } else if($(this).text() == "其他需求") {
  136. oDemandAim = 3;
  137. $(".tcdPageCode").remove();
  138. $("#shoudao").append('<div class="tcdPageCode"></div>');
  139. demandList(true, 5, 1, oDemandAim, oSortType);
  140. } else if($(this).text() == "不限") {
  141. oDemandAim = "";
  142. $(".tcdPageCode").remove();
  143. $("#shoudao").append('<div class="tcdPageCode"></div>');
  144. demandList(true, 5, 1, oDemandAim, oSortType);
  145. } else if($(this).text() == "按最早发布时间排序") {
  146. oSortType = 1;
  147. $(".tcdPageCode").remove();
  148. $("#shoudao").append('<div class="tcdPageCode"></div>');
  149. demandList(true, 5, 1, oDemandAim, oSortType);
  150. } else if($(this).text() == "按最新发布时间排序") {
  151. oSortType = 0;
  152. $(".tcdPageCode").remove();
  153. $("#shoudao").append('<div class="tcdPageCode"></div>');
  154. demandList(true, 5, 1, oDemandAim, oSortType);
  155. }
  156. return false;
  157. });
  158. $("body").click(function(e) {
  159. if($(".option4")[0].style.display == "block" || $(".option3")[0].style.display == "block") {
  160. $(".option4")[0].style.display = "none";
  161. $(".option3")[0].style.display = "none";
  162. }
  163. });
  164. return false;
  165. })
  166. }
  167. selcet(3);
  168. selcet(4);
  169. /*进入needSure.html*/
  170. $("#demandList").on("click", ".replybtn", function() {
  171. var demand = $(this).attr("demanid");
  172. location.href = "needSure.html?demandId=" + demand;
  173. })
  174. })