<template>
  <div>
    <el-carousel trigger="click" style="height:100%">
      <el-carousel-item v-for="item in bannerList" :key="item"  >
        <div style="position: relative">
          <el-image
            style="width: 100%;height: 100%"
            :src="item.portalConfigPic"
            fit="contain"></el-image>
          <div class="title">{{ item.portalConfigTitle }}</div>
          <div class="subTitle">{{ item.portalConfigDesc }}</div>
        </div>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
import {getPortalList} from "@/api";

export default {
  name: 'Carousel',
  data() {
    return {
      bannerList:[],
    }
  },
  mounted() {
    this.getData()
  },
  methods:{
    getData(){
      getPortalList({
        portalConfigType:1,
        pageNum:1,
        pageSize:100
      }).then(e=>{
        console.log(e.rows)
        this.bannerList = e.rows
      })
    }
  },
}
</script>

<style lang="less" scoped>
@import "~@/style.less";

/deep/ .el-carousel__container {
  height: 100%;
}

/deep/ .el-carousel__button {
  width: 50px;
  height: 6px;
  border-radius: 3px;
  background-color: #cfd6de;
}

/deep/ .el-carousel__indicator--horizontal {
  padding: 12px 8px;
}

/deep/ .el-carousel__indicator.is-active button {
  opacity: 1;
  background-color: #3372ff;
}

/deep/ .el-carousel__indicators--horizontal {
  bottom: 5%;
}
.title{
  position: absolute;
  top: 43.7%;
  left: 37.7%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  color: #3372ff;
  font-size: 2.2vw;
  letter-spacing: 6.1px;
}
.subTitle{
  position: absolute;
  top: 56%;
  left: 38.7%;
  transform: translate(-50%, -50%);
  color: #3372ff;
  font-size: 1.3vw;
  letter-spacing: 2.3px;
  white-space: nowrap;
}
</style>
