portal html css js resource

needList.js 6.3KB

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