$(function() { var typeid = getparam("id"); var listname = getparam("listname"); console.log(listname) $("." + listname).addclass("active").siblings().removeclass("active"); var str = ""; if (listname === "introduce") { // 公司资讯 $(".tab-tie").text("资讯列表"); str = "
  • 英伦简介
  • "+ "
  • 英伦文化
  • "+ "
  • 公司荣誉
  • "+ "
  • 公司架构
  • "; }else if (listname === "family") { str = "
  • 英伦之家
  • "+ "
  • 员工风采
  • "+ "
  • 党员之家
  • "; } $(".list ul").append(str); 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)").html($(".nav li.active > a").text()); $(".company-activity p:nth-child(2)").html(listname); $(".high-tit").html($(".list ul li.active a").text()); //活动 $.ajax({ url:"/cms/reception/imagetextlist", datatype: "json", type:"post", data:{ typeid: typeid == null ? 1 : typeid, page: 1, pagesize:10 }, success: function(res) { if (res.status === 0) { if (res.data.length === 0) return; var data = res.data; if(array.isarray(data)) { var str = "" for (var i = 0; i < data.length; i++) { str += "

    "+data[i].title+":  "+data[i].abstract+"

    "; } $("#content").append(str); }else { $("#content").html("

    "+res.data.title +"

    "+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"); } }); });