<template>
    <view class="banner-wrap banner-three">
        <view class="title-wrap">
            <view class="title">生态农场指数</view>
            <view class="sub-title">通风透光防病虫，覆草种植原生态</view>
        </view>
        <swiper v-if="boxList.length" class="carousel" style="height: 370px" arrow="always" :interval="5000">
            <swiper-item class="carousel-item" v-for="(item, index) in boxList" :key="index">
                <view class="name">
                    <span>{{ item.title }}： {{item.value}}分 </span>
                    <span class="size">（排名前 {{item.rank}}%）</span>
                </view>
                <image class="img" :src="item.img" alt="" />
                <view class="desc">{{ item.name }}</view>
            </swiper-item>
        </swiper>
    </view>
</template>

<script setup>
import { ref ,watch} from "vue";

const boxList = ref([
    {
        "value": 92,
        "name": "通风优良，树距科学，防风林促进气流，减少病害，提升授粉和果实品质。",
        "img": "https://birdseye-img.sysuimars.com/temp/tgl3.png",
        "title": "通风率",
        "rank": "20"
    },
    {
        "value": 89,
        "name": "透光优良，开心形修剪，行距合理，光合高效，果实糖度高，优果率超85%。",
        "img": "https://birdseye-img.sysuimars.com/temp/tgl4.jpg",
        "title": "透光率",
        "rank": "20"
    },
    {
        "value": 88,
        "name": "70%益草覆盖，保水土增天敌，减除草剂，有机质+0.5%，生态经济双赢。",
        "img": "https://birdseye-img-ali-cdn.sysuimars.com//biodiversityImg/1749134540014.png",
        "title": "生物多样性",
        "rank": "5"
    }
]);

</script>

<style lang="scss" scoped>
.banner-wrap {
    width: 100%;
    height: 100%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center center;
    .title {
        font-size: 36px;
        letter-spacing: 4px;
        font-family: "jiangxizhuokai";
    }
    &.banner-three {
        background-image: url("https://birdseye-img.sysuimars.com/youwei-uniapp/home/report-banner-3.png");
        padding: 60px 14px;
        box-sizing: border-box;
        .sub-title {
            letter-spacing: 3px;
            margin-top: 10px;
        }
        .carousel {
            margin-top: 12px;
            width: 100%;
            ::v-deep {
                .el-carousel__button {
                    width: 5px;
                    height: 5px;
                    border-radius: 50%;
                }
                .el-carousel__arrow{
                    width: 32px;
                    height: 32px;
                    background: rgba(0, 0, 0,0.6);
                    .el-icon{
                        font-size: 22px;
                        font-weight: bold;
                    }
                }
            }
            .carousel-item {
                width: 100%;
                height: 100%;
                background: rgba(255, 255, 255, 0.6);
                border-radius: 12px;
                padding: 39px 16px 26px 16px;
                box-sizing: border-box;
                backdrop-filter: blur(2px);
                .name {
                    position: absolute;
                    top: 0;
                    left: calc(50% - 225px / 2);
                    font-family: "jiangxizhuokai";
                    padding: 6px;
                    font-size: 16px;
                    color: #333333;
                    text-align: center;
                    width: 225px;
                    box-sizing: border-box;
                    background: url("https://birdseye-img.sysuimars.com/youwei-uniapp/home/name-bg.png") no-repeat center center / 100% 100%;
                    .size {
                        font-size: 13px;
                    }
                }
                .img{
                    width: 100%;
                    height: 240px;
                    object-fit: cover;
                    margin: 11px 0;
                    border-radius: 5px;
                }
                .desc {
                    color: #333333;
                    font-size: 12px;
                    letter-spacing: 1px;
                    line-height: 18px;
                }
            }
        }
    }
}
</style>
