<template>
    <!-- 频道页 -->
    <div>
        <HomePageHead></HomePageHead>
        <HomePageNavigation></HomePageNavigation>
        <HomeSecondaryHeading :titleData="pageData" :pinyinid="routeId"></HomeSecondaryHeading>
        <main class="index_main">
 
            <section class="channel_1 clearfix phone_none" v-if="newsData.length > 0">
                <div class="channel_1_box clearfix">
                    <div class="roll_1_box clearfix">
                        <HomeSwiperNzgx :imgData="newsData[0].data"></HomeSwiperNzgx>
                    </div>
                </div>
                <div class="channel_2_box clearfix">
                    <div class="channel_ul_1 clearfix">
                        <NuxtLink class="channel_ul_1_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
                            v-for="item in newsData[0].data2" :key="item.id"
                            :target="item.islink == 1 ? '_blank' : '_self'">
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
            </section>
            <!-- 广告 1-->

            <HomeAdvertising :imgurl="adImg1" v-if="newsData.length > 0"></HomeAdvertising>
            <section class="channel_2 clearfix phone_none" >
                <div class="channel_1_box" v-if="companyData.length > 0">

                    <div class="channel_head_box clearfix">
                        <div class="channel_head_box_left">
                            <div class="channel_head_left_a_btn">
                                <NuxtLink class="channel_head_left_a channel_head_left_a_only"
                                    :href="getLinkPath(companyData[0])" v-if="companyData[0]"
                                    :title="companyData[0].alias">
                                    {{ companyData[0].alias }}
                                </NuxtLink>
                            </div>
                        </div>
                    </div>
                    <div class=" clearfix">
                        <div class="channel_3_box clearfix">
                            <div class="channel_ul_2 clearfix" v-if="companyData[0]">
                                <NuxtLink class="channel_ul_2_a dot1" :href="getLinkPathDetail(item)"
                                    :title="item.title" v-for="item in companyData[0].data3" :key="item.id"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.title }}
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="channel_4_box clearfix">
                            <div class="channel_img_ul_1">
                                <div class="channel_img_ul_1_li" v-if="companyData[0]">
                                    <NuxtLink class="channel_img_ul_1_li_a" :href="getLinkPathDetail(item)"
                                        :title="item.title" v-for="item in companyData[0].data" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <img class="channel_img_ul_1_li_img" :src="item.imgurl" alt="item.imgurl">
                                        <div class="channel_img_ul_1_li_dot2 dot2">
                                            {{ item.title }}
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                            <div class="channel_img_ul_even_1 clearfix" v-if="companyData[0]">
                                <div class="channel_img_ul_even_1_li" v-for="item in companyData[0].data2">
                                    <NuxtLink class="channel_img_ul_even_1_li_a" :href="getLinkPathDetail(item)"
                                        :title="item.title" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <img class="channel_img_ul_even_1_li_img" :src="item.imgurl" alt="item.imgurl">
                                        <div class="channel_img_ul_even_1_li_dot2 dot2">
                                            {{ item.title }}
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="channel_2_box" v-if="companyData.length > 1">

                    <div class="channel_head_box clearfix">
                        <div class="channel_head_box_left">
                            <div class="channel_head_left_a_btn">
                                <NuxtLink class="channel_head_left_a channel_head_left_a_only"
                                    :href="getLinkPath(companyData[1])" v-if="companyData[1]"
                                    :title="companyData[1].alias">
                                    {{ companyData[1].alias }}
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="channel_head_box_right">
                            <!-- <NuxtLink class="channel_head_box_right_1_a" :href="getLinkPath(companyData[1])"
                                v-if="companyData[1]" :title="companyData[1].alias">
                                栏目简介
                            </NuxtLink> -->
                        </div>
                    </div>
                    <div class=" clearfix">
                        <div class="channel_even_img_ul_2 clearfix" v-if="companyData[1]">
                            <div class="channel_even_img_ul_2_li" v-for="item in companyData[1].data">
                                <NuxtLink class="channel_even_img_ul_2_a" :href="getLinkPathDetail(item)"
                                    :title="item.title" :key="item.id" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img class="channel_even_img_ul_2_li_img" :src="item.imgurl" alt="item.title">
                                    <div class="channel_even_img_ul_2_dot1 dot1">{{ item.title }}</div>
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="channel_ul_3 clearfix" v-if="companyData[1]">
                            <NuxtLink class="channel_ul_3_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
                                v-for="item in companyData[1].data2" :key="item.id"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                {{ item.title }}
                            </NuxtLink>
                        </div>
                    </div>
                </div>
            </section>

            <div class="phone_box_1 pc_none" v-if="companyData[0]">

                <div class="phone_box_head">
                        <NuxtLink
                             class=""
                            :href="getLinkPath(companyData[0])">
                            {{ companyData[0].alias }}
                        </NuxtLink>
                </div>

                <div class="phone_box_img_ul">

                    <div class="" >
                        <NuxtLink class=""
                                :href="getLinkPathDetail(item)"
                                v-for="item in companyData[0].data.slice(0, 1)" 
                                :key="item.id"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img class=" " :src="item.imgurl" alt="item.imgurl">
                                <span class=" ">
                                    {{ item.title }}
                                </span>
                        </NuxtLink>
                    </div>

                </div>

                <div class="phone_box_ul">

                    <div class="">

                        <NuxtLink class=""
                             v-for="item in companyData[0].data3.slice(0, 3)" 
                             :href="getLinkPathDetail(item)"
                             :key="item.id"
                             :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.title }}
                        </NuxtLink>

                    </div>                    

                </div>

            </div>

            <div class="phone_box_2 pc_none" v-if="companyData[1]">

                <div class="phone_box_head">
                        <NuxtLink
                             class=""
                            :href="getLinkPath(companyData[1])">
                            {{ companyData[1].alias }}
                        </NuxtLink>
                </div>

                <div class="phone_box_img_ul">

                    <div class="" >
                        <NuxtLink class=""
                                :href="getLinkPathDetail(item)"
                                v-for="item in companyData[1].data.slice(0, 1)" 
                                :key="item.id"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img class=" " :src="item.imgurl" alt="item.imgurl">
                                <span class=" ">
                                    {{ item.title }}
                                </span>
                        </NuxtLink>
                    </div>

                </div>

                <div class="phone_box_ul">

                    <div class="">

                        <NuxtLink class=""
                             v-for="item in companyData[1].data2.slice(0, 3)" 
                             :href="getLinkPathDetail(item)"
                             :key="item.id"
                             :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.title }}
                        </NuxtLink>

                    </div>                    

                </div>

            </div>

            <section class="channel_3 clearfix phone_none">

                <div class="channel_1_box" v-if="companyData.length > 2">
                    <div class="channel_head_box clearfix">
                        <div class="channel_head_box_left">
                            <div class="channel_head_left_a_btn">
                                <NuxtLink class="channel_head_left_a channel_head_left_a_only"
                                    :href="getLinkPath(companyData[2])" v-if="companyData[2]"
                                    :title="companyData[2].alias">
                                    {{ companyData[2].alias }}
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="channel_head_box_right">
                            <!-- <NuxtLink class="channel_head_box_right_1_a" :href="getLinkPath(companyData[2])"
                                v-if="companyData[2]" :title="companyData[2].alias">
                                栏目简介
                            </NuxtLink> -->
                        </div>
                    </div>
                    <div class=" clearfix">
                        <div class="channel_ul_4 clearfix" v-if="companyData[2]">
                            <NuxtLink class="channel_ul_4_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
                                v-for="item in companyData[2].data2" :key="item.id"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                {{ item.title }}
                            </NuxtLink>
                        </div>
                    </div>
                </div>
                <div class="channel_2_box" v-if="companyData.length > 3">
                    <div class="channel_head_box clearfix">
                        <div class="channel_head_box_left">
                            <div class="channel_head_left_a_btn">
                                <NuxtLink class="channel_head_left_a channel_head_left_a_only"
                                    :href="getLinkPath(companyData[3])" v-if="companyData[3]"
                                    :title="companyData[3].alias">
                                    {{ companyData[3].alias }}
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="channel_head_box_right">
                            <!-- <NuxtLink class="channel_head_box_right_1_a" :href="getLinkPath(companyData[3])"
                                v-if="companyData[3]" :title="companyData[3].alias">
                                栏目简介
                            </NuxtLink> -->
                        </div>
                    </div>
                    <div class="channel_img_ul_2">
                        <div class="channel_img_ul_2_li" v-if="companyData[3]">
                            <NuxtLink class="channel_img_ul_2_li_a" :href="getLinkPathDetail(item)" :title="item.title"
                                v-for="item in companyData[3].data" :key="item.id"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img class="channel_img_ul_2_li_img" :src="item.imgurl" alt="item.imgurl">
                                <div class="channel_img_ul_2_li_dot2 dot2">{{ item.title }}</div>
                            </NuxtLink>
                        </div>
                    </div>
                </div>
            </section>

            <div class="phone_box_3 pc_none" v-if="companyData[2]">

                <div class="phone_box_head">
                    
                        <NuxtLink
                             class=""
                            :href="getLinkPath(companyData[2])">
                            {{ companyData[2].alias }}
                        </NuxtLink>
                </div> 

                <div class="phone_box_ul">

                    <div class="">
 
                        <NuxtLink class=""
                                :href="getLinkPathDetail(item)" 
                            v-for="item in companyData[2].data2.slice(0, 3)"
                                :key="item.id"
                            :target="item.islink == 1 ? '_blank' : '_self'">
                            {{ item.title }}
                        </NuxtLink>

                    </div>                    

                </div>

            </div>

            <div class="phone_box_4 pc_none" v-if="companyData[3]">

                <div class="phone_box_head">
                        <NuxtLink
                             class=""
                            :href="getLinkPath(companyData[3])">
                            {{ companyData[3].alias }}
                        </NuxtLink>
                </div>

                <div class="phone_box_img_ul">

                    <div class="" >
                        <NuxtLink class=""
                                :href="getLinkPathDetail(item)"
                                v-for="item in companyData[3].data.slice(0, 1)" 
                                :key="item.id"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                <img class=" " :src="item.imgurl" alt="item.imgurl">
                                <span class=" ">
                                    {{ item.title }}
                                </span>
                        </NuxtLink>
                    </div>

                </div>
 

            </div>
            



            <!-- 广告 2-->
            <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>
            <section class="channel_4 clearfix phone_none">
                <div class="channel_1_box" v-if="companyData.length > 6">
                    <div class="channel_head_box clearfix" v-if="companyData.length > 4">
                        <div class="channel_head_box_left">
                            <div class="channel_head_left_a_btn">
                                <NuxtLink class="channel_head_left_a channel_head_left_a_only"
                                    :href="getLinkPath(companyData[4])" v-if="companyData[4]"
                                    :title="companyData[4].alias">
                                    {{ companyData[4].alias }}
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="channel_head_box_right">
                            <!-- <NuxtLink class="channel_head_box_right_1_a" :href="getLinkPath(companyData[4])"
                                v-if="companyData[4]" :title="companyData[4].alias">
                                栏目简介
                            </NuxtLink> -->
                        </div>
                    </div>
                    <div class=" clearfix" v-if="companyData.length > 4">
                        <div class="channel_3_box clearfix">
                            <div class="channel_img_ul_3_ul boxheight2">
                                <div class="channel_img_ul_3_li" v-if="companyData[4]">
                                    <NuxtLink class="channel_img_ul_3_li_a" :href="getLinkPathDetail(item)"
                                        :title="item.title" v-for="item in companyData[4].data" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <img class="channel_img_ul_3_li_img" :src="item.imgurl" alt="item.title">
                                        <div class="channel_img_ul_3_li_dot1 dot1">
                                            {{ item.title }}
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                        </div>
                        <div class="channel_4_box clearfix">
                            <div class="channel_ul_5 clearfix" v-if="companyData[4]">
                                <NuxtLink class="channel_ul_5_a dot1" :href="getLinkPathDetail(item)"
                                    :title="item.title" v-for="item in companyData[4].data2" :key="item.id"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.title }}
                                </NuxtLink>
                            </div>
                        </div>
                    </div>
                    <div class="channel_head_box clearfix channel_head_box_2" v-if="companyData.length > 5">
                        <div class="channel_head_box_left">
                            <div class="channel_head_left_a_btn">
                                <NuxtLink class="channel_head_left_a channel_head_left_a_only"
                                    :href="getLinkPath(companyData[5])" v-if="companyData[5]"
                                    :title="companyData[5].alias">
                                    {{ companyData[5].alias }}
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="channel_head_box_right">
                            <!-- <NuxtLink class="channel_head_box_right_1_a" :href="getLinkPath(companyData[5])"
                                v-if="companyData[5]" :title="companyData[5].alias">
                                栏目简介
                            </NuxtLink> -->
                        </div>
                    </div>
                    <div class=" clearfix" v-if="companyData.length > 5">
                        <div class="channel_3_box clearfix">
                            <div class="channel_img_ul_4_ul">
                                <div class="channel_img_ul_4_li" v-if="companyData[5]">
                                    <NuxtLink class="channel_img_ul_4_li_a" :href="getLinkPathDetail(item)"
                                        :title="item.title" v-for="item in companyData[5].data" :key="item.id"
                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                        <img class="channel_img_ul_4_li_img" :src="item.imgurl" alt="item.title">
                                        <div class="channel_img_ul_4_li_dot1 dot1">
                                            {{ item.title }}
                                        </div>
                                    </NuxtLink>
                                </div>
                            </div>
                        </div>
                        <div class="channel_4_box clearfix">
                            <div class="channel_ul_6 clearfix" v-if="companyData[5]">
                                <NuxtLink class="channel_ul_6_a dot1" :href="getLinkPathDetail(item)"
                                    :title="item.title" v-for="item in companyData[5].data2" :key="item.id"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    {{ item.title }}
                                </NuxtLink>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="channel_2_box" v-if="companyData.length > 6">
                    <div class="channel_head_box clearfix">
                        <div class="channel_head_box_left">
                            <div class="channel_head_left_a_btn">
                                <NuxtLink class="channel_head_left_a channel_head_left_a_only"
                                    :href="getLinkPath(companyData[6])" v-if="companyData[6]"
                                    :title="companyData[6].alias">
                                    {{ companyData[6].alias }}
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="channel_head_box_right">
                            <!-- <NuxtLink class="channel_head_box_right_1_a" :href="getLinkPath(companyData[6])"
                                v-if="companyData[6]" :title="companyData[6].alias">
                                栏目简介
                            </NuxtLink> -->
                        </div>
                    </div>
                    <div class="boxheight1 clearfix">
                        <div class="channel_img_ul_5_ul">
                            <div class="channel_img_ul_5_li">
                                <NuxtLink class="channel_img_ul_5_li_a" :href="getLinkPathDetail(item)"
                                    :title="item.title" v-for="item in companyData[6].data" :key="item.id"
                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img class="channel_img_ul_5_li_img" :src="item.imgurl" alt="item.title">
                                    <div class="channel_img_ul_5_li_dot1 dot1">{{ item.title }} </div>
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="index_ul_7 clearfix">
                            <NuxtLink class="index_ul_7_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
                                v-for="item in companyData[6].data2" :key="item.id"
                                :target="item.islink == 1 ? '_blank' : '_self'">
                                {{ item.title }}
                            </NuxtLink>
                        </div>
                    </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,
    },
});
console.log('mkdataRouteId', getRouteId);

