<template>
    <div>
        <HomePageHead></HomePageHead>
        <HomePageNavigation></HomePageNavigation>
        <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
        <!--头条-->
        <HomePageMessage></HomePageMessage>
        <!-- 第一部分 -->
        <div class="part1">
            <div class="inner">
                <div class="part1_left">
                    <div class="hengxian">
                        <em></em>
                    </div>
                    <div class="part1_left_title">
                        <img src="../public/index/nav01.png" alt="">
                        <NuxtLink class="active" v-if="pageData[0].cid" :href="getLinkPath(pageData[0])"
                            :title="pageData[0].alias">
                            {{ pageData[0].alias }}
                        </NuxtLink>
                    </div>
                    <div class="part1_left_content">
                        <div class="part1_left_content1">
                            <div class="part1_left_photo">
                                <div class="part1_left_photo11" v-for="item in boxData1" :key="index">
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <img :src="item.imgurl" :alt="item.title">
                                        <div class="left_content">
                                            {{ item.title }}
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                            <ul class="part1_left_context">
                                <li class="part1_left_contextList" v-for="item in boxData1data2" :key="index">
                                    {{ item.title }}
                                </li>
                            </ul>
                        </div>
                        <div class="part1_left_content2">
                            <ul class="part1_left_context222">
                                <li class="part1_left_contextList222" v-for="item in boxData1data3" :key="index">
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        {{ item.title }}
                                    </NuxtLink>
                                </li>
                            </ul>
                            <ul class="part1_left_context222">
                                <li class="part1_left_contextList222" v-for="item in boxData1data4" :key="index">
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        {{ item.title }}
                                    </NuxtLink>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="part1_right">
                    <div class="part1_right_title">
                        <NuxtLink :class="{ 'part1_right_titlelist': true, 'active': hoverStatus == 1 }"
                            @mouseenter="qhPic(1)" v-if="pageData[1].cid" :href="getLinkPath(pageData[1])"
                            :title="pageData[1].alias">
                            {{ pageData[1].alias }}
                        </NuxtLink>
                        <NuxtLink :class="{ 'part1_right_titlelist': true, 'active': hoverStatus == 2 }"
                            @mouseenter="qhPic(2)" v-if="pageData[2].cid" :href="getLinkPath(pageData[2])"
                            :title="pageData[2].alias">
                            {{ pageData[2].alias }}
                        </NuxtLink>
                    </div>
                    <div v-if="hoverStatus == 1">
                        <div class="part1_right_photo_text">
                            <div v-for="item in boxData2" :key="index">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" :alt="item.title">
                                    <div class="part1_right_text">
                                        {{ item.title }}
                                    </div>
                                </NuxtLink>
                            </div>
                        </div>
                        <ul class="part1_right_content">
                            <li class="part1_right_contentList" v-for="item in boxData2data2" :key="index">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <em></em>
                                    {{ item.title }}
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                    <div v-if="hoverStatus == 2">
                        <div class="part1_right_photo_text">
                            <div v-for="item in boxData3" :key="index">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" :alt="item.title">
                                    <div class="part1_right_text">
                                        {{ item.title }}
                                    </div>
                                </NuxtLink>
                            </div>
                        </div>
                        <ul class="part1_right_content">
                            <li class="part1_right_contentList" v-for="item in boxData3data2" :key="index">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <em></em>
                                    {{ item.title }}
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <!-- 广告位 2 -->
        <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>

        <!-- 第二部分 -->
        <div class="part2">
            <div class="inner">
                <div class="part2_left">
                    <div class="part2_hengxian">
                        <em></em>
                    </div>
                    <div class="part2_left_title">
                        <img src="../public/index/nav02.png" alt="">
                        <NuxtLink class="active" v-if="pageData[3].cid" :href="getLinkPath(pageData[3])"
                            :title="pageData[3].alias">
                            {{ pageData[3].alias }}
                        </NuxtLink>
                    </div>
                    <div class="part2_left_content1">
                        <ul class="part2_left_content111">
                            <li class="part2_left_content1_list" v-for="item in boxData4" :key="index">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <span class="nav2_title">{{ item.alias }}</span>
                                </NuxtLink>
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <span class="nav2_title_content">
                                        {{ item.title }}
                                    </span>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                    <ul class="part2_left_content2">
                        <li class="part2_left_content2list" v-for="item in boxData4data2" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img :src="item.imgurl" :alt="item.title" class="part2_left_content222img">
                                <div class="content2_text">
                                    <span class="content2_text_content">
                                        {{ item.title }}
                                    </span>
                                    <span class="content2_text_title">{{ item.alias }}</span>
                                </div>
                            </NuxtLink>
                        </li>
                        <div class="adlogo3" v-if="adImg3">
                            <a href="http://sannongdy.org.cn/" v-if="adImg3.image_url == null" target="_blank"
                                :title="adImg3.place_name">
                                <img :src="adImg3.thumb" :alt="adImg3.place_name" data-tag="imgurl.ad_tag">
                            </a>
                            <a :href="adImg3.image_url" v-else :title="adImg3.ad_name">
                                <img :src="adImg3.image_src" :alt="adImg3.ad_name" data-tag="imgurl.ad_tag">
                            </a>
                        </div>
                    </ul>
                </div>
                <div class="part2_right">
                    <div class="part2_right_title">
                        <NuxtLink v-if="pageData[4].cid" :href="getLinkPath(pageData[4])" :title="pageData[4].alias">
                            {{ pageData[4].alias }}
                        </NuxtLink>
                    </div>
                    <ul class="part2_right_content">
                        <li class="part2_right_contentList" v-for="(item, index) in boxData5" :key="index">
                            <span class="listNumber">{{ index + 1 }}</span>
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                {{ item.title }}
                            </NuxtLink>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <!-- 第三部分 -->
        <div class="part3">
            <div class="inner">
                <div class="part3_left">
                    <div class="part3_hengxian">
                        <em></em>
                    </div>
                    <div class="part3_left_title">
                        <img src="../public/index/nav03.png" alt="">
                        <NuxtLink class="active" v-if="pageData[5].cid" :href="getLinkPath(pageData[5])"
                            :title="pageData[5].alias">
                            {{ pageData[5].alias }}
                        </NuxtLink>
                    </div>
                    <div class="part3_left_content">
                        <div class="part3_left_content1">
                            <div class="part3_left_content1_photo1">
                                <div v-for="item in boxData6" :key="index">
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <img :src="item.imgurl" :alt="item.title">
                                        <div class="part3_left_content1_text">
                                            {{ item.title }}
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                            <div class="part3_left_content1_photo2">
                                <div class="part3_left_content1_photo2list" v-for="item in boxData6data2" :key="index">
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <img :src="item.imgurl" :alt="item.title">
                                        <div class="part3_left_content1_text">
                                            {{ item.title }}
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                        </div>
                        <div class="part3_left_content2">
                            <ul class="part3_left_content2_text">
                                <li class="part3_left_content2_list" v-for="item in boxData6data3" :key="index">
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <span class="nav3_title">{{ item.alias }}</span>
                                    </NuxtLink>
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <span class="nav3_title_content">
                                            {{ item.title }}
                                        </span>
                                    </NuxtLink>
                                </li>
                            </ul>
                            <ul class="part3_left_content2_text">
                                <li class="part3_left_content2_list" v-for="item in boxData6data4" :key="index">
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <span class="nav3_title">{{ item.alias }}</span>
                                    </NuxtLink>
                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <span class="nav3_title_content">
                                            {{ item.title }}
                                        </span>
                                    </NuxtLink>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="part3_right">
                    <div class="part3_right_title">
                        <NuxtLink class="active" v-if="pageData[6].cid" :href="getLinkPath(pageData[6])"
                            :title="pageData[6].alias">
                            {{ pageData[6].alias }}
                        </NuxtLink>
                    </div>
                    <div class="part3_right_content">
                        <div class="right_photo_text" v-for="item in boxData7" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img :src="item.imgurl" :alt="item.title">
                                <div class="right_text">
                                    {{ item.title }}
                                </div>
                            </NuxtLink>
                        </div>
                        <ul class="rightcontent_text">
                            <li class="rightcontent_textlist" v-for="item in boxData7data3" :key="index">
                                <em></em>
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.title }}
                                </NuxtLink>
                            </li>
                        </ul>
                        <div class="right_photo_text" v-for="item in boxData7data2" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img :src="item.imgurl" :alt="item.title">
                                <div class="right_text">
                                    {{ item.title }}
                                </div>
                            </NuxtLink>
                        </div>
                        <ul class="rightcontent_text">
                            <li class="rightcontent_textlist" v-for="item in boxData7data4" :key="index">
                                <em></em>
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.title }}
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <HomeAdvertising :imgurl="adImg4"></HomeAdvertising>
        <!-- 第四部分 -->
        <div class="part4">
            <div class="inner">
                <div class="part4_one">
                    <div class="part4_title">
                        <div class="part4_hengxian">
                            <em></em>
                        </div>
                        <div class="part4_left_title">
                            <img src="../public/index/nav03.png" alt="">
                            <NuxtLink class="active" v-if="pageData[7].cid" :href="getLinkPath(pageData[7])"
                                :title="pageData[7].alias">
                                {{ pageData[7].alias }}
                            </NuxtLink>
                        </div>
                    </div>
                    <div class="part4_photo_text">
                        <div v-for="item in boxData8" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img :src="item.imgurl" :alt="item.title">
                                <span class="text">{{ item.title }}</span>
                            </NuxtLink>
                        </div>
                    </div>
                    <ul class="part4_photo_content">
                        <li class="part4_photo_contentlist" v-for="item in boxData8data2" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <span class="nav11_title">{{ item.alias }}</span>
                            </NuxtLink>
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <span class="nav11_title_content">
                                    {{ item.title }}
                                </span>
                            </NuxtLink>
                        </li>
                    </ul>
                </div>
                <div class="part4_one">
                    <div class="part4_title">
                        <div class="part4_hengxian">
                            <em></em>
                        </div>
                        <div class="part4_left_title">
                            <img src="../public/index/nav03.png" alt="">
                            <NuxtLink class="active" v-if="pageData[8].cid" :href="getLinkPath(pageData[8])"
                                :title="pageData[8].alias">
                                {{ pageData[8].alias }}
                            </NuxtLink>
                        </div>
                    </div>
                    <div class="part4_photo_text">
                        <div v-for="item in boxData9" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img :src="item.imgurl" :alt="item.title">
                                <span class="text">{{ item.title }}</span>
                            </NuxtLink>
                        </div>
                    </div>
                    <ul class="part4_photo_content">
                        <li class="part4_photo_contentlist" v-for="item in boxData9data2" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <span class="nav11_title_content2">
                                    {{ item.title }}
                                </span>
                            </NuxtLink>
                        </li>
                    </ul>
                </div>
                <div class="part4_one">
                    <div class="part4_title">
                        <div class="part4_hengxian">
                            <em></em>
                        </div>
                        <div class="part4_left_title">
                            <img src="../public/index/nav03.png" alt="">
                            <NuxtLink class="active" v-if="pageData[9].cid" :href="getLinkPath(pageData[9])"
                                :title="pageData[9].alias">
                                {{ pageData[9].alias }}
                            </NuxtLink>
                        </div>
                    </div>
                    <div class="part4_photo_text">
                        <div v-for="item in boxData10" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img :src="item.imgurl" :alt="item.title">
                                <span class="text">{{ item.title }}</span>
                            </NuxtLink>
                        </div>
                    </div>
                    <ul class="part4_photo_content">
                        <li class="part4_photo_contentlist" v-for="item in boxData10data2" :key="index">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <span class="nav11_title_content2">
                                    {{ item.title }}
                                </span>
                            </NuxtLink>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <HomeFoot></HomeFoot>
    </div>
