<template>
    <div class="slider" v-if="message">

        <div class="scienceTitle phone_none" v-if="message">
            <h5 v-if="message.cid">
                <NuxtLink v-if="message.cid" :href="getLinkPath(message)" class="active" :title="message.alias">
                    {{ message.alias }}
                </NuxtLink>
            </h5>
            <NuxtLink v-if="message.cid" :href="getLinkPath(message)" :title="message.alias">
                查看更多
            </NuxtLink>
        </div>

        
        <div class="phone_name_7 pc_none">
            <NuxtLink v-if="message.cid" :href="getLinkPath(message)" :title="message.alias">
                    {{ message.alias }}
                </NuxtLink>
        </div>

        <!-- 标题下内容列表 -->
        <div class="box">
            <div class="boxcontent">
                <div class="boxcontentleft">
                    <div class="boxleft" v-if="boxData1">
                        <div class="boxBigImg" v-if="boxData1[0]">
                            <NuxtLink :href="getLinkPathDetail(boxData1[0])" :title="boxData1[0].title"
                                :target="boxData1[0].islink == 1 ? '_blank' : '_self'">
                                <img :src="boxData1[0].imgurl" :alt="boxData1[0].title">
                                <div>
                                    <p><span>专题</span>{{ boxData1[0].title }}</p>
                                </div>
                            </NuxtLink>
                        </div>
                        <div class="boxMainImg">
                            <NuxtLink :href="getLinkPathDetail(boxData1[1])" :title="boxData1[1].title"
                                :target="boxData1[1].islink == 1 ? '_blank' : '_self'" v-if="boxData1[1]">
                                <img :src="boxData1[1].imgurl" :alt="boxData1[1].title">
                                <div>
                                    <p>{{ boxData1[1].title }}</p>
                                </div>
                            </NuxtLink>
                            <NuxtLink :href="getLinkPathDetail(boxData1[2])" :title="boxData1[2].title"
                                :target="boxData1[2].islink == 1 ? '_blank' : '_self'" v-if="boxData1[2]">
                                <img :src="boxData1[2].imgurl" :alt="boxData1[2].title">
                                <div>
                                    <p>{{ boxData1[2].title }}</p>
                                </div>
                            </NuxtLink>
                        </div>
                        <div class="boxBigImg">
                            <NuxtLink :href="getLinkPathDetail(boxData1[3])" :title="boxData1[3].title"
                                :target="boxData1[3].islink == 1 ? '_blank' : '_self'" v-if="boxData1[3]">
                                <img :src="boxData1[3].imgurl" :alt="boxData1[3].title">
                                <div>
                                    <p>{{ boxData1[3].title }}</p>
                                </div>
                            </NuxtLink>
                        </div>
                    </div>
                </div>

                <div class="boxright">
                    <ul>
                        <li v-for="item in boxData2">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <p class="title">{{ item.title }}</p>
                            </NuxtLink>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
//1.获得传入的数据 start---------------------------------------->
const props = defineProps({
    message: Array,
    boxData1: Array,
    boxData2: Array,
});
//1.获得传入的数据 end---------------------------------------->

//2.获得本页的数据 start---------------------------------------->
//格式化跳转路径 - 标题
const getLinkPath = (item) => {
    if (item.children_count == 0) {
        return `/${item.aLIas_pinyin}/list-1.html`;
    } else {
        return `/${item.aLIas_pinyin}/index.html`;
    }
}
//格式化跳转路径 - 到详情
const getLinkPathDetail = (item) => {
    if (item.islink == 1) {
        return `${item.linkurl}`;
    } else {
        return `/${item.pinyin}/${item.id}.html`;
    }
}
//2.获得本页的数据 end---------------------------------------->
</script>

<style lang="less" scoped>
.slider {
    width: 720px;
}

