<template>
    <div class="conatiner">
          <el-carousel class="swiper banner" :class="[bannerList.length==1?'noButton':'']" height="220px" :interval="4000">
            <template v-for="item in bannerList">
                <el-carousel-item  :style="{backgroundImage:'url('+item.imageUrl+')'}">
                    <a v-if="item.url" :href="item.url"></a>
                </el-carousel-item>
            </template>

        </el-carousel>

        <div class="content">
            <div class="name">
                <div class="kuai"></div>
                <span>关于我们</span>
            </div>
            <div class="content-content">
                <div class="content-img" :style="{backgroundImage:'url('+aboutInfo.image+')'}"></div>

                <div class="content-text">
                    <div class="title">{{aboutInfo.title}}</div>
                    <div class="content-all" v-html="aboutInfo.description">

                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'home',
    data() {
        return {
            aboutInfo: {},
            bannerList:[]
        }
    },
    mounted() {
        this.$http.get({
            url: '/aboutUs/getOne',
            data: {
                id: 1
            }
        }).then(res => {
            if (res.success) {
                this.aboutInfo = res.data
            }
        }).catch(e => {
            console.log(e)
        })

        this.$http.get({
            url: '/bannerInfo/all',
            data: {
                location: 13
            }
        }).then(res => {
            if (res.success) {
               this.bannerList=res.data
            }
        }).catch(e => {
            console.log(e)
        })
    },
    computed: {
    },
    methods: {
        scrollMenu() { }
    }
}
</script>

<style lang="less" scoped>
.banner {
    width: 1190px;
    height: 220px;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    margin: auto;
}

.content {
    width: 1146px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(234, 234, 234, 1);
    padding: 0 22px;
    .name {
        height: 36px;
        line-height: 36px;
        border-bottom: 1px solid #ebebeb;
        .kuai {
            width: 7px;
            height: 15px;
            background: rgba(11, 158, 192, 1);
            display: inline-block;
            vertical-align: middle;
        }

        span {
            font-size: 14px;
            font-family: MicrosoftYaHei;
            color: rgba(51, 51, 51, 1);
            line-height: 19px;
            margin-left: 13px;
            vertical-align: middle;
        }
    }
    .content-content {
        overflow: hidden;
        padding: 16px 0 100px;
        .content-img {
            width: 414px;
            height: 316px;
            background-position: center center;
            background-repeat: no-repeat;
            background-size: cover;
            float: left;
        }

        .content-text {
            width: 680px;
            float: right;

            .title {
                font-size: 18px;
                font-family: MicrosoftYaHei;
                color: rgba(51, 51, 51, 1);
                line-height: 24px;
            }

            .content-all {
                font-size: 14px;
                font-family: PingFangSC-Regular;
                color: rgba(102, 102, 102, 1);
                line-height: 24px;
                margin-top: 13px;
            }
        }
    }
}
</style>
