portal html css js resource

cmp-needList.js 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. $(document).ready(function() {
  2. var id = $.cookie('orgId');
  3. var oDemandAim = "",
  4. oSortType = "";
  5. /*查询企业认证状态*/
  6. function companyAuthentState() {
  7. $.ajax({
  8. url: '/ajax/org/authStatus',
  9. type: "GET",
  10. timeout: 10000,
  11. dataType: "json",
  12. data: {
  13. "id": id
  14. },
  15. beforeSend: function() {},
  16. success: function(data, textState) {
  17. if(data.success) {
  18. console.log(data);
  19. if(data.data == 3) {
  20. $("#companyDemandList").show();
  21. } else {
  22. $("#identityState").show();
  23. }
  24. }
  25. },
  26. error: function(XMLHttpRequest, textStats, errorThrown) {
  27. $.MsgBox.Alert('提示', '服务器请求失败')
  28. }
  29. })
  30. }
  31. companyAuthentState();
  32. /*企业需求列表*/
  33. /*需求列表*/
  34. function demandList(isbind, pageSize, pageNo, oDemand, oSort) {
  35. $.ajax({
  36. url: "/ajax/demand/pqOrg",
  37. type: "GET",
  38. timeout: 10000,
  39. dataType: "json",
  40. data: {
  41. "orgId": id,
  42. "pageNo": pageNo,
  43. "demandStatus": oDemand,
  44. "sortType": oSort
  45. },
  46. beforeSend: function() {},
  47. success: function(data, textState) {
  48. if(data.success) {
  49. console.log(data);
  50. $("#demandList").html(" ");
  51. var $info = data.data.data;
  52. demandHtml($info);
  53. if($info.length != 0) {
  54. if(isbind == true) {
  55. $(".tcdPageCode").createPage({
  56. pageCount: Math.ceil(data.data.total / pageSize),
  57. current: data.data.data.pageNo,
  58. backFn: function(p) {
  59. demandList(false, 5, p, oDemandAim, oSortType);
  60. }
  61. });
  62. }
  63. }
  64. }
  65. },
  66. error: function(XMLHttpRequest, textStats, errorThrown) {
  67. }
  68. })
  69. }
  70. demandList(true, 5, 1, oDemandAim, oSortType);
  71. function demandHtml($data) {
  72. for(var i = 0; i < $data.length; i++) {
  73. var $obje = $data[i].professor;
  74. var personStr = personalInformation($obje);
  75. var demandAim = "技术咨询",
  76. demandType = "已关闭",
  77. demandStyle = "status-5";
  78. var oImg = "",
  79. oTime = "";
  80. if($data[i].demandAim == 2) {
  81. demandAim = "寻找资源"
  82. } else if($data[i].demandAim == 3) {
  83. demandAim = "其他需求"
  84. }
  85. if($data[i].demandStatus == 1) {
  86. demandType = "发布中";
  87. demandStyle = "status-4";
  88. }
  89. if($obje.hasHeadImage) {
  90. oImg = "/images/head/" + $obje.id + "_l.jpg";
  91. } else {
  92. oImg = "../images/default-photo.jpg"
  93. }
  94. if($obje.authType) {
  95. var typeTname = " authicon authicon-cu"
  96. } else {
  97. if($obje.authStatus == 3) {
  98. if($obje.authentication == 1) {
  99. var typeTname = " authicon2 authicon-mana";
  100. } else if($obje.authentication == 2) {
  101. var typeTname = " authicon2 authicon-staff";
  102. } else {
  103. var typeTname = " authicon2 authicon-stu"
  104. }
  105. }
  106. }
  107. oTime = $data[i]["createTime"].substr(0, 4) + "年" + $data[i].createTime.substr(4, 2) + "月" + $data[i].createTime.substr(6, 2) + "日" +
  108. $data[i].createTime.substr(8, 2) + ":" + $data[i].createTime.substr(10, 2);
  109. var oClass = autho($obje.authType, $obje.orgAuth, $obje.authStatus);
  110. var dataString = "<li class='workselectitem'>"
  111. dataString += "<div class='col-w-2'>"
  112. dataString += "<div class='workitimg headRadius'>"
  113. dataString += "<img class='headPhoto' src='" + oImg + "' width='100%'>"
  114. dataString += "</div></div>"
  115. dataString += "<div class='col-w-10 needinfo'>"
  116. dataString += "<div class='workinfor worksitcon'>"
  117. dataString += "<h4><span class='h1Font'>" + $obje.name + "</span>"
  118. dataString += "<em class='authicon "+oClass.sty+"' title='"+oClass.title+"'></em></h4>"
  119. dataString += "<h6 class='h3Font'>" + personStr + "</h6>"
  120. dataString += "<h6 style='position:relative;'>"
  121. dataString += "<div class='titList'>需求主题:<em class='h4Font'>" + $data[i].demandTitle + "</em></div>"
  122. dataString += "<span class='lasttime rightTime'>" + oTime + "</span>"
  123. dataString += "<p class='rebackcon ellipsisSty-2'>" + $data[i].demandContent + "</p>"
  124. dataString += "</h6></div>"
  125. dataString += "<div class='workhandle'>"
  126. dataString += "<div class='rightopert floatR'>"
  127. dataString += "<span class='replybtn' demanid='" + $data[i].demandId + "'>查看</span></div>"
  128. dataString += "<div class='leftstate floatR'>"
  129. dataString += "<span class='coultstate " + demandStyle + "'><i>" + demandType + "</i></span></div>"
  130. dataString += "<div class='leftstate floatR'>"
  131. dataString += "<span class='coultstate coulstAim status-4'><i>" + demandAim + "</i></span></div></div></div></li>"
  132. $("#demandList").append(dataString);
  133. }
  134. }
  135. /*职位职称所在机构,部门,地址等等*/
  136. function personalInformation($person) {
  137. var arr1 = [$person.title, $person.office, $person.department, $person.orgName, $person.address];
  138. var arr = new Array();
  139. var arr2 = new Array();
  140. var n = 0;
  141. for(var i = 0; i < arr1.length; i++) {
  142. if(arr1[i]) {
  143. arr.push(arr1[i]);
  144. if(arr1[i] == arr1[arr1.length - 1]) {
  145. n = 1;
  146. }
  147. }
  148. }
  149. if(n == 1) {
  150. for(var i = 0; i < arr.length - 1; i++) {
  151. arr2.push(arr[i]);
  152. }
  153. return arr2.join() + " | " + arr[arr.length - 1];
  154. } else {
  155. return arr.join();
  156. }
  157. }
  158. /*检索排序*/
  159. function selcet(i) {
  160. $(".selcet" + i).on('click', function(e) {
  161. var option = $(this).find(".option" + i);
  162. option.css("display", "block")
  163. var o_this = $(this);
  164. o_this.find("li").click(function() {
  165. o_this.find("li").removeClass("workcurrent");
  166. $(this).addClass("workcurrent");
  167. o_this.find("span").text($(this).text());
  168. option.css("display", "none");
  169. if($(this).text() == "发布中") {
  170. oDemandAim = 1;
  171. $(".tcdPageCode").remove();
  172. $("#shoudao").append('<div class="tcdPageCode"></div>');
  173. demandList(true, 5, 1, oDemandAim, oSortType);
  174. } else if($(this).text() == "已关闭") {
  175. oDemandAim = 0;
  176. $(".tcdPageCode").remove();
  177. $("#shoudao").append('<div class="tcdPageCode"></div>');
  178. demandList(true, 5, 1, oDemandAim, oSortType);
  179. } else if($(this).text() == "全部") {
  180. oDemandAim = "";
  181. $(".tcdPageCode").remove();
  182. $("#shoudao").append('<div class="tcdPageCode"></div>');
  183. demandList(true, 5, 1, oDemandAim, oSortType);
  184. } else if($(this).text() == "按最早发布时间排序") {
  185. oSortType = 1;
  186. $(".tcdPageCode").remove();
  187. $("#shoudao").append('<div class="tcdPageCode"></div>');
  188. demandList(true, 5, 1, oDemandAim, oSortType);
  189. } else if($(this).text() == "按最新发布时间排序") {
  190. oSortType = 0;
  191. $(".tcdPageCode").remove();
  192. $("#shoudao").append('<div class="tcdPageCode"></div>');
  193. demandList(true, 5, 1, oDemandAim, oSortType);
  194. }
  195. return false;
  196. });
  197. $("body").click(function(e) {
  198. if($(".option4")[0].style.display == "block" || $(".option3")[0].style.display == "block") {
  199. $(".option4")[0].style.display = "none";
  200. $(".option3")[0].style.display = "none";
  201. }
  202. });
  203. return false;
  204. })
  205. }
  206. selcet(3); selcet(4);
  207. /*进入needSure.html*/
  208. $("#demandList").on("click", ".replybtn", function() {
  209. var demand = $(this).attr("demanid");
  210. location.href = "cmp-needShow.html?demandId=" + demand;
  211. })
  212. })