<template>
    <div>
        <HomePageHead></HomePageHead>
        <HomePageNavigation></HomePageNavigation>
        <!-- 农资供销 nzgx -->
        <main class="index_main">
            <div class="index_head_out clearfix">
                <h3 class="index_head_h3">
                    <a class="index_head_h3_a" href="" title="">
                        <div class="index_head_h3_tag">头条</div>
                        《习近平关于加强党的作风建设论述摘编》出版发行
                    </a>
                </h3>
                <div class="index_head_a_box clearfix">
                    <a class="index_head_a dot1" href="" title="">春节前夕看望慰问，习近平为何来到这个村总书记的“新春之约”第1视点</a>
                    <a class="index_head_a dot1" href="" title="">暖暖新家暖暖年学习快评</a>
                    <a class="index_head_a dot1" href="" title="">深深牵挂暖人心瞰辽宁</a>
                </div>
            </div>
            <section class="index_1 clearfix">
                <div class="index_1_box">
                    <div class="roll_1_box">
                        <HomeBigSwiper></HomeBigSwiper>
                    </div>
                </div>
                <div class="index_2_box">
                    <div class="index_1_ul clearfix">
                        <a class="index_1_ul_a dot1" href="" title="" v-for="(per_obj, per_index) in 10" :key="per_obj">
                            政讯通政讯通政讯通政讯通政讯通政讯通政讯通政讯通政讯通政讯通政讯通政讯通政讯通
                        </a>
                    </div>
                </div>
            </section>
            <section class="index_2 clearfix">
                <div class="index_head_box clearfix">
                    <div class="index_head_box_left">
                        <div class="index_head_left_a_btn ">
                            <a class="index_head_left_a index_head_left_a_only" href="" title="">企业推荐</a>
                        </div>
                    </div>
                    <div class="index_head_box_right">
                        <a class="index_head_box_right_1_a" href="" title=""> 更多 &gt; </a>
                    </div>
                </div>
                <!--企业推荐open-->
                <div class="index_2_color_box clearfix">
                    <div class="index_ul_2 clearfix">
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">1</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣商贸贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">11</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣商贸公贸公贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">11</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣商贸公贸贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">11</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">1欣欣商贸欣商贸欣商贸欣商贸欣商贸欣商贸欣商贸欣商贸欣商贸欣商贸欣商贸欣商贸贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">12</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣贸公司欣欣贸公司欣欣贸公司欣欣贸公司欣欣贸公司欣欣贸公司欣欣贸公司欣欣贸公司欣欣贸公司欣欣贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">11</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣商贸公贸公贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">11</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">11</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣商贸公贸公贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">11</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣贸公司</a>
                        </div>
                        <div class="index_ul_2_li">
                            <div class="index_ul_2_li_num">11</div> <a class="index_ul_2_li_a dot2" href=""
                                title="">欣欣商贸公贸公贸公司</a>
                        </div>
                    </div>
                    <div class="index_2_foot clearfix">
                        <a class="index_2_foot_a_btn" href="" title="">开通企业网站</a>
                        <a class="index_2_foot_a_btn" href="" title="">管理企业网站</a>
                    </div>
                </div>
                <!--企业推荐end-->
            </section>
            <div class="banner_1">
                <a class="banner_1_a" href="" title="">
                    <img class="banner_1_img" src="@/public/img/3.png" title="" alt="">
                </a>
            </div>
            <section class="index_3 clearfix">
                <div class="index_3_head_box clearfix">
                    <a class="index_3_head_btn_a back100 index_3_head_btn_a_only" href="" title="">产品分类</a>
                    <a class="index_3_head_btn_a back100" href="" title="">农资商城</a>
                </div>
                <div class=" clearfix">
                    <div class=" clearfix">
                        <!--产品分类open-->
                        <div class="index_big_ul clearfix">
                            <div class="index_big_li clearfix" v-for="(per_obj, per_index) in 5" :key="per_obj">
                                <a class="index_big_li_head_a" href="" title="">种子</a>
                                <div class="index_ul_3_in clearfix">
                                    <a class="index_ul_3_a" href="" title="" v-for="(per_obj, per_index) in 7"
                                        :key="per_obj">种子种子</a>
                                </div>
                            </div>
                        </div>
                        <!--产品分类end-->
                    </div>
                    <!--农资商城open-->
                    <!-- <div class=" clearfix">农资商城</div> -->
                    <!--农资商城end-->
                </div>
            </section>
            <section class="index_4 clearfix">
                <div class="index_1_box clearfix">
                    <div class="index_head_box clearfix">
                        <div class="index_head_box_left">
                            <div class="index_head_left_a_btn">
                                <a class="index_head_left_a index_head_left_a_only" href="" title="">
                                    生活用品
                                </a>
                            </div>
                            <div class="index_head_left_a_btn">
                                <a class="index_head_left_a" href="" title="">
                                    书刊音像
                                </a>
                            </div>
                        </div>
                        <div class="index_head_btn_right_box_2"><a class="index_head_btn_right_a_2" href=""
                                title="">发布信息</a></div>
                    </div>
                    <!--生活用品open-->
                    <div class=" clearfix">
                        <div class="index_3_box clearfix">
                            <div class="index_ul_4_out clearfix">
                                <div class="index_ul_4_img_box clearfix">
                                    <a class=" " href="" title="">
                                        <img class="index_ul_4_img" src="@/public/img/11.png" title="" alt="">
                                    </a>
                                </div>
                                <div class="index_ul_4">
                                    <a class="index_ul_4_a dot1" href="" title="" v-for="(per_obj, per_index) in 3"
                                        :key="per_obj">
                                        生活用品生活用品生活用品生活用品生活用品生活用品生活用品生活用品
                                    </a>
                                </div>
                            </div>
                            <div class="index_ul_5 clearfix">
                                <a class="index_ul_5_a dot1" href="" title="" v-for="(per_obj, per_index) in 3"
                                    :key="per_obj">
                                    生活用品生活用品生活用品生活用品生活用品生活用品
                                </a>
                            </div>
                        </div>
                        <div class="index_4_box clearfix">
                            <div class="index_ul_4_out clearfix">
                                <div class="index_ul_4_img_box clearfix">
                                    <a class=" " href="" title="">
                                        <img class="index_ul_4_img" src="@/public/img/12.png" title="" alt="">
                                    </a>
                                </div>
                                <div class="index_ul_4">
                                    <a class="index_ul_4_a dot1" href="" title="" v-for="(per_obj, per_index) in 3"
                                        :key="per_obj">
                                        生活用品生活用品生活用品生活用品生活用品生活用品生活用品生活用品
                                    </a>
                                </div>
                            </div>
                            <div class="index_ul_5 clearfix">
                                <a class="index_ul_5_a dot1" href="" title="" v-for="(per_obj, per_index) in 3"
                                    :key="per_obj">
                                    生活用品生活用品生活用品生活用品生活用品生活用品
                                </a>
                            </div>
                        </div>
                    </div>
                    <!--生活用品end-->
                </div>
                <div class="index_2_box clearfix">
                    <div class="index_head_box clearfix">
                        <div class="index_head_box_left">
                            <div class="index_head_left_a_btn">
                                <a class="index_head_left_a index_head_left_a_only" href="" title="">综合资讯</a>
                            </div>
                        </div>
                        <div class="index_head_box_right_3">
                            <a class="index_head_box_right_3_a" href="" title=""> 更多</a>
                            <a class="index_head_box_right_3_a" href="" title=""> 更多</a>
                            <a class="index_head_box_right_3_a" href="" title=""> 更多</a>
                        </div>
                    </div>
                    <!--综合资讯open-->
                    <div class="index_ul_6 clearfix">
                        <a class="index_ul_6_a dot1" href="" title="" v-for="(per_obj, per_index) in 7" :key="per_obj">
                            生活用品生活用品生活用品生活用品生活用品生活用品
                        </a>
                    </div>
                    <!--综合资讯end-->
                </div>
            </section>
            <section class="index_5 clearfix">
                <div class="index_1_box clearfix">
                    <div class="index_head_box clearfix">
                        <div class="index_head_box_left">
                            <div class="index_head_left_a_btn">
                                <a class="index_head_left_a index_head_left_a_only" href="" title="">农资供求</a>
                            </div>
                        </div>
                        <div class="index_head_box_right_3">
                            <a class="index_head_box_right_3_a" href="" title=""> 更多</a>
                            <a class="index_head_box_right_3_a" href="" title=""> 更多</a>
                            <a class="index_head_box_right_3_a" href="" title=""> 更多</a>
                        </div>
                    </div>
                    <!--农资供求open-->
                    <div class=" clearfix">
                        <div class="index_3_box clearfix">
                            <div class="index_img_ul_1_ul">
                                <div class="index_img_ul_1_li">
                                    <a class="index_img_ul_1_li_a" href="" title="">
                                        <img class="index_img_ul_1_li_img" src="@/public/img/8.png" title="" alt="">
                                        <div class="index_img_ul_1_li_dot1 dot1">
                                            农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权
                                        </div>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="index_4_box clearfix">
                            <div class="index_name_ul">
                                <div class="index_name_ul_li">
                                    <a class="index_name_ul_li_tag" href="" title="">供应</a>
                                    <a class="index_name_ul_li_dot1 dot1" href=""
                                        title="">民工动态民工动态民工动态民工动态民工动态民工动态民工动态</a>
                                </div>
                                <div class="index_name_ul_li" v-for="(per_obj, per_index) in 2" :key="per_obj">
                                    <a class="index_name_ul_li_tag" href="" title="">【供应】</a>
                                    <a class="index_name_ul_li_dot1 dot1" href=""
                                        title="">民工动态民工动态民工动态民工动态民工动态民工动态民工动态</a>
                                </div>
                            </div>
                            <div class="index_name_ul_2">
                                <div class="index_name_ul_2_li">
                                    <a class="index_name_ul_2_li_tag" href="" title="">求购</a>
                                    <a class="index_name_ul_2_li_dot1 dot1" href=""
                                        title="">民工动态民工动态民工动态民工动态民工动态民工动态民工动态</a>
                                </div>
                                <div class="index_name_ul_2_li" v-for="(per_obj, per_index) in 2" :key="per_obj">
                                    <a class="index_name_ul_2_li_tag" href="" title="">【求购】</a>
                                    <a class="index_name_ul_2_li_dot1 dot1" href=""
                                        title="">民工动态民工动态民工动态民工动态民工动态民工动态民工动态</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--农资供求 end-->
                </div>
                <div class="index_2_box clearfix">
                    <div class="index_head_box clearfix">
                        <div class="index_head_box_left">
                            <div class="index_head_left_a_btn">
                                <a class="index_head_left_a index_head_left_a_only" href="" title="">三农专题</a>
                            </div>
                        </div>
                        <div class="index_head_box_right"><a class="index_head_box_right_1_a" href="" title=""> 更多
                                &gt; </a></div>
                    </div>
                    <div class=" clearfix">
                        <!--三农专题open-->
                        <div class="index_5_box clearfix">
                            <div class="index_img_ul_2">
                                <div class="index_img_ul_2_li" v-for="(per_obj, per_index) in 2" :key="per_obj">
                                    <a class="index_img_ul_2_li_a" href="" title="">
                                        <img class="index_img_ul_2_li_img" src="../public/img/24.png" title="" alt="">
                                        <div class="index_img_ul_2_li_dot1 dot1">
                                            农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权
                                        </div>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="index_6_box clearfix">
                            <div class="index_ul_8 clearfix">
                                <div class="index_ul_8_li_box" v-for="(per_obj, per_index) in 4" :key="per_obj">
                                    <div class="index_ul_8_li"><a class="index_ul_8_a dot2" href=""
                                            title="">4农民权农民工维权权农民工维权权农民工维权权农民工维权权农民工维权</a></div>
                                </div>
                            </div>
                        </div>
                        <!--三农专题end-->
                    </div>
                </div>
            </section>
            <div class="banner_2"><a class="banner_2_a" href="" title=""><img class="banner_2_img"
                        src="../public/img/3.png" title="" alt=""></a></div>
            <section class="index_6 clearfix">
                <div class="index_1_box clearfix">
                    <div class="index_head_box clearfix">
                        <div class="index_head_box_left">
                            <div class="index_head_left_a_btn">
                                <a class="index_head_left_a index_head_left_a_only" href="" title="">农资供销网</a>
                            </div>
                        </div>
                        <div class="index_head_box_right_4">
                            <a class="index_head_box_right_4_a" href="" title=""> 更多</a>
                            <a class="index_head_box_right_4_a" href="" title=""> 更多</a>
                            <a class="index_head_box_right_4_a" href="" title=""> 更多</a>
                        </div>
                    </div>
                    <!--政策法规open-->
                    <div class=" clearfix">
                        <div class="index_3_box clearfix">
                            <div class="index_img_ul_3">
                                <div class="index_img_ul_3_li">
                                    <a class="index_img_ul_3_li_a" href="" title="">
                                        <img class="index_img_ul_3_li_img" src="../public/img/31.png" title="" alt="">
                                        <div class="index_img_ul_3_li_dot2 dot2">
                                            农民工维权农民工维权农民工维权农民工维权农民工维权农 民工维权农民工维权农民工维权农民工维权农民工维权农民工维权
                                        </div>
                                    </a>
                                </div>
                            </div>
                            <div class="index_img_ul_even_1 clearfix">
                                <div class="index_img_ul_even_1_li" v-for="(per_obj, per_index) in 2" :key="per_obj">
                                    <a class="index_img_ul_even_1_li_a" href="" title="">
                                        <img class="index_img_ul_even_1_li_img" src="../public/img/32.png" title=""
                                            alt="">
                                        <div class="index_img_ul_even_1_li_dot2 dot2">农民工维权农民工维权农民工维权农民工维
                                            权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="index_4_box clearfix">
                            <div class="index_ul_9 clearfix">
                                <div class="index_ul_9_head_box clearfix">
                                    <a class="index_ul_9_head_a" href="" title="">热点政策法规</a>
                                </div>
                                <a class="index_ul_9_a dot1" href="" title="" v-for="(per_obj, per_index) in 5"
                                    :key="per_obj">
                                    生活用品生活用品生活用品生活用品生活用品生活用品 </a>
                            </div>
                            <div class="index_ul_9 clearfix">
                                <div class="index_ul_9_head_box clearfix">
                                    <a class="index_ul_9_head_a" href="" title="">最新法规</a>
                                </div>
                                <a class="index_ul_9_a dot1" href="" title="" v-for="(per_obj, per_index) in 5"
                                    :key="per_obj">
                                    生活用品生活用品生活用品生活用品生活用品生活用品 </a>
                            </div>
                        </div>
                    </div>
                    <!--政策法规end-->
                </div>
                <div class="index_2_box clearfix">
                    <div class="index_head_box clearfix">
                        <div class="index_head_box_left">
                            <div class="index_head_left_a_btn"><a class="index_head_left_a index_head_left_a_only"
                                    href="" title="">会展服务</a></div>
                        </div>
                        <div class="index_head_box_right"><a class="index_head_box_right_1_a" href="" title=""> 更多
                                &gt; </a></div>
                    </div>
                    <!--会展服务open-->
                    <div class=" clearfix">
                        <div class="index_even_img_ul_1 clearfix">
                            <div class="index_even_img_ul_1_li" v-for="(per_obj, per_index) in 2" :key="per_obj">
                                <a class="index_even_img_ul_1_a" href="" title="">
                                    <img class="index_even_img_ul_1_li_img" src="../public/img/9.png" title="" alt="">
                                    <div class="index_even_img_ul_1_dot1 dot1">
                                        农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权</div>
                                </a>
                            </div>
                        </div>
                        <div class="index_ul_10 clearfix">
                            <a class="index_ul_10_a dot1" href="" title="" v-for="(per_obj, per_index) in 7"
                                :key="per_obj"> 生活用品生活用品生活用品生活用品生活用品生品生活用品生品生活用品生活用品 </a>
                        </div>
                    </div>
                    <!--会展服务end-->
                </div>
            </section>
            <section class="index_7 clearfix">
                <div class="index_7_line_box clearfix">
                    <div class="index_7_in_box">
                        <div class="index_7_head">
                            <a class="index_7_head_a" href="" title="">推广服务</a>
                        </div>
                        <div class="index_ul_11 clearfix">
                            <a class="index_ul_11_a dot1" href="" title="" v-for="(per_obj, per_index) in 3"
                                :key="per_obj"> 生活用品生活用品生活用品生活用品生活用品生品生活用品生品生活用品生活用品 </a>
                        </div>
                    </div>
                    <div class="index_7_in_box">
                        <div class="index_7_head">
                            <a class="index_7_head_a" href="" title="">策划服务</a>
                        </div>
                        <!--策划服务open-->
                        <div class="index_ul_11 clearfix">
                            <a class="index_ul_11_a dot1" href="" title="" v-for="(per_obj, per_index) in 3"
                                :key="per_obj"> 生活用品生活用品生活用品生活用品生活用品生品生活用品生品生活用品生活用品 </a>
                        </div>
                        <!--策划服务end-->
                    </div>
                    <div class="index_7_in_box">
                        <div class="index_7_head">
                            <a class="index_7_head_a" href="" title="">网站动态</a>
                        </div>
                        <!--网站动态-->
                        <div class="index_ul_11 clearfix">
                            <a class="index_ul_11_a dot1" href="" title="" v-for="(per_obj, per_index) in 3"
                                :key="per_obj"> 生活用品生活用品生活用品生活用品生活用品生品生活用品生品生活用品生活用品 </a>
                        </div>
                        <!--网站动态-->
                    </div>
                </div>
            </section>
            <section class="index_8 clearfix">
                <div class="index_1_box clearfix">
                    <div class="index_head_box clearfix index_head_box_2">
                        <div class="index_head_box_left">
                            <div class="index_head_left_a_btn">
                                <a class="index_head_left_a index_head_left_a_only" href="" title="">行业报告</a>
                            </div>
                        </div>
                    </div>
                    <!--行业报告open-->
                    <div class="index_big_2_ul clearfix">
                        <div class="index_big_2_li clearfix">
                            <div class="index_big_2_li_img_box">
                                <a class="index_big_2_li_img_a" href="" title="">
                                    <img class="index_big_2_li_img" src="../public/img/28.png" title="" alt="">
                                </a>
                            </div>
                            <div class="index_big_2_li_in">
                                <div class="index_ul_12">
                                    <a class="index_ul_12_a dot1" href="" title="" v-for="(per_obj, per_index) in 4"
                                        :key="per_obj">农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权农民工维权</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="index_ul_13 clearfix">
                        <a class="index_ul_13_a dot1" href="" title="" v-for="(per_obj, per_index) in 3" :key="per_obj">
                            生活用品生活用品生活用品生活用品生活用品生品生活用品生品生活活用品生品生活用品生品生活活用品生品生活用品生品生活用品生活用品 </a>
                    </div>
                    <!--行业报告end-->
                </div>
                <div class="index_2_box clearfix">
                    <div class="index_head_box clearfix index_head_box_3">
                        <div class="index_head_box_left">
                            <div class="index_head_left_a_btn">
                                <a class="index_head_left_a index_head_left_a_only" href="" title="">专家服务</a>
                            </div>
                        </div>
                        <div class="index_head_box_right"><a class="index_head_box_right_1_a" href="" title=""> 更多
                                &gt; </a></div>
                    </div>
                    <!--专家服务open-->
                    <div class="index_ul_6 clearfix">
                        <div class="index_ul_6_li clearfix">
                            <a class="index_ul_6_li_a" href="" title="">
                                <div class="index_ul_6_img_box">
                                    <img class="index_ul_6_img" src="../public/img/10.png" title="" alt="">
                                </div>
                                <div class="index_ul_6_li_right">
                                    <div class="index_ul_6_li_head">郭建炜</div>
                                    <article class="index_ul_6_li_article dot3">
                                        郭建炜郭建炜郭 郭建炜郭建炜郭 郭建炜郭建炜郭 郭建炜郭建炜郭 郭建炜郭建炜郭 郭建炜郭建炜郭 郭建炜郭建炜郭 郭建炜郭建炜郭 炜郭
                                    </article>
                                    <span class="index_ul_6_li_article_detail">【详细】</span>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="index_ul_13 clearfix">
                        <a class="index_ul_13_a dot1" href="" title="" v-for="(per_obj, per_index) in 3" :key="per_obj">
                            生活用品生活用品生活用品生活用品生活用品生品生活用品生品生活活用品生品生活用品生品生活活用品生品生活用品生品生活用品生活用品 </a>
                    </div>
                    <!--专家服务end-->
                </div>
            </section>
            <div class="banner_2"><a class="banner_2_a" href="" title=""><img class="banner_2_img"
                        src="../public/img/3.png" title="" alt=""></a></div>
        </main>
        <!-- 页面底部 -->
        <HomeFoot></HomeFoot>
    </div>
