<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="listNewsImgNewsBox">
                    <div v-for="item in component_style1_News1Array" class="listNewsImgNewsItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsImgNewsItemContent">
                                <div class="listNewsImgNewsItemTitle">
                                    {{ item.title }}
                                </div>
                            </div>
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsImgNewsUl">
                    <div class="listNewsImgNewsLi" v-for="item in component_style1_News3">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            <div class="listNewsImgNewsMark" v-if="skinId==1">
                                <div>重 点</div>
                                <div>关 注</div>
                            </div>
                            <div class="listNewsImgNewsMark_skin2" v-if="skinId==2">
                                <div>重 点</div>
                                <div>关 注</div>
                            </div>
                            <div class="listNewsImgNewsTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="listNewsContentRight">
                <div class="listNewsImgNewsBox">
                    <div v-for="item in component_style1_News1Array_2" class="listNewsImgNewsItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsImgNewsItemContent">
                                <div class="listNewsImgNewsItemTitle">
                                    {{ item.title }}
                                </div>
                            </div>
                        </NuxtLink>
                    </div>
                </div>
                <div class="adBox">
                    <!-- 广告模块 -->
                    <a href="http://nzgxw.org.cn/" v-if="templateAdData.image_url==null" target="_blank" :title="templateAdData.introduce">
                        <img :src="templateAdData.thumb" :alt="templateAdData.introduce" :id="templateAdData.ad_tag"  data-tag="templateAdData.ad_tag">
                    </a>
                    <a :href="templateAdData.image_url" v-else :title="templateAdData.introduce">
                        <img :src="templateAdData.image_src" :alt="templateAdData.introduce" :id="templateAdData.ad_tag" data-tag="templateAdData.ad_tag">
                    </a>
                </div>
            </div>
        </div>
    </div>
</template>

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

<style lang="less" scoped>
.listNewsBox {
    width: 1200px;
    height: 480px;
    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 {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        .listNewsContentLeft {
            width: 720px;
            height: 420px;
            .listNewsImgNewsBox {
                width: 720px;
                height: 110px;
                display: flex;
                align-items: flex-start;
                justify-content: space-between;
                margin-bottom: 20px;   
                .listNewsImgNewsItem {
                    a {
                        display: flex;
                        height: 110px;
                        width: 350px;
                        background: #F9FAFB;
                        align-items: flex-start;
                        justify-content: space-between;      
                    }
                    .listNewsImgNewsItemContent {
                        padding: 15px 8px;
                    }
                    .listNewsImgNewsItemTitle {
                        color: #333333;
                        font-size: 18px;
                        box-sizing: border-box;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        display: -webkit-box;
                        line-clamp: 2;
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                    }
                    img {
                        display: block;
                        width: 170px;
                        height: 110px;
                    }
                }
            }
            .listNewsImgNewsUl {
                .listNewsImgNewsLi {
                    width: 720px;
                    height: 62px;
                    background: #F9FAFB;
                    display: flex;
                    margin-bottom: 14px;
                    a {
                        display: flex;
                        align-items: center;
                        justify-content: center;
                    }
                    .listNewsImgNewsMark {
                        background: #004564;
                        color: #fff;
                        width: 50px;
                        height: 62px;
                        box-sizing: border-box;
                        padding: 12px 10px;
                        font-size: 12px;
                        font-weight: bold;
                        margin-right: 10px;
                        div {
                            margin-bottom: 5px;
                            &:last-child {
                                margin-bottom: 0;
                            }
                        }
                    }
                    .listNewsImgNewsMark_skin2 {
                        background: #A91B33;
                        color: #fff;
                        width: 50px;
                        height: 62px;
                        box-sizing: border-box;
                        padding: 15px 10px;
                        font-size: 12px;
                        font-weight: bold;
                        margin-right: 10px;
                        div {
                            margin-bottom: 5px;
                            &:last-child {
                                margin-bottom: 0;
                            }
                        }
                    }
                    .listNewsImgNewsTitle {
                        flex:1;
                        color:#333;
                        font-size: 18px;
                        height: 62px;
                        line-height: 62px;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                    }
                    &:first-child {
                        .listNewsImgNewsTitle {
                            font-weight: bold;
                        }
                    }
                    &:last-child {
                        margin-bottom: 0;
                    }
                }
            }
        }
        .listNewsContentRight {
            width: 450px;
            height: 420px;
            .listNewsImgNewsBox {
                margin-bottom: 20px;
                .listNewsImgNewsItem {
                    a {
                        display: flex;
                        height: 110px;
                        width: 450px;
                        background: #F9FAFB;
                        align-items: flex-start;
                        justify-content: space-between;      
                    }
                    .listNewsImgNewsItemContent {
                        padding: 15px 8px;
                    }
                    .listNewsImgNewsItemTitle {
                        color: #333333;
                        font-size: 18px;
                        box-sizing: border-box;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        display: -webkit-box;
                        line-clamp: 2;
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                    }
                    img {
                        display: block;
                        width: 170px;
                        height: 110px;
                    }
                }
            }
            .adBox {
                box-sizing: border-box;
                position: relative;
                img {
                    display: block;
                    width: 450px;
                    height: 290px;
                }
                .templateEditBtnBox {
                    right: 0;
                }
            }
        }
    }
}
</style>