<template>
    <div>
        <HomePageHead></HomePageHead>
        <HomePageNavigation></HomePageNavigation>
        <HomeSecondaryHeading :titleData="pageData" :pinyinid="routeId"></HomeSecondaryHeading>
        <main class="index_main">
            <section class="index_1 clearfix">
                <div class="index_1_left">
                    <div class="roll_1_box">
                        <HomeSmallSwiper1 :data="pageData[0].data"></HomeSmallSwiper1>
                    </div>
                </div>
                <div class="index_1_right">
                    <div class="index_1_color_box">
                        <h3 class="index_1_head_h3 clearfix phone_head_5">
                            <NuxtLink class="index_1_head_a" :href="getLinkPath(pageData[0])" v-if="pageData[0]"
                                :title="pageData[0].alias">
                                {{ pageData[0].alias }}
                            </NuxtLink>
                        </h3>
 
                        <div class="phone_channel_img_ul_4 pc_none">

                            <div class="phone_channel_img_li_2" v-for="item in pageData[0].data.slice(0, 1)" :key="item.id">

                                <NuxtLink class="phone_channel_img_li_a_2" :href="getLinkPathDetail1(item)"
                                    :title="item.title" :key="item.id" :target="item.islink == 1 ? '_blank' : '_self'">

                                    <img class="phone_channel_img_li_foto_2" :src="item.imgurl" 
                                        alt="item.title">

                                    <span class="phone_channel_img_li_text_2">{{ item.title }}</span>
                                </NuxtLink>
                            </div>
 
                        </div>

                        <div class="index_1_ul" v-if="pageData[0].data2">
                            <NuxtLink class="index_1_ul_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
                                v-for="item in pageData[0].data2" :key="item.id"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                {{ item.title }}
                            </NuxtLink>
                        </div>

                    </div>
                </div>
            </section>
            <HomeAdvertisingClass :adData1="adImg1" :adData2="adImg2"></HomeAdvertisingClass>
            <section class="index_2 clearfix">
                <div class="index_2_left" v-if="pageData[1]">
                    <h3 class="index_2_left_h3 clearfix phone_head_1">
                        <NuxtLink class="index_2_left_h3_a index_2_left_h3_a_only" :href="getLinkPath(pageData[1])"
                            v-if="pageData[1]" :title="pageData[1].alias">
                            {{ pageData[1].alias }}
                        </NuxtLink>
                    </h3>
                    <div class="index_2_left_img_out">
                        <div class="index_2_big_img_ul clearfix">
                            <div class="index_2_big_img_li phone_img_li_1">
                                <NuxtLink class="index_2_big_img_li_a" :href="getLinkPathDetail(item)"
                                    :title="item.title" v-for="item in pageData[1].data" :key="item.id"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" title="item.title" alt="item.title">
                                    <div class="index_2_img_li_dot1 dot1">{{ item.title }}</div>
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="index_2_img_ul clearfix">
                            <div class="index_2_img_li" v-for="item in pageData[1].data2" :key="item.id">
                                <NuxtLink class="index_2_img_li_a" :href="getLinkPathDetail(item)" :title="item.title"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" title="item.title" alt="item.title">
                                    <div class="index_2_img_li_dot1 dot1">{{ item.title }}</div>
                                </NuxtLink>
                            </div>
                        </div>
                    </div>

                    <div class="index_2_left_ul_box">
                        <div class="index_2_left_ul index_2_left_ul_group_6">
                            <div class="index_2_left_ul_li dot1" v-for="item in pageData[1].data3" :key="item.id">
                                <NuxtLink class="index_2_left_ul_li_a_name" :href="getLinkPath1(item)"
                                    :title="item.title" :key="item.id" :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.alias }}
                                </NuxtLink>
                                <NuxtLink class="index_2_left_ul_li_a_text" :href="getLinkPathDetail1(item)"
                                    :title="item.title" :key="item.id" :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.title }}
                                </NuxtLink>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="index_2_right" v-if="pageData[2]">
                    <h3 class="index_2_right_head phone_head_2">
                        <NuxtLink class="index_2_right_head_a" :href="getLinkPath(pageData[2])" v-if="pageData[2]"
                            :title="pageData[2].alias">
                            {{ pageData[2].alias }}
                        </NuxtLink>
                    </h3>

                    <div class="phone_channel_img_ul pc_none">

                        <div class="phone_channel_img_li" v-for="item in pageData[2].data.slice(0, 1)" :key="item.id">

                            <NuxtLink class="phone_channel_img_li_a" :href="getLinkPathDetail(item)" :title="item.title"
                                :key="item.id" :target="item.islink == 1 ? '_blank' : '_self'">
                                <img class="phone_channel_img_li_foto" :src="item.imgurl" title="" alt=""></img>
                                <span class="phone_channel_img_li_text">{{ item.title }}</span>
                            </NuxtLink>
                        </div>

                    </div>

                    <div class="phone_channel_ul pc_none">

                        <NuxtLink v-for="item in pageData[2].data.slice(1, 2)" class="phone_channel_li_a"
                            :href="getLinkPathDetail(item)" :title="item.title" :key="item.id"
                            :target="item.islink == 1 ? '_blank' : '_self'">

                            {{ item.title }}
                        </NuxtLink>

                        <NuxtLink v-for="item in pageData[3].data.slice(0, 4)" class="phone_channel_li_a"
                            :href="getLinkPathDetail(item)" :title="item.title" :key="item.id"
                            :target="item.islink == 1 ? '_blank' : '_self'">

                            {{ item.title }}
                        </NuxtLink>


                    </div>


                    <div class="index_2_right_img_ul phone_none">

                        <div class="index_2_right_img_li clearfix" v-for="item in pageData[2].data" :key="item.id">
                            <NuxtLink class="index_2_right_img_li_a" :href="getLinkPathDetail(item)" :title="item.title"
                                :key="item.id" :target="item.islink == 1 ? '_blank' : '_self'">
                                <div class="index_2_right_img_li_a_img_box">
                                    <img class="" :src="item.imgurl" title="" alt="">
                                </div>
                                <div class="index_2_right_img_li_dot3 dot3">
                                    {{ item.title }}
                                </div>
                            </NuxtLink>
                        </div>
                    </div>
                    <div class="index_1_ul index_1_ul_2 phone_none">
                        <NuxtLink class="index_1_ul_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
                            v-for="item in pageData[2].data3" :key="item.id"
                            :target="item.islink == 1 ? '_blank' : '_self'">
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                    <div class="index_2_right_img_ul phone_none">
                        <div class="index_2_right_img_li clearfix" v-for="item in pageData[2].data2" :key="item.id">
                            <NuxtLink class="index_2_right_img_li_a" :href="getLinkPathDetail(item)" :title="item.title"
                                :key="item.id" :target="item.islink == 1 ? '_blank' : '_self'">
                                <div class="index_2_right_img_li_a_img_box">
                                    <img class="" :src="item.imgurl" title="" alt="">
                                </div>
                                <div class="index_2_right_img_li_dot3 dot3">
                                    {{ item.title }}
                                </div>
                            </NuxtLink>
                        </div>
                    </div>

                </div>
            </section>

            <section class="index_3 clearfix">
                <div class="index_2_left" v-if="pageData[4]">

                    <h3 class="index_2_left_h3 clearfix phone_head_3">
                        <NuxtLink :class="{ 'index_2_left_h3_a': true, 'index_2_left_h3_a_only': showTabs == 1 }"
                            :href="getLinkPath(pageData[3])" v-if="pageData[3]" :title="pageData[3].alias"
                            @mouseenter="qhtabs(1)">
                            {{ pageData[3].alias }}
                        </NuxtLink>
                        <NuxtLink
                            :class="{ 'index_2_left_h3_a phone_none': true, 'index_2_left_h3_a_only': showTabs == 2 }"
                            :href="getLinkPath(pageData[4])" v-if="pageData[4]" :title="pageData[4].alias"
                            @mouseenter="qhtabs(2)">
                            {{ pageData[4].alias }}
                        </NuxtLink>
                    </h3>
                    <div class="phone_channel_img_ul_2 pc_none">

                        <div class="phone_channel_img_li_2" v-for="item in pageData[3].data2.slice(0, 1)" :key="item.id">

                            <NuxtLink class="phone_channel_img_li_a_2" :href="getLinkPathDetail1(item)"
                                :title="item.title" :key="item.id" :target="item.islink == 1 ? '_blank' : '_self'">

                                <img class="phone_channel_img_li_foto_2" :src="item.imgurl" title="item.title"
                                    alt="item.title">

                                <span class="phone_channel_img_li_text_2">{{ item.title }}</span>
                            </NuxtLink>
                        </div>

                    </div>

                    <div v-if="showTabs == 1">


                        <div class="index_2_left_img_out">


                            <div class="index_2_left_ul index_2_left_ul_group_5 phone_img_ul_1">

                                <div class="index_2_left_ul_li dot1" v-for="item in pageData[3].data" :key="item.id">

                                    <NuxtLink class="index_2_left_ul_li_a_name" :href="getLinkPath1(item)"
                                        :title="item.title" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        {{ item.alias }}
                                    </NuxtLink>
                                    <NuxtLink class="index_2_left_ul_li_a_text" :href="getLinkPathDetail1(item)"
                                        :title="item.title" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        {{ item.title }}
                                    </NuxtLink>
                                </div>
                            </div>
                        </div>
                        <div class="index_2_left_ul_box phone_none">
                            <div class="index_3_img_ul">
                                <div class="index_3_img_li clearfix" v-for="item in pageData[3].data2" :key="item.id">
                                    <NuxtLink class="index_3_img_li_a" :href="getLinkPathDetail1(item)"
                                        :title="item.title" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <div class="index_3_img_li_img_box">
                                            <img :src="item.imgurl" title="item.title" alt="item.title">
                                        </div>
                                        <div class="index_3_img_li_in">
                                            <div class="index_3_img_li_dot3 dot3">
                                                {{ item.title }}
                                            </div>
                                            <NuxtLink class="index_2_left_ul_li_a_name" :href="getLinkPath1(item)"
                                                :title="item.title" :key="item.id"
                                                :target="item.islink == 1 ? '_blank' : '_self'">
                                                <span class="index_3_img_li_tag">{{ item.alias }}</span>
                                            </NuxtLink>
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div v-if="showTabs == 2">

                        <div class="index_2_left_img_out">
                            <div class="index_2_left_ul index_2_left_ul_group_5">
                                <div class="index_2_left_ul_li dot1" v-for="item in pageData[4].data" :key="item.id">
                                    <NuxtLink class="index_2_left_ul_li_a_name" :href="getLinkPath1(item)"
                                        :title="item.title" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        {{ item.alias }}
                                    </NuxtLink>
                                    <NuxtLink class="index_2_left_ul_li_a_text" :href="getLinkPathDetail1(item)"
                                        :title="item.title" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        {{ item.title }}
                                    </NuxtLink>
                                </div>
                            </div>
                        </div>
                        <div class="index_2_left_ul_box">
                            <div class="index_3_img_ul">
                                <div class="index_3_img_li clearfix" v-for="item in pageData[4].data2" :key="item.id">

                                    <NuxtLink class="index_3_img_li_a" :href="getLinkPathDetail1(item)"
                                        :title="item.title" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <div class="index_3_img_li_img_box">
                                            <img :src="item.imgurl" title="item.title" alt="item.title">
                                        </div>
                                        <div class="index_3_img_li_in">
                                            <div class="index_3_img_li_dot3 dot3">
                                                {{ item.title }}
                                            </div>
                                            <NuxtLink class="index_2_left_ul_li_a_name" :href="getLinkPath1(item)"
                                                :title="item.title" :key="item.id"
                                                :target="item.islink == 1 ? '_blank' : '_self'">
                                                <span class="index_3_img_li_tag">{{ item.alias }}</span>
                                            </NuxtLink>
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="phone_box_3 pc_none"> <!--phone 农业项目 -->
                        <h3 class="index_2_left_h3 clearfix phone_head_4">

                            <NuxtLink :class="{ 'index_2_left_h3_a': true, 'index_2_left_h3_a_only': showTabs == 2 }"
                                :href="getLinkPath(pageData[4])" v-if="pageData[4]" :title="pageData[4].alias"
                                @mouseenter="qhtabs(2)">
                                {{ pageData[4].alias }}
                            </NuxtLink>
                        </h3>

                        <div class=" pc_none">

                            <div class="phone_channel_img_ul_3 ">

                                <div class="phone_channel_img_li_3" v-for="item in pageData[4].data2.slice(0, 1)"
                                    :key="item.id">

                                    <NuxtLink class="phone_channel_img_li_a_3" :href="getLinkPathDetail1(item)"
                                        :title="item.title" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">

                                        <img class="phone_channel_img_li_foto_3" :src="item.imgurl" title="item.title"
                                            alt="item.title">

                                        <span class="phone_channel_img_li_text_3">{{ item.title }}</span>
                                    </NuxtLink>
                                </div>


                            </div>
                            <div class="phone_channel_ul_3 ">
                                <NuxtLink v-for="item in pageData[4].data.slice(1, 6)" class="phone_channel_li_3_a"
                                    :href="getLinkPathDetail1(item)" :title="item.title" :key="item.id"
                                    :target="item.islink == 1 ? '_blank' : '_self'">

                                    {{ item.title }}
                                </NuxtLink>
                            </div>
                        </div>

                    </div>



                </div>

                <div class="index_2_right">
                    <h3 class="index_2_right_head phone_head_5">
                        <NuxtLink class="index_2_right_head_a" :href="getLinkPath(pageData[5])" v-if="pageData[5]"
                            :title="pageData[5].alias">
                            {{ pageData[5].alias }}
                        </NuxtLink>
                    </h3>
                    <div class="index_3_num_ul phone_img_ul_2" v-if="pageData[5]">
                        <NuxtLink class="index_1_ul_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
                            v-for="item in pageData[5].data" :key="item.id"
                            :target="item.islink == 1 ? '_blank' : '_self'">
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
            </section>
        </main>
        <!-- 页脚部分 -->
        <HomeFoot1></HomeFoot1>
    </div>