</template>

<script setup>
//1.加载页面必备组件 start---------------------------------------->
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
//1.加载页面必备组件 end---------------------------------------->

//2.选项卡 start---------------------------------------->
const hoverStatus = ref(1)
const qhPic = function (num) {
    hoverStatus.value = num;
}
//2.选项卡 end---------------------------------------->

//3.广告 start---------------------------------------->
//获得所有广告
let adImg1 = ref({})
let adImg2 = ref({})
let adImg3 = ref({})
let adImg4 = ref({})

onMounted(async () => {
    //从客户端获取行政职能部门 加快打开速度//从客户端获取行政职能部门 加快打开速度
    const { $webUrl, $CwebUrl } = useNuxtApp();

    //从客户端启动广告
    //广告1
    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmw_index_0001`
    const responseAd1 = await fetch(url, {
        headers: {
            'Content-Type': 'application/json',
            'Userurl': $CwebUrl,
            'Origin': $CwebUrl
        }
    });
    const resultAd1 = await responseAd1.json();
    adImg1.value = resultAd1.data[0];

    //广告2
    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmw_index_0002`
    const responseAd2 = await fetch(url2, {
        headers: {
            'Content-Type': 'application/json',
            'Userurl': $CwebUrl,
            'Origin': $CwebUrl
        }
    });
    const resultAd2 = await responseAd2.json();
    adImg2.value = resultAd2.data[0];

    //广告3
    let url3 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmw_index_0003`
    const responseAd3 = await fetch(url3, {
        headers: {
            'Content-Type': 'application/json',
            'Userurl': $CwebUrl,
            'Origin': $CwebUrl
        }
    });
    const resultAd3 = await responseAd3.json();
    adImg3.value = resultAd3.data[0];
    console.log('ad3', adImg3.value);


    //广告4
    let url4 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmw_index_0004`
    const responseAd4 = await fetch(url4, {
        headers: {
            'Content-Type': 'application/json',
            'Userurl': $CwebUrl,
            'Origin': $CwebUrl
        }
    });
    const resultAd4 = await responseAd4.json();
    adImg4.value = resultAd4.data[0];

})
//3.广告 end---------------------------------------->

