<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="listNewsContentLeft">
                <div class="listNewsContentLeftTop">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                        v-for="item in component_style1_News1Array"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentLeftTopTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
                <div class="listNewsContentLeftBottom">
                    <div v-for="item in component_style1_News1Array_2">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentLeftTopTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="listNewsContentRight">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </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({});
const component_style1_News1Array_2 = ref({});
const component_style1_News2Array = ref([]);

//真实数据
// component_style1_News1Array.value = props.templateData.imgnum.slice(0,1);
// component_style1_News1Array_2.value = props.templateData.imgnum.slice(1,3);
// component_style1_News2Array.value = props.templateData.textnum;
component_style1_News1Array.value = props.templateData.img.slice(0,1);
component_style1_News1Array_2.value = props.templateData.img.slice(1,3);
component_style1_News2Array.value = props.templateData.text;

//样式1与样式2共用 end ---------------------------------------->
</script>

<style lang="less" scoped>
// 样式1 start ---------------------------------------->
.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;
        }
    }
    // 样式2 start ---------------------------------------->
    .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;
        }
    }
    // 样式2 end ---------------------------------------->
    .listNewsContent {
        display: flex;
        align-items: center;
        justify-content: space-between;
        .listNewsContentLeft {
            width: 350px;
            height: 380px;
            img {
                display: block;
            }
            .listNewsContentLeftTop {
                margin-bottom: 20px;
                position: relative;
                img {
                    display: block;
                    width: 350px;
                    height: 245px;
                }
            }
            .listNewsContentLeftBottom {
                display: flex;
                align-items: center;
                justify-content: space-between;
                position: relative;
                &>div {
                    position: relative;
                }
                img {
                    width: 170px;
                    height: 110px;
                }
            }
            .listNewsContentLeftTopTitle {
                position: absolute;
                bottom:0;
                z-index:1;
                width: 100%;
                color:#fff;
                height: 50px;
                background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                line-height: 65px;
                box-sizing: border-box;
                padding:0 8px;
            }
        }
        .listNewsContentRight {
            width: 350px;
            height: 380px;
            div {
                padding-left: 16px;
                box-sizing: border-box;
                background: url('http://img.bjzxtw.org.cn/pre/image/png/20250605/1749100871349444.png') no-repeat left center;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                margin-bottom: 20px;
                height: 24px;
                line-height: 24px;
                font-size: 18px;
                display: block;
                &:last-child {
                    margin-bottom: 0;
                }
                &:first-child,&:nth-child(4),&:nth-child(7) {
                    color:#333333;
                    font-weight: bold;
                }
                a {
                    color:#333333;
                }
            }
        }
    }
}
// 样式1 end ---------------------------------------->
</style>