<template>
    <!--样式1-->
    <div class="swiperStyle1" v-if="skinId==1">
        <el-carousel :interval="3000" height="405px" indicator-position="none" arrow="always" @change="change_fun">
            <el-carousel-item v-for="(item, index) in imagelist" :key="item.id">
                <NuxtLink 
                    :to="`/${item.pinyin}/${item.id}.html`" 
                    class="swiper_link"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <img :src="item.imgurl">
                    <span class="swiper_dot1 dot1">
                        {{ item.title }}
                    </span>
                </NuxtLink>
            </el-carousel-item>
        </el-carousel>
        <div class="roll_num_box">
            <span class="roll_num_box_new">{{ roll_num_this + 1 }}</span>
            /
            {{ roll_num_lang }}
        </div>
    </div>
    <!--样式2-->
    <div class="swiperStyle2" v-if="skinId==2">
        <el-carousel :interval="3333" height="405px" indicator-class="custom-indicator" @change="change_fun" trigger="click">
            <el-carousel-item v-for="(item, index) in imagelist" :key="item.id">
                <NuxtLink 
                    :to="`/${item.pinyin}/${item.id}.html`" 
                    class="swiper_link"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <img :src="item.imgurl">
                    <span class="swiper_dot1 dot1">
                        {{ item.title }}
                    </span>
                </NuxtLink>
            </el-carousel-item>
        </el-carousel>
    </div>
    <!--样式3-->
    <div class="swiperStyle3" v-if="skinId==3">
        <el-carousel :interval="3333" height="405px" indicator-class="custom-indicator" @change="change_fun" trigger="click">
            <el-carousel-item v-for="(item, index) in imagelist" :key="item.id">
                <NuxtLink 
                    :to="`/${item.pinyin}/${item.id}.html`" 
                    class="swiper_link"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <img :src="item.imgurl">
                    <span class="swiper_dot1 dot1">
                        {{ item.title }}
                    </span>
                </NuxtLink>
            </el-carousel-item>
        </el-carousel>
    </div>
    <!--样式4-->
    <div class="swiperStyle4" v-if="skinId==4">
        <el-carousel :interval="3333" height="405px" indicator-class="custom-indicator" @change="change_fun" trigger="click">
            <el-carousel-item v-for="(item, index) in imagelist" :key="item.id">
                <NuxtLink 
                    :to="`/${item.pinyin}/${item.id}.html`" 
                    class="swiper_link"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <img :src="item.imgurl">
                    <span class="swiper_dot1 dot1">
                        {{ item.title }}
                    </span>
                </NuxtLink>
            </el-carousel-item>
        </el-carousel>
    </div>
    <!-- 样式5 -->
    <div class="swiperStyle5" v-if="skinId==5">
        <el-carousel :interval="3333" height="405px" indicator-class="custom-indicator" @change="change_fun" trigger="click">
            <el-carousel-item v-for="(item, index) in imagelist" :key="item.id" >
                <NuxtLink 
                    :to="`/${item.pinyin}/${item.id}.html`" 
                    class="swiper_link"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <img :src="item.imgurl">
                    <span class="swiper_dot1 dot1">
                        {{ item.title }}
                    </span>
                </NuxtLink>
            </el-carousel-item>
            <div class="roll_num_box">
                <span class="roll_num_box_new">{{ roll_num_this + 1 }}</span>/{{ total_num }}
            </div>
        </el-carousel>
    </div>
    <!-- 样式6 -->
    <div class="swiperStyle6" v-if="skinId==6">
        <el-carousel :interval="3333" height="405px" indicator-class="custom-indicator" @change="change_fun" trigger="click">
            <el-carousel-item v-for="(item, index) in imagelist" :key="item.id" >
                <NuxtLink 
                    :to="`/${item.pinyin}/${item.id}.html`" 
                    class="swiper_link"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <img :src="item.imgurl">
                    <span class="swiper_dot1">
                        <span class="title dot1">{{ item.title }}</span>
                    </span>
                </NuxtLink>
            </el-carousel-item>
        </el-carousel>
    </div>
</template>

