<template>
    <div class="listNewsBox">
        <div class="ul_box_1" v-if="componentStyle == 1">
            <h4 class="ul_head">
                <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
                    <span>{{ titleLink.alias }}</span>
                </NuxtLink>
            </h4>
            <div class="ul_img_box">
                <NuxtLink v-for="item in component_style1_News1Array" :href="getLinkPathDetail(item)" :title="item.title"
                    :target="item.islink == 1 ? '_blank' : '_self'">
                    <img class="" :src="item.imgurl" title="item.title" alt="item.title">
                    <span class="ul_img_dot1">{{ item.title }}</span>
                </NuxtLink>
            </div>
            <div class="ul_box">
                <div class="ul_li" v-for="item in component_style1_News2Array_1">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                       :target="item.islink == 1 ? '_blank' : '_self'">
                       {{ item.title }}
                   </NuxtLink>
                </div>
            </div>
        </div>
        <div class="ul_box_2" v-if="componentStyle == 2">
            <h4 class="ul_head">
                <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
                    <span>{{ titleLink.alias }}</span>
                </NuxtLink>
            </h4>
            <div class="ul_box">
                <div class="ul_li" v-for="item in component_style1_News2Array_1">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                       :target="item.islink == 1 ? '_blank' : '_self'">
                       {{ item.title }}
                   </NuxtLink>
                </div>
            </div>
            <div class="ul_img_box">
                <NuxtLink v-for="item in component_style1_News1Array" :href="getLinkPathDetail(item)" :title="item.title"
                    :target="item.islink == 1 ? '_blank' : '_self'">
                    <img class="" :src="item.imgurl" title="item.title" alt="item.title">
                    <span class="ul_img_dot1">{{ item.title }}</span>
                </NuxtLink>
            </div>
        </div>
        <div class="ul_box_3" v-if="componentStyle == 3">
            <h4 class="ul_head">
                <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
                    <span>{{ titleLink.alias }}</span>
                </NuxtLink>
            </h4>
            <div class="ul_img_box">
                <NuxtLink v-for="item in component_style1_News1Array" :href="getLinkPathDetail(item)" :title="item.title"
                    :target="item.islink == 1 ? '_blank' : '_self'">
                    <img class="" :src="item.imgurl" title="item.title" alt="item.title">
                    <span class="ul_img_dot1">{{ item.title }}</span>
                </NuxtLink>
            </div>
            <div class="ul_box">
                <div class="ul_li" v-for="item in component_style1_News2Array_1">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                       :target="item.islink == 1 ? '_blank' : '_self'">
                       {{ item.title }}
                   </NuxtLink>
                </div>
            </div>
        </div>
        <div class="ul_box_4" v-if="componentStyle == 4">
            <h4 class="ul_head">
                <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
                    <span>{{ titleLink.alias }}</span>
                </NuxtLink>
            </h4>
            <div class="ul_box">
                <div class="ul_li" v-for="item in component_style1_News2Array_1">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                       :target="item.islink == 1 ? '_blank' : '_self'">
                       {{ item.title }}
                   </NuxtLink>
                </div>
            </div>
            <div class="ul_img_box">
                <NuxtLink v-for="item in component_style1_News1Array" :href="getLinkPathDetail(item)" :title="item.title"
                    :target="item.islink == 1 ? '_blank' : '_self'">
                    <img class="" :src="item.imgurl" title="item.title" alt="item.title">
                    <span class="ul_img_dot1">{{ item.title }}</span>
                </NuxtLink>
            </div>
        </div>
        <div class="ul_box_5" v-if="componentStyle == 5">
            <h4 class="ul_head">
                <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
                    <span>{{ titleLink.alias }}</span>
                </NuxtLink>
            </h4>
            <div class="ul_box">
                <div class="ul_li" v-for="item in component_style1_News2Array_2">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                       :target="item.islink == 1 ? '_blank' : '_self'">
                       {{ item.title }}
                   </NuxtLink>
                </div>
            </div>
        </div>
        <div class="ul_box_6" v-if="componentStyle == 6">
            <h4 class="ul_head">
                <span class=" ">{{ name }}</span>
            </h4>
            <div class="ul_box">
                <div class="ul_li" v-for="item in component_style1_News2Array_2">
                    <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,//标题
    componentStyle: Number,//样式编号
});
const component_style1_News1Array = ref([]);
const component_style1_News2Array_1 = ref([]);
const component_style1_News2Array_2 = ref([]);
//最新资讯数据 start ---------------------------------------->
async function getPageData() {
    const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'imgnum': 4,
            'textnum': 4,
            'level': 4,
            'id': 0,
            'placeid': 0,
        },
    });
    if (mkdata.code == 200) {
        component_style1_News1Array.value = mkdata.data.img.slice(0, 1);
        component_style1_News2Array_1.value = mkdata.data.text.slice(0, 4);
        component_style1_News2Array_2.value = mkdata.data.text.slice(0, 11);
    }
}
getPageData();
//最新资讯数据 end ---------------------------------------->
</script>

