portal html css js resource

needList.js 6.5KB

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