if (getRouteId.code == 200) {
    routeId = getRouteId.data.category_id
    console.log('mkdataRouteId1111', routeId);

} 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({})
let adImg3 = ref({})
let adImg4 = ref({})
onMounted(async () => {
    //从客户端获取行政职能部门 加快打开速度
    const { $webUrl, $CwebUrl } = useNuxtApp();
    //广告1
    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_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=nzgxw_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
    let url3 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_category_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];

    //广告4
    let url4 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_category_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 ---------------------------------------->
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
    // },
])
const companyData = ref([])
const newsData = ref([])

//4.1 获取所有导航
try {
    const navigateData = await requestDataPromise('/web/getWebsiteModelCategory', {
        method: 'GET',
        query: {
            'placeid': 1,
            'pid': routeId,
            'num': 20
        },
    });
    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,
                type: navigateData.data[index].type,
                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 {
                if (navigateData.data[index].type == 1) {
                    newsData.value.push(data);
                } else if (navigateData.data[index].type == 6) {
                    companyData.value.push(data);
                }
                // companyData.value.push(data);
                //每个页面最多8个模块
                pageData.value.push(data);
            }

        }
        console.log("mkdata导航池加载完毕", companyData.value);

        //导航池加载完毕，开始申请模块数据
        let getJson = []
        for (let i = 0; i < companyData.value.length; i++) {
            if (i == 0) {
                getJson.push({ "id": companyData.value[i].cid + ",3,11" });//模块2 
            } else if (i == 1) {
                getJson.push({ "id": companyData.value[i].cid + ",2,7" });//模块3 
            } else if (i == 2) {
                getJson.push({ "id": companyData.value[i].cid + ",0,8" });//模块4 
            } else if (i == 3) {
                getJson.push({ "id": companyData.value[i].cid + ",1,0" });//模块5
            } else if (i == 4) {
                getJson.push({ "id": companyData.value[i].cid + ",1,6" });//模块6
            } else if (i == 5) {
                getJson.push({ "id": companyData.value[i].cid + ",1,6" });//模块7
            } else if (i == 6) {
                getJson.push({ "id": companyData.value[i].cid + ",1,7" });//模块8 
            }
        }
        let jsonString = JSON.stringify(getJson);
        getPageAllData(jsonString);


        let getnewsJson = []
        if (newsData.value.length > 0) {
            for (let i = 0; i < newsData.value.length; i++) {
                if (i == 0) {
                    getnewsJson.push({ "parent": routeId + ",0,0", "child": pageData.value[i].cid + ",4,9" });//模块1 
                }
            }
            let newsJsonString = JSON.stringify(getnewsJson);
            getPageNewsData(newsJsonString);
        }




    } else {
        console.log("错误：渲染8个模块环节出错，请检查是否存在没有数据的模块！")
    }
} catch (error) {
    console.log("错误：导航池渲染执行接口出错！请检查频道页渲染的模块数据是否完整！")
}

