$(function() {
var typeid = getparam("id");
var listname = getparam("listname");
$("." + listname).addclass("active").siblings().removeclass("active");
$(".list ul").append("
人才需求联系方式");
var lists = $(".list ul li");
selectitem(lists, typeid);
//首页轮播图
$.ajax({
url:"/cms/reception/imagetextlist",
datatype: "json",
type:"post",
data:{
typeid: "2",
page: 1,
pagesize:10
},
success: function(res) {
if (res.status === 0) {
if (res.data.length === 0) return;
var data = res.data;
var controll = "";
var sliderstr = "";
for (var i = 0; i < data.length; i++) {
controll += "";
sliderstr += "";
}
// 往轮播容器添加轮播图
$("#slider .slides").html(sliderstr);
// 轮播控制
//$("#slider .pagination").html(controll);
// 轮播控制
$(".pagination li:first-child").addclass("active");
$("#slider").easyslider( {
slidespeed: 500,
paginationspacing: "20px",
paginationdiameter: "12px",
paginationpositionfrombottom: "20px",
slidesclass: ".slides",
controlsclass: ".controls",
paginationclass: ".pagination"
});
}
}
});
$(".present").text($(".nav li.active > a").text());
$(".company-activity p:nth-child(1)").text($(".nav li.active > a").text());
$(".company-activity p:nth-child(2)").text(listname);
$(".high-tit").text($(".list ul li.active a").text());
//活动
$.ajax({
url:"/cms/reception/contactus",
datatype: "json",
type:"post",
data:{},
success: function(res) {
console.log(res)
if (res.status === 0) {
if (res.data === "" || res.data == null) return;
$("#content").html(res.data.content);
}
}
});
//联系我们
$.ajax({
url:"/cms/reception/contactus",
datatype: "json",
type:"post",
success: function(res) {
if (res.status === 0) {
$(".info").append(res.data.content);
}
}
});
$('#search').bind('keypress', function (event) {
if (event.keycode == "13") {
//关键字
$.ajax({
url:"/cms/reception/keywordsearch",
datatype: "json",
type:"post",
data:{
keyword:$(this).val(),
page: 1,
pagesize:10
},
success: function(res) {
if (res.status === 0) {
$(".search-down-menu").css("display", "block");
$(".search-down-menu").children("div").remove();
if (res.data.length === 0) {
$(".search-down-menu").append("暂无搜索结果, 请重新输入...
");
}
var data = res.data;
var str = "";
for(var i = 0; i< data.length; i++) {
str += ""+
""+
data[i].title+
""+
"";
}
$(".search-down-menu ul").html(str);
$(document).on("click", function() {
$(".search-down-menu").css("display", "none");
})
}
}
});
}
});
$('#search').bind("input propertychange", function() {
if($(this).val() === "") {
$(".search-down-menu").css("display", "none");
}
});
});