</template>

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

//1.获取头条新闻 start---------------------------------------->
//1.1 头条
const headline = ref({})
const headlineData2 = ref([])
async function getModelData1() {
    const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'pageSize': 4,
            'level': 1,
            'placeid': 0,
            'id': ''
        },
    });
    if (mkdata.code == 200) {
        //填充大标题
        for (let index in mkdata.data) {
           if(index < 1 ){
                headline.value = mkdata.data[index]
           }else{
                headlineData2.value.push(mkdata.data[index])
           }
        }
    } else {
        console.log("设置大标题错误", mkdata.message)
    }
}
getModelData1()

//1.3 今日热点
const hotNewsList = ref("")
async function getModelData3() {
    const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'pageSize': 10,
            'level': 6,
            'placeid': 0,
            'id': ''
        },
    });
    if (mkdata.code == 200) {
        hotNewsList.value = mkdata.data;
    } else {
        console.log("获取首页今日热点错误", mkdata.message)
    }
}
getModelData3()
//1.获取头条新闻 end---------------------------------------->

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

const hoverStatusTwo = ref(1)
const qhPicTwo = function (num) {
    hoverStatusTwo.value = num;
}

const hoverStatusThree = ref(1)
const qhPicThree = function (num) {
    hoverStatusThree.value = num;
}