async function getPageAllData(jsonString) {
    const mkdata = await requestDataPromise('/web/getWebsiteCompany', {
        method: 'GET',
        query: {
            'id': jsonString
        },
    });
    console.log('mkdata', mkdata.data.length);
    if (mkdata.code == 200) {
        // if (mkdata.data.length > 0) {
        //     //模块1 顶部大图和列表
        //     companyData.value[0].data = mkdata.data[0].img_num;
        //     companyData.value[0].data2 = mkdata.data[0].text_num;
        // }
        if (mkdata.data.length > 0) {
            //模块2
            companyData.value[0].data3 = mkdata.data[0].text_num;
            for (let index in mkdata.data[0].img_num) {
                if (index < 1) {
                    companyData.value[0].data.push(mkdata.data[0].img_num[index]);
                } else {
                    companyData.value[0].data2.push(mkdata.data[0].img_num[index]);
                }
            }
        }
        if (mkdata.data.length >= 1) {
            //模块3
            companyData.value[1].data = mkdata.data[1].img_num;
            companyData.value[1].data2 = mkdata.data[1].text_num;
        }
        if (mkdata.data.length >= 2) {
            //模块4
            companyData.value[2].data = mkdata.data[2].img_num;
            companyData.value[2].data2 = mkdata.data[2].text_num;
        }
        if (mkdata.data.length >= 4) {
            //模块5
            companyData.value[3].data = mkdata.data[3].img_num;
        }
        if (mkdata.data.length >= 5) {
            //模块6
            companyData.value[4].data = mkdata.data[4].img_num;
            companyData.value[4].data2 = mkdata.data[4].text_num;
        }
        if (mkdata.data.length >= 6) {
            //模块7
            companyData.value[5].data = mkdata.data[5].img_num;
            companyData.value[5].data2 = mkdata.data[5].text_num;
        }
        if (mkdata.data.length >= 7) {
            //模块8
            companyData.value[6].data = mkdata.data[6].img_num;
            companyData.value[6].data2 = mkdata.data[6].text_num;
        }

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

async function getPageNewsData(newsJsonString) {
    const mkdata = await requestDataPromise('/web/getWebsiteAllArticle', {
        method: 'GET',
        query: {
            'id': newsJsonString
        },
    });
    console.log('mkdata__news', mkdata.data);
    if (mkdata.code == 200) {
        if (mkdata.data.length > 0) {
            //模块1 顶部大图和列表
            newsData.value[0].data = mkdata.data[0].child.imgnum;
            newsData.value[0].data2 = mkdata.data[0].child.textnum;
        }
    } 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_main:nth-last-of-type(1){margin-bottom:30px;}
 
            .phone_box_1{

                width:92%;margin:0px auto 0px;    
                .phone_box_head{

                        height:50px;line-height:50px;
                        background:#fff;border-bottom:1px solid #E6E6E6;
                         width:100%;
                        
                        a{ 
                                float:left;height:50px;line-height:50px;margin:0;position:relative;
                                color:#a91b33;font-size:18px; font-weight:bold;box-sizing:border-box;
                                position:relative;padding-left:8px;
                        }

                        a::before{
                            content: '';display: block;
                            position:absolute;left:0px;top:15px;
                            background:#a91b33;
                            width:3px;height:20px;
                        }
    
                }
                
                .phone_box_img_ul{

                    height:55vw;overflow:hidden;margin-top:15px;

                    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; display:block;
                        background:linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));
                        word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
                    }
                    >div:nth-of-type(n+2){display:none;}

                }

                .phone_box_ul{
                    
                    overflow:hidden;height:123px;margin-top:15px;
                    >div{width:100%;height:100%;}
                    a{
                                    width:100%!important;display:block;height:40px;line-height:40px;            
                                    border-bottom:1px solid #E6E6E6;display:block;position:relative;
                                    word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
                                    font-size:16px;color:#333;text-indent:18px;
                    }
                    a::after{
                                    content: '';display: block;
                                    position:absolute;left:0px;top:18px;background:#E6E6E6;
                                    width:6px;height:6px;
                    }
                    a:nth-of-type(n+6){display:none;}
                }
             }
             
            .phone_box_2{

                width:92%;margin:0px auto 0px;    
                .phone_box_head{

                        height:50px;line-height:50px;
                        background:#fff;border-bottom:1px solid #E6E6E6;
                        margin-top:15px;width:100%;
                        
                        a{ 
                                float:left;height:50px;line-height:50px;margin:0;position:relative;
                                color:#a91b33;font-size:18px; font-weight:bold;box-sizing:border-box;
                                position:relative;padding-left:8px;
                        }

                        a::before{
                            content: '';display: block;
                            position:absolute;left:0px;top:15px;
                            background:#a91b33;
                            width:3px;height:20px;
                        }
    
                }
                
                .phone_box_img_ul{

                    height:55vw;overflow:hidden;margin-top:15px;

                    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; display:block;
                        background:linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));
                        word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
                    }
                    >div:nth-of-type(n+2){display:none;}

                }

                .phone_box_ul{
                    
                    overflow:hidden;height:123px;margin-top:15px;
                    >div{width:100%;height:100%;}
                    a{
                                    width:100%!important;display:block;height:40px;line-height:40px;            
                                    border-bottom:1px solid #E6E6E6;display:block;position:relative;
                                    word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
                                    font-size:16px;color:#333;text-indent:18px;
                    }
                    a::after{
                                    content: '';display: block;
                                    position:absolute;left:0px;top:18px;background:#E6E6E6;
                                    width:6px;height:6px;
                    }
                    a:nth-of-type(n+6){display:none;}
                }
             }
            .phone_box_3{

                width:92%;margin:0px auto 0px;    
                .phone_box_head{

                        height:50px;line-height:50px;
                        background:#fff;border-bottom:1px solid #E6E6E6;
                        margin-top:15px;width:100%;
                        
                        a{ 
                                float:left;height:50px;line-height:50px;margin:0;position:relative;
                                color:#a91b33;font-size:18px; font-weight:bold;box-sizing:border-box;
                                position:relative;padding-left:8px;
                        }

                        a::before{
                            content: '';display: block;
                            position:absolute;left:0px;top:15px;
                            background:#a91b33;
                            width:3px;height:20px;
                        }
    
                }
                 
                .phone_box_ul{
                    
                    overflow:hidden;height:123px;margin-top:8px;
                    >div{width:100%;height:100%;}
                    a{
                                    width:100%!important;display:block;height:40px;line-height:40px;            
                                    border-bottom:1px solid #E6E6E6;display:block;position:relative;
                                    word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
                                    font-size:16px;color:#333;text-indent:18px;
                    }
                    a::after{
                                    content: '';display: block;
                                    position:absolute;left:0px;top:18px;background:#E6E6E6;
                                    width:6px;height:6px;
                    }
                    a:nth-of-type(n+6){display:none;}
                }
             }
            
            .phone_box_4{

                width:92%;margin:0px auto 0px;    
                .phone_box_head{

                        height:50px;line-height:50px;
                        background:#fff;border-bottom:1px solid #E6E6E6;
                        margin-top:15px;width:100%;
                        
                        a{ 
                                float:left;height:50px;line-height:50px;margin:0;position:relative;
                                color:#a91b33;font-size:18px; font-weight:bold;box-sizing:border-box;
                                position:relative;padding-left:8px;
                        }

                        a::before{
                            content: '';display: block;
                            position:absolute;left:0px;top:15px;
                            background:#a91b33;
                            width:3px;height:20px;
                        }
    
                }
                
                .phone_box_img_ul{

                    height:55vw;overflow:hidden;margin-top:15px;

                    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; display:block;
                        background:linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));
                        word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
                    }
                    >div:nth-of-type(n+2){display:none;}

                }
 
             }
             
             .phone_none{display:none;}
    }


</style>



