<template>
    <div class="listNewsBox">
        <div class="listNewsTitle" v-if="skinId==1">
            <NuxtLink
                v-if="titleLink.cid"
                :href="getLinkPath(titleLink)"
                :title="titleLink.alias"
            >
                {{titleLink.alias}}
            </NuxtLink>
        </div>
        <div class="listNewsTitle_skin2" v-if="skinId==2">
            <span>
                <NuxtLink
                    v-if="titleLink.cid"
                    :href="getLinkPath(titleLink)"
                    :title="titleLink.alias"
                >
                    {{titleLink.alias}}
                </NuxtLink>
            </span>
        </div>
        <div class="listNewsContent">
            <div class="listNewsContentItem" v-for="(item,index) in component_style1_News1Array">
                <NuxtLink 
                    :href="getLinkPathDetail(item)" 
                    :title="item.title"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <div class="listNewsContentItemLeft">
                        <img :src="item.imgurl" />
                        <span class="icon1" v-if="index==0"></span>
                        <span class="icon2" v-if="index==1"></span>
                        <span class="icon3" v-if="index==2"></span>
                    </div>
                    <div class="listNewsContentItemRight">
                        {{ item.title }}
                    </div>
                </NuxtLink>
            </div>
        </div>
    </div>
</template>

<script setup>
//引入vue
import {ref} from 'vue';
//获得新闻数据
const props = defineProps({
    titleLink:Object,//板块名称
    templateData:Array,//新闻数据
    skinId:String,//皮肤id
});
//样式1与样式2共用 start ---------------------------------------->
const component_style1_News1Array = ref({});
component_style1_News1Array.value = props.templateData.imgnum.slice(0,7);
//样式1与样式2共用 end ---------------------------------------->
</script>

<style lang="less" scoped>
.listNewsBox {
    position: relative;
    .listNewsTitle {
        font-size:22px;
        font-weight:bold;
        height: 40px;
        line-height: 40px;
        border-bottom: 2px solid #004564;
        color:#004564;
        margin-bottom: 20px;
        box-sizing: border-box;
        a {
            color:#004564;
            display: block;
            height: 25px;
            line-height: 25px;
        }
    }
    .listNewsTitle_skin2 {
        font-size:22px;
        font-weight:bold;
        height: 40px;
        line-height: 40px;
        border-bottom: 2px solid #A91B33;
        color:#A91B33;
        margin-bottom: 20px;
        box-sizing: border-box;
        a {
            color:#A91B33;
            display: block;
            height: 25px;
            line-height: 25px;
        }
        span {
            color:#A91B33;
            height: 25px;
            line-height: 25px;
            border-left: 3px solid #A91B33;
            padding-left: 12px;
            display: block;
        }
    }
    .listNewsContent {
        .listNewsContentItem {
            width: 450px;
            height: 110px;
            margin-bottom: 20px;
            background: #F9FAFB;
            &:last-child {
                margin-bottom: 0;
            }
            a {
                display: flex;
                align-items: center;
                justify-content: space-between;
            }
            .listNewsContentItemLeft {
                width: 170px;
                height: 110px;
                position: relative;
                img {
                    display: block;
                    width: 170px;
                    height: 110px;
                }
                span {
                    position: absolute;
                    top: -3px;
                    left: 10px;
                    display: block;
                    width: 20px;
                    height: 20px;
                }
                span.icon1 {
                    background: url('http://img.bjzxtw.org.cn/pre/image/jpeg/20250609/1749437491337294.jpg') no-repeat center center;
                }
                span.icon2 {
                    background: url('http://img.bjzxtw.org.cn/pre/image/jpeg/20250609/1749437499146137.jpg') no-repeat center center;
                }
                span.icon3 {
                    background: url('http://img.bjzxtw.org.cn/pre/image/jpeg/20250609/1749437506412478.jpg') no-repeat center center;
                }
            }
            .listNewsContentItemRight {
                width: 280px;
                height: 110px;
                padding:15px 8px;
                box-sizing: border-box;
                font-size: 18px;
                color: #333333;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 3;
            }
        }
    }
}
</style>