$.index = { load: function () { this.gettab(); this.getbanner(); this.getcompany(); this.getscene(); //this.getproducttype(); this.getproduct(); this.getjournalisms(); }, //获取导航栏 gettab : function(){ var json = { page : 1, size : 6, 'map.sort':1 }; $.common.get("api/open/home/navfindpage", json, function (data) { var list = data.data.content; if(list.length>0){ //顶部导航特殊处理 $(".tablist li a").each(function(i,v){ if(list[i]){ $(v).html(list[i].title); $(v).attr('href',list[i].link); } }); //子导航 $.each(list, function (i, v) { var son = v.sonlist; if(son.length>0 && v.title!="首页"){ var html = "";//顶部 var html2 = "";//底部 for(var k = 0;k`+son[k].title+``; html2 += `
`+son[k].title+`<
`; }else { html += `
  • `+son[k].title+`
  • `; html2 += `
    `+son[k].title+`<
    `; } } $(".tab"+i).html(html); $(".bottomtab"+i).html(html2); $(".tabname"+i).html(v.title); }else { if(v.flag == 1){ $(".tabname"+i).html(""+v.title+"" ); }else { $(".tabname"+i).html(""+v.title+"" ); } } }); } }) }, showlink : function(data){ console.log("进来了"); return; window.open(data,"_blank"); }, //获取轮播图 getbanner : function() { var json = { page : 1, size : 6, 'map.sort':1 }; $.common.get("api/open/home/banfindpage", json, function (data) { var list = data.data.content; if(list.length>0){ var html = ""; var html2 = ""; //子导航 $.each(list, function (i, v) { html += `
    `; if(v.title){ html += `
    `+ `
    `+ `
    `+v.title+`
    `; if(v.content){ html += `
    `+v.content+`
    `; } html += `
    `+ `
    `; } html += `
    `; html2 += `
    `; }); $(".banner").html(html); var my = new swiper('.ind-banner .swiper-container', { effect: 'fade', autoplay: 3500, speed: 600, pagination: '.ind-banner .swiper-pagination', // paginationtype : 'progress', paginationclickable: true, autoplaydisableoninteraction: false, loop: true, nextbutton: '.swiper-button-next', prevbutton: '.swiper-button-prev', oninit: function(swiper) { swiperanimatecache(swiper); swiperanimate(swiper); }, onslidechangeend: function(swiper) { swiperanimate(swiper); } }); //移动端 $(".banneryd").html(html2); $('.indexflashtel').slick({ dots: true, infinite: true, autoplay: true, arrows: false, speed: 500, slidestoshow: 1, slidestoscroll: 1 }); } }) }, //获取关于公司 getcompany : function(){ $.common.get("api/open/home/findcompany", {}, function (data) { var obj = data.data; $(".homeintroduce").html(obj.homeintroduce); $(".yearnum").html(obj.yearnum); $(".yearnum").attr("rel",obj.yearnum); $(".income").html(obj.income); $(".income").attr("rel",obj.income); $(".phone").html("电话:"+obj.phone); $(".address2").html("地址:"+obj.address); $(".mailbox").html("邮箱:"+obj.mailbox); $(".fax").html("传真:"+obj.fax); $(".icpkeep").html(obj.icpkeep); $(".yuekeep").html(obj.yuekeep); var date = new date(); $(".establishment").html(obj.year+"-"+date.getfullyear()); }) }, //获取场景 getscene : function(){ var json = { page : 1, size : 4, 'map.sort':1 }; $.common.get("api/open/home/scenefindpage", json, function (data) { var list = data.data.content; if(list.length>0){ var html = ``; $.each(list, function (i, v) { html += `
    `+ `
    `+ `
    `+ `

    `+v.title+`

    `+ `

    `+v.sontitle+`

    `+ `
    `+ `
    `; }); $(".scene").html(html); } }) }, // //获取产品类型 // getproducttype : function(){ // var json = { // page : 1, // size : 6, // 'map.state':0 // }; // $.common.get("api/open/home/protypefindpage", json, function (data) { // var list = data.data.content; // if(list.length>0){ // var html = ``; // $.each(list, function (i, v) { // html += `
  • `+v.name+`
  • `; // }); // $(".producttype").html(html); // } // }) // }, //获取产品 getproduct : function(type){ var json = { page : 1, size : 20, 'map.state':0 }; if(type){ json['map.ptid'] = type; } $.common.get("api/open/home/profindpage", json, function (data) { var list = data.data.content; if(list.length>0){ var html = ``; $.each(list, function (i, v) { html += `
    `+ ``+ `
    `+ `
    `+v.name+`
    `+ `
    `+ `
    `; }); $(".product").html(html); $('.blog-carousel-active').slick({ autoplay: false, infinite: true, fade: false, dots: false, arrows: true, prevarrow: '', nextarrow: '', slidestoshow: 4, responsive: [ { breakpoint: 1600, settings: { slidestoshow: 3, } }, { breakpoint: 992, settings: { slidestoshow: 2, } }, { breakpoint: 576, settings: { slidestoshow: 1, arrows: false, } }, ] }); } }) }, //获取新闻 getjournalisms : function(){ var json = { page : 1, size : 4, 'map.state':0 }; $.common.get("api/open/home/joufindpage", json, function (data) { var list = data.data.content; if(list.length>0){ var html = ``; $.each(list, function (i, v) { html += `
  • `+ ``+ `
    `+ `
    `+ `

    `+v.title+`

    `+ `

    `+v.describe+`

    `+ `
    `+v.createtime+`
    `+ `
    `+ `
    `+ `
  • `; }); console.log(html); $("#journalismlist").html(html); var swiper = new swiper('.news_swiper', { slidesperview: 4, spacebetween: 80, speed: 1000, clickable: true, pagination: '.news_swiper .swiper-pagination', breakpoints: { 1540: { spacebetween: 40, }, 768: { slidesperview: 2, spacebetween: 20, }, 640: { slidesperview: 1, spacebetween: 20, }, } }); } }) } }