// 标题
.scienceTitle {
    height: 50px;
    line-height: 50px;
    border-bottom: 1px solid #D9D9D9;
    display: flex;
    justify-content: space-between;

    h5 {
        float: left;
        width: 96px;
        height: 34px;
        font-family: PingFang SC, PingFang SC;
        font-weight: 600;
        font-size: 24px;
        color: #000000;
        line-height: 28px;
        text-align: left;
        font-style: normal;
        text-transform: none;
        margin-right: 20px;
        // border-bottom: 2px solid #139602;

        height: 50px;
        line-height: 50px;

        a {
            font-size: 22px;
            color: #49a769;
            border-bottom: 3px solid #49a769;
            height: 50px;
            line-height: 50px;
            display: inline-block;
            box-sizing: border-box;
            width: auto;
            font-weight: bold;
        }
    }

    a {
        width: 65px;
        height: 50px;
        line-height: 50px;
        font-weight: 400;
        font-size: 16px;
        color: #333333;
        font-style: normal;
        text-transform: none;
        display: inline-block;
    }

    >p {
        float: left;
        height: 37px;
        line-height: 30px;

        >span {
            display: inline-block;
            height: 20px;
            line-height: 20px;
            text-align: center;
            margin: 4px 0px 3px;
            padding: 0 20px;
            border-right: 1px solid #ccc;

            >a {
                display: inline-block;
                padding-bottom: 11px;
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 20px;
                color: #666666;
                line-height: 20px;
                font-style: normal;
                text-transform: none;
                box-sizing: border-box;
            }

            .current {
                color: #139602;
                border-bottom: 1px solid #139602;
            }
        }

        >span:nth-child(4) {
            border-right: none;
        }

        >span:hover>a {
            color: #139602;
            border-bottom: 1px solid #139602;

        }
    }
}

.box {
    width: 720px;
    height: 662px;
    position: relative;
    overflow: hidden;

    .boxcontent {
        display: flex;
        justify-content: space-between;
        padding-top: 30px;

        .boxcontentleft {
            width: 349px;
            height: 632px;
            position: relative;
        }

        .boxleft {
            width: 349px;
            height: 632px;
            position: relative;
        }
    }

    .boxMainImg {
        display: flex;
        justify-content: space-between;
        margin-bottom: 15px;

        a {
            position: relative;
            width: 170px;
            height: 115px;
            display: block;

            img {
                width: 170px;
                height: 115px;
                border-radius: 4px;
                border-radius: 6px;
            }

            div {
                position: absolute;
                bottom: 0;
                left: 7px;
                z-index: 99;

                p {
                    display: -webkit-box;
                    -webkit-box-orient: vertical;
                    -webkit-line-clamp: 2;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    word-break: break-all;
                    width: 158px;
                    height: 23px;
                    color: #fff;
                }

                span {
                    display: block;
                    height: 20px;
                    line-height: 20px;
                    text-align: left;
                    color: #fff;
                }
            }
        }
    }

    .boxBigImg {
        margin-bottom: 15px;

        a {
            position: relative;
            width: 349px;
            height: 236px;
            border-radius: 6px;
            display: block;

            img {
                width: 349px;
                height: 236px;
                border-radius: 6px;
            }

            div {
                position: absolute;
                bottom: 7px;
                left: 20px;
                z-index: 99;

                p {
                    display: -webkit-box;
                    -webkit-box-orient: vertical;
                    -webkit-line-clamp: 2;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    word-break: break-all;
                    width: 320px;
                    height: 24px;
                    color: #fff;
                    font-size: 16px;
                    margin-bottom: 4px;

                    span {
                        display: inline-block;
                        background: #9CD26B;
                        font-size: 14px;
                        color: #fff;
                        padding: 0 6px;
                        border-radius: 4px;
                        margin-right: 5px;display:none;
                    }
                }

                span {
                    display: block;
                    height: 20px;
                    line-height: 20px;
                    text-align: left;
                    color: #fff;
                }
            }
        }
    }
}

