<template>
    <div>
        <HomePageHead></HomePageHead>
        <HomePageNavigation></HomePageNavigation>
        <HomePageMessage></HomePageMessage>
        <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
        <HomeMoreService></HomeMoreService>
        <div class="farming" >
            <div class="inner">
                <div class="farmerLeft" v-if="pageData.length>=1">
                    <div class="farmer">
                        <h3 v-if="pageData[0].cid">
                            <NuxtLink
                                class="active"
                                v-if="pageData[0].cid"
                                :href="getLinkPath(pageData[0])"
                                :title="pageData[0].alias"
                            >
                                {{pageData[0].alias}}
                            </NuxtLink>
                            <NuxtLink
                                v-if="pageData[0].cid"
                                :href="getLinkPath(pageData[0])"
                                :title="pageData[0].alias"
                            >
                                查看更多
                            </NuxtLink>
                        </h3>
                        <ul class="mode1ul_style1">
                            <li v-for="(item,index) in boxData1" class="imgbg">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" :alt="item.title">
                                    <div>
                                        <p>
                                            <span v-if="index==0">专题</span>
                                            {{item.title}}
                                        </p>
                                    </div>
                                </NuxtLink>
                            </li>
                        </ul>
                        <ul class="mode1ul_style2">
                            <li v-for="item in boxData1data2">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <p class="title">{{ item.title }}</p>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="farmerRight" v-if="pageData.length>=2">
                    <div class="rich">
                        <h3 v-if="pageData[1].cid">
                            <NuxtLink
                                v-if="pageData[1].cid"
                                :href="getLinkPath(pageData[1])"
                                class="active"
                                :title="pageData[1].alias"
                            >
                                {{ pageData[1].alias }}
                            </NuxtLink>
                            <NuxtLink
                                v-if="pageData[1].cid"
                                :href="getLinkPath(pageData[1])"
                                :title="pageData[1].alias"
                            >
                                查看更多
                            </NuxtLink>
                        </h3>
                        <ul>
                            <li v-for="(item,index) in boxData2">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <div class="index">{{index+1}}</div>
                                    <div class="title">{{item.title}}</div>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="scienceEducation">
            <div class="inner">
                <div class="scienceLeft" v-if="pageData.length>=3">
                    <HomeSlider :message="pageData[2]" :boxData1="boxData17.imgnum" :boxData2="boxData17.textnum"></HomeSlider>
                </div>
                <div class="scienceRight" v-if="pageData.length>=4">
                    <div class="adBox1" v-if="adImg2">
                        <a href="http://nzgxw.org.cn/" v-if="adImg2.image_url==null" target="_blank" :title="adImg2.place_name" data-tag="adImg2.ad_tag">
                            <img :src="adImg2.thumb" :alt="adImg2.place_name">
                        </a>
                        <a :href="adImg2.image_url" v-else :title="adImg2.ad_name" data-tag="adImg2.ad_tag">
                            <img :src="adImg2.image_src" :alt="adImg2.ad_name">
                        </a>
                    </div>
                    <h3 v-if="pageData[3].cid">
                        <span>
                            <NuxtLink
                                v-if="pageData[3].cid"
                                :href="getLinkPath(pageData[3])"
                                class="active"
                                :title="pageData[3].alias"
                            >
                                {{ pageData[3].alias }}
                            </NuxtLink>
                        </span>
                        <NuxtLink
                            v-if="pageData[3].cid"
                            :href="getLinkPath(pageData[3])"
                            :title="pageData[3].alias"
                        >
                            查看更多
                        </NuxtLink>
                    </h3>
                    <div class="banner_b_img">
                        <ul>
                            <li v-for="item in boxData4">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <p class="title">{{ item.title }}</p>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <HomeTopTen :imgurl="adImg3" v-if="adImg3"></HomeTopTen>
        <div class="layoutCopy">
            <div class="layoutCopyLeft">
                <div class="layoutCopyLeftTop">
                    <div class="layoutCopyLeft1" v-if="pageData.length>=5">
                        <div class="layoutTitleBox" v-if="pageData[4]">
                            <div class="layoutTitle" v-if="pageData[4].cid"> 
                                <NuxtLink
                                    v-if="pageData[4].cid"
                                    :href="getLinkPath(pageData[4])"
                                    class="active"
                                    :title="pageData[4].alias"
                                >
                                    {{ pageData[4].alias }}
                                </NuxtLink>
                            </div>
                            <div class="layoutMore" v-if="pageData[4].cid">
                                <NuxtLink
                                    v-if="pageData[4].cid"
                                    :href="getLinkPath(pageData[4])"
                                    :title="pageData[4].alias"
                                >
                                    查看更多
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="layoutCopyData_style1" v-if="boxData5[0]">
                            <NuxtLink :href="getLinkPathDetail(boxData5[0])" :title="boxData5[0].title"  :target="boxData5[0].islink == 1 ? '_blank' : '_self'">
                                <img :src="boxData5[0].imgurl" :alt="boxData5[0].title">
                                <div>
                                    <span>{{ boxData5[0].title }}</span>
                                </div>
                            </NuxtLink>
                            <NuxtLink :href="getLinkPathDetail(boxData5data2[0])" :title="boxData5data2[0]"  :target="boxData5data2[0].islink == 1 ? '_blank' : '_self'">
                                <p class="title">{{ boxData5data2[0].title }}</p>
                                <p>&nbsp;</p>
                            </NuxtLink>
                        </div>
                    </div>
                    <div class="layoutCopyLeft2" v-if="pageData.length>=6">
                        <div class="layoutTitleBox" v-if="pageData[5]">
                            <div class="layoutTitle" v-if="pageData[5].cid">
                                <NuxtLink
                                    v-if="pageData[5].cid"
                                    :href="getLinkPath(pageData[5])"
                                    class="active"
                                    :title="pageData[5].alias"
                                >
                                    {{ pageData[5].alias }}
                                </NuxtLink>
                            </div>
                            <div class="layoutMore" v-if="pageData[5].cid">
                                <NuxtLink
                                    v-if="pageData[5].cid"
                                    :href="getLinkPath(pageData[5])"
                                    :title="pageData[5].alias"
                                >
                                    查看更多
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="layoutCopyData_style2">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"  v-for="item in boxData6" :target="item.islink == 1 ? '_blank' : '_self'">
                                <p class="title">{{ item.title }}</p>
                            </NuxtLink>
                        </div>
                    </div>
                </div>
                <div class="layoutCopyLeftBottom" v-if="pageData.length>=7">
                    <div class="layoutTitleBox" v-if="pageData[6]">
                        <div class="layoutTitle" v-if="pageData[6].cid"> 
                            <NuxtLink
                                v-if="pageData[6].cid"
                                :href="getLinkPath(pageData[6])"
                                class="active"
                                :title="pageData[6].alias"
                            >
                                {{ pageData[6].alias }}
                            </NuxtLink>
                        </div>
                        <div class="layoutMore" v-if="pageData[6].cid">
                            <NuxtLink
                                v-if="pageData[6].cid"
                                :href="getLinkPath(pageData[6])"
                                :title="pageData[6].alias"
                            >
                                查看更多
                            </NuxtLink>
                        </div>
                    </div>
                    <div class="layoutCopyData_style3">
                        <div v-for="(item,index) in boxData7">
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="style3link1" v-if="index==0" :target="item.islink == 1 ? '_blank' : '_self'">
                                <div class="time">
                                    <p>{{getTime(item.updated_at,'day',1)}}</p>
                                    <p>{{getTime(item.updated_at,'month',1)}}</p>
                                </div>
                                <div>
                                    <p class="title">{{ item.title }}</p>
                                    <p class="introduce">{{ item.introduce }}</p>
                                </div>
                            </NuxtLink>
                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="style3link2" v-if="index>0" :target="item.islink == 1 ? '_blank' : '_self'">
                                <div>
                                    <b></b>
                                    <p class="title">{{item.title}}</p>
                                </div>
                                <p>&nbsp;</p>
                            </NuxtLink>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layoutCopyRight"  v-if="pageData.length>=8">
                <div class="layoutTitleBox" v-if="pageData[7]">
                    <div class="layoutTitle" v-if="pageData[7].cid"> 
                        <NuxtLink
                            v-if="pageData[7].cid"
                            :href="getLinkPath(pageData[7])"
                            class="active"
                            :title="pageData[7].alias"
                        >
                            {{ pageData[7].alias }}
                        </NuxtLink>
                    </div>
                    <div class="layoutMore" v-if="pageData[7].cid">
                        <NuxtLink
                            v-if="pageData[7].cid"
                            :href="getLinkPath(pageData[7])"
                            :title="pageData[7].alias"
                        >
                            查看更多
                        </NuxtLink>
                    </div>
                </div>
                <div class="layoutCopyData_style4">
                    <div class="layoutCopyData_pic">
                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" v-for="item in boxData8" :target="item.islink == 1 ? '_blank' : '_self'">
                            <img :src="item.imgurl" :alt="item.title">
                            <p>{{item.title}}</p>
                        </NuxtLink>
                    </div>
                    <div class="layoutCopyData_text">
                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" v-for="item in boxData88" :target="item.islink == 1 ? '_blank' : '_self'">
                            <div class="title">{{item.title}}</div>
                            <div class="more">详</div>
                        </NuxtLink>
                    </div>
                </div>
            </div>
        </div>
        <div class="farming">
            <div class="inner">
                <div class="farmerLeft">
                    <div class="farmer">
                        <h3>
                            <div class="titleBoxTabs" v-if="pageData.length>=9">
                                <span class="active" v-if="pageData[8].cid">
                                    <NuxtLink :href="getLinkPath(pageData[8])" :title="pageData[8].alias" @mouseenter="tabsData1 = 1" :class="{ active: tabsData1 == 1 }">
                                        {{pageData[8].alias}}
                                    </NuxtLink>
                                </span>
                                <span v-if="pageData[9].cid">
                                    <NuxtLink :href="getLinkPath(pageData[9])" :title="pageData[9].alias" @mouseenter="tabsData1 = 2" :class="{ active: tabsData1 == 2 }">
                                        {{pageData[9].alias}}
                                    </NuxtLink>
                                </span>
                            </div>
                        </h3>
                        <ul class="mode1ul_style1" v-if="tabsData1==1">
                            <li v-for="(item,index) in boxData9" class="imgbg">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" :alt="item.title">
                                    <div>
                                        <p>
                                            <span v-if="index==0">专题</span>
                                            {{ item.title }}
                                        </p>
                                        <p>&nbsp;</p>
                                    </div>
                                </NuxtLink>
                            </li>
                        </ul>
                        <ul class="mode1ul_style2" v-if="tabsData1==1">
                            <li v-for="item in boxData9data2">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <p class="title">{{ item.title }}</p>
                                    <p>&nbsp;</p>
                                </NuxtLink>
                            </li>
                        </ul>
                        <ul class="mode1ul_style1" v-if="tabsData1==2">
                            <li v-for="(item,index) in boxData10" class="imgbg">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" :alt="item.title">
                                    <div>
                                        <p>
                                            <span v-if="index==0">专题</span>
                                            {{ item.title }}
                                        </p>
                                        <p>&nbsp;</p>
                                    </div>
                                </NuxtLink>  
                            </li>
                        </ul>
                        <ul class="mode1ul_style2" v-if="tabsData1==2">
                            <li v-for="item in boxData10data2">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <p class="title">{{ item.title }}</p>
                                    <p>&nbsp;</p>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="farmerRight">
                    <div class="rich" v-if="pageData.length>=11">
                        <h3 v-if="pageData[10]">
                            <span v-if="pageData[10].cid">
                                <NuxtLink
                                    v-if="pageData[10].cid"
                                    :href="getLinkPath(pageData[10])"
                                    class="active"
                                    :title="pageData[10].alias"
                                >
                                    {{ pageData[10].alias }}
                                </NuxtLink>
                            </span>
                            <NuxtLink
                                v-if="pageData[10].cid"
                                :href="getLinkPath(pageData[10])"
                                :title="pageData[10].alias"
                            >
                                查看更多
                            </NuxtLink>
                        </h3>
                        <div class="richList">
                            <div class="richListPic" v-if="boxData11[0]">
                                <NuxtLink :href="getLinkPathDetail(boxData11[0])" :title="boxData11[0].title" :target="boxData11[0].islink == 1 ? '_blank' : '_self'">
                                    <img :src="boxData11[0].imgurl" :alt="boxData11[0].title">
                                    <div>
                                        <span>{{boxData11[0].title}}</span>
                                    </div>
                                </NuxtLink>
                            </div>
                            <div class="richListText" v-if="boxData11data2[0]">
                                <NuxtLink :href="getLinkPathDetail(boxData11data2[0])" :title="boxData11data2[0].title" :target="boxData11data2[0].islink == 1 ? '_blank' : '_self'">
                                    <span>{{boxData11data2[0].title}}</span>
                                </NuxtLink>
                            </div>
                            <div class="richListText" v-if="boxData11data2[1]">
                                <NuxtLink :href="getLinkPathDetail(boxData11data2[1])" :title="boxData11data2[1].title" :target="boxData11data2[1].islink == 1 ? '_blank' : '_self'">
                                    <span>{{boxData11data2[1].title}}</span>
                                </NuxtLink>
                            </div>
                            <div class="richListPictow" v-if="boxData11[1]">
                                <NuxtLink :href="getLinkPathDetail(boxData11[1])" :title="boxData11[1].title" :target="boxData11[1].islink == 1 ? '_blank' : '_self'">
                                    <img :src="boxData11[1].imgurl" :alt="boxData11[1].title">
                                    <div>
                                        <span>{{boxData11[1].title}}</span>
                                    </div>
                                </NuxtLink>
                            </div>
                            <div class="richListText" v-if="boxData11data2[2]">
                                <NuxtLink :href="getLinkPathDetail(boxData11data2[2])" :title="boxData11data2[2].title" :target="boxData11data2[2].islink == 1 ? '_blank' : '_self'">
                                    <span>{{boxData11data2[2].title}}</span>
                                </NuxtLink>
                            </div>
                            <div class="richListText" v-if="boxData11data2[3]">
                                <NuxtLink :href="getLinkPathDetail(boxData11data2[3])" :title="boxData11data2[3].title" :target="boxData11data2[3].islink == 1 ? '_blank' : '_self'">
                                    <span>{{boxData11data2[3].title}}</span>
                                </NuxtLink>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <section class="index_3 clearfix">
             <div class="index_3_box_left">
                 <div class="index_2_head_box clearfix">
                     <div class="index_1_head_box index_1_head_box_2 clearfix" v-if="pageData.length>=12">
                        <div class="index_1_head index_1_head_only" v-if="pageData[11].cid">
                            <NuxtLink
                                v-if="pageData[11].cid"
                                :href="getLinkPath(pageData[11])"
                                @mouseenter="tabsData2 = 1"
                                :class="{ active: tabsData2 == 1 }"
                                :title="pageData[11].alias"
                            >
                                {{ pageData[11].alias }}
                            </NuxtLink>
                        </div>
                        <div class="index_1_head" v-if="pageData[12].cid">
                            <NuxtLink
                                v-if="pageData[12].cid"
                                :href="getLinkPath(pageData[12])"
                                @mouseenter="tabsData2 = 2"
                                :class="{ active: tabsData2 == 2 }"
                                :title="pageData[12].alias"
                            >
                                {{ pageData[12].alias }}
                            </NuxtLink>
                        </div>
                     </div>
                 </div>
                 <div class="index_3_ul clearfix" v-if="tabsData2==1">
                     <div :class="['index_3_li',index < 2 ? 'index_3_li_color' : '']" v-for="(item, index) in boxData12">
                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                            <p class="title">
                                <b :class="['lis',index < 2 ? 'active' : '']"></b>
                                {{item.title}}
                            </p>
                        </NuxtLink>
                    </div>
                </div>
                <div class="index_3_ul clearfix" v-if="tabsData2==2">
                     <div :class="['index_3_li',index < 2 ? 'index_3_li_color' : '']" v-for="(item, index) in boxData13">
                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                            <p class="title">
                                <b :class="['lis',index < 2 ? 'active' : '']"></b>
                                {{item.title}}
                            </p>
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="index_1_box_right">
                <img src="../public/index/sndc.png" alt="三农调查">
                <div class="index_3_box_vote">
                    <div class="inquire" v-if="voteList.length>0">
                        <p v-if="voteList.length>0">{{voteList[0].survey_name}}</p>
                        <div class="radioBox">
                            <div v-if="!isDisabled">
                                <div class="radio" v-if="isRadio">
                                    <el-radio-group v-model="radio1" @change="handleRadioChange">
                                        <el-radio v-for="item in voteList" :key="item.id" :value="item.id" size="large">
                                            <span v-if="item.is_other == 0">{{item.choice_name}}</span>
                                            <span v-else>其他</span>
                                        </el-radio>
                                    </el-radio-group>
                                    <el-input
                                        v-if="showUserChoice"
                                        v-model="userChoice"
                                        :rows="2"
                                        type="textarea"
                                        resize="none"
                                        placeholder="请输入.."
                                    />
                                </div>
                                <div class="checkInputBox" v-else>
                                    <el-checkbox-group v-model="check1" @change="handleCheckboxChange">
                                        <span v-for="item in voteList" :key="item.id">
                                            <span v-if="item.is_other == 0">
                                                <el-checkbox size="large" :label="item.choice_name" :value="item.id"/>
                                            </span>
                                            <span v-else>
                                                <el-checkbox size="large" label="其他" :value="item.id"/>
                                            </span>
                                        </span>
                                    </el-checkbox-group>
                                    <el-input
                                        v-if="showUserChoice"
                                        v-model="userChoice"
                                        :rows="2"
                                        type="textarea"
                                        resize="none"
                                        placeholder="请输入.."
                                    />
                                </div>
                            </div>
                            <div class="inquireData" v-else>
                                <div v-for="item in websiteSurveyData.data" :key="item.id">
                                    <div class="inquireDataItem active" v-if="item.status == 1">
                                        <div class="inquireDataItemTitle">
                                            <span v-if="item.choice_name == ''">其他</span>
                                            <span v-else>{{item.choice_name}}</span>
                                        </div>
                                        <div class="inquireDataItemNum">{{item.results}}票</div>
                                    </div>
                                    <div class="inquireDataItem" v-else>
                                        <div class="inquireDataItemTitle">
                                            <span v-if="item.choice_name == ''">其他</span>
                                            <span v-else>{{item.choice_name}}</span>
                                        </div>
                                        <div class="inquireDataItemNum">{{item.results}}票</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="btn">
                            <button class="voting" @click="addWebsiteSurvey" :disabled="isDisabled" v-if="!isDisabled">投票</button>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <div class="titleBox" v-if="adImg4">
            <a href="http://nzgxw.org.cn/" v-if="adImg4.image_url==null" target="_blank" :title="adImg4.place_name" data-tag="adImg4.ad_tag">
                <img :src="adImg4.thumb" alt="adImg4.place_name">
            </a>
            <a :href="adImg4.image_url" v-else target="_blank" :title="adImg4.ad_name" data-tag="adImg4.ad_tag">
                <img :src="adImg4.image_src" alt="adImg4.ad_name">
            </a>
        </div>
        <div class="lastPart3">
            <div class="inner">
                <div class="lastPartTitle" v-if="pageData.length>=14">
                    <div class="left" >
                        <span v-if="pageData[13].cid">
                            <NuxtLink
                                v-if="pageData[13].cid"
                                :href="getLinkPath(pageData[13])"
                                :class="{ active: tabsData3 == 1 }"
                                @mouseenter="tabsData3=1"
                                :title="pageData[13].alias"
                            >
                                {{ pageData[13].alias }}
                            </NuxtLink>
                        </span>
                        <span v-if="pageData[14].cid">
                            <NuxtLink
                                v-if="pageData[14].cid"
                                :href="getLinkPath(pageData[14])"
                                :class="{ active: tabsData3 == 2 }"
                                @mouseenter="tabsData3 = 2"
                                :title="pageData[14].alias"
                            >
                                {{ pageData[14].alias }}
                            </NuxtLink>
                        </span>
                    </div>
                    <div class="right" v-if="tabsData3==1">
                        <NuxtLink :to="{ path: `/${item.aLIas_pinyin}/list-1.html`}"  v-for="item in boxData14menu" :title="item.alias">
                            {{item.alias}}
                        </NuxtLink>
                    </div>
                    <div class="right" v-if="tabsData3==2">
                        <NuxtLink :to="{ path: `/${item.aLIas_pinyin}/list-1.html}`}" v-if="pageData[14].cid" v-for="item in boxData15menu" :title="item.alias">
                            {{item.alias}}
                        </NuxtLink>
                    </div>
                </div>
                <div class="lastPartContext" v-if="tabsData3==1">
                    <div class="left">
                        <ul class="mode1ul_style1">
                            <li v-for="(item,index) in boxData14" class="imgbg">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" :alt="item.title">
                                    <div>
                                        <p>
                                            <span v-if="index==0">专题</span>
                                            {{ item.title }}
                                        </p>
                                    </div>
                                </NuxtLink>
                            </li>
                        </ul>
                        <ul class="mode1ul_style2">
                            <li v-for="item in boxData14data2">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <p class="title">{{ item.title }}</p>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                    <div class="right" v-if="pageData.length>=15">
                        <div class="title">
                            <h3 v-if="boxData14menu[0]">
                                <NuxtLink
                                    :to="{ path: `/${boxData14childpinyin}/list-1.html`}"
                                    v-if="boxData14menu[0]" class="leftTitle" :title="boxData14menu[0].alias">
                                    {{ boxData14menu[0].alias }}
                                </NuxtLink>
                                <NuxtLink
                                    :to="{ path: `/${boxData14childpinyin}/list-1.html`}"
                                    v-if="boxData14menu[0]" :title="boxData14menu[0].alias">
                                    查看更多
                                </NuxtLink>
                            </h3>
                        </div>
                        <ul class="content">
                            <li v-for="item in boxData14mainData">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <span>
                                        <strong>{{getTime(item.updated_at,'month',1)}}</strong>
                                        {{getTime(item.updated_at,'year',3)}}
                                    </span>
                                    <span class="text">{{ item.title }}</span>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="lastPartContext" v-if="tabsData3==2">
                    <div class="left">
                        <ul class="mode1ul_style1">
                            <li v-for="(item,index) in boxData15" class="imgbg">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <img :src="item.imgurl" :alt="item.title">
                                    <div>
                                        <p>
                                            <span v-if="index==0">专题</span>
                                            {{ item.title }}
                                        </p>
                                    </div>
                                </NuxtLink>
                            </li>
                        </ul>
                        <ul class="mode1ul_style2">
                            <li v-for="item in boxData15data2">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <p class="title">{{ item.title }}</p>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                    <div class="right" v-if="pageData.length>=15">
                        <div class="title">
                            <h3 v-if="boxData15menu[0]">
                                <NuxtLink
                                    :to="{ path: `/${boxData15childpinyin}/list-1.html`}"
                                    v-if="boxData15menu[0]" class="leftTitle" :title="boxData15menu[0].alias">
                                    {{ boxData15menu[0].alias }}
                                </NuxtLink>
                                <NuxtLink
                                    :to="{ path: `/${boxData15childpinyin}/list-1.html`}"
                                    v-if="boxData15menu[0]" :title="boxData15menu[0].alias">
                                    查看更多
                                </NuxtLink>
                            </h3>
                        </div>
                        <ul class="content">
                            <li v-for="item in boxData15mainData">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <span>
                                        <strong>{{getTime(item.updated_at,'month',1)}}</strong>
                                        {{getTime(item.updated_at,'year',3)}}
                                    </span>
                                    <span class="text">{{ item.title }}</span>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <section class="index_2 clearfix">
            <div class="index_2_head_box clearfix" v-if="pageData.length>=16">
                <div class="index_1_head_box index_1_head_box_2 clearfix">
                    <div class="index_1_head index_1_head_only" v-if="pageData[15].cid">
                        <NuxtLink
                            v-if="pageData[15].cid"
                            :href="getLinkPath(pageData[15])"
                            :class="{ active: tabsData4 == 1 }"
                            :title="pageData[15].alias"
                        >
                            {{ pageData[15].alias }}
                        </NuxtLink>
                    </div>
                </div>
                <div class="index_2_head_a_box clearfix">
                    <NuxtLink :to="{ path: `/${item.aLIas_pinyin}/list-1.html`}" v-if="pageData[15].cid" v-for="item in boxData16menu" :title="item.alias">
                        {{item.alias}}
                    </NuxtLink>
                </div>
            </div>
            <div class=" clearfix">
                <div class=" clearfix">
                    <div class="index_1_box">
                        <div class="index_2_big_img_ul">
                            <div class="index_2_big_img_li cover100" v-if="boxData16.length>0">
                                <NuxtLink :href="getLinkPathDetail(boxData16[0])" :title="boxData16[0].title" :target="boxData16[0].islink == 1 ? '_blank' : '_self'">
                                    <img class="" :src="boxData16[0].imgurl" :alt="boxData16[0].title">
                                    <div class="index_2_big_img_li_dot2 dot2">
                                        <span class="index_2_big_img_li_dot2_tag">专题</span>
                                        {{boxData16[0].title}}
                                    </div>
                                    <div class="index_1_box_right_img_li_dot1 dot1"></div>
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="index_1_box_right_img_ul index_1_box_right_img_ul_2 clearfix">
                            <div class="index_1_box_right_img_li cover100" v-if="boxData16.length>1">
                                <NuxtLink :href="getLinkPathDetail(boxData16[1])" :title="boxData16[1].title" :target="boxData16[1].islink == 1 ? '_blank' : '_self'">
                                    <img class="" :src="boxData16[1].imgurl" :alt="boxData16[1].title">
                                    <div class="index_1_box_right_img_li_dot1 dot1">
                                        {{boxData16[1].title}}
                                    </div>
                                </NuxtLink>
                            </div>
                            <div class="index_1_box_right_img_li cover100" v-if="boxData16.length>2">
                                <NuxtLink :href="getLinkPathDetail(boxData16[2])" :title="boxData16[2].title" :target="boxData16[2].islink == 1 ? '_blank' : '_self'">
                                    <img class="" :src="boxData16[2].imgurl" :alt="boxData16[2].title">
                                    <div class="index_1_box_right_img_li_dot1 dot1">
                                        {{boxData16[2].title}}
                                    </div>
                                </NuxtLink>
                            </div>
                        </div>
                        <div class="index_2_big_img_ul" v-if="boxData16.length>3">
                            <NuxtLink :href="getLinkPathDetail(boxData16[3])" :title="boxData16[3].title" :target="boxData16[3].islink == 1 ? '_blank' : '_self'">
                                <div class="index_2_big_img_li cover100" v-if="boxData16[3]">
                                    <img class="" :src="boxData16[3].imgurl" :alt="boxData16[3].title">
                                    <div class="index_2_big_img_li_dot2 dot2">
                                        {{boxData16[3].title}}
                                    </div>
                                </div>
                            </NuxtLink>
                        </div>
                    </div>
					<div class="index_1_box">
                        <div class="index_1_ul clearfix">
                            <div class="index_1_li clearfix index_1_li_only" v-for="item in boxData16data2">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <div class="index_1_li_dot2 dot2">
                                       {{ item.title }}
                                    </div>
                                </NuxtLink>
                            </div>
                        </div>
                    </div>
                    <div class="index_1_box_right">
                        <div class="index_1_head_box clearfix index_1_head_box_line_none">
                            <NuxtLink
                                :to="{ path: `/${boxData16childpinyin}/list-1.html`}"
                                v-if="boxData16menu[0]" class="leftTitle" :title="boxData16menu[0].alias">
                                {{ boxData16menu[0].alias }}
                            </NuxtLink>
                            <NuxtLink
                                :to="{ path: `/${boxData16childpinyin}/list-1.html`}"
                                v-if="boxData16menu[0]" :title="boxData16menu[0].alias">
                                查看更多
                            </NuxtLink>
                        </div>                  
                        <div class="index_2_ul">
                            <div class="index_2_li clearfix" v-for="item in boxData16mainData">
                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
                                    <time class="index_2_li_time_box">
                                        <div class="index_2_li_time_head">
                                            {{getTime(item.updated_at,'day',1)}}
                                        </div>
                                        <div class="index_2_li_time_foot">
                                            {{getTime(item.updated_at,'year',2)}}
                                        </div>
                                    </time> 
                                    <div class="index_2_li_dot2 dot2">
                                        {{item.title}}
                                    </div>
                                </NuxtLink>
                            </div>
                        </div>						
                    </div>
				</div>
			</div>
        </section>
        <HomeFoot></HomeFoot>
    </div>