<style lang="less" scoped>
//基本样式
.listNewsBox {
    position: relative;

    .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;

        span {
            color: #A91B33;
            height: 30px;
            line-height: 30px;
            border-left: 3px solid #A91B33;
            padding-left: 12px;
        }
    }

    .listNewsContent {
        .listNewsContentItem {
            display: flex;
            background: #F9FAFB;
            align-items: flex-start;
            margin-bottom: 20px;

            &:last-child {
                margin-bottom: 0;
            }

            .listNewsContentItemLeft {
                width: 170px;
                height: 110px;
                position: relative;

                img {
                    display: block;
                    width: 170px;
                    height: 110px;
                }

                .listNewsContentItemLeftTitle {
                    position: absolute;
                    bottom: 0;
                    z-index: 1;
                    width: 100%;
                    color: #fff;
                    height: 28px;
                    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
                    box-sizing: border-box;
                    padding: 0 5px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    line-height: 28px;
                    font-size: 14px;
                }
            }

            .listNewsContentItemRight {
                padding: 10px;
                box-sizing: border-box;
                flex: 1;
                height: 110px;
                overflow: hidden;

                div {
                    box-sizing: border-box;
                    height: 24px;
                    line-height: 24px;
                    padding-left: 16px;
                    font-size: 18px;
                    color: #333333;
                    margin-bottom: 10px;
                    background: url(http://img.bjzxtw.org.cn/pre/image/png/20250605/1749100871349444.png) no-repeat left center;

                    &:last-child {
                        margin-bottom: 0;
                    }
                }
            }
        }
    }
}

