<template>
    <div class="contlt">
        <a class="">热门文章</a>
    </div>
    <ul class="right_con_list">
        <template v-for="(item, per_index) in hotNewsList">
            <NuxtLink to="item.linkurl" v-if="item.islink == 1" :title="item.title">
                {{ item.title }}
            </NuxtLink>
        </template>
        <template v-for="(item, per_index) in hotNewsList">
            <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" v-if="item.islink == 0" :title="item.title">
                {{ item.title }}
            </NuxtLink>
        </template>
    </ul>
    <!-- 列表 -->
    <!-- <ul class="rightList">
        <li v-for="item in hotNewsList">
            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
                {{ item.title }}
            </NuxtLink>
            <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" v-if="item.islink == 0" :title="item.title">
                {{ item.title }}
            </NuxtLink>
        </li>
    </ul> -->
</template>
<script setup>
const hotNewsList = ref([])
async function getPageData() {
    const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'textnum': 0,
            'imgnum': 5,
            'level': 5,
            'placeid': 0,
            'id': 0
        },
    });
    console.log("获取热点精选", mkdata);
    if (mkdata.code == 200) {
        for (let item of mkdata.data.img) {
            if (item.imgurl) {
                hotNewsList.value.push(item)
                if (hotNewsList.value.length == 5) {
                    break;
                }
            }
        }
        // hotNewsList.value = mkdata.data;
    } else {
        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
        console.log("错误位置：获取热点精选")
        console.log("后端错误反馈：", mkdata.message)
        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
    }
}
getPageData();
</script>
<style lang="less" scoped>
.title {
    width: 100%;
    overflow: hidden;
    >h4 {
        width: 100%;
        height: 70px;
        line-height: 70px;
        background-size: 100% 100%;
        background: url('../../public/index/reconewsh2.gif') no-repeat #158d91;
        font-size: 22px;
        color: #fff;
        font-weight: bold;
        padding-left: 30px;
        box-sizing: border-box;
        >span {
            float: right;
            font-family: Microsoft YaHei, Microsoft YaHei;
            font-weight: 400;
            font-size: 14px;
            margin-right: 10px;
            color: #999999;
            text-align: left;
            font-style: normal;
            text-transform: none;
        }
    }
}
.rightList {
    padding-top: 20px;
    background-color: #f1f1f1;
    padding-bottom: 30px;
    >li {
        width: 90%;
        margin: 0 auto;
        border-bottom: 1px dashed #ccc;
        background: url(../../public/index/reconlia.png) no-repeat 0 20px;
        padding-left: 20px;
        box-sizing: border-box;
        a {
            display: block;
            width: 100%;
            height: 50px;
            line-height: 50px;
            font-size: 14px;
            color: #333;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
        }
    }
}
.title>h4 {
    height: 55PX;
    line-height: 55PX;
    font-size: 20PX;
}
.rightList {}
.rightList>li a {
    height: 44PX;
    line-height: 44PX;
    font-size: 16PX;
}
.rightList>li {
    background-position-y: center;
}
.contlt {
    width: 100%;
    height: 40PX;
    overflow: hidden;
    border-bottom: solid 2PX #b41c2a;
    margin-bottom: 10PX;
}
.contlt a {
    display: block;
    width: 107PX;
    height: 40PX;
    line-height: 40PX;
    background: #b41c2a;
    text-align: center;
    color: #fff;
    font-size: 20PX;
    font-weight: bold;
    border-top-left-radius: 10PX;
    border-top-right-radius: 10PX;
}
.right_con_list {
    width: 100%;
    height: auto;
    overflow: hidden;
    display: block;
}
.right_con_list a {
    width: 100%;
    height: 45PX;
    line-height: 45PX;
    border-bottom: solid 1PX #ccc;
    font-size: 16PX;
    color: #333;
    background: url(public/index/index_42.png) no-repeat left center;
    background-size: auto 14PX;
    text-indent: 22PX;
    display: block;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.right_con_list a:nth-of-type(-n+3) {
    background-image: url(public/index/index_31.png);
}
@media screen and (min-width: 1401px) {
    //你的样式
}
@media screen and (max-width: 1400px) {}
@media screen and (min-width: 801px) and (max-width: 1400px) {
    //你的样式
}
@media screen and (max-width: 800px) {
    .right_con_list {
        overflow: hidden;
    }
    .right_con_list a {
        width: 49%;
    }
    .right_con_list a:nth-of-type(odd) {
        float: left;
    }
    .right_con_list a:nth-of-type(even) {
        float: right;
    }
    .right_con_list a {
        height: 55px;
        line-height: 55px;
        font-size: 24px;
        background-size: auto 14px;
        text-indent: 22px;
    }
    .contlt {
        height: 40px;
        margin-bottom: 10px;
    }
    .contlt a {
        width: auto;
        height: 55px;
        line-height: 50px;
        float: left;
        padding: 0px 6px;
        font-size: 26px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }
}
</style>