</template>

<script setup>
//页面是否已经加载完毕
const pageLoading = ref(false)
//1.加载页面必备组件 start---------------------------------------->
import { ref, onMounted } from 'vue';
import { ElRadio, ElRadioGroup,ElCheckbox,ElCheckboxGroup,ElMessage,ElInput } from 'element-plus';
import { useSeoMeta } from '#imports';

//格式化跳转路径 - 标题
//首页分类栏目标题，不需要考虑外链
const getLinkPath = (item) => {
    if (item.children_count == 0) {
        //return `/newsList/${item.cid}?page=1`;
        return `/${item.aLIas_pinyin}/list-1.html`;
    } else {
        //return `/primaryNavigation/${item.cid}`;
        return `/${item.aLIas_pinyin}/index.html`;
    }
}
//首页跳转到详情，这里需要考虑外链
const getLinkPathDetail = (item) => {
    if (item.islink == 1) {
        return `${item.linkurl}`;
    } else {
        return `/${item.pinyin}/${item.id}.html`;
    }
}
//1.加载页面必备组件 end---------------------------------------->

//2.交互方法 start---------------------------------------->
//2.1 新闻图片切换
const hoverStatus = ref(1)
const qhPic = function (num) {
    hoverStatus.value = num;
}
//2.交互方法 end---------------------------------------->