//图片切换
const showImg = ref(1)
const changeImg = function (num) {
    showImg.value = num;
}
//2.选项卡 end---------------------------------------->

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

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

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

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

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

//4.3获得导航数据
try {
    const navigateData = await requestDataPromise('/web/getWebsiteModelCategory', {
        method: 'GET',
        query: {
            'placeid': 1,
            'pid': 0,
            'num': 30
        },
    });
    if (navigateData.code == 200) {
        // 遍历可用的导航池放到页面中
        for (let index in navigateData.data) {
            let data = {
                title: navigateData.data[index].name,
                cid: navigateData.data[index].category_id,
                children_count: navigateData.data[index].children_count,
                alias: navigateData.data[index].alias,
                aLIas_pinyin: navigateData.data[index].aLIas_pinyin,
                chilid_id: navigateData.data[index].chilid_id
            };
            //渲染标题
            //1
            if (navigateData.data[index].category_id == 11) { pageData.value[0] = data }
            //2
            if (navigateData.data[index].category_id == 317) { pageData.value[1] = data }
            //3
            if (navigateData.data[index].category_id == 1) { pageData.value[2] = data }
            //4
            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 == 21) { pageData.value[5] = data }
            //7
            if (navigateData.data[index].category_id == 153) { pageData.value[6] = data }
            //8
            if (navigateData.data[index].category_id == 12) { pageData.value[7] = data }
            //9
            if (navigateData.data[index].category_id == 13) { pageData.value[8] = data }
            //10
            if (navigateData.data[index].category_id == 24) { pageData.value[9] = data }
            //11
            if (navigateData.data[index].category_id == 14) { pageData.value[10] = data }
            //12
            if (navigateData.data[index].category_id == 15) { pageData.value[11] = data }
        }
    } else {
        console.log("获取导航池出错！", navigateData.message)
    }
} catch (error) {
    console.log("错误：导航池渲染执行接口出错！请检查首页的14的模块的具体执行方法！")
}