<script setup>
//引入vue
import { ref } from 'vue'
import { ElCarousel, ElCarouselItem } from 'element-plus'
//获得新闻数据
const props = defineProps({
    skinId:String,//皮肤编号
    templateData:Array,//新闻数据
});
//焦点图效果 start---------------------------------------->
const roll_num_lang = ref(5);
const roll_num_this = ref(0);
const total_num = ref(5);
const change_fun = (the_1) => {
    roll_num_this.value = the_1
}
const imagelist = ref("")
imagelist.value = props.templateData.slice(0, 5);
roll_num_lang.value = props.templateData.length - 1;
total_num.value = props.templateData.length;
//焦点图效果 end---------------------------------------->
</script>

<style lang="less" scoped>
//样式1 start---------------------------------------->
.swiperStyle1 {
    width: 100%;
    height: 405px;
    position: relative;
    .roll_num_box {
        position: absolute;
        z-index: 100;
        left: 60px;
        bottom: 0px;
        height: 60px;
        line-height: 60px;
        color: #fff;
        font-size: 16px;
        .roll_num_box_new {
            font-size: 20px;
        }
    }
    .dot1 {
        display: block;
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    img {
        width: 100%;
        height: 405px;
    }
    .swiper_dot1 {
        display: block;
        width: 100%;
        line-height: 60px;
        height: 60px;
        color: #fff;
        font-size: 18px;
        text-indent: 20px;
        position: absolute;
        bottom: 0;
        left: 0;
        z-index: 10;
        box-sizing: border-box;
        padding: 0 144px;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
    }
    .el-carousel {
        :deep(.el-carousel__arrow i) {
            font-size: 33px !important;
        }
        .roll_1_box {
            position: relative;
        }
        :deep(.el-carousel__arrow--left) {
            position: absolute;
            width: 35px;
            height: 57px;
            color: #fff;
            background: rgba(0, 0, 0, 0);
            left: 9px;
            border: none;
            border-radius: 0;
            top: 100%;
            margin-top: -28px;
        }
        :deep(.el-carousel__arrow--right) {
            width: 35px;
            height: 57px;
            color: #fff;
            background: rgba(0, 0, 0, 0);
            position: absolute;
            right: 9;
            border: none;
            border-radius: 0;
            top: 100%;
            margin-top: -28px;
        }
        :deep(.el-carousel__indicators) {
            // 指示器
            left: unset;
            transform: unset;
            right: 10px;
            bottom: 11px;
        }
        :deep(.el-carousel__button) {
            // 指示器按钮
            width: 10px;
            height: 10px;
            border: none;
            border-radius: 5px;
            background: #fff;
            opacity: 1;
        }
        :deep(.is-active .el-carousel__button) {
            // 指示器激活按钮
            background: #255590;
            width: 25px;
            opacity: 1;

        }
        :deep(.el-carousel__container) {
            height: 100%;
        }
    }
    .custom-indicator button {
        background-color: #fff;
        opacity: 1;
        width: 8px;
        height: 8px;
    }
    .custom-indicator button.is-active {
        background-color: #DD7D18;
        width: 58px;
        opacity: 1;
    }
}
//样式1 end---------------------------------------->

//样式2 start---------------------------------------->
.swiperStyle2 {
    width: 100%;
    height: 405px;
    position: relative;
    img {
        width: 100%;
        height: 405px;
    }
    .swiper_dot1 {
        display: block;
        width: 100%;
        line-height: 60px;
        height: 60px;
        color: #fff;
        font-size: 24px;
        text-indent: 20px;
        position: absolute;
        bottom: 0;
        left: 0;
        z-index: 10;
        box-sizing: border-box;
        padding-right: 244px;
        background:linear-gradient(0deg,rgba(0,0,0,0.5) 33%,rgba(0,0,0,0) 100%);
    }
    .el-carousel {
        /deep/.el-carousel__arrow i {
            font-size: 16px !important;
        }
        /deep/.el-carousel__arrow--left {
            left: 20px;
            width: 36px;
            height: 36px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            border-radius: 50%;
            position: absolute;
            border: none;
            border-radius: 50%;
        }
        /deep/.el-carousel__arrow--right {
            right: 20px;
            width: 36px;
            height: 36px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            position: absolute;
            border: none;
            border-radius: 50%;
        }
        /deep/ .el-carousel__indicators {
            // 指示器
            left: unset;
            transform: unset;
            right: 10px;
            bottom: 11px;
        }
        /deep/ .el-carousel__button {
            // 指示器按钮
            width: 10px;
            height: 10px;
            border: none;
            background: #fff;
            opacity: 1;
        }
        /deep/ .is-active .el-carousel__button {
            // 指示器激活按钮
            background: #A91B33;
            width: 10px;
            height: 10px;
            opacity: 1;

        }
        /deep/ .el-carousel__container {
            height: 100%;
        }
    }
    .custom-indicator button {
        background-color: #fff;
        opacity: 1;
        width: 8px;
        height: 8px;
    }
    .custom-indicator button.is-active {
        background-color: #DD7D18;
        width: 58px;
        opacity: 1;
    }
}
//样式2 end---------------------------------------->
//样式3 start---------------------------------------->
.swiperStyle3 {
    width: 100%;
    height: 405px;
    position: relative;
    img {
        width: 100%;
        height: 405px;
    }
    .swiper_dot1 {
        display: block;
        width: 100%;
        line-height: 60px;
        height: 60px;
        color: #fff;
        font-size: 24px;
        text-indent: 20px;
        position: absolute;
        bottom: 0;
        left: 0;
        z-index: 10;
        box-sizing: border-box;
        padding-right: 244px;
        background:linear-gradient(0deg,rgba(0,0,0,0.5) 33%,rgba(0,0,0,0) 100%);
    }
    .el-carousel {
        /deep/.el-carousel__arrow i {
            font-size: 16px !important;
        }
        /deep/.el-carousel__arrow--left {
            left: 20px;
            width: 36px;
            height: 36px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            border-radius: 50%;
            position: absolute;
            border: none;
            border-radius: 50%;
        }
        /deep/.el-carousel__arrow--right {
            right: 20px;
            width: 36px;
            height: 36px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            position: absolute;
            border: none;
            border-radius: 50%;
        }
        /deep/ .el-carousel__indicators {
            // 指示器
            left: unset;
            transform: unset;
            right: 10px;
            bottom: 11px;
        }
        /deep/ .el-carousel__button {
            // 指示器按钮
            width: 10px;
            height: 10px;
            border: none;
            background: #fff;
            opacity: 1;
        }
        /deep/ .is-active .el-carousel__button {
            // 指示器激活按钮
            background: #c82200;
            width: 10px;
            height: 10px;
            opacity: 1;

        }
        /deep/ .el-carousel__container {
            height: 100%;
        }
    }
    .custom-indicator button {
        background-color: #fff;
        opacity: 1;
        width: 8px;
        height: 8px;
    }
    .custom-indicator button.is-active {
        background-color: #c82200;
        width: 58px;
        opacity: 1;
    }
}
//样式3 end---------------------------------------->
//样式4 start ---------------------------------------->
.swiperStyle4 {
    width: 100%;
    height: 405px;
    position: relative;
    img {
        width: 100%;
        height: 405px;
    }
    .swiper_dot1 {
        display: block;
        width: 100%;
        line-height: 60px;
        height: 60px;
        color: #fff;
        font-size: 24px;
        text-indent: 20px;
        position: absolute;
        bottom: 0;
        left: 0;
        z-index: 10;
        box-sizing: border-box;
        padding-right: 244px;
        background:linear-gradient(0deg,rgba(0,0,0,0.5) 33%,rgba(0,0,0,0) 100%);
    }
    .el-carousel {
        /deep/.el-carousel__arrow i {
            font-size: 16px !important;
        }
        /deep/.el-carousel__arrow--left {
            left: 20px;
            width: 36px;
            height: 36px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            border-radius: 50%;
            position: absolute;
            border: none;
            border-radius: 50%;
        }
        /deep/.el-carousel__arrow--right {
            right: 20px;
            width: 36px;
            height: 36px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            position: absolute;
            border: none;
            border-radius: 50%;
        }
        /deep/ .el-carousel__indicators {
            // 指示器
            left: unset;
            transform: unset;
            right: 10px;
            bottom: 11px;
        }
        /deep/ .el-carousel__button {
            // 指示器按钮
            width: 10px;
            height: 10px;
            border: none;
            background: #fff;
            opacity: 1;
        }
        /deep/ .is-active .el-carousel__button {
            // 指示器激活按钮
            background: #fe8f00;
            width: 10px;
            height: 10px;
            opacity: 1;

        }
        /deep/ .el-carousel__container {
            height: 100%;
        }
    }
    .custom-indicator button {
        background-color: #fff;
        opacity: 1;
        width: 8px;
        height: 8px;
    }
    .custom-indicator button.is-active {
        background-color: #fe8f00;
        width: 58px;
        opacity: 1;
    }
}
//样式4 end ---------------------------------------->
//样式5 start ------------------------------------->
.swiperStyle5 {
    position: relative;
    .roll_num_box {
        position: absolute;
        z-index: 2;
        right: 35px;
        bottom: 5px;
        height: 60px;
        line-height: 60px;
        color: #fff;
        font-size: 20px;
        .roll_num_box_new {
            font-size: 20px;
        }
    }
    .dot1 {
        display: block;
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .swiper_dot1 {
        display: block;
        width: 100%;
        line-height: 60px;
        height: 60px;
        color: #fff;
        font-size: 18px;
        text-indent: 20px;
        position: absolute;
        bottom: 0;
        left: 0;
        z-index: 10;
        box-sizing: border-box;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
    }
    .el-carousel {
        :deep(.el-carousel__arrow i) {
            font-size: 33px !important;
        }
        .roll_1_box {
            position: relative;
        }
        :deep(.el-carousel__arrow--left)  {
            left: 20px;
            width: 30px;
            height: 56px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            border-radius: 50%;
            position: absolute;
            border: none;
            border-radius: 4px;
        }
        :deep(.el-icon-arrow-left:before) {
            font-size: 24px;
            line-height: 56px;
        }
        :deep(.el-carousel__arrow--right)  {
            right: 20px;
            width: 30px;
            height: 56px;
            color: #eee;
            background: #00000080;
            position: absolute;
            border: none;
            border-radius: 4px;
        }
        :deep(.el-icon-arrow-right:before) {
            font-size: 24px;
            line-height: 56px;
        }
        :deep(.el-carousel__indicators)  {
            display: none;
        }
    }
    .custom-indicator button {
        background-color: #fff;
        opacity: 1;
        width: 8px;
        height: 8px;
    }
    .custom-indicator button.is-active {
        background-color: #c82200;
        width: 58px;
        opacity: 1;
    }
}
//样式5 end ------------------------------------->
//样式6 start ------------------------------------->
.swiperStyle6 {
    position: relative;
    .roll_num_box {
        position: absolute;
        z-index: 2;
        right: 35px;
        bottom: 5px;
        height: 60px;
        line-height: 60px;
        color: #fff;
        font-size: 20px;
        .roll_num_box_new {
            font-size: 20px;
        }
    }
    .dot1 {
        display: block;
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .swiper_dot1 {
        display: block;
        width: 100%;
        line-height: 60px;
        height: 60px;
        color: #fff;
        font-size: 18px;
        text-indent: 10px;
        position: absolute;
        bottom: 0;
        left: 0;
        z-index: 10;
        box-sizing: border-box;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
        
        .title{
            display: inline-block;
            width: 490px;
        }
    }
    .el-carousel {
        :deep(.el-carousel__arrow i) {
            font-size: 33px !important;
        }
        .roll_1_box {
            position: relative;
        }
        :deep(.el-carousel__arrow--left)  {
            left: 20px;
            width: 36px;
            height: 36px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            border-radius: 50%;
            position: absolute;
            border: none;
            border-radius: 50%;
        }
        :deep(.el-icon-arrow-left:before) {
            font-size: 24px;
            line-height: 56px;
        }
        :deep(.el-carousel__arrow--right)  {
            right: 20px;
            width: 36px;
            height: 36px;
            color: #eee;
            background: rgba(0,0,0,0.5);
            position: absolute;
            border: none;
            border-radius: 50%;
        }
        :deep(.el-icon-arrow-right:before) {
            font-size: 24px;
            line-height: 56px;
        }
        :deep(.el-carousel__indicators)  {
            // 指示器
            left: unset;
            transform: unset;
            right: 10px;
            bottom: 11px;
        }
        :deep(.el-carousel__button) {
            // 指示器按钮
            width: 26px;
            height: 5px;
            border: none;
            background: #fff;
            opacity: 1;
            border-radius: 4px;
        }
        :deep(.is-active .el-carousel__button) {
            // 指示器激活按钮
            background: #154079;
            width: 26px;
            height: 5px;
            opacity: 1;
        }
        :deep(.el-carousel__container) {
            height: 100%;
        }
    }
    .custom-indicator button {
        background-color: #fff;
        opacity: 1;
        width: 8px;
        height: 8px;
    }
    .custom-indicator button.is-active {
        background-color: #154079;
        width: 58px;
        opacity: 1;
    }
}
//样式6 end ------------------------------------->
</style>