//3.投票 start---------------------------------------->
//3.1 投票选择的值
const radio1 = ref(''); //单选
const check1 = ref([]); //多选
const isDisabled = ref(false);//是否禁用提交按钮
const isRadio = ref(true);//是否渲染单选

const userSurId = ref('');//投票属于哪一篇文章
const userChoice = ref('');//用于判断用户选择了其他选项以后，输入的值
const userIsChoice = ref('');//用于判断其他选项目前是什么值
const showUserChoice = ref(false);//是否显示其他输入框
const websiteSurveyData = ref([]);//投票结果

//3.2获得投票列表
let voteList = ref([]);
//广告改为客户端启动
// async function getVoteList(){
//     const voteData = await requestHome('/web/getWebsiteSurvey',{method:'GET'});
//     //这里有问题，后台传入的数据已经发生了变化，按照传入的进行修改
//     if(voteData.code == 200){
//         voteList.value = voteData.data;
//         console.log(voteList.value)
//         //判断显示单选还是多选
//         //survey_type 0是单选 1是多选
//         if(voteData.data[0].survey_type == 0){
//             isRadio.value = true;
//         }else{
//             isRadio.value = false;
//         }

//         for(let item of voteData.data){
//             //如果含有其他
//             if(item.is_other==1){
//                 userIsChoice.value = item.id;
//             }
//         }
//         //用户投票属于哪一篇文章
//         userSurId.value = voteData.data[0].sur_id;

