<!-- 资讯 -->
<template>
    <div class="message">
        <div class="inner">
            <!-- 大标题 -->
            <div class="bigTitle">
                <div class="inner" v-for="(item, index) in headlinelist" :key="index">
                    <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/mainTitleicon.png" alt="" class="left">
                    <!-- <h1 class="left">{{ item.title }}</h1> -->
                    <!-- <a>{{ item.title }}</a> -->
                    <NuxtLink :to="item.linkurl" v-if="item.islink==1" :title="item.title">
                        <h1 class="left">{{ item.title }}</h1>
                    </NuxtLink>
                    <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink==0" :title="item.title">
                        <h1 class="left">{{ item.title }}</h1>
                    </NuxtLink>
                </div>
            </div>
            <!-- 大标题下的列表 -->
            <HomeBigTitleList></HomeBigTitleList>
            <div class="messageLeft">
                <!-- 轮播图 -->
                <HomeBigSwiper></HomeBigSwiper>
            </div>
            <div class="messageRight">
                <!-- 列表 -->
                <div class="hotTop">
                    <h3>今日热点</h3>
                    <ul>
                        <li v-for="(item, index) in hotNewsList" :key="index">
                            <strong>{{ index + 1 }}</strong>
                            <NuxtLink :to="item.linkurl" v-if="item.islink==1" :title="item.title">{{ item.title }}</NuxtLink>
                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink==0" :title="item.title">{{ item.title }}</NuxtLink>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
import { NuxtLink } from "#components";
import { ref, onMounted } from "vue"
const nuxtApp = useNuxtApp();
const axios = nuxtApp.$axios;

//1.获得板块数据 start ---------------------------------------->
//大标题
const headlinelist = ref("")
async function getModelData1() {
    const mkdata =  await requestDataPromise('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'pageSize': 1,
            'level': 1,
            'placeid': 0
        },
    });
    headlinelist.value = mkdata.data;
}
getModelData1()

const recommendImage = ref("")
async function getModelData2() {
    const mkdata =  await requestDataPromise('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'pageSize': 3,
            'level': 3,
            'placeid': 0
        },
    });
    recommendImage.value = mkdata.data;
}
getModelData2()

const hotNewsList = ref("")
async function getModelData3() {
    const mkdata =  await requestDataPromise('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'pageSize': 8,
            'level': 4,
            'placeid': 0
        },
    });
    hotNewsList.value = mkdata.data;
}
getModelData3()
//1.获得板块数据 end ---------------------------------------->
</script>

<style lang="less" scoped>
// 大标题
.bigTitle {
    width: 100%;
    height: 70px;
    margin-top: 20px;

    img {
        width: 57px;
        height: 52px;
        margin: 6px 17px 9px 97px;
        vertical-align: middle;
    }

    h1 {
        width: 960px;
        height: 70px;
        font-family: PingFang SC, PingFang SC;
        font-weight: 600;
        font-size: 30px;
        // font-size: 38px;
        //margin-bottom: 25px;
        white-space: nowrap;
        /* 防止文本换行 */
        overflow: hidden;
        /* 隐藏溢出的内容 */
        text-overflow: ellipsis;
        color: #49A769;
        line-height: 59px;
        text-align: left;
        font-style: normal;
        text-transform: none;
    }
}

// 资讯
.message {
    width: 100%;
    height: 570px;

    .messageLeft,
    .messageRight {
        float: left;
    }

    // 左侧
    .messageLeft {

        // 轮播图
        >img {
            width: 790px;
            height: 440px;
        }

        // 轮播图下小图列表
        .smallList {
            width: 790px;
            height: 140px;
            margin-top: 16px;


            >li {
                width: 250px;
                height: 140px;
                float: left;
                padding-right: 20px;
                position: relative;
                // background-color: #f5f5f5;

                img {
                    width: 250px;
                    height: 140px;
                }

                p {
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    width: 250px;
                    height: 30px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    line-height: 30px;
                    padding-left: 4px;
                    box-sizing: border-box;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 500;
                    font-size: 16px;
                    color: #FFFFFF;
                    text-align: left;
                    font-style: normal;
                    text-transform: none;
                    background: rgba(0, 0, 0, 0.5);
                    border-radius: 0px 0px 2px 2px;
                }
            }

            >li:nth-child(3) {
                padding-right: 0px;
            }
        }
    }

    // 右侧
    .messageRight {
        width: 450px;
        height: 405px;
        margin-left: 30px;

        .hotTop,
        .suggest {
            width: 450px;
            height: 283px;

            >h3 {
                height: 40px;
                line-height: 40px;
                font-family: Source Han Sans, Source Han Sans;
                font-weight: bold;
                font-size: 24px;
                color: #000000;
                line-height: 28px;
                text-align: left;
                font-style: normal;
                text-transform: none;
                border-bottom: 1px solid #139602;

                >span {
                    float: right;
                    width: 56px;
                    height: 20px;
                    line-height: 24px;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 14px;
                    color: #999999;
                    font-style: normal;
                    text-transform: none;
                }
            }

            ul {
                >li {
                    height: 25px;
                    padding-top: 20px;

                    >strong {
                        display: inline-block;
                        width: 24px;
                        height: 24px;
                        line-height: 24px;
                        background-color: #cecece;
                        padding-left: 6px;
                        box-sizing: border-box;
                        font-family: Source Han Sans, Source Han Sans;
                        font-weight: 500;
                        font-size: 18px;
                        color: #FFFFFF;
                        font-style: normal;
                        text-transform: none;
                        vertical-align: -2px;
                    }

                    &:nth-child(1)>strong {
                        background-color: #00C524;
                    }

                    &:nth-child(2)>strong {
                        background-color: #FFDF27;
                    }

                    &:nth-child(3)>strong {
                        background-color: #F3C57F;
                    }

                    >em {
                        display: inline-block;
                        width: 6px;
                        height: 6px;
                        border-radius: 10px;
                        border: 2px solid #8CBA86;
                        vertical-align: -1px;
                    }

                    >a,
                    >span {
                        display: inline-block;
                        width: 416px;
                        height: 25px;
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 500;
                        font-size: 18px;
                        color: #333333;
                        line-height: 21px;
                        text-align: left;
                        font-style: normal;
                        text-transform: none;
                        padding-left: 9px;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        vertical-align: middle;
                    }

                    >a:hover,
                    >span:hover {
                        color: #139609;
                    }

                }
            }
        }
        .hotTop {
            width: 450px;
        }
        .suggest {
            margin-top: 32px;
        }
    }
}
</style>