$(function () {
    getHonor();
    getKhs();
    getImg();
    getAbout();
});

function getHonor(){
    $.ajax({
        url: url+'/honor/honor/listForPage',
        data: {},
        type: "get",
        dateType: "json",
        success:function (res) {
            $("#honor-title1").html(res[0].title);
            $("#honor-title2").html(res[1].title);
            $("#honor-title3").html(res[2].title);
            $("#honor-title4").html(res[3].title);
            $("#honor-content1").html(res[0].content);
            $("#honor-content2").html(res[1].content);
            $("#honor-content3").html(res[2].content);
            $("#honor-content4").html(res[3].content);
        }
    });
}

function getKhs(){
    $.ajax({
        url: url+'/khs/khs/listForPage',
        data: {},
        type: "get",
        dateType: "json",
        success:function (res) {
            $("#khm1").html(res[0].name);
            $("#khm2").html(res[1].name);
            $("#khm3").html(res[2].name);
            $("#khm4").html(res[3].name);
            $("#khs1").html(res[0].content);
            $("#khs2").html(res[1].content);
            $("#khs3").html(res[2].content);
            $("#khs4").html(res[3].content);
            $("#tx1").attr('src',formatImgUrl(res[0].image));
            $("#tx2").attr('src',formatImgUrl(res[1].image));
            $("#tx3").attr('src',formatImgUrl(res[2].image));
            $("#tx4").attr('src',formatImgUrl(res[3].image));
        }
    });
}

function getImg() {
    $.ajax({
        url: url+'/about/about/selectImg',
        data: {},
        type: "get",
        dateType: "json",
        success:function (res) {
            $("#about-img").css("background-image","url("+formatImgUrl(res[0])+")");
        }
    });
}

function getAbout() {
    $.ajax({
        url: url+'/about/about/listForPage',
        data: {},
        type: "get",
        dateType: "json",
        success:function (res) {
            var result = "";
           $.each(res,function (i,list) {
                result+="<p style='font-size: .16rem;color: #666666;'>"+list.content+"</p>"
           });
           $("#about").html(result);
        }
    });
}