//     }else{
//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
//         console.log("错误位置：首页投票")
//         console.log("后端错误反馈：",voteData.message)
//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->") 
//     }
// }
//getVoteList()
//3.2当用户选择了选项，判断是否展示其他输入框
const handleRadioChange = (value) => {
    if(value == userIsChoice.value){
        showUserChoice.value = true;
    }else{
        showUserChoice.value = false;
    }
}

const handleCheckboxChange = (value) => {
    if (value.includes(userIsChoice.value)) {
        showUserChoice.value = true;
    } else {
        showUserChoice.value = false;
    }
}

//3.2发起投票
async function addWebsiteSurvey(){
    //判断当前是单选还是多选
    console.log(isRadio.value)
    if(isRadio.value){
        console.log("用户单选！")
        if(radio1.value!=''){
            //先判断一下是否使用了其他选项
            if(showUserChoice.value){
                if(userChoice.value!=''){
                    //文章id
                    // console.log(userSurId.value)
                    // 用户输入的值
                    // console.log(userChoice.value)
                    //如果使用了其他，其他的选项需要增加进去
                    const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption',{
                        method:'GET',
                        query:{
                            'sur_id':userSurId.value,//投票的新闻id
                            'choice_name':userChoice.value,//投票的选项id
                        }
                    });
                    if(ChoiceData.code == 200){
                        //提交完其他选项以后，再正式发起投票
                        const mkData = await requestDataPromise('/web/addWebsiteSurveyVote',{
                            method:'GET',
                            query:{
                                'sur_id':userSurId.value,
                                'choice_id':ChoiceData.data
                            }
                        });
                        if(mkData.code == 200){
                            ElMessage.success('投票成功！')
                            //把投票结果显示到页面上 禁用投票按钮
                            isDisabled.value = true;
                            websiteSurveyData.value = mkData.data;
                            //遍历一下，把用户选中的那个设置status为1
                            let data = mkData.data;
                            //遍历一下，把用户选中的那个设置status为1
                            for(let item of data.data){
                                for(let i of data.choice){
                                    if(item.id == i){
                                        console.log(item.id)
                                        item.status = 1;
                                    }
                                }
                            }
                            websiteSurveyData.value = data;
                        }else{
                            ElMessage.error(mkData.message)
                        }
                    }else{
                        ElMessage.error('其他投票失败！')
                    }
                }else{
                    ElMessage.error('请输入选项内容！')
                }
            }else{
                //如果没选择其他，直接提交选择的内容
                const mkData = await requestDataPromise('/web/addWebsiteSurveyVote',{
                    method:'GET',
                    query:{
                        'sur_id':userSurId.value,
                        'choice_id':radio1.value
                    }
                });
                if(mkData.code == 200){
                    ElMessage.success('投票成功！')
                    //把投票结果显示到页面上 禁用投票按钮
                    isDisabled.value = true;
                    let data = mkData.data;
                    //遍历一下，把用户选中的那个设置status为1
                    for(let item of data.data){
                        for(let i of data.choice){
                            if(item.id == i){
                                item.status = 1;
                            }
                        }
                    }
                    websiteSurveyData.value = data;
                }else{
                    ElMessage.error('投票失败！')
                }
            }
        }else{
            ElMessage.error('请选择一个选项')
        }
    }else{
        console.log("多选！")
        //多选
        if(check1.value!=[]){
             //先判断一下是否使用了其他选项
            if(showUserChoice.value){
                if(userChoice.value!=''){
                    //判断用户是否只选择了一个其他
                    if(check1.value.length == 1){
                        const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption',{
                            method:'GET',
                            query:{
                                'sur_id':userSurId.value,//投票的新闻id
                                'choice_name':userChoice.value,//用户输入的其他选项文字
                            }
                        });
                        if(ChoiceData.code == 200){
                            //提交完其他选项以后，再正式发起投票
                            const mkData = await requestDataPromise('/web/addWebsiteSurveyVote',{
                                method:'GET',
                                query:{
                                    'sur_id':userSurId.value,
                                    'choice_id':ChoiceData.data
                                }
                            });
                            if(mkData.code == 200){
                                ElMessage.success('投票成功！')
                                //把投票结果显示到页面上 禁用投票按钮
                                isDisabled.value = true;
                                websiteSurveyData.value = mkData.data;
                                //遍历一下，把用户选中的那个设置status为1
                                let data = mkData.data;
                                //遍历一下，把用户选中的那个设置status为1
                                for(let item of data.data){
                                    for(let i of data.choice){
                                        if(item.id == i){
                                            console.log(item.id)
                                            item.status = 1;
                                        }
                                    }
                                }
                                websiteSurveyData.value = data;
                            }else{
                                ElMessage.error(mkData.message)
                            }
                        }else{
                            ElMessage.error('其他投票失败！')
                        }

                    }else{
                        //用户选择了除了其他以外，还包括别的选项
                        const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption',{
                            method:'GET',
                            query:{
                                'sur_id':userSurId.value,//投票的新闻id
                                'choice_name':userChoice.value,//用户输入的其他选项文字
                            }
                        });
                        if(ChoiceData.code == 200){
                            let data = check1.value;
                            //找到多选的数组，把其他默认值给替换掉
                            for (let i = 0; i < data.length; i++) {
                                if (data[i] == userIsChoice.value) {
                                    data[i] = ChoiceData.data;
                                }
                            }
                            let jsonArray = JSON.stringify(data);
                            //提交完其他选项以后，再正式发起投票
                            const mkData = await requestDataPromise('/web/addWebsiteSurveyVote',{
                                method:'GET',
                                query:{
                                    'sur_id':userSurId.value,
                                    'choice_id':jsonArray
                                }
                            });
                            
                            if(mkData.code == 200){
                                ElMessage.success('投票成功！')
                                //把投票结果显示到页面上 禁用投票按钮
                                isDisabled.value = true;
                                websiteSurveyData.value = mkData.data;
                                //遍历一下，把用户选中的那个设置status为1
                                let data = mkData.data;
                                //遍历一下，把用户选中的那个设置status为1
                                for(let item of data.data){
                                    for(let i of data.choice){
                                        if(item.id == i){
                                            //console.log(item.id)
                                            item.status = 1;
                                        }
                                    }
                                }
                                websiteSurveyData.value = data;
                            }else{
                                ElMessage.error(mkData.message)
                            }
                        }else{
                            ElMessage.error('其他投票失败！')
                        }

                    }
                }else{
                    ElMessage.error('请输入选项内容！')
                }
            }else{
                let jsonArray = JSON.stringify(check1.value);
                //如果没选择其他，直接提交选择的内容
                const mkData = await requestHome('/web/addWebsiteSurveyVote',{
                    method:'GET',
                    query:{
                        'sur_id':userSurId.value,
                        'choice_id':jsonArray
                    }
                });
                if(mkData.code == 200){
                    ElMessage.success('投票成功！')
                    //把投票结果显示到页面上 禁用投票按钮
                    isDisabled.value = true;
                    websiteSurveyData.value = mkData.data;
                    //遍历一下，把用户选中的那个设置status为1
                    let data = mkData.data;
                    //遍历一下，把用户选中的那个设置status为1
                    for(let item of data.data){
                        for(let i of data.choice){
                            if(item.id == i){
                                console.log(item.id)
                                item.status = 1;
                            }
                        }
                    }
                    websiteSurveyData.value = data;
                }else{
                    ElMessage.error('投票失败！')
                }
            }
        }else{
            ElMessage.error('请选择一个选项')
        }
    }
}
//3.投票 end---------------------------------------->


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

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

    //从客户端启动投票
    //获得投票列表
    let voteUrl = `${$webUrl}/web/getWebsiteSurvey`
    const responseVote = await fetch(voteUrl, {
        headers: {
            'Content-Type': 'application/json',
            'Userurl': $CwebUrl,
            'Origin': $CwebUrl
        }
    });
    const voteData = await responseVote.json();
    if(voteData.code == 200){
        voteList.value = voteData.data;
        //判断显示单选还是多选
        //survey_type 0是单选 1是多选
        if(voteData.data[0].survey_type == 0){
            isRadio.value = true;
        }else{
            isRadio.value = false;
        }

        for(let item of voteData.data){
            //如果含有其他
            if(item.is_other==1){
                userIsChoice.value = item.id;
            }
        }
        //用户投票属于哪一篇文章
        userSurId.value = voteData.data[0].sur_id;

    }else{
        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
        console.log("错误位置：首页投票")
        console.log("后端错误反馈：",voteData.message)
        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->") 
    }

    //从客户端启动广告
    //广告1
    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_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=snzxw_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=snzxw_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];

    //广告4
    let url4 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_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];

})
//4.交互方法 end---------------------------------------->

