$(document).ready(function() { $(".onlogin .headnavbtn li").eq(0).addClass("navcurrent"); var id = $.cookie('orgId'); if(id == "" || id == null || id == "null"){ location.href = "cmp-settled-log.html"; } var oDemandAim = "", oSortType = ""; /*查询企业认证状态*/ function companyAuthentState() { $.ajax({ url: '/ajax/org/authStatus', type: "GET", timeout: 10000, dataType: "json", data: { "id": id }, beforeSend: function() {}, success: function(data, textState) { if(data.success) { console.log(data); if(data.data == 3) { $("#companyDemandList").show(); } else { $("#identityState").show(); } } }, error: function(XMLHttpRequest, textStats, errorThrown) { $.MsgBox.Alert('提示', '服务器请求失败') } }) } companyAuthentState(); /*企业需求列表*/ /*需求列表*/ function demandList(isbind, pageSize, pageNo, oDemand, oSort) { $.ajax({ url: "/ajax/demand/pqOrg", type: "GET", timeout: 10000, dataType: "json", data: { "orgId": id, "pageNo": pageNo, "demandStatus": oDemand, "sortType": oSort }, beforeSend: function() {}, success: function(data, textState) { if(data.success) { console.log(data); $("#demandList").html(" "); var $info = data.data.data; demandHtml($info); if($info.length != 0) { if(isbind == true) { $(".tcdPageCode").createPage({ pageCount: Math.ceil(data.data.total / pageSize), current: data.data.data.pageNo, backFn: function(p) { demandList(false, 5, p, oDemandAim, oSortType); } }); } } } }, error: function(XMLHttpRequest, textStats, errorThrown) { } }) } demandList(true, 5, 1, oDemandAim, oSortType); function demandHtml($data) { for(var i = 0; i < $data.length; i++) { var $obje = $data[i].professor; var personStr = personalInformation($obje); var demandAim = "技术咨询", demandType = "已关闭", demandStyle = "status-5"; var oImg = "", oTime = ""; if($data[i].demandAim == 2) { demandAim = "寻找资源" } else if($data[i].demandAim == 3) { demandAim = "其他需求" } if($data[i].demandStatus == 1) { demandType = "发布中"; demandStyle = "status-4"; } if($obje.hasHeadImage) { oImg = "/images/head/" + $obje.id + "_l.jpg"; } else { oImg = "../images/default-photo.jpg" } oTime = $data[i]["createTime"].substr(0, 4) + "年" + $data[i].createTime.substr(4, 2) + "月" + $data[i].createTime.substr(6, 2) + "日" + $data[i].createTime.substr(8, 2) + ":" + $data[i].createTime.substr(10, 2); var oClass = autho($obje.authType, $obje.orgAuth, $obje.authStatus); var dataString = "
  • " dataString += "
    " dataString += "
    " dataString += "" dataString += "
    " dataString += "
    " dataString += "
    " dataString += "

    " + $obje.name + "" dataString += "

    " dataString += "
    " + personStr + "
    " dataString += "
    " dataString += "
    需求主题:" + $data[i].demandTitle + "
    " dataString += "" + oTime + "" dataString += "

    " + $data[i].demandContent + "

    " dataString += "
    " dataString += "
    " dataString += "
    " dataString += "查看
    " dataString += "
    " dataString += "" + demandType + "
    " dataString += "
    " dataString += "" + demandAim + "
  • " $("#demandList").append(dataString); } } /*职位职称所在机构,部门,地址等等*/ function personalInformation($person) { var arr1 = [$person.title, $person.office, $person.department, $person.orgName, $person.address]; var arr = new Array(); var arr2 = new Array(); var n = 0; for(var i = 0; i < arr1.length; i++) { if(arr1[i]) { arr.push(arr1[i]); if(arr1[i] == arr1[arr1.length - 1]) { n = 1; } } } if(n == 1) { for(var i = 0; i < arr.length - 1; i++) { arr2.push(arr[i]); } return arr2.join() + " | " + arr[arr.length - 1]; } else { return arr.join(); } } /*检索排序*/ function selcet(i) { $(".selcet" + i).on('click', function(e) { var option = $(this).find(".option" + i); option.css("display", "block") var o_this = $(this); o_this.find("li").click(function() { o_this.find("li").removeClass("workcurrent"); $(this).addClass("workcurrent"); o_this.find("span").text($(this).text()); option.css("display", "none"); if($(this).text() == "发布中") { oDemandAim = 1; $(".tcdPageCode").remove(); $("#shoudao").append('
    '); demandList(true, 5, 1, oDemandAim, oSortType); } else if($(this).text() == "已关闭") { oDemandAim = 0; $(".tcdPageCode").remove(); $("#shoudao").append('
    '); demandList(true, 5, 1, oDemandAim, oSortType); } else if($(this).text() == "全部") { oDemandAim = ""; $(".tcdPageCode").remove(); $("#shoudao").append('
    '); demandList(true, 5, 1, oDemandAim, oSortType); } else if($(this).text() == "按最早发布时间排序") { oSortType = 1; $(".tcdPageCode").remove(); $("#shoudao").append('
    '); demandList(true, 5, 1, oDemandAim, oSortType); } else if($(this).text() == "按最新发布时间排序") { oSortType = 0; $(".tcdPageCode").remove(); $("#shoudao").append('
    '); demandList(true, 5, 1, oDemandAim, oSortType); } return false; }); $("body").click(function(e) { if($(".option4")[0].style.display == "block" || $(".option3")[0].style.display == "block") { $(".option4")[0].style.display = "none"; $(".option3")[0].style.display = "none"; } }); return false; }) } selcet(3); selcet(4); /*进入needSure.html*/ $("#demandList").on("click", ".replybtn", function() { var demand = $(this).attr("demanid"); location.href = "cmp-needShow.html?demandId=" + demand; }) })