let getJson = [
    { "parent": "11,2,12", "child": "" },//模块1
    { "parent": "317,2,12", "child": "" },//模块2
    { "parent": "1,2,12", "child": "" },//模块3
    { "parent": "2,1,2", "child": "" },//模块4
    { "parent": "5,1,2", "child": "" },//模块5
    { "parent": "21,3,9", "child": "" },//模块6
    { "parent": "153,2,6", "child": ""},//模块7
    { "parent": "12,3,9", "child": "" },//模块8
    { "parent": "13,1,2", "child": "" },//模块9
    { "parent": "24,1,6", "child": "" },//模块10
    { "parent": "14,2,4", "child": "" },//模块11
]

let jsonString = JSON.stringify(getJson);

async function getPageAllData() {
    const mkdata = await requestDataPromise('/web/getWebsiteAllArticle', {
        method: 'GET',
        query: {
            'id': jsonString
        },
    });
    if (mkdata.code == 200) {
        //模块1
        for(let index in mkdata.data[0].imgnum){
            if(index < 1){
                boxData1.value.push(mkdata.data[0].imgnum[index])
            }else{
                boxData1data2.value.push(mkdata.data[0].imgnum[index])
            }
        }
        for(let index in mkdata.data[0].textnum){
            if(index < 6){
                boxData1data3.value.push(mkdata.data[0].textnum[index])
            }else{
                boxData1data4.value.push(mkdata.data[0].textnum[index])
            }
        }
        //模块2
        for(let index in mkdata.data[1].imgnum){
            if(index < 1){
                boxData2.value.push(mkdata.data[1].imgnum[index])
            }else{
                boxData2data2.value.push(mkdata.data[1].imgnum[index])
            }
        }
        for(let index in mkdata.data[1].textnum){
            if(index < 6){
                boxData2data3.value.push(mkdata.data[1].textnum[index])
            }else{
                boxData2data4.value.push(mkdata.data[1].textnum[index])
            }
        }
        //模块3
        for(let index in mkdata.data[2].imgnum){
            if(index < 1){
                boxData3.value.push(mkdata.data[2].imgnum[index])
            }else{
                boxData3data2.value.push(mkdata.data[2].imgnum[index])
            }
        }
        for(let index in mkdata.data[2].textnum){
            if(index < 6){
                boxData3data3.value.push(mkdata.data[2].textnum[index])
            }else{
                boxData3data4.value.push(mkdata.data[2].textnum[index])
            }
        }
        //模块4
        boxData4.value = mkdata.data[3].imgnum;
        boxData4data2.value = mkdata.data[3].textnum;
        //模块5
        boxData5.value = mkdata.data[4].imgnum;
        boxData5data2.value = mkdata.data[4].textnum;
        //模块6
        for(let index in mkdata.data[5].imgnum){
            if(index < 1){
                boxData6.value.push(mkdata.data[5].imgnum[index])
            }else{
                boxData6data2.value.push(mkdata.data[5].imgnum[index])
            }
        }
        boxData6data3.value = mkdata.data[5].textnum;
        //模块7
        boxData7.value = mkdata.data[6].imgnum;
        for(let index in mkdata.data[6].textnum){
            if(index <= 2){
                boxData7data2.value.push(mkdata.data[6].textnum[index])
            }else{
                boxData7data3.value.push(mkdata.data[6].textnum[index])
            }
        }
        //模块8
        for(let index in mkdata.data[7].imgnum){
            if(index < 1){
                boxData8.value.push(mkdata.data[7].imgnum[index])
            }else{
                boxData8data2.value.push(mkdata.data[7].imgnum[index])
            }
        }
        boxData8data3.value = mkdata.data[7].textnum;
        //模块9
        boxData9.value = mkdata.data[8].imgnum;
        boxData9data2.value = mkdata.data[8].textnum;
        //模块10
        boxData10.value = mkdata.data[9].imgnum;
        boxData10data2.value = mkdata.data[9].textnum;
        //模块11
        boxData11.value = mkdata.data[10].imgnum;
        boxData11data2.value = mkdata.data[10].textnum;
    } else {
        ElMessage.error(mkdata.message)
    }
}
getPageAllData();
//4.页面数据 end---------------------------------------->

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

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

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