//5.页面基本信息 start---------------------------------------->
//5.1 导航信息
const pageData = ref([
    // { cid: "", title: "", data: [] ,children_count:""},
]);
//5.2 模块数据
//注意前置变量 在nuxt3的ssr模式中，并不存在变量提升。
//模块1
const boxData1 = ref([])
const boxData1data2 = ref([])
//模块2
const boxData2 = ref([]);
//模块3 - 该数据已经在模块中请求
//const boxData3 = ref([]);
//模块4
const boxData4 = ref([]);
//模块5
const boxData5 = ref([]);
const boxData5data2 = ref([]);
//模块6
const boxData6 = ref([]);
//模块7
const boxData7 = ref([]);
//模块8
const boxData8 = ref([]);
const boxData88 = ref([]);
//模块9 模块10 切换
const tabsData1 = ref(1)
//模块9
const boxData9 = ref([]);
const boxData9data2 = ref([]);
//模块10 
const boxData10 = ref([]);
const boxData10data2 = ref([]);
//模块11
const boxData11 = ref([]);
const boxData11data2 = ref([]);
//模块12 模块13 切换
const tabsData2 = ref(1)
//模块12
const boxData12 = ref([]);
//模块13 - 该模块只有一个入口
const boxData13 = ref([]);
//模块14 模块15 切换
const tabsData3 = ref(1)
//模块14 - 该模块含有子导航
const boxData14 = ref([]);
const boxData14data2 = ref([]);
const boxData14menu = ref([]);
const boxData14childpinyin = ref([]);
const boxData14mainData = ref([]);
//模块15
const boxData15 = ref([]);
const boxData15data2 = ref([]);
const boxData15menu = ref([]);
const boxData15childpinyin = ref([]);
const boxData15mainData = ref([]);
//模块16 模块17 切换
const tabsData4 = ref(1)
//模块16 - 该模块含有子导航
const boxData16 = ref([]);
const boxData16data2 = ref([]);
const boxData16menu = ref([]);
const boxData16childpinyin = ref([]);
const boxData16mainData = ref([]);
//模块17 - 政策法规 本来这个是模块3 原来是单独放到一个模块中的，现在提出来了
const boxData17 = ref({})


