<template>
  <div id="swiperBox">
    <el-carousel indicator-position="none" height="610px" arrow="never">
      <el-carousel-item v-if="info.carousel_first_img_url"
        ><img
          :src="info.carousel_first_img_url"
          alt=""
          @click="toUrl(info.carousel_first_link)"
      /></el-carousel-item>
      <el-carousel-item v-if="info.carousel_second_img_url"
        ><img
          :src="info.carousel_second_img_url"
          alt=""
          @click="toUrl(info.carousel_second_link)"
      /></el-carousel-item>
      <el-carousel-item v-if="info.carousel_third_img_url"
        ><img
          :src="info.carousel_third_img_url"
          alt=""
          @click="toUrl(info.carousel_third_link)"
      /></el-carousel-item>
    </el-carousel>
  </div>
</template>
<script>
export default {
  props: {
    info: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  methods: {
    toUrl(url) {
      if (url) {
        window.location.href = url;
      }
    },
  },
};
</script>
<style lang="scss" scoped>
#swiperBox {
  width: 268px;
  height: 610px;
  flex-shrink: 0;
  margin-right: 10px;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
img {
  width: 100%;
  height: auto;
}
</style>