</template>

<script setup>
//0.加载页面依赖 start ---------------------------------------->
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
//0.加载页面依赖 end ---------------------------------------->

//1.获得路由id start ---------------------------------------->
const targetSegment = getRoutePath(1);
//1.1 获得当前的路由id
let routeId;
//通过导航路径反向查询导航id
const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
    method: 'GET',
    query: {
        'pinyin': targetSegment,
    },
});
if (getRouteId.code == 200) {
    routeId = getRouteId.data.category_id
} else {
    console.log("获得路由id出错！", getRouteId.message)
}
//1.获得路由id end ---------------------------------------->

//2.选项卡 start ---------------------------------------->
let showTabs = ref(1)
let qhtabs = function (number) {
    console.log(number)
    showTabs.value = number
}
//2.选项卡 end ---------------------------------------->

//3.广告 start ---------------------------------------->
let adImg1 = ref({})
let adImg2 = ref({})
onMounted(async () => {
    //从客户端获取行政职能部门 加快打开速度
    const { $webUrl, $CwebUrl } = useNuxtApp();
    //广告1
    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmw_category_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_category_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.广告 end ---------------------------------------->

//4.页面数据 start ---------------------------------------->
const pageData = ref([
    //示例：
    // {
    //     id: 1, 
    //     title: "", //该导航的标题
    //     data: [], //数据1
    //     data1: [], //数据2
    //     data2: [], //数据3
    //     data3: [], //数据4
    //     data4: [], //数据5
    //     category_id1: "",  //子导航id1
    //     category_id2: "", 
    //     category_id3: "",
    //     category_id4: "",
    //     title1: "", //子导航标题1
    //     title2: "",
    //     title3: "",
    //     title4: "",
    //     cid: "" //该导航的id
    // },
])

//4.1 获取所有导航
try {
    const navigateData = await requestDataPromise('/web/getWebsiteModelCategory', {
        method: 'GET',
        query: {
            'placeid': 1,
            'pid': routeId,
            'num': 16
        },
    });
    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: targetSegment + "/" + navigateData.data[index].aLIas_pinyin,
                data: [],
                data1: [],
                data2: [],
                data3: [],
                data4: [],
                category_id1: "",
                category_id2: "",
                category_id3: "",
                category_id4: "",
                title1: "",
                title2: "",
                title3: "",
                title4: ""
            };
            if (navigateData.data[index].is_url == 1) {
                // 处理 URL 的逻辑
            } else {
                //每个页面最多8个模块
                pageData.value.push(data);
            }
        }
        //导航池加载完毕，开始申请模块数据
        let getJson = [
            // { "parent": routeId + ",0,0", "child": pageData.value[0].cid + ",5,7" },//模块1理论前沿
            // { "parent": routeId + ",0,0", "child": pageData.value[1].cid + ",3,11" },//模块2典型经验
            // { "parent": routeId + ",0,0", "child": pageData.value[2].cid + ",4,2" },//模块3农业天地
            // { "parent": routeId + ",0,0", "child": pageData.value[3].cid + ",3,10" },//模块4美丽乡村
            // { "parent": routeId + ",0,0", "child": pageData.value[4].cid + ",3,10" },//模块5农民之家
            // { "parent": routeId + ",0,0", "child": pageData.value[5].cid + ",0,7" },//模块6农业天地
            // { "parent": routeId + ",0,0", "child": pageData.value[6].cid + ",2,3" },//模块7农村建设
            // { "parent": routeId + ",0,0", "child": pageData.value[7].cid + ",4,0" },//模块8高端资讯
        ]
        for (let index in pageData.value) {
            // console.log("index", index)
            if (index == 0) {
                getJson.push({ "parent": routeId + ",0,0", "child": pageData.value[index].cid + ",5,7" })//模块1理论前沿
            } else if (index == 1) {
                getJson.push({ "parent": routeId + ",0,0", "child": pageData.value[index].cid + ",3,11" })//模块2典型经验
            } else if (index == 2) {
                getJson.push({ "parent": routeId + ",0,0", "child": pageData.value[index].cid + ",4,2" })//模块3农业天地
            } else if (index == 3) {
                getJson.push({ "parent": routeId + ",0,0", "child": pageData.value[index].cid + ",3,10" })//模块4美丽乡村
            } else if (index == 4) {
                getJson.push({ "parent": routeId + ",0,0", "child": pageData.value[index].cid + ",3,10" })//模块5农民之家 
            } else if (index == 5) {
                getJson.push({ "parent": routeId + ",0,0", "child": pageData.value[index].cid + ",0,9" })//模块6农业天地 
            } else if (index == 6) {
                getJson.push({ "parent": routeId + ",0,0", "child": pageData.value[index].cid + ",2,3" })//模块7农村建设 
            } else if (index == 7) {
                getJson.push({ "parent": routeId + ",0,0", "child": pageData.value[index].cid + ",4,0" })//模块8高端资讯 
            }
        }
        let jsonString = JSON.stringify(getJson);
        getPageAllData(jsonString);

        //频道页特殊数据
        let getJson1 = []
        for (let index in pageData.value) {
            // console.log("index", index)
            if (index == 1) {
                getJson1.push({ "parent": pageData.value[index].cid + ",0,11" })//模块2典型经验
            } else if (index == 3) {
                getJson1.push({ "parent": pageData.value[index].cid + ",3,10" })//模块4美丽乡村
            } else if (index == 4) {
                getJson1.push({ "parent": pageData.value[index].cid + ",3,10" })//模块5农民之家 
            }
        }
        let jsonString1 = JSON.stringify(getJson1);
        if (jsonString1 != '[]') {
            getPageAllData1(jsonString1);
        }
    } else {
        // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
        // console.log("错误位置：分类页导航池")
        // console.log("后端错误反馈：", navigateData.message)
        // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
    }
} catch (error) {
    // console.log("错误：导航池渲染执行接口出错！请检查频道页渲染的模块数据是否完整！")
}


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


    if (mkdata.code == 200) {
        //模块1
        pageData.value[0].data = mkdata.data[0].child.imgnum;
        pageData.value[0].data2 = mkdata.data[0].child.textnum;
        //模块2
        for (let index in mkdata.data[1].child.imgnum) {
            if (index == 0) {
                pageData.value[1].data.push(mkdata.data[1].child.imgnum[index]);
            } else {
                pageData.value[1].data2.push(mkdata.data[1].child.imgnum[index]);
            }
        }
        // pageData.value[1].data3 = mkdata.data[1].child.textnum;
        //模块3
        for (let index in mkdata.data[2].child.imgnum) {
            if (index <= 1) {
                pageData.value[2].data.push(mkdata.data[2].child.imgnum[index]);
            } else {
                pageData.value[2].data2.push(mkdata.data[2].child.imgnum[index]);
            }
        }
        pageData.value[2].data3 = mkdata.data[2].child.textnum;
        //模块4
        // pageData.value[3].data = mkdata.data[3].child.textnum;
        // pageData.value[3].data2 = mkdata.data[3].child.imgnum;
        // //模块5
        // pageData.value[4].data = mkdata.data[4].child.textnum;
        // pageData.value[4].data2 = mkdata.data[4].child.imgnum;
        //模块6
        pageData.value[5].data = mkdata.data[5].child.textnum;

    } else {
        ElMessage.error(mkdata.message)
    }
}