//3.2获得导航数据
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
            };
            //主体渲染 第一层
            //新农村11
            if(navigateData.data[index].category_id == 11){pageData.value[0]=data}
            //农民工317
            if(navigateData.data[index].category_id == 317){pageData.value[1]=data}
            //第二层
            //政策法规1
            if(navigateData.data[index].category_id == 1){pageData.value[2]=data}
            //三农之窗2
            if(navigateData.data[index].category_id == 2){pageData.value[3]=data}
            //第三层
            //区域经济5
            if(navigateData.data[index].category_id == 5){pageData.value[4]=data}
            //三农投资6
            if(navigateData.data[index].category_id == 12){pageData.value[5]=data}
            //农贸信息13
            if(navigateData.data[index].category_id == 13){pageData.value[6]=data}
            //书刊信息24
            if(navigateData.data[index].category_id == 24){pageData.value[7]=data}
            //第四层
            //三农科教14
            if(navigateData.data[index].category_id == 14){pageData.value[8]=data}
            //文化生活15
            if(navigateData.data[index].category_id == 15){pageData.value[9]=data}
            //三农服务27
            if(navigateData.data[index].category_id == 27){pageData.value[10]=data}
            //第五层
            //三农探索16
            if(navigateData.data[index].category_id == 16){pageData.value[11]=data}
            //三农人物18
            if(navigateData.data[index].category_id == 18){pageData.value[12]=data}
            //第六层
            //农资购销21
            if(navigateData.data[index].category_id == 21){pageData.value[13]=data}
            //农产购销153
            if(navigateData.data[index].category_id == 153){pageData.value[14]=data}
            //第七层
            //打假维权26
            if(navigateData.data[index].category_id == 26){pageData.value[15]=data}
        }
    }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("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
    console.log("错误位置：首页导航渲染阶段")
    console.log("错误：导航池渲染执行接口出错！请检查首页的14的模块的具体执行方法！")
    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
}