.fade-in {
    animation: fadeIn 1s ease-in-out;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

.fade-enter-to,
.fade-leave-from {
    opacity: 1;
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 1s ease;
}

.scienceListBox {
    width: 3160px;
    height: 570px;
    position: absolute;
    top: 0;
    left: 0;
    transition: all 3s linear 0;
    z-index: 99;
}

// 标题下列表
.scienceList {
    width: 790px;
    height: 570px;
    float: left;
    margin-top: 17px;

    >li {
        width: 250px;
        height: 276px;
        float: left;
        margin-right: 20px;
        position: relative;

        img {
            width: 250px;
            height: 220px;
            border-radius: 40px 4px 40px 4px;
        }

        p {
            width: 254px;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow: hidden;
            text-overflow: ellipsis;
            word-break: break-all;
            height: 48px;
            overflow: hidden;
            font-family: PingFang SC, PingFang SC;
            font-weight: 600;
            font-size: 18px;
            color: #333333;
            line-height: 24px;
            text-align: left;
            font-style: normal;
            text-transform: none;

        }

        p:hover {
            color: #139602;
        }
    }

    >li:nth-child(3),
    >li:nth-child(6) {
        margin-right: 0;
    }

    >li::before {
        content: "";
        display: inline-block;
        width: 40px;
        height: 20px;
        position: absolute;
        z-index: 99;
        top: 0;
        right: 0;
        background-image: url("../../static/images/Component 209.png");
    }
}

.boxright {
    position: relative;

    ul {
        li {
            width: 349px;
            box-sizing: border-box;
            border-bottom: 1px solid #E6E6E6;
            margin-bottom: 21px;
            padding-bottom: 8px;

            .title {
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
                overflow: hidden;
                text-overflow: ellipsis;
                word-break: break-all;
                height: 44px;
                width: 100%;
                font-size: 16px;
                color: #333333;
                margin-bottom: 5px;
                box-sizing: border-box;
            }

            .title:hover {
                color: #49A769;
            }

            .time {
                font-size: 14px;
                color: #999999;
                margin-bottom: 10px;
            }


        }
    }
}

.imgbg::after {
    content: '';
    display: block;
    width: 100%;
    height: 68px;
    z-index: 44;
    left: 0px;
    bottom: 0;
    position: absolute;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), black);
    opacity: .3;
    border-radius: 6px;
}
</style>




<style lang="less" scoped>

   @media screen and (min-width:801px){/*pc*/

    
        .pc_none{display:none;}  
    }        
    @media screen and (max-width:800px){/*ipad_phone*/
         
        .slider {width:100%;}    
        .box {width:100%;overflow:hidden;height:auto;}
        .box .boxcontent{width:100%;overflow:hidden;height:auto;display:block;padding-top:15px;}
        .box .boxcontent .boxcontentleft{width:100%;overflow:hidden;height:auto;}
        .box .boxcontent .boxleft{width:100%;overflow:hidden;height:auto;}
        .box .boxBigImg a {width:100%;height:100%;}
        .box .boxBigImg a img{width:100%;height:100%;}

        .boxright ul{display:block;width:100%;overflow:hidden;height:205px;}
        .boxright ul li{width:100%;}
        .boxright ul li .title{height:auto;height:22px;line-height:22px;margin:9px auto;
            
            word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
            display:block;-webkit-box-orient: vertical; -webkit-line-clamp: 1;
                 
                position:relative;text-indent:18px;    
 
        }
        .boxright ul li .title::after{
            
            content: '';display: block;
		 
                    position:absolute;left:0px;top:8px;background:#E6E6E6;
                    width:6px;height:6px;
        }



        .box .boxcontent .boxleft>div{display:none;}
        .box .boxcontent .boxleft>div:nth-of-type(1){display:block;height:55vw;}

        .boxright ul li{padding:0;margin:0;display:none;}
        .boxright ul li:nth-of-type(-n+5){display:block;}

        
        .scienceTitle h5 a{font-size:18px;}
        .scienceTitle a{font-size:12px;width:auto;color:#999;}
         

        .box .boxBigImg a div{width:90%;left:5%;} 
        .box .boxBigImg a div p{-webkit-line-clamp:1;width:100%;}


        
        .phone_name_7{
                    width:100%;height:50px;border-bottom:1px solid #E6E6E6;
                    a{
                        float:left;height:50px;line-height:50px;font-size:18px;color:#49A769;font-weight:bold;
                        box-sizing:border-box;border-bottom:3px solid #49A769;
                    }
                }

           .phone_none{display:none;}     
   
    }



</style>