//4.页面数据 start---------------------------------------->
//4.1导航
const pageData = ref([
    //示例 { cid: "", title: "", data: [] ,children_count:""},
]);
//4.2 模块数据
//模块1
const boxData1 = ref([])
const boxData1data2 = ref([])
const boxData1data3 = ref([])
const boxData1data4 = ref([])
//模块2
const boxData2 = ref([]);
const boxData2data2 = ref([]);
//模块3 
const boxData3 = ref([]);
const boxData3data2 = ref([]);
//模块4
const boxData4 = ref([]);
const boxData4data2 = ref([]);
//模块5
const boxData5 = ref([]);
//模块6
const boxData6 = ref([]);
const boxData6data2 = ref([]);
const boxData6data3 = ref([]);
const boxData6data4 = ref([]);
//模块7
const boxData7 = ref([]);
const boxData7data2 = ref([]);
const boxData7data3 = ref([]);
const boxData7data4 = ref([]);
//模块8
const boxData8 = ref([]);
const boxData8data2 = ref([]);
//模块9
const boxData9 = ref([]);
const boxData9data2 = ref([]);
//模块10 
const boxData10 = ref([]);
const boxData10data2 = ref([]);

//4.3获得导航数据
try {
    const navigateData = await requestDataPromise('/web/getWebsiteModelCategory', {
        method: 'GET',
        query: {
            'placeid': 1,
            'pid': 0,
            'num': 30
        },
    });
    if (navigateData.code == 200) {
        // 遍历可用的导航池放到页面中
        for (let index in navigateData.data) {
            let data = {
                title: navigateData.data[index].name,
                cid: navigateData.data[index].category_id,
                children_count: navigateData.data[index].children_count,
                alias: navigateData.data[index].alias,
                aLIas_pinyin: navigateData.data[index].aLIas_pinyin
            };
            //渲染标题
            //1 农业生产372
            if (navigateData.data[index].category_id == 372) { pageData.value[0] = data }
            //2 三农资讯328
            if (navigateData.data[index].category_id == 328) { pageData.value[1] = data }
            //3 市场行情377
            if (navigateData.data[index].category_id == 377) { pageData.value[2] = data }
            //4 商贸信息375
            if (navigateData.data[index].category_id == 375) { pageData.value[3] = data }
            //5 农民生活373
            if (navigateData.data[index].category_id == 373) { pageData.value[4] = data }
            //6 法治天地426
            if (navigateData.data[index].category_id == 426) { pageData.value[5] = data }
            //7 招商引资425
            if (navigateData.data[index].category_id == 425) { pageData.value[6] = data }
            //8 农知农技374
            if (navigateData.data[index].category_id == 374) { pageData.value[7] = data }
            //9 农民合作社427
            if (navigateData.data[index].category_id == 427) { pageData.value[8] = data }
            //10 新农村491
            if (navigateData.data[index].category_id == 491) { pageData.value[9] = data }
        }
    } else {
        console.log("获取导航池出错！", navigateData.message)
    }
} catch (error) {
    console.log("错误：导航池渲染执行接口出错！请检查首页的14的模块的具体执行方法！")
}