//样式4
.listNewsBox {
    .listNewsStyle4 {
        .listNewsContentItem {
            .listNewsContentItemRight {
                div {
                    background: url(https://img.bjzxtw.org.cn/pre/image/png/20250909/1757379542529609.png) no-repeat left center;
                }
            }
        }
    }
}

//样式5
.listNewsBox {
    .listNewsStyle5 {
        .listNewsContentItem {
            .listNewsContentItemRight {
                div {
                    background: url(https://img.bjzxtw.org.cn/pre/image/png/20250909/1757386056889702.png) no-repeat left center;
                }
            }
        }
    }
}

//样式6
.listNewsBox {
    .listNewsStyle6 {
        .listNewsContentItem {
            .listNewsContentItemRight {
                div {
                    padding-left: 0px;
                    background: none;
                }
            }
        }
    }
}

//样式9
.listNewsBox {
    .listNewsStyle9 {
        .listNewsContentItem {
            .listNewsContentItemRight {
                div {
                    &:first-child {
                        font-weight: 400;
                    }
                }
            }
        }
    }
}

.listNewsContent {
    display: none;
}

.ul_box_1 {
    width: 100%;

    .ul_head {
        height: 47px;
        border-bottom: solid 1px #93969A;
        border-top: solid 1px #DCDDDF;
        margin: 0px;
        box-sizing: border-box;
    }

    .ul_head * {
        float: left;
        height: 100%;
        line-height: 47px;
        box-sizing: border-box;
        font-weight: bold;
        color: #A72213;
        font-size: 20px;
        border-bottom: solid 2px #A72213;
    }

    .ul_img_box {
        width: 100%;
        height: 268px;
        position: relative;
        margin-top: 20px;
    }

    .ul_img_box img {
        display: block;
        width: 100%;
        height: 100%;
    }

    .ul_img_dot1 {
        height: 50px;
        line-height: 50px;
        color: #fff;
        box-sizing: border-box;
        font-size: 14px;
        position: absolute;
        font-weight: bold;
        display: block;
        padding: 0px 15px;
        width: 100%;
        left: 0px;
        bottom: 0px;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .6));
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ul_box {
        margin-top: 28px;
        overflow: hidden;
        width: 100%;

        .ul_li {
            line-height: 24px;
            height: 24px;
            position: relative;
            color: #333;
            font-size: 18px;
            text-indent: 9px;
            margin-bottom: 20px;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            a {
                color: #333;
            }
        }

        .ul_li::before {
            content: '';
            position: absolute;
            left: 0px;
            top: 10px;
            width: 4px;
            height: 4px;
            background: #F2F2F2;
            border-radius: 2px;
        }
    }
}

.ul_box_2 {
    width: 100%;

    .ul_head {
        height: 47px;
        border-bottom: solid 1px #93969A;
        border-top: solid 1px #DCDDDF;
        margin: 0px;
        box-sizing: border-box;
    }

    .ul_head * {
        float: left;
        height: 100%;
        line-height: 47px;
        box-sizing: border-box;
        font-weight: bold;
        color: #A72213;
        font-size: 20px;
        border-bottom: solid 2px #A72213;
    }

    .ul_img_box {
        width: 100%;
        height: 268px;
        position: relative;
        margin-top: 28px;
    }

    .ul_img_box img {
        display: block;
        width: 100%;
        height: 100%;
    }

    .ul_img_dot1 {
        height: 50px;
        line-height: 50px;
        color: #fff;
        box-sizing: border-box;
        font-size: 14px;
        position: absolute;
        font-weight: bold;
        display: block;
        padding: 0px 15px;
        width: 100%;
        left: 0px;
        bottom: 0px;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .6));
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ul_box {
        margin-top: 20px;
        overflow: hidden;
        width: 100%;

        .ul_li {
            line-height: 24px;
            height: 24px;
            position: relative;
            color: #333;
            font-size: 18px;
            text-indent: 9px;
            margin-bottom: 20px;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            a {
                color: #333;
            }
        }

        .ul_li:last-child {
            margin-bottom: 0;
        }

        .ul_li::before {
            content: '';
            position: absolute;
            left: 0px;
            top: 10px;
            width: 4px;
            height: 4px;
            background: #F2F2F2;
            border-radius: 2px;
        }

    }
}

.ul_box_3 {
    width: 100%;

    .ul_head {
        height: 47px;
        border-bottom: solid 1px #93969A;
        border-top: solid 1px #DCDDDF;
        margin: 0px;
        box-sizing: border-box;
    }

    .ul_head * {
        float: left;
        height: 100%;
        line-height: 47px;
        box-sizing: border-box;
        font-weight: bold;
        color: #A72213;
        font-size: 20px;
        border-bottom: solid 2px #A72213;
    }

    .ul_img_box {
        width: 100%;
        height: 268px;
        position: relative;
        margin-top: 20px;
    }

    .ul_img_box img {
        display: block;
        width: 100%;
        height: 100%;
    }

    .ul_img_dot1 {
        height: 50px;
        line-height: 50px;
        color: #fff;
        box-sizing: border-box;
        font-size: 14px;
        position: absolute;
        font-weight: bold;
        display: block;
        padding: 0px 15px;
        width: 100%;
        left: 0px;
        bottom: 0px;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .6));
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ul_box {

        margin-top: 28px;
        overflow: hidden;
        width: 100%;

        .ul_li {
            line-height: 24px;
            height: 24px;
            position: relative;
            color: #333;
            font-size: 18px;
            text-indent: 9px;
            margin-bottom: 20px;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            a {
                color: #333;
            }
        }

        .ul_li:nth-of-type(1) {
            font-weight: bold;
        }

        .ul_li::before {
            content: '';
            position: absolute;
            left: 0px;
            top: 10px;
            width: 4px;
            height: 4px;
            background: #F2F2F2;
            border-radius: 2px;
        }

    }
}