//频道页特殊数据
async function getPageAllData1(jsonString1) {
    const mkdata = await requestDataPromise('/web/getWebsiteArticles', {
        method: 'GET',
        query: {
            'id': jsonString1
        },
    });
    // console.log('模块数据111：', mkdata);


    if (mkdata.code == 200) {
        //模块2
        pageData.value[1].data3 = mkdata.data[0].textnum;
        //模块4
        pageData.value[3].data = mkdata.data[1].textnum;
        pageData.value[3].data2 = mkdata.data[1].imgnum;
        //模块5
        pageData.value[4].data = mkdata.data[2].textnum;
        pageData.value[4].data2 = mkdata.data[2].imgnum;

    } else {
        ElMessage.error(mkdata.message)
    }
}
//4.页面数据 end ---------------------------------------->

//5.设置seo信息 start---------------------------------------->
const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
    method: 'GET',
    query: {
        'catid': routeId
    },
});

if (setData.code == 200) {
    let seoTitle = setData.data.seo_title;
    let seoDescription = setData.data.seo_description;
    let seoKeywords = setData.data.seo_keywords;
    let seoSuffix = setData.data.suffix;
    let seoName = setData.data.website_name;

    useSeoMeta({
        title: seoTitle + "_" + seoName + "_" + seoSuffix,
        meta: [
            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
            { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no', tagPriority: 10 }
        ]
    });
} else {
    // console.log("设置频道页SEO出错！", setData.message)
}
//5.设置seo信息 end---------------------------------------->
</script>

<style lang="less" scoped>
@import '@/assets/css/class.less';
</style>



<style lang="less" scoped>
@media screen and (min-width:801px) {
    /*pc*/


    .pc_none {
        display: none;
    }
}

@media screen and (max-width:800px) {
    /*ipad_phone*/

    .index_main {
        width: 100%;
    }

    .index_1 {
        width: 92%;
        height: auto;
        margin: 0px auto;
    }

    .index_1_right {
        width: 100%;
        float: none;
    }

    .index_1_color_box {
        padding: 0;
        border: none;
        background: #fff;
    }

    .index_1_head_h3 {
        height: 50px;
        line-height: 50px;
        background: #fff;
        border-top: 1px solid #DD7D18;
        padding: 0;
        width: 100%;
        margin: 15px auto 0px;

    }

    .index_1_head_h3 .index_1_head_a {
        float: left;
        height: 50px;
        line-height: 50px;
        margin: 0;
        color: #dd7d18;
        font-size: 18px;
        border-top: 3px solid #DD7D18;
        font-weight: bold;
        box-sizing: border-box;

    }

    .index_1_ul_a {
        width: 100% !important;
        display: block;
        height: 40px !important;
        border-bottom: 1px solid #E6E6E6;
        margin: 0px !important;
        line-height: 40px;
        position: relative;
        text-indent: 18px;
        font-size: 16px;

    }

    .index_1_ul_a:nth-of-type(n+6) {
        display: none;
    }

    .index_1_ul_a::after {
        content: '';
        display: block;
        position: absolute;
        left: 0px;
        top: 18px;
        background: #E6E6E6;
        width: 6px;
        height: 6px;
    }

    .index_2 {
        height: auto;
        overflow: hidden;
        width: 92%;
        margin: 0px auto;
    }

    .index_2_left {
        width: 100%;
        float: none;
        overflow: hidden;
    }

    .index_2_left_img_out {
        width: 100%;
        float: none;
        overflow: hidden;
    }

    .index_2_left_h3 {
        height: 50px;
        line-height: 50px;
        background: #fff;
        border-top: 1px solid #DD7D18;
        padding: 0;
        width: 100%;

    }

    .index_2_left_h3_a {
        float: left;
        height: 50px;
        line-height: 50px;
        margin: 0;
        color: #dd7d18;
        font-size: 18px;
        border-top: 3px solid #DD7D18;
        font-weight: bold;
        box-sizing: border-box;
        padding: 0 !important;
    }

    .index_2_big_img_li {
        width: 100%;
        float: none;
        height: 55vw;
        border-radius: 10px;
        position: relative;
        overflow: hidden;
    }

    .index_2_big_img_li a {
        display: block;
        width: 100%;
        height: 100%;
    }

    .index_2_big_img_li img {
        display: block;
        width: 100%;
        height: 100%;
    }

    .index_2_img_li_dot1 {
        position: absolute;
        width: 100%;
        height: 66px;
        line-height: 90px;
        color: #fff;
        font-size: 16px;
        left: 0px;
        bottom: 0px;
        padding: 0px 5%;
        box-sizing: border-box;
        font-weight: bold;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));

    }

    .index_2_left_ul_box {
        width: 100%;
        float: none;
        overflow: hidden;
    }

    .index_2_left_ul_li {
        width: 100% !important;
        display: block;
        height: 40px !important;
        border-bottom: 1px solid #E6E6E6;
        margin: 0px !important;
    }

    .index_2_left_ul_li .index_2_left_ul_li_a_text {
        width: 100% !important;
        display: block;
        font-weight: normal !important;
        line-height: 40px;
        height: 40px;
        position: relative;
        text-indent: 18px;
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 16px;
    }

    .index_2_left_ul_li .index_2_left_ul_li_a_text::after {
        content: '';
        display: block;
        position: absolute;
        left: 0px;
        top: 18px;
        background: #E6E6E6;
        width: 6px;
        height: 6px;
    }

    .index_2_right {
        width: 100%;
        float: none;
        overflow: hidden;
    }

    .index_2_right_head {
        height: 50px;
        line-height: 50px;
        background: #fff;
        border-top: 1px solid #DD7D18;
        padding: 0;
        width: 100%;

    }

    .index_2_right_head .index_2_right_head_a {
        float: left;
        height: 50px;
        line-height: 50px;
        margin: 0;
        color: #dd7d18;
        font-size: 18px;
        border-top: 3px solid #DD7D18;
        font-weight: bold;
        box-sizing: border-box;
    }

    .phone_channel_img_ul {
        width: 100%;
        float: none;
        overflow: hidden;

        div {
            width: 100%;
            float: none;
            height: 55vw;
            border-radius: 10px;
            position: relative;
            overflow: hidden;
        }

        a {
            display: block;
            width: 100%;
            height: 100%;
        }

        img {
            display: block;
            width: 100%;
            height: 100%;
        }

        span {
            position: absolute;
            width: 100%;
            height: 66px;
            line-height: 90px;
            color: #fff;
            font-size: 16px;
            left: 0px;
            bottom: 0px;
            padding: 0px 5%;
            box-sizing: border-box;
            font-weight: bold;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));

        }
    }


    .phone_channel_ul {

        a {
            border-bottom: 1px solid #E6E6E6;
            width: 100% !important;
            display: block;
            color: #333;
            line-height: 40px;
            height: 40px;
            position: relative;
            text-indent: 18px;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 16px;
        }

        a::after {
            content: '';
            display: block;
            position: absolute;
            left: 0px;
            top: 18px;
            background: #E6E6E6;
            width: 6px;
            height: 6px;
        }

    }


    .index_2_left_ul_li .index_2_left_ul_li_a_name {
        display: none;
    }

    .index_2_left_ul_li:nth-of-type(n+6) {
        display: none;
    }

    .index_3 {
        width: 92%;
        float: none;
        overflow: hidden;
        margin: 0px auto;
        height: auto;
    }


    .phone_channel_img_ul_2 {
        min-height:55vw; 
        width: 100%;
        float: none;
        overflow: hidden;

        div {
            width: 100%;
            float: none;
            height: 55vw;
            border-radius: 10px;
            position: relative;
            overflow: hidden;
        }

        a {
            display: block;
            width: 100%;
            height: 100%;
        }

        img {
            display: block;
            width: 100%;
            height: 100%;
        }

        span {
            position: absolute;
            width: 100%;
            height: 66px;
            line-height: 90px;
            color: #fff;
            font-size: 16px;
            left: 0px;
            bottom: 0px;
            padding: 0px 5%;
            box-sizing: border-box;
            font-weight: bold;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));

        }
    }

    .phone_channel_img_ul_3 {

        min-height:55vw; 
        width: 100%;
        float: none;
        overflow: hidden;

        div {
            width: 100%;
            float: none;
            height: 55vw;
            border-radius: 10px;
            position: relative;
            overflow: hidden;
        }

        a {
            display: block;
            width: 100%;
            height: 100%;
        }

        img {
            display: block;
            width: 100%;
            height: 100%;
        }

        span {
            position: absolute;
            width: 100%;
            height: 66px;
            line-height: 90px;
            color: #fff;
            font-size: 16px;
            left: 0px;
            bottom: 0px;
            padding: 0px 5%;
            box-sizing: border-box;
            font-weight: bold;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));

        }
    }

    .phone_channel_img_ul_4 {

        width: 100%;
        float: none;
        overflow: hidden;
        min-height:55vw; 

        div {
            width: 100%;
            float: none;
            height: 55vw;
            border-radius: 10px;
            position: relative;
            overflow: hidden;
            margin-bottom:15px;
        }

        a {
            display: block;
            width: 100%;
            height: 100%;
        }

        img {
            display: block;
            width: 100%;
            height: 100%;
        }

        span {
            position: absolute;
            width: 100%;
            height: 66px;
            line-height: 90px;
            color: #fff;
            font-size: 16px;
            left: 0px;
            bottom: 0px;
            padding: 0px 5%;
            box-sizing: border-box;
            font-weight: bold;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));

        }
    }


    .phone_channel_ul_3 {
        height: 207px;
        overflow: hidden;
        margin: 13px auto 15px;

        a {
            border-bottom: 1px solid #E6E6E6;
            width: 100% !important;
            display: block;
            color: #333;
            line-height: 40px;
            height: 40px;
            position: relative;
            text-indent: 18px;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 16px;
        }

        a::after {
            content: '';
            display: block;
            position: absolute;
            left: 0px;
            top: 18px;
            background: #E6E6E6;
            width: 6px;
            height: 6px;
        }

    }


    .index_1_ul {
        height: 205px;
        overflow: hidden;
    }

    .index_2_left_ul_group_6 {
        height: 205px;
        overflow: hidden;
    }

    .index_2_left_ul_group_5 {
        height: 205px;
        overflow: hidden;
    }

    .phone_channel_ul {
        height: 205px;
        overflow: hidden;
        margin: 15px auto 15px;
    }

    .index_3_num_ul {
        height: 205px;
        overflow: hidden;
    }



    .phone_head_1 {
        margin: 30px auto 0px;
    }

    .phone_head_2 {
        margin: 30px auto 0px;
    }

    .phone_head_3 {
        margin: 15px auto 0px;
    }

    .phone_head_4 {
        margin: 15px auto 0px;
    }

    .phone_head_5 {
        margin: 15px auto 0px;
    }


    .phone_img_li_1 {
        margin-bottom: 15px;
    }

    .phone_img_ul_1 {
        margin: 15px auto 13px;
    }

    .phone_img_ul_2 {
        margin-bottom: 11px;
    }





    .index_2_img_ul {
        display: none;
    }

    .index_1 .index_1_left {
        display: none;
    }

    .phone_none {
        display: none;
    }
}
</style>