let getJson = [
    { "parent": "372,2,12", "child": "" },//模块1 农业生产372
    { "parent": "328,1,4", "child": "" },//模块2 三农资讯328
    { "parent": "377,1,4", "child": "" },//模块3 市场行情377
    { "parent": "375,1,10", "child": "" },//模块4 商贸信息375
    { "parent": "373,1,8", "child": "" },//模块5 农民生活373
    { "parent": "426,3,11", "child": "" },//模块6 法治天地426
    { "parent": "425,4,4", "child": "" },//模块7 招商引资425
    { "parent": "374,1,5", "child": "" },//模块8 农知农技374
    { "parent": "427,1,5", "child": "" },//模块9 农民合作社427
    { "parent": "491,1,5", "child": "" },//模块10 新农村11
]

let jsonString = JSON.stringify(getJson);

async function getPageAllData() {
    const mkdata = await requestDataPromise('/web/getWebsiteAllArticle', {
        method: 'GET',
        query: {
            'id': jsonString
        },
    });
    console.log('mkdata', mkdata)

    if (mkdata.code == 200) {
        //模块1
        boxData1.value = mkdata.data[0].imgnum;
        mkdata.data[0].textnum.forEach((item, index) => {
            if (index < 4) {
                boxData1data2.value.push(item);
            } else if (index < 8) {
                boxData1data3.value.push(item);
            } else if (index < 12) {
                boxData1data4.value.push(item);
            }
        });
        //模块2
        boxData2.value = mkdata.data[1].imgnum;
        boxData2data2.value = mkdata.data[1].textnum;
        //模块3
        boxData3.value = mkdata.data[2].imgnum;
        boxData3data2.value = mkdata.data[2].textnum;
        //模块4
        boxData4.value = mkdata.data[3].textnum;
        boxData4data2.value = mkdata.data[3].imgnum;
        //模块5
        boxData5.value = mkdata.data[4].textnum;
        //模块6
        mkdata.data[5].imgnum.forEach((item, index) => {
            if (index < 1) {
                boxData6.value.push(item);
            } else {
                boxData6data2.value.push(item);
            }
        });
        //模块7
        mkdata.data[6].imgnum.forEach((item, index) => {
            if (index < 2) {
                boxData7.value.push(item);
            } else {
                boxData7data2.value.push(item);
            }
        });
        mkdata.data[6].textnum.forEach((item, index) => {
            if (index < 2) {
                boxData7data3.value.push(item);
            } else {
                boxData7data4.value.push(item);
            }
        });
        //模块8
        boxData8.value = mkdata.data[7].imgnum;
        //模块9
        boxData9.value = mkdata.data[8].imgnum;
        boxData9data2.value = mkdata.data[8].textnum;
        //模块10
        boxData10.value = mkdata.data[9].imgnum;
        boxData10data2.value = mkdata.data[9].textnum;
    } else {
        ElMessage.error(mkdata.message)
    }
}
getPageAllData();