.ul_box_4 {
    width: 100%;

    .ul_head {
        height: 47px;
        border-bottom: solid 1px #93969A;
        border-top: solid 1px #DCDDDF;
        margin: 0px;
        box-sizing: border-box;
    }

    .ul_head * {
        float: left;
        height: 100%;
        line-height: 47px;
        box-sizing: border-box;
        font-weight: bold;
        color: #A72213;
        font-size: 20px;
        border-bottom: solid 2px #A72213;
    }

    .ul_img_box {
        width: 100%;
        height: 268px;
        position: relative;
        margin-top: 28px;
    }

    .ul_img_box img {
        display: block;
        width: 100%;
        height: 100%;
    }

    .ul_img_dot1 {
        height: 50px;
        line-height: 50px;
        color: #fff;
        box-sizing: border-box;
        font-size: 14px;
        position: absolute;
        font-weight: bold;
        display: block;
        padding: 0px 15px;
        width: 100%;
        left: 0px;
        bottom: 0px;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .6));
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ul_box {

        margin-top: 20px;
        overflow: hidden;
        width: 100%;

        .ul_li {
            line-height: 24px;
            height: 24px;
            position: relative;
            color: #333;
            font-size: 18px;
            text-indent: 9px;
            margin-bottom: 20px;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            a {
                color: #333;
            }
        }

        .ul_li:nth-of-type(1) {
            font-weight: bold;
        }

        .ul_li:last-child {
            margin-bottom: 0;
        }

        .ul_li::before {
            content: '';
            position: absolute;
            left: 0px;
            top: 10px;
            width: 4px;
            height: 4px;
            background: #F2F2F2;
            border-radius: 2px;
        }

    }
}

.ul_box_5 {
    width: 100%;

    .ul_head {
        height: 47px;
        border-bottom: solid 1px #93969A;
        border-top: solid 1px #DCDDDF;
        margin: 0px;
        box-sizing: border-box;
    }

    .ul_head * {
        float: left;
        height: 100%;
        line-height: 47px;
        box-sizing: border-box;
        font-weight: bold;
        color: #A72213;
        font-size: 20px;
        border-bottom: solid 2px #A72213;
    }

    .ul_box {

        margin-top: 20px;
        overflow: hidden;
        width: 100%;

        .ul_li {
            line-height: 24px;
            height: 24px;
            position: relative;
            color: #333;
            font-size: 18px;
            text-indent: 9px;
            margin-bottom: 19px;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            a {
                color: #333;
            }
        }

        .ul_li::before {
            content: '';
            position: absolute;
            left: 0px;
            top: 10px;
            width: 4px;
            height: 4px;
            background: #F2F2F2;
            border-radius: 2px;
        }

    }
}

.ul_box_6 {
    width: 100%;

    .ul_head {
        height: 47px;
        border-bottom: solid 1px #93969A;
        border-top: solid 1px #DCDDDF;
        margin: 0px;
        box-sizing: border-box;
    }

    .ul_head * {
        float: left;
        height: 100%;
        line-height: 47px;
        box-sizing: border-box;
        font-weight: bold;
        color: #A72213;
        font-size: 20px;
        border-bottom: solid 2px #A72213;
    }

    .ul_box {

        margin-top: 20px;
        overflow: hidden;
        width: 100%;

        .ul_li {
            line-height: 24px;
            height: 24px;
            position: relative;
            color: #333;
            font-size: 18px;
            text-indent: 9px;
            margin-bottom: 19px;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            a {
                color: #333;
            }
        }

        .ul_li:nth-of-type(1) {
            font-weight: bold;
        }

        .ul_li::before {
            content: '';
            position: absolute;
            left: 0px;
            top: 10px;
            width: 4px;
            height: 4px;
            background: #F2F2F2;
            border-radius: 2px;
        }

    }
}
</style>
