<template>
    <div class="title">
        <h4>
            热点精选
        </h4>
    </div>
    <!-- 列表 -->
    <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;
}
@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) {
    .title>h4 {
        height: 55px;
        line-height: 55px;
        font-size: 20px;
    }
    .rightList {}
    .rightList>li {
        padding-left: 26px;
    }
    .rightList>li a {
        height: 55px;
        line-height: 55px;
        font-size: 22px;
    }
}
</style>