let getJson = [
    {"parent":"11,2,8","child":""},//模块1新农村 
    {"parent":"317,0,8","child":""},//模块2农民工 
    {"parent":"2,0,5","child":""},//模块4三农之窗
    {"parent":"5,1,1","child":""},//模块5区域经济
    {"parent":"12,0,3","child":""},//模块6三农投资 
    {"parent":"13,0,4","child":""},//模块7农贸信息 
    {"parent":"24,2,7","child":""},//模块8书刊信息
    {"parent":"14,2,8","child":""},//模块9三农科教 
    {"parent":"15,2,8","child":""},//模块10文化生活
    {"parent":"27,2,4","child":""},//模块11三农服务27
    {"parent":"16,0,14","child":""},//模块12三农探索16
    {"parent":"18,0,14","child":""},//模块13三农人物18
    {"parent":"21,2,8","child":"189,0,5"},//模块14农资购销
    {"parent":"153,2,8","child":"258,0,5"},//模块15农产购销
    {"parent":"26,4,8","child":"191,0,5"},//模块16打假维权
    {"parent":"1,4,8","child":""},//模块3政策法规
]

let jsonString = JSON.stringify(getJson);

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

    if(mkdata.code==200){
        //模块1新农村
        boxData1.value = mkdata.data[0].imgnum;
        boxData1data2.value = mkdata.data[0].textnum;
        //模块2农名工
        boxData2.value = mkdata.data[1].textnum;
        //模块4三农之窗
        boxData4.value = mkdata.data[2].textnum;
        //模块5区域经济
        boxData5.value = mkdata.data[3].imgnum;
        boxData5data2.value = mkdata.data[3].textnum;
        //模块6三农投资
        boxData6.value = mkdata.data[4].textnum;
        //模块7农贸信息
        boxData7.value = mkdata.data[5].textnum;
        //模块8书刊信息
        boxData8.value = mkdata.data[6].imgnum;
        boxData88.value = mkdata.data[6].textnum;
        //模块9三农科教
        boxData9.value = mkdata.data[7].imgnum;
        boxData9data2.value = mkdata.data[7].textnum;
        //模块10文化生活
        boxData10.value = mkdata.data[8].imgnum;
        boxData10data2.value = mkdata.data[8].textnum;
        //模块11三农服务
        boxData11.value = mkdata.data[9].imgnum;
        boxData11data2.value = mkdata.data[9].textnum;
        //模块12三农探索
        boxData12.value = mkdata.data[10].textnum;
        //模块13三农人物
        boxData13.value = mkdata.data[11].textnum;
        //模块14农资购销 该栏目含有子导航
        boxData14.value = mkdata.data[12].imgnum;
        boxData14data2.value = mkdata.data[12].textnum;
        boxData14menu.value =  mkdata.data[12].child.all_childcat;
        boxData14childpinyin.value = mkdata.data[12].child.pinyin;
        boxData14mainData.value = mkdata.data[12].child.textnum;
        //模块14农产购销 
        boxData15.value = mkdata.data[13].imgnum;
        boxData15data2.value = mkdata.data[13].textnum;
        boxData15menu.value = mkdata.data[13].child.all_childcat;
        boxData15childpinyin.value = mkdata.data[13].child.pinyin;
        boxData15mainData.value = mkdata.data[13].child.textnum;
        //模块15打假维权 
        boxData16.value = mkdata.data[14].imgnum;
        boxData16data2.value = mkdata.data[14].textnum;
        boxData16menu.value = mkdata.data[14].child.all_childcat;
        boxData16childpinyin.value = mkdata.data[14].child.pinyin;
        boxData16mainData.value = mkdata.data[14].child.textnum;
        //模块17政策法规
        boxData17.value = mkdata.data[15];

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


//获得模块数据
// async function getPageData(catid,img_num,text_num,modulesNum,childNavNum,childImgNum,childTextNum){
//     const mkdata =  await requestDataPromise('/web/getWebsiteCatidArticle', {
//         method: 'GET',
//         query: {
//             'catid': catid, //catid
//             'img_num': img_num, //图片数量
//             'text_num': text_num, //文字数量
//             'child_catnum':childNavNum,//子级栏目菜单数量
//             'child_imgnum':childImgNum,//子栏目展示图片新闻数量
//             'child_textnum':childTextNum//子栏目展示文字新闻数量
//         },
//     });
//     //模块1新农村
//     if(modulesNum == 1){
//         if(mkdata.code==200){
//             boxData1.value = mkdata.data.img;
//             boxData1data2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块2农名工
//     if(modulesNum == 2){
//         if(mkdata.code==200){
//             boxData2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块4三农之窗
//     if(modulesNum == 4){
//         if(mkdata.code==200){
//             boxData4.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块5区域经济
//     if(modulesNum == 5){
//         if(mkdata.code==200){
//             boxData5.value = mkdata.data.img;
//             boxData5data2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块6三农投资
//     if(modulesNum == 6){
//         if(mkdata.code==200){
//             boxData6.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块7农贸信息
//     if(modulesNum == 7){
//         if(mkdata.code==200){
//             boxData7.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块8书刊信息
//     if(modulesNum == 8){
//         if(mkdata.code==200){
//             boxData8.value = mkdata.data.img;
//             boxData88.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块9三农科教
//     if(modulesNum == 9){
//         if(mkdata.code==200){
//             boxData9.value = mkdata.data.img;
//             boxData9data2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         } 
//     }
//     //模块10文化生活
//     if(modulesNum == 10){
//         if(mkdata.code==200){
//             boxData10.value = mkdata.data.img;
//             boxData10data2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         } 
//     }
//     //模块11三农服务
//     if(modulesNum == 11){
//         if(mkdata.code==200){
//             boxData11.value = mkdata.data.img;
//             boxData11data2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         } 
//     }
//     //模块12三农探索
//     if(modulesNum == 12){
//         if(mkdata.code==200){
//             boxData12.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块13三农人物
//     if(modulesNum == 13){
//         if(mkdata.code==200){
//             boxData13.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块14农资购销 该栏目含有子导航
//     if(modulesNum == 14){
//         if(mkdata.code==200){
//             boxData14.value = mkdata.data.img;
//             boxData14data2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     if(modulesNum == 142){
//         if(mkdata.code==200){
//             boxData14menu.value = mkdata.data.child;
//             boxData14mainData.value = mkdata.data.child[0].text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块14农产购销 该栏目含有子导航
//     if(modulesNum == 15){
//         if(mkdata.code==200){
//             boxData15.value = mkdata.data.img;
//             boxData15data2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     if(modulesNum == 152){
//         if(mkdata.code==200){
//             boxData15menu.value = mkdata.data.child;
//             boxData15mainData.value = mkdata.data.child[0].text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     //模块15打假维权 
//     if(modulesNum == 16){
//         if(mkdata.code==200){
//             boxData16.value = mkdata.data.img;
//             boxData16data2.value = mkdata.data.text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
//     if(modulesNum == 162){
//         if(mkdata.code==200){
//             boxData16menu.value = mkdata.data.child;
//             boxData16mainData.value = mkdata.data.child[0].text;
//         }else{
//             ElMessage.error(mkdata.message)
//         }
//     }
// }
//模块1新农村 导航池11 图文2 文字8 
// await getPageData(11,2,8,1,0,0,0);
// //模块2农民工 导航池317 文字8 
// await getPageData(317,0,8,2,0,0,0);
// //----//组件 模块3政策法规 导航池1 图文4 文字8  
// //模块4三农之窗 文字8 
// await getPageData(2,0,5,4,0,0,0);
// //模块5区域经济 图文1 文字1 
// await getPageData(5,1,1,5,0,0,0);
// //模块6三农投资 导航池6 文字3
// await getPageData(12,0,3,6,0,0,0);
// //模块7农贸信息 导航池13 图片5
// await getPageData(13,0,4,7,0,0,0);
// //模块8书刊信息 导航池24 图片2 文字
// await getPageData(24,2,8,8,0,0,0);
// //模块9三农科教 图片2 文字8 （9和10是选项卡 如果只有9没有10就会报错）
// await getPageData(14,2,8,9,0,0,0);////////////////////////////////////                                   
// //模块10文化生活 图片2 文字8 /////////////////////////////////////
// await getPageData(15,2,8,10,0,0,0);///////////////////////////////////
// //模块11三农服务27 图片2 文字4
// await getPageData(27,2,4,11,0,0,0);
// //模块12三农探索16 图片0 文字10（12和13是选项卡 如果只有12没有13就会报错）
// await getPageData(16,0,14,12,0,0,0);//////////////////////////////////////
// //模块13三农人物18 图片0 文字10;//////////////////////////////////////
// await getPageData(18,0,14,13,0,0,0);//////////////////////////////////////
// //模块14农资购销21 图片2 文字8 子导航8 子导航展示： 文字6
// await getPageData(21,2,8,14,0,0,0);//////////////////////////////////////
// await getPageData(21,0,0,142,8,0,5);/////////////////////////////////////
// //模块15农产购销153 图片2 文字8 子导航8 子导航展示： 文字6
// await getPageData(153,2,8,15,0,0,0);//////////////////////////////////////
// await getPageData(153,0,0,152,8,0,5);/////////////////////////////////////
// //模块16打假维权26 图片4 文字8 子导航8 子导航展示： 文字6
// await getPageData(26,4,8,16,0,0,0);//////////////////////////////////////
// await getPageData(26,0,0,162,8,0,5);/////////////////////////////////////
//5.页面基本信息 end---------------------------------------->

//6.设置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: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
        ]
    });
}else{
    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
    console.log("错误位置：设置首页SEO数据")
    console.log("后端错误反馈：",setData.message)
    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
}
//6.设置seo数据 start---------------------------------------->
</script>

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