<template>
    <div class="hotNewsBox">
        <div class="listNewsTitle" v-if="skinId==1">
            <b>热点精选</b>
        </div>
        <div class="listNewsTitle_skin2" v-if="skinId==2">
            <span><b>热点精选</b></span>
        </div>
        <div class="hotNewsContent" v-if="skinId==1">
            <div v-for="(item,index) in component_style1_News1Array">
                <NuxtLink 
                    :href="getLinkPathDetail(item)" 
                    :title="item.title"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <span>{{ index+1 }}</span>
                    {{ item.title }}
                </NuxtLink>
            </div>
        </div>
        <div class="hotNewsContent_skin2" v-if="skinId==2">
            <div v-for="(item,index) in component_style1_News1Array">
                <NuxtLink 
                    :href="getLinkPathDetail(item)" 
                    :title="item.title"
                    :target="item.islink == 1 ? '_blank' : '_self'"
                >
                    <span>{{ index+1 }}</span>
                    {{ item.title }}
                </NuxtLink>
            </div>
        </div>
    </div>
</template>

<script setup>
//引入vue
import {ref} from 'vue';
//获得新闻数据
const props = defineProps({
    //templateData:Array,//新闻数据
    skinId:String,//皮肤id
});
const component_style1_News1Array = ref([]);
//component_style1_News1Array.value = props.templateData.text.slice(0,8);

async function getPageData() {
    const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'imgnum': 0,
            'textnum': 8,
            'level': 5,
            'placeid': 0,
            'id': 0
        },
    });
    if (mkdata.code == 200) {
        component_style1_News1Array.value = mkdata.data.text;
    }
}
getPageData();
</script>

<style lang="less" scoped>
.hotNewsBox {
    .listNewsTitle {
        font-size:22px;
        font-weight:bold;
        height: 40px;
        line-height: 25px;
        border-bottom: 2px solid #004564;
        color:#004564;
        margin-bottom: 20px;
        box-sizing: border-box;
        b {
            color:#004564;
            display: block;
            height: 25px;
            line-height: 25px;
        }
    }
    .listNewsTitle_skin2 {
        font-size:22px;
        font-weight:bold;
        height: 40px;
        line-height: 25px;
        border-bottom: 2px solid #A91B33;
        color:#A91B33;
        margin-bottom: 20px;
        box-sizing: border-box;
        b {
            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;
        }
    }
    .hotNewsContent {
        font-size:18px;
        color:#333333;
        div {
            a {
                display: block;
                color:#333333;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
            }
            padding-bottom:20px;
            border-bottom:1px solid #E4E4E4;
            margin-bottom: 22px;
            
            span {
                margin-right: 15px;
                font-size:20px;
                font-weight:bold;
                font-style: italic;
            }
            &:nth-child(1) span,
            &:nth-child(2) span,
            &:nth-child(3) span {
                color: #004564;
            }
            &:nth-child(n+4) span {
                color: #D9D9D9;
            }
        }
    }
    .hotNewsContent_skin2 {
        font-size:18px;
        color:#333333;
        div {
            padding-bottom:20px;
            border-bottom:1px solid #E4E4E4;
            margin-bottom: 22px;
            a {
                display: block;
                color:#333333;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
            }
            span {
                margin-right: 15px;
                font-size:20px;
                font-weight:bold;
                font-style: italic;
            }
            &:nth-child(1) span,
            &:nth-child(2) span,
            &:nth-child(3) span {
                color: #A91B33;
            }
            &:nth-child(n+4) span {
                color: #D9D9D9;
            }
        }
    }
}
</style>