//获取模块下的特殊数据
let getJson1 = [
    { "parent": "375,1,10" },//模块4 商贸信息375
    { "parent": "426,0,10" },//模块6 法治天地426
    { "parent": "374,0,5" },//模块8 农知农技374
]
let jsonString1 = JSON.stringify(getJson1);
//获取模块下的特殊数据
async function getPageData() {
    const mkdata = await requestDataPromise('/web/getWebsiteArticles', {
        method: 'GET',
        query: {
            'id': jsonString1
        },
    });
    // console.log("成功获取模块数据2222！", mkdata);
    if (mkdata.code == 200) {
        // console.log("成功获取模块数据2222！", mkdata);

        //模块4商贸信息375
        boxData4.value = mkdata.data[0].textnum;
        boxData4data2.value = mkdata.data[0].imgnum;
        //模块6法治天地426
        mkdata.data[1].textnum.forEach((item, index) => {
            if (index < 6) {
                boxData6data3.value.push(item);
            } else {
                boxData6data4.value.push(item);
            }
        });
        //模块8农知农技374
        boxData8data2.value = mkdata.data[2].textnum;
    }

}
getPageData();

//4.页面数据 end---------------------------------------->

//5.设置seo数据 start---------------------------------------->
//获取seo数据
const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
    method: 'GET',
    query: {},
});
if (setData.code == 200) {
    let seoTitle = setData.data.website_head.title;
    let seoDescription = setData.data.website_head.description;
    let seoKeywords = setData.data.website_head.keywords;
    let seoSuffix = setData.data.website_head.suffix;
    let seoName = setData.data.website_head.website_name;

    useSeoMeta({
        title: seoTitle + "_" + seoSuffix,
        meta: [
            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
        ]
    });
} else {
    console.log("设置首页SEO出错！", setData.message)
}
//5.设置seo数据 start---------------------------------------->
</script>

<style lang="less" scoped>
@import url('@/assets/css/index.less');
</style>