Răsfoiți Sursa

将路由白名单功能上到正式环境

Jing 8 ore în urmă
părinte
comite
0b8af9de1a

+ 16 - 0
.nuxt/components.d.ts

@@ -8,6 +8,8 @@ interface _GlobalComponents {
     'DetailHotNews2': typeof import("../components/detail/HotNews2.vue")['default']
     'GoodsSwiperSnscShopInfoCateg': typeof import("../components/goods/SwiperSnscShopInfoCateg.vue")['default']
     'GoodsClass': typeof import("../components/goods/class.vue")['default']
+    'GoodsDetail': typeof import("../components/goods/detail.vue")['default']
+    'GoodsDetailSec': typeof import("../components/goods/detail_sec.vue")['default']
     'HomeAdvertising': typeof import("../components/home/Advertising.vue")['default']
     'HomeAdvertisingClass': typeof import("../components/home/AdvertisingClass.vue")['default']
     'HomeBigSwiper': typeof import("../components/home/BigSwiper.vue")['default']
@@ -29,6 +31,8 @@ interface _GlobalComponents {
     'HomePageNavigation': typeof import("../components/home/pageNavigation.vue")['default']
     'HomePageNavigation1': typeof import("../components/home/pageNavigation1.vue")['default']
     'NewsClass': typeof import("../components/news/class.vue")['default']
+    'NewsDetail': typeof import("../components/news/detail.vue")['default']
+    'NewsDetailSec': typeof import("../components/news/detail_sec.vue")['default']
     'NuxtWelcome': typeof import("../node_modules/nuxt/dist/app/components/welcome.vue")['default']
     'NuxtLayout': typeof import("../node_modules/nuxt/dist/app/components/nuxt-layout")['default']
     'NuxtErrorBoundary': typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default']
@@ -58,6 +62,8 @@ interface _GlobalComponents {
     'LazyDetailHotNews2': typeof import("../components/detail/HotNews2.vue")['default']
     'LazyGoodsSwiperSnscShopInfoCateg': typeof import("../components/goods/SwiperSnscShopInfoCateg.vue")['default']
     'LazyGoodsClass': typeof import("../components/goods/class.vue")['default']
+    'LazyGoodsDetail': typeof import("../components/goods/detail.vue")['default']
+    'LazyGoodsDetailSec': typeof import("../components/goods/detail_sec.vue")['default']
     'LazyHomeAdvertising': typeof import("../components/home/Advertising.vue")['default']
     'LazyHomeAdvertisingClass': typeof import("../components/home/AdvertisingClass.vue")['default']
     'LazyHomeBigSwiper': typeof import("../components/home/BigSwiper.vue")['default']
@@ -79,6 +85,8 @@ interface _GlobalComponents {
     'LazyHomePageNavigation': typeof import("../components/home/pageNavigation.vue")['default']
     'LazyHomePageNavigation1': typeof import("../components/home/pageNavigation1.vue")['default']
     'LazyNewsClass': typeof import("../components/news/class.vue")['default']
+    'LazyNewsDetail': typeof import("../components/news/detail.vue")['default']
+    'LazyNewsDetailSec': typeof import("../components/news/detail_sec.vue")['default']
     'LazyNuxtWelcome': typeof import("../node_modules/nuxt/dist/app/components/welcome.vue")['default']
     'LazyNuxtLayout': typeof import("../node_modules/nuxt/dist/app/components/nuxt-layout")['default']
     'LazyNuxtErrorBoundary': typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default']
@@ -114,6 +122,8 @@ export const DetailHotNews: typeof import("../components/detail/HotNews.vue")['d
 export const DetailHotNews2: typeof import("../components/detail/HotNews2.vue")['default']
 export const GoodsSwiperSnscShopInfoCateg: typeof import("../components/goods/SwiperSnscShopInfoCateg.vue")['default']
 export const GoodsClass: typeof import("../components/goods/class.vue")['default']
+export const GoodsDetail: typeof import("../components/goods/detail.vue")['default']
+export const GoodsDetailSec: typeof import("../components/goods/detail_sec.vue")['default']
 export const HomeAdvertising: typeof import("../components/home/Advertising.vue")['default']
 export const HomeAdvertisingClass: typeof import("../components/home/AdvertisingClass.vue")['default']
 export const HomeBigSwiper: typeof import("../components/home/BigSwiper.vue")['default']
@@ -135,6 +145,8 @@ export const HomePageHead: typeof import("../components/home/pageHead.vue")['def
 export const HomePageNavigation: typeof import("../components/home/pageNavigation.vue")['default']
 export const HomePageNavigation1: typeof import("../components/home/pageNavigation1.vue")['default']
 export const NewsClass: typeof import("../components/news/class.vue")['default']
+export const NewsDetail: typeof import("../components/news/detail.vue")['default']
+export const NewsDetailSec: typeof import("../components/news/detail_sec.vue")['default']
 export const NuxtWelcome: typeof import("../node_modules/nuxt/dist/app/components/welcome.vue")['default']
 export const NuxtLayout: typeof import("../node_modules/nuxt/dist/app/components/nuxt-layout")['default']
 export const NuxtErrorBoundary: typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default']
@@ -164,6 +176,8 @@ export const LazyDetailHotNews: typeof import("../components/detail/HotNews.vue"
 export const LazyDetailHotNews2: typeof import("../components/detail/HotNews2.vue")['default']
 export const LazyGoodsSwiperSnscShopInfoCateg: typeof import("../components/goods/SwiperSnscShopInfoCateg.vue")['default']
 export const LazyGoodsClass: typeof import("../components/goods/class.vue")['default']
+export const LazyGoodsDetail: typeof import("../components/goods/detail.vue")['default']
+export const LazyGoodsDetailSec: typeof import("../components/goods/detail_sec.vue")['default']
 export const LazyHomeAdvertising: typeof import("../components/home/Advertising.vue")['default']
 export const LazyHomeAdvertisingClass: typeof import("../components/home/AdvertisingClass.vue")['default']
 export const LazyHomeBigSwiper: typeof import("../components/home/BigSwiper.vue")['default']
@@ -185,6 +199,8 @@ export const LazyHomePageHead: typeof import("../components/home/pageHead.vue")[
 export const LazyHomePageNavigation: typeof import("../components/home/pageNavigation.vue")['default']
 export const LazyHomePageNavigation1: typeof import("../components/home/pageNavigation1.vue")['default']
 export const LazyNewsClass: typeof import("../components/news/class.vue")['default']
+export const LazyNewsDetail: typeof import("../components/news/detail.vue")['default']
+export const LazyNewsDetailSec: typeof import("../components/news/detail_sec.vue")['default']
 export const LazyNuxtWelcome: typeof import("../node_modules/nuxt/dist/app/components/welcome.vue")['default']
 export const LazyNuxtLayout: typeof import("../node_modules/nuxt/dist/app/components/nuxt-layout")['default']
 export const LazyNuxtErrorBoundary: typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default']

+ 1 - 1
.nuxt/manifest/latest.json

@@ -1 +1 @@
-{"id":"dfdec9e5-f4a6-4750-a763-f9b529e2f898","timestamp":1749791870363}
+{"id":"0251fa41-92b4-445a-bc23-3464336d5fba","timestamp":1750669732348}

+ 1 - 0
.nuxt/manifest/meta/0251fa41-92b4-445a-bc23-3464336d5fba.json

@@ -0,0 +1 @@
+{"id":"0251fa41-92b4-445a-bc23-3464336d5fba","timestamp":1750669732348,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 0 - 1
.nuxt/manifest/meta/dfdec9e5-f4a6-4750-a763-f9b529e2f898.json

@@ -1 +0,0 @@
-{"id":"dfdec9e5-f4a6-4750-a763-f9b529e2f898","timestamp":1749791870363,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 1 - 1
.nuxt/tsconfig.json

@@ -102,7 +102,7 @@
         "./imports"
       ],
       "#app-manifest": [
-        "./manifest/meta/dfdec9e5-f4a6-4750-a763-f9b529e2f898.json"
+        "./manifest/meta/0251fa41-92b4-445a-bc23-3464336d5fba.json"
       ],
       "#components": [
         "./components"

+ 1 - 0
.nuxt/types/plugins.d.ts

@@ -17,6 +17,7 @@ type NuxtAppInjections =
   InjectionType<typeof import("../../node_modules/nuxt/dist/pages/runtime/plugins/prefetch.client.js")> &
   InjectionType<typeof import("../../plugins/element-plus")> &
   InjectionType<typeof import("../../plugins/request")> &
+  InjectionType<typeof import("../../plugins/category")> &
   InjectionType<typeof import("../../plugins/globals")> &
   InjectionType<typeof import("../../plugins/pinia")>
 

+ 5 - 1
assets/css/search.less

@@ -112,7 +112,8 @@
 
 
                     >a {
-                        width: 360px;
+                        display: inline-block;
+                        width: 950px;
                         height: 26px;
                         font-family: Microsoft YaHei, Microsoft YaHei;
                         font-weight: 400;
@@ -122,6 +123,9 @@
                         text-align: left;
                         font-style: normal;
                         text-transform: none;
+                        white-space: nowrap;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
                     }
 
                     .time {

+ 86 - 8
assets/css/shop/goodsDetail.less

@@ -117,7 +117,7 @@ section {
 }
 
 .index_main {
-    margin: 0 auto 444px;
+    margin: 0 auto 30px;
 }
 
 .slow_6 {
@@ -186,7 +186,7 @@ section {
 
 .index_2_right {
     float: right;
-    width: 845px;
+    width: 540px;
 }
 
 .index_2_h4 {
@@ -251,7 +251,7 @@ section {
     }
 
     .shop_head_1_name:nth-of-type(1) {
-        background: url(../public/img/3.png) no-repeat left center;
+        background: url(@/public/img/3.png) no-repeat left center;
         background-size: 12px 18px;
     }
 }
@@ -261,13 +261,15 @@ section {
 }
 
 .card_1_box {
-    display: none;
-}
+    font-size: 18px;
+    color: #333333;
 
-.card_1_box_only {
-    display: block;
+    p {
+        line-height: 35px;
+    }
 }
 
+
 .box_1_head {
     height: 67px;
     background: #F7FBFE;
@@ -342,6 +344,7 @@ section {
         color: #999;
         font-size: 12px;
         margin-top: 5px;
+        text-align: center;
     }
 
     .img_li_1_a:hover .img_li_1_dot2 {
@@ -368,4 +371,79 @@ section {
 
 @media screen and (max-width:599px) {}
 
-@media screen and (max-width:320px) {}
+@media screen and (max-width:320px) {}
+
+//导航条
+.breadcrumb {
+    width: 100%;
+    height: 22px;
+    padding-bottom: 30px;
+    border-bottom: 1px solid #ccc;
+    font-family: Microsoft YaHei, Microsoft YaHei;
+    font-weight: 400;
+    font-size: 20px;
+    color: #666666;
+    line-height: 23px;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+    margin-top: 20px;
+
+    :deep(.el-breadcrumb) {
+        display: inline-block;
+        vertical-align: -4px;
+    }
+
+    :deep(.el-breadcrumb__inner a),
+    :deep(.el-breadcrumb__inner.is-link) {
+        color: #666666;
+        font-weight: 400;
+        text-decoration: none;
+        transition: var(--el-transition-color);
+    }
+
+    span {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+
+    span:hover {
+        color: #666666;
+    }
+
+    .location {
+        margin-right: 20px;
+        width: 100px;
+        height: 22px;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+}
+
+.supply_art_box_img {
+    img {
+        width: 210px;
+        height: 210px;
+        margin-right: 30px;
+    }
+
+}
+
+// .allInfo {
+//     font-size: 14px;
+//     color: #255590;
+//     margin-top: 20px;
+//     margin-bottom: 20px;
+// }

+ 10 - 6
assets/css/shop/goodsDetail1.less

@@ -119,7 +119,7 @@ section {
 }
 
 .index_main {
-    margin: 0 auto 444px;
+    margin: 0 auto 30px;
 }
 
 .slow_6 {
@@ -186,9 +186,10 @@ section {
     height: 330px;
 }
 
-.index_2_right {
-    float: right;
-    width: 540px;
+.index_2_left {
+    float: left;
+    margin-left: 20px;
+    width: 850px;
 }
 
 .index_2_h4 {
@@ -217,7 +218,7 @@ section {
 
 .index_2_li {
     display: flex;
-    margin-bottom: 19px;
+    margin-bottom: 11px;
 
     .index_2_li_label {
         line-height: 21px;
@@ -254,7 +255,7 @@ section {
     }
 
     .shop_head_1_name:nth-of-type(1) {
-        background: url(../public/img/3.png) no-repeat left center;
+        background: url(@/public/img/3.png) no-repeat left center;
         background-size: 12px 18px;
     }
 }
@@ -409,11 +410,13 @@ section {
 }
 
 .shop_ul_img_2 {
+    height: 260px;
     width: 252px;
     margin: 20px auto 0px;
 }
 
 .shop_li_img_2 {
+    width: 252px;
     height: 22px;
     margin-bottom: 22px;
 
@@ -469,6 +472,7 @@ section {
 }
 
 .shop_li_img_2:nth-of-type(1) .shop_li_img_2_right {
+    width: 252px;
     height: auto;
     display: flex;
     border-bottom: solid 1px #E9E9E9;

+ 110 - 2
assets/css/shop/goodsList.less

@@ -128,7 +128,7 @@ section {
 
 .index_main {
     width: 1200px;
-    margin: 0px auto 440px;
+    margin: 0px auto 30px;
 }
 
 .banner_1 {
@@ -316,6 +316,7 @@ section {
     width: 588px;
     box-sizing: border-box;
     padding: 0px 9px;
+    min-height: 175px;
 
     .img_li_1 {
         float: left;
@@ -345,6 +346,7 @@ section {
         color: #999;
         font-size: 12px;
         margin-top: 5px;
+        text-align: center;
     }
 
     .img_li_1_a:hover .img_li_1_dot2 {
@@ -396,6 +398,7 @@ section {
     margin: 20px auto 0px;
     box-sizing: border-box;
     padding: 0px 7px;
+    min-height: 175px;
 
     .img_li_2 {
         float: left;
@@ -425,6 +428,7 @@ section {
         color: #999;
         font-size: 12px;
         margin-top: 5px;
+        text-align: center;
     }
 
     .img_li_2_a:hover .img_li_2_dot2 {
@@ -444,6 +448,12 @@ section {
     margin-top: 30px;
 }
 
+.index_4,
+.index_5,
+.index_6 {
+    margin-top: 30px;
+}
+
 /* 三农市场网-商城-商品列表 */
 .categ_table {
     .categ_table_head_box {
@@ -607,4 +617,102 @@ section {
 
 @media screen and (max-width:599px) {}
 
-@media screen and (max-width:320px) {}
+@media screen and (max-width:320px) {}
+
+//导航条
+.breadcrumb {
+    width: 100%;
+    height: 22px;
+    padding-bottom: 30px;
+    border-bottom: 1px solid #ccc;
+    font-family: Microsoft YaHei, Microsoft YaHei;
+    font-weight: 400;
+    font-size: 20px;
+    color: #666666;
+    line-height: 23px;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+    margin-top: 40px;
+
+    :deep(.el-breadcrumb) {
+        display: inline-block;
+        vertical-align: -4px;
+    }
+
+    :deep(.el-breadcrumb__inner a),
+    :deep(.el-breadcrumb__inner.is-link) {
+        color: #666666;
+        font-weight: 400;
+        text-decoration: none;
+        transition: var(--el-transition-color);
+    }
+
+    span {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+
+    span:hover {
+        color: #666666;
+    }
+
+    .location {
+        margin-right: 20px;
+        width: 100px;
+        height: 22px;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+}
+
+//分页
+.pagination1 {
+    width: 1200px;
+    height: 34px;
+    margin-left: 141px;
+    display: flex;
+    justify-content: center;
+    margin: 0;
+
+    // 鼠标移入后字体颜色
+    .el-pagination::v-deep :hover {
+        color: #255590;
+    }
+
+    .el-pagination.is-background::v-deep .btn-next,
+    .el-pagination.is-background::v-deep .btn-prev {
+        width: 70px;
+        height: 34px;
+        margin: 0px 10px;
+        border-radius: 4px;
+    }
+
+    .el-pagination.is-background::v-deep .el-pager li {
+        margin: 0px 10px;
+        width: 38px;
+        height: 34px;
+        border-radius: 4px;
+    }
+
+    .el-pagination.is-background::v-deep .btn-next.is-active,
+    .el-pagination.is-background::v-deep .btn-prev.is-active,
+    .el-pagination.is-background::v-deep .el-pager li.is-active {
+        background-color: #255590;
+        color: #fff;
+    }
+
+
+}

+ 63 - 2
assets/css/shop/newsDetail.less

@@ -133,7 +133,7 @@ section {
 
 .index_main {
     width: 1200px;
-    margin: 0px auto 330px;
+    margin: 0px auto 30px;
 }
 
 .banner_1 {
@@ -178,6 +178,7 @@ section {
 .info_1_aside {
     width: 266px;
     float: right;
+    margin-top: 20px;
 }
 
 .info_ul_1 {
@@ -533,7 +534,6 @@ section {
 
 .show_1_article {
     margin-top: 60px;
-    border-bottom: solid 1px #D9D9D9;
     padding-bottom: 60px;
 }
 
@@ -542,4 +542,65 @@ section {
     font-size: 20px;
     line-height: 34px;
     margin-top: 40px;
+    border-top: solid 1px #D9D9D9;
+
+}
+
+//导航条
+.breadcrumb {
+    width: 100%;
+    height: 22px;
+    padding-bottom: 25px;
+    border-bottom: 1px solid #ccc;
+    font-family: Microsoft YaHei, Microsoft YaHei;
+    font-weight: 400;
+    font-size: 20px;
+    color: #666666;
+    line-height: 23px;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+    margin-top: 25px;
+
+    :deep(.el-breadcrumb) {
+        display: inline-block;
+        vertical-align: -4px;
+    }
+
+    :deep(.el-breadcrumb__inner a),
+    :deep(.el-breadcrumb__inner.is-link) {
+        color: #666666;
+        font-weight: 400;
+        text-decoration: none;
+        transition: var(--el-transition-color);
+    }
+
+    span {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+
+    span:hover {
+        color: #666666;
+    }
+
+    .location {
+        margin-right: 20px;
+        width: 100px;
+        height: 22px;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
 }

+ 43 - 2
assets/css/shop/newsList.less

@@ -137,7 +137,7 @@ section {
 
 .index_main {
     width: 1200px;
-    margin: 0px auto 330px;
+    margin: 0px auto 30px;
 }
 
 .shop_head_1 {
@@ -653,6 +653,7 @@ section {
 
 .index_3 {
     margin-top: 30px;
+    margin-bottom: 25px;
 }
 
 .index_3_left {
@@ -698,6 +699,7 @@ section {
 .info_1_aside {
     width: 266px;
     float: right;
+    margin-top: 55px;
 }
 
 .info_ul_1 {
@@ -1020,4 +1022,43 @@ section {
 
 @media screen and (max-width:599px) {}
 
-@media screen and (max-width:320px) {}
+@media screen and (max-width:320px) {}
+
+//分页
+.pagination {
+    width: 800px;
+    height: 34px;
+    margin-left: 141px;
+    display: flex;
+    justify-content: center;
+    margin: 0;
+
+    // 鼠标移入后字体颜色
+    .el-pagination::v-deep :hover {
+        color: #255590;
+    }
+
+    .el-pagination.is-background::v-deep .btn-next,
+    .el-pagination.is-background::v-deep .btn-prev {
+        width: 70px;
+        height: 34px;
+        margin: 0px 10px;
+        border-radius: 4px;
+    }
+
+    .el-pagination.is-background::v-deep .el-pager li {
+        margin: 0px 10px;
+        width: 38px;
+        height: 34px;
+        border-radius: 4px;
+    }
+
+    .el-pagination.is-background::v-deep .btn-next.is-active,
+    .el-pagination.is-background::v-deep .btn-prev.is-active,
+    .el-pagination.is-background::v-deep .el-pager li.is-active {
+        background-color: #255590;
+        color: #fff;
+    }
+
+
+}

+ 56 - 51
components/goods/class.vue

@@ -16,8 +16,9 @@
                             {{ pageData[0].alias }}
                         </NuxtLink>
                         <div class="shop_2_right clearfix">
-                            <a class="shop_2_a" href="" title="" v-for="(item, index) in pageData[0].children"
-                                :key="index">{{ item.alias }}</a>
+                            <a class="shop_2_a" :href="`${pageData[0].pinyin}/${item.aLIas_pinyin}/list-1.html`"
+                                :title="item.alias" v-for="(item, index) in pageData[0].children" :key="index">{{
+                                    item.alias }}</a>
                         </div>
                     </div>
                     <div class="shop_2_box clearfix">
@@ -26,8 +27,9 @@
                             {{ pageData[1].alias }}
                         </NuxtLink>
                         <div class="shop_2_right clearfix">
-                            <a class="shop_2_a" href="" title="" v-for="(item, index) in pageData[1].children"
-                                :key="index">{{ item.alias }}</a>
+                            <a class="shop_2_a" :href="`${pageData[1].pinyin}/${item.aLIas_pinyin}/list-1.html`"
+                                :title="item.alias" v-for="(item, index) in pageData[1].children" :key="index">{{
+                                    item.alias }}</a>
                         </div>
                     </div>
                 </div>
@@ -38,18 +40,20 @@
                             {{ pageData[2].alias }}
                         </NuxtLink>
                         <div class="shop_2_right clearfix">
-                            <a class="shop_2_a" href="" title="" v-for="(item, index) in pageData[2].children"
-                                :key="index">{{ item.alias }}</a>
+                            <a class="shop_2_a" :href="`${pageData[2].pinyin}/${item.aLIas_pinyin}/list-1.html`"
+                                :title="item.alias" v-for="(item, index) in pageData[2].children" :key="index">{{
+                                    item.alias }}</a>
                         </div>
                     </div>
                     <div class="shop_2_box clearfix">
-                        <NuxtLink class="shop_2_name" href="" title="" :href="`/${pageData[3].aLIas_pinyin}/index.html`"
+                        <NuxtLink class="shop_2_name" :href="`/${pageData[3].aLIas_pinyin}/index.html`"
                             :title="pageData[3].title">
                             {{ pageData[3].alias }}
                         </NuxtLink>
                         <div class="shop_2_right clearfix">
-                            <a class="shop_2_a" href="" title="" v-for="(item, index) in pageData[3].children"
-                                :key="index">{{ item.alias }}</a>
+                            <a class="shop_2_a" :href="`${pageData[3].pinyin}/${item.aLIas_pinyin}/list-1.html`"
+                                :title="item.alias" v-for="(item, index) in pageData[3].children" :key="index">{{
+                                    item.alias }}</a>
                         </div>
                     </div>
                 </div>
@@ -60,7 +64,8 @@
                     {{ pageData[4].alias }}
                 </NuxtLink>
                 <div class="shop_2_right_2 clearfix">
-                    <a class="shop_2_a_2" href="" title="" v-for="(item, index) in pageData[4].children" :key="index">
+                    <a class="shop_2_a_2" :href="`${pageData[4].pinyin}/${item.aLIas_pinyin}/list-1.html`"
+                        :title="item.alias" v-for="(item, index) in pageData[4].children" :key="index">
                         {{ item.alias }}</a>
                 </div>
             </div>
@@ -69,11 +74,12 @@
             <!-- 农产批发1 -->
             <div class="shop_3_in clearfix">
                 <div class="shop_head_2 clearfix">
-                    <div class="shop_head_2_name">{{ goodsData[0].alias }}</div>
+                    <NuxtLink class="shop_head_2_name" :href="`/${goodsData[0].aLIas_pinyin}/index.html`"
+                        :title="goodsData[0].title">{{ goodsData[0].alias }}</NuxtLink>
                 </div>
                 <div class="shop_img_ul_1 clearfix" v-if="goodsData[0].data">
                     <div class="shop_img_li_1 clearfix" v-for="(item, index) in goodsData[0].data" :key="index">
-                        <a class="shop_img_li_1_a" href="" title="">
+                        <a class="shop_img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
                             <div class="shop_img_li_1_img_box clearfix">
                                 <img class="shop_img_li_1_img" :src="item.imgurl" title="" alt="">
                             </div>
@@ -82,7 +88,7 @@
                                 <div class="shop_img_li_1_tag">
                                     {{ item.type_id == 1 ? '求购' : '供应' }}
                                 </div>
-                                <div class="shop_img_li_1_btn">查看详情</div>
+                                <a class="shop_img_li_1_btn" :href="getLinkPathDetail(item)">查看详情</a>
                             </div>
                         </a>
                     </div>
@@ -90,16 +96,17 @@
             </div>
             <div class="shop_3_in clearfix">
                 <div class="shop_head_3 clearfix">
-                    <a class="shop_head_3_more" href="" title="">栏目简介</a>
+                    <a class="shop_head_3_more" :href="`/${goodsData[0].aLIas_pinyin}/index.html`"
+                        :title="goodsData[0].title">栏目简介</a>
                 </div>
                 <div class="shop_ul_1 clearfix" v-if="goodsData[0].data1.length > 0">
                     <div class="shop_li_1 clearfix" v-for="(item, index) in goodsData[0].data1" :key="index">
-                        <a class="shop_li_1_a" href="" title="">
+                        <a class="shop_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
                             <div class="shop_li_1_left">
                                 <h4 class="shop_li_1_h4 dot1">{{ item.name }}</h4>
                                 <div class="shop_li_1_text dot1">{{ item.description }}</div>
                             </div>
-                            <div class="shop_li_1_btn">查看详情</div>
+                            <a class="shop_li_1_btn" :href="getLinkPathDetail(item)">查看详情</a>
                         </a>
                     </div>
                 </div>
@@ -161,6 +168,7 @@
                 <img class="banner_1_img" src="@/public/img/6.png" title="" alt="">
             </a>
         </div>
+        <!-- 资讯 -->
         <section class="shop_5 clearfix">
             <!-- 农产动态 1-->
             <div class="shop_5_left clearfix">
@@ -176,13 +184,11 @@
                 <div class="shop_box_1 clearfix">
                     <div class="shop_img_ul_4 clearfix">
                         <div class="shop_img_li_4 clearfix">
-                            <NuxtLink class="shop_img_li_4_a"
-                                :href="`/${newsData[0].data.pinyin}/${newsData[0].data.id}.html`"
-                                :title="newsData[0].data.title">
-                                <img class="shop_img_li_4_img" :src="newsData[0].data.imgurl"
-                                    :title="newsData[0].data.title" alt="">
+                            <NuxtLink class="shop_img_li_4_a" :href="getLinkPathDetail(item)"
+                                v-for="(item, index) in newsData[0].data" :title="item.title" :key="index">
+                                <img class="shop_img_li_4_img" :src="item.imgurl" :title="item.title" alt="">
                                 <div class="shop_img_li_4_rgba clearfix dot1">
-                                    {{ newsData[0].data.alias }}
+                                    {{ item.title }}
                                 </div>
                             </NuxtLink>
                         </div>
@@ -193,7 +199,7 @@
                                 :title="item.title">
                                 <img class="shop_img_li_5_img" :src="item.imgurl" :title="item.title" alt="">
                                 <div class="shop_img_li_5_rgba clearfix dot1">
-                                    {{ item.alias }}
+                                    {{ item.title }}
                                 </div>
                             </NuxtLink>
                         </div>
@@ -203,7 +209,7 @@
                     <div class="shop_ul_2 clearfix">
                         <NuxtLink class="shop_li_2 clearfix dot1" :href="`/${item.pinyin}/${item.id}.html`"
                             :title="item.title" v-for="(item, index) in newsData[0].data2" :key="index">
-                            {{ item.alias }}
+                            {{ item.title }}
                         </NuxtLink>
                     </div>
                 </div>
@@ -222,12 +228,11 @@
                 </div>
                 <div class="shop_img_ul_6 clearfix">
                     <div class="shop_img_li_6 clearfix">
-                        <NuxtLink class="shop_img_li_6_a"
-                            :href="`/${newsData[1].data.pinyin}/${newsData[1].data.id}.html`"
-                            :title="newsData[1].data.title">
-                            <img class="shop_img_li_6_img" :src="newsData[1].data.imgurl" title="" alt="">
+                        <NuxtLink class="shop_img_li_6_a" :href="getLinkPathDetail(item)"
+                            v-for="(item, index) in newsData[1].data" :key="index" :title="item.title">
+                            <img class="shop_img_li_6_img" :src="item.imgurl" title="" alt="">
                             <div class="shop_img_li_6_rgba clearfix dot1">
-                                {{ newsData[1].data.alias }}
+                                {{ item.title }}
                             </div>
                         </NuxtLink>
                     </div>
@@ -235,7 +240,7 @@
                 <div class="shop_ul_3 clearfix">
                     <NuxtLink class="shop_li_3 dot1" :href="`/${item.pinyin}/${item.id}.html`" :title="item.title"
                         v-for="(item, index) in newsData[1].data2" :key="index">
-                        {{ item.alias }}
+                        {{ item.title }}
                     </NuxtLink>
                 </div>
             </div>
@@ -256,13 +261,11 @@
                 <div class="shop_box_3 clearfix">
                     <div class="shop_img_ul_7 clearfix">
                         <div class="shop_img_li_7 clearfix">
-                            <NuxtLink class="shop_img_li_7_a"
-                                :href="`/${newsData[2].data.pinyin}/${newsData[2].data.id}.html`"
-                                :title="newsData[2].data.title">
-                                <img class="shop_img_li_7_img" :src="newsData[2].data.imgurl"
-                                    :title="newsData[2].data.title" alt="">
+                            <NuxtLink class="shop_img_li_7_a" :href="getLinkPathDetail(item)"
+                                v-for="(item, index) in newsData[2].data" :key="index" :title="item.title">
+                                <img class="shop_img_li_7_img" :src="item.imgurl" :title="item.title" alt="">
                                 <div class="shop_img_li_7_rgba clearfix dot1">
-                                    {{ newsData[2].data.alias }}
+                                    {{ item.title }}
                                 </div>
                             </NuxtLink>
                         </div>
@@ -272,7 +275,7 @@
                     <div class="shop_ul_4 clearfix">
                         <NuxtLink :href="`/${item.pinyin}/${item.id}.html`" :title="item.title"
                             class="shop_li_4 clearfix dot1" v-for="(item, index) in newsData[2].data2" :key="index">
-                            {{ item.alias }}
+                            {{ item.title }}
                         </NuxtLink>
                     </div>
                 </div>
@@ -296,7 +299,7 @@
                                 :title="item.title">
                                 <img class="shop_img_li_8_img" :src="item.imgurl" title="" alt="">
                                 <div class="shop_img_li_8_rgba clearfix dot1">
-                                    {{ item.alias }}
+                                    {{ item.title }}
                                 </div>
                             </NuxtLink>
                         </div>
@@ -308,7 +311,7 @@
                             <div class="shop_li_5_in clearfix">
                                 <NuxtLink class="shop_li_5_a dot2" :href="`/${item.pinyin}/${item.id}.html`"
                                     :title="item.title">
-                                    {{ item.alias }}
+                                    {{ item.title }}
                                 </NuxtLink>
                             </div>
                         </div>
@@ -317,17 +320,13 @@
             </div>
             <!-- 农产商机2 -->
         </section>
-        <div class="banner_2 clearfix">
-            <a class="banner_2_a" href="" title=""><img class="banner_2_img" src="@/public/img/15.png" title=""
-                    alt=""></a>
-        </div>
     </main>
     <HomeFoot></HomeFoot>
 </template>
 <script setup>
 import { NuxtLink } from '#components';
 import { ref } from 'vue'
-// import { ElRadio, ElRadioGroup } from 'element-plus'
+import { ElRadio, ElRadioGroup, ElMessage } from 'element-plus'
 //1.获得路由id start ---------------------------------------->
 const targetSegment = getRoutePath(1);
 //1.1 获得当前的路由id
@@ -456,6 +455,7 @@ try {
                 aLIas_pinyin: targetSegment + "/" + navigateData.data[index].aLIas_pinyin,
                 children: navigateData.data[index].children,
                 type: navigateData.data[index].type,
+                pinyin: navigateData.data[index].aLIas_pinyin,
                 data: [],
                 data1: [],
                 data2: [],
@@ -482,9 +482,9 @@ try {
                 pageData.value.push(data);
             }
         }
-        console.log("导航池11111122222", pageData.value);
-        console.log("导航池11111133333", goodsData.value);
-        console.log("导航池11111144444", newsData.value);
+        console.log("导航池11111pageData", pageData.value);
+        console.log("导航池11111goods", goodsData.value);
+        console.log("导航池11111newsData", newsData.value);
 
         //导航池加载完毕,开始申请模块数据
         let getJson = [
@@ -505,6 +505,7 @@ try {
             }
         }
         let jsonString = JSON.stringify(getJson);
+        console.log('jsonString', jsonString);
         getPageAllData(jsonString);
 
         let goodsJson = [
@@ -543,7 +544,7 @@ async function getPageGoodsAllData(goodsJsonString) {
     if (mkdata.code == 200) {
         //模块1
         for (let index in mkdata.data[0]) {
-            console.log("获取商品数据", index, mkdata.data[0][index]);
+            // console.log("获取商品数据", index, mkdata.data[0][index]);
             if (index < 4) {
                 goodsData.value[0].data.push(mkdata.data[0][index]);
             } else {
@@ -551,8 +552,12 @@ async function getPageGoodsAllData(goodsJsonString) {
             }
         }
         //模块2
-        goodsData.value[1].data = mkdata.data[1];
-        goodsData.value[2].data = mkdata.data[2];
+        if (mkdata.length > 1) {
+            goodsData.value[1].data = mkdata.data[1];
+        }
+        if (mkdata.length > 2) {
+            goodsData.value[2].data = mkdata.data[2];
+        }
         console.log("获取商品数据111111", goodsData.value);
     }
 }
@@ -565,7 +570,7 @@ async function getPageAllData(jsonString) {
             'id': jsonString
         },
     });
-    // console.log("获取资讯数据11111111111", mkdata.data);
+    console.log("获取资讯数据11111111111222222", mkdata);
 
     if (mkdata.code == 200) {
         //模块1 顶部大图和列表

+ 549 - 0
components/goods/detail.vue

@@ -0,0 +1,549 @@
+<template>
+    <!-- goods -->
+    <div class="goods">
+        <main class="index_main" v-if="shopType == 1">
+            <section class="index_1 clearfix">
+                <div class="breadcrumb">
+                    <div class="inner">
+                        <span class="location">当前位置 :</span>
+                        <el-breadcrumb :separator-icon="ArrowRight">
+                            <el-breadcrumb-item>
+                                <NuxtLink to="/">首页</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item v-if="p_parent_name != ''">
+                                <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item v-if="parent_name != ''">
+                                <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
+                                </NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item>
+                                <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`">
+                                    {{ navTitle }}
+                                </NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item>
+                                {{ routeNewsTtitle }}
+                            </el-breadcrumb-item>
+                        </el-breadcrumb>
+                    </div>
+                </div>
+            </section>
+            <section class="index_2 clearfix">
+                <img class="index_2_img" :src="shopImg" :title="newsDetail.name" alt="">
+                <div class="index_2_left">
+                    <h4 class="index_2_h4 dot1">{{ newsDetail.name }}</h4>
+                    <div class="index_2_title_box clearfix">
+                        <time class="index_2_title"> 更新日期:{{ newsDetail.updated_at }}</time>
+                        <span class="index_2_title">浏览次数:{{ newsDetail.hits }}</span>
+                    </div>
+                    <div class="index_2_ul clearfix">
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">公 司 名</label>
+                            <span class="index_2_li_text "> {{ newsDetail.com }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">所 在 地</label>
+                            <span class="index_2_li_text ">{{ newsDetail.address }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">联 系 人</label>
+                            <span class="index_2_li_text ">{{ newsDetail.contact }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">产品单价</label>
+
+                            <span class="index_2_li_text">
+                                {{ newsDetail.price }}
+                                元/
+                                {{ newsDetail.unit }}
+                            </span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">最小定量</label>
+                            <span class="index_2_li_text ">{{ newsDetail.min }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">供货总量</label>
+                            <span class="index_2_li_text ">{{ newsDetail.max }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">有 效 期</label>
+                            <span class="index_2_li_text ">{{ getTime(newsDetail.validity, 'year', 1) }}</span>
+                        </div>
+                    </div>
+                </div>
+            </section>
+            <!-- 选项卡1 -->
+            <section class="index_3 clearfix">
+                <div class="shop_head_1 clearfix">
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 1 }"
+                        @mouseover="supply_num = 1">详情信息</div>
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 2 }"
+                        @mouseover="supply_num = 2">联系方式</div>
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 3 }"
+                        @mouseover="supply_num = 3">图片展示</div>
+                </div>
+                <div class="card_out clearfix">
+                    <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 1" v-html="newsDetail.detail">
+                    </div>
+                    <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 2">
+                        <p class="supply_art_box_p">公司名称:{{ newsDetail.com }}</p>
+                        <p class="supply_art_box_p">电子邮箱:{{ newsDetail.email }}</p>
+                        <p class="supply_art_box_p">邮政编码:{{ newsDetail.postal }}</p>
+                        <p class="supply_art_box_p">联系地址:{{ newsDetail.address }}</p>
+                    </div>
+                    <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 3">
+                        <div class="supply_art_box_img">
+                            <img :src="item" v-for="item in newsDetail.imgurl">
+                        </div>
+                    </div>
+                </div>
+            </section>
+            <!-- 选项卡2 -->
+            <section class="index_4 clearfix">
+                <div class="box_1 clearfix">
+                    <div class="box_1_head">
+                        <div class="box_1_head_name">点击排行</div>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in pageData1" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
+                                </div>
+                                <div class="img_li_1_dot2">{{ item.name }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+                <div class="box_1 clearfix">
+                    <div class="box_1_head">
+                        <div class="box_1_head_name">最新商机</div>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in pageData2" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
+                                </div>
+                                <div class="img_li_1_dot2">{{ item.name }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+            </section>
+        </main>
+
+        <main class="index_main" v-if="shopType == 2">
+            <section class=" clearfix">
+                <div class="index_out_1_left clearfix">
+                    <section class="index_1 clearfix">
+                        <div class="breadcrumb">
+                            <div class="inner">
+                                <span class="location">当前位置 :</span>
+                                <el-breadcrumb :separator-icon="ArrowRight">
+                                    <el-breadcrumb-item>
+                                        <NuxtLink to="/">首页</NuxtLink>
+                                    </el-breadcrumb-item>
+                                    <el-breadcrumb-item v-if="p_parent_name != ''">
+                                        <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
+                                    </el-breadcrumb-item>
+                                    <el-breadcrumb-item v-if="parent_name != ''">
+                                        <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`">
+                                            {{ parent_name }}
+                                        </NuxtLink>
+                                    </el-breadcrumb-item>
+                                    <el-breadcrumb-item>
+                                        <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`">
+                                            {{ navTitle }}
+                                        </NuxtLink>
+                                    </el-breadcrumb-item>
+                                    <el-breadcrumb-item>
+                                        {{ routeNewsTtitle }}
+                                    </el-breadcrumb-item>
+                                </el-breadcrumb>
+                            </div>
+                        </div>
+                    </section>
+                    <section class="index_2 clearfix">
+                        <img class="index_2_img" :src="shopImg" :title="newsDetail.name" alt="">
+                        <div class="index_2_right">
+                            <h4 class="index_2_h4 dot1">求购:{{ newsDetail.name }}</h4>
+                            <div class="index_2_ul clearfix">
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">发布日期</label>
+                                    <span class="index_2_li_text">{{ getTime(newsDetail.updated_at, 'year', 1) }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">截止日期</label>
+                                    <span class="index_2_li_text">{{ getTime(newsDetail.validity, 'year', 1) }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">浏览次数</label>
+                                    <span class="index_2_li_text">{{ newsDetail.hits }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">联 系 人</label>
+                                    <span class="index_2_li_text">{{ newsDetail.contact }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">发布地区</label>
+                                    <span class="index_2_li_text">{{ newsDetail.address }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">座 机</label>
+                                    <span class="index_2_li_text">{{ newsDetail.landline }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">联系电话</label>
+                                    <span class="index_2_li_text">{{ newsDetail.phone }}</span>
+                                </div>
+                            </div>
+                        </div>
+                    </section>
+                </div>
+                <div class="shop_3_right clearfix">
+                    <div class="choice_1_box clearfix">
+                        <div class="choice_1_btn_box clearfix">
+                            <div class="choice_1_btn" :class="{ choice_1_btn_only: supply_buy == 1 }"
+                                @mouseover="supply_buy = 1">
+                                <span class="choice_1_btn_a" title="供应商品">供应商品</span>
+                            </div>
+                            <div class="choice_1_btn " :class="{ choice_1_btn_only: supply_buy == 2 }"
+                                @mouseover="supply_buy = 2">
+                                <a class="choice_1_btn_a" title="求购商品">求购商品</a>
+                            </div>
+                        </div>
+                        <div class="choice_1_card_box">
+                            <!-- 供应商品 -->
+                            <div class="shop_ul_img_2 choice_1_card clearfix" v-show="supply_buy == 1">
+                                <div class="shop_li_img_2" v-for="(item, index) in pageData3" :key="index">
+                                    <NuxtLink class="shop_li_img_2_a" :href="getLinkPathDetail(item)"
+                                        :title="item.name">
+                                        <div class="shop_li_img_2_num"> {{ index + 1 }} </div>
+                                        <div class="shop_li_img_2_right clearfix">
+                                            <img class="shop_li_img_2_img" :src="item.imgurl" :title="item.name" alt="">
+                                            <div class="shop_li_img_2_text">
+                                                {{ item.name }}
+                                            </div>
+                                        </div>
+                                    </NuxtLink>
+                                </div>
+                            </div>
+                            <!-- 供应商品 -->
+                            <!-- 求购商品 -->
+                            <div class="shop_ul_img_2 choice_1_card clearfix" v-show="supply_buy == 2">
+                                <div class="shop_li_img_2" v-for="(item, index) in pageData4" :key="index">
+                                    <NuxtLink class="shop_li_img_2_a" :href="getLinkPathDetail(item)"
+                                        :title="item.name">
+                                        <div class="shop_li_img_2_num"> {{ index + 1 }} </div>
+                                        <div class="shop_li_img_2_right clearfix">
+                                            <img class="shop_li_img_2_img" :src="item.imgurl" :title="item.name" alt="">
+                                            <div class="shop_li_img_2_text">
+                                                {{ item.name }}
+                                            </div>
+                                        </div>
+                                    </NuxtLink>
+                                </div>
+                            </div>
+                            <!-- 求购商品 -->
+                        </div>
+                    </div>
+                </div>
+            </section>
+            <!-- 选项卡1 -->
+            <section class="index_3 clearfix">
+                <div class="shop_head_1 clearfix">
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: buy_num == 1 }"
+                        @mouseover="buy_num = 1">详情信息</div>
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: buy_num == 2 }"
+                        @mouseover="buy_num = 2">发布人信息</div>
+                </div>
+                <div class="card_out clearfix">
+                    <div class="card_1_box clearfix card_1_box_only" v-show="buy_num == 1" v-html="newsDetail.detail">
+                    </div>
+                    <div class="card_1_box clearfix card_1_box_only" v-show="buy_num == 2">
+                        <P>公司名称:{{ newsDetail.com }}</P>
+                        <P>电子邮箱:{{ newsDetail.email }}</P>
+                        <P>邮政编码:{{ newsDetail.postal }}</P>
+                        <P>联系地址:{{ newsDetail.address }}</P>
+                    </div>
+                </div>
+            </section>
+            <!-- 选项卡2 -->
+            <section class="index_4 clearfix">
+                <div class="box_1 clearfix">
+                    <div class="box_1_head">
+                        <div class="box_1_head_name">点击排行</div>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in pageData1" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
+                                </div>
+                                <div class="img_li_1_dot2">{{ item.name }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+                <div class="box_1 clearfix">
+                    <div class="box_1_head">
+                        <div class="box_1_head_name">最新商机</div>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in pageData2" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
+                                </div>
+                                <div class="img_li_1_dot2">{{ item.name }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+            </section>
+        </main>
+    </div>
+</template>
+
+<script setup>
+//0.页面依赖 start ---------------------------------------->
+import { onMounted, ref } from 'vue'
+import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox, ElCheckboxGroup, ElMessage, ElInput } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+//0.页面依赖 end ---------------------------------------->
+
+//1.获得路由id start ---------------------------------------->
+const route = useRoute();
+const articleId = parseInt(route.params.id);
+const targetSegment = getRoutePath(1);
+const targetSegment1 = getRoutePath(2);
+const targetSegment2 = getRoutePath(3);
+const supply_num = ref(1)
+const buy_num = ref(1)
+const supply_buy = ref(1)
+
+//1.1 获得当前的路由id
+let routeId;
+let routeType;
+let navTitle = ref('')//二级导航标题
+let navCid = ref('')//二级导航id
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment2,
+    },
+});
+console.log("getRouteId", getRouteId);
+
+if (getRouteId.code == 200) {
+    navTitle.value = getRouteId.data.alias
+    navCid.value = getRouteId.data.category_id
+} else {
+    console.log("获得路由id出错!", getRouteId.message)
+}
+//1.2 获取二级栏目
+let parent_name = ref('');//父级名称
+let parent_id = ref('');//父级id
+let parent_pinyin = ref('');//父级拼音
+const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment1,
+    },
+});
+console.log("getRoutePName", getRoutePName);
+
+if (getRoutePName.code == 200) {
+    routeId = getRoutePName.data.category_id
+    parent_id.value = getRoutePName.data.category_id
+    parent_name.value = getRoutePName.data.alias
+    routeType = getRoutePName.data.type
+} else {
+    console.log("获得路由id出错!", getRoutePName.message)
+}
+//1.3 获取一级栏目
+let p_parent_name = ref('');//父级名称
+let p_parent_id = ref('');//父级id
+let p_parent_pinyin = ref('');//父级拼音
+const getRoutePName_parent = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+console.log("getRoutePName_parent", getRoutePName_parent);
+
+if (getRoutePName_parent.code == 200) {
+    p_parent_id.value = getRoutePName_parent.data.category_id
+    p_parent_name.value = getRoutePName_parent.data.alias
+    // p_parent_pinyin.value = getRoutePName_parent.data.aLIas_pinyin
+} else {
+    console.log("获得路由id出错!", getRoutePName_parent.message)
+}
+//1.4 获取某个栏目
+const getParentId = await requestDataPromise('/web/getOneWebsiteCategory', {
+    method: 'GET',
+    query: {
+        'catid': parent_id.value,
+    },
+});
+console.log("getParentId", getParentId);
+
+if (getParentId.code == 200) {
+    parent_pinyin.value = getParentId.data.aLIas_pinyin
+} else {
+    console.log("获得路由id出错!", getParentId.message)
+}
+//1.获得路由id end ---------------------------------------->
+
+//2.获得模块数据 start ---------------------------------------->
+const pageData1 = ref([])//点击排行
+const pageData2 = ref([])//最新商机
+const pageData3 = ref([])//供应商品
+const pageData4 = ref([])//求购商品
+
+//创建请求数据json
+let getJson = [
+    { "level": "3,0,8" },//点击排行
+    { "level": "4,0,8" },//最新商机
+    { "level": "5,0,6" },//供应商品
+    { "level": "6,0,6" },//求购商品
+]
+let jsonString = JSON.stringify(getJson)
+
+//获取所有数据
+async function getPageAllData() {
+    const mkdata = await requestDataPromise('/web/getWebsiteshop', {
+        method: 'GET',
+        query: {
+            'id': jsonString,
+            'catid': 713,
+        },
+    });
+    if (mkdata.code == 200) {
+        //点击排行
+        pageData1.value = mkdata.data.goods[0];
+        //最新商机
+        pageData2.value = mkdata.data.goods[1];
+        //供应商品
+        pageData3.value = mkdata.data.goods[2];
+        //求购商品
+        pageData4.value = mkdata.data.goods[3];
+    } else {
+        ElMessage.error(mkdata.message)
+    }
+}
+getPageAllData();
+
+//2.获得模块数据 end ---------------------------------------->
+
+
+//4.新闻详情 start ---------------------------------------->
+//4.1 资讯详情
+const newsDetail = ref({})
+const routeNewsTtitle = ref("");
+//4.2 发布日期
+const time = ref("");
+//4.3 路径
+const routLevelTitle = ref("");
+const routLevelId = ref("");
+//4.4 是否展示投票
+const articleChoice = ref(false);
+//4.5 获取详情
+let shopImg = ref('')
+let shopType = ref(1)
+async function getPageData() {
+    const mkdata = await requestDataPromise('/web/getWebsiteshopInfo', {
+        method: 'GET',
+        query: {
+            'id': articleId
+        },
+    });
+    if (mkdata.code == 200) {
+        //判断是否显示投票
+        if (mkdata.data.is_survey == 1) {
+            console.log("本篇文章含有投票!")
+            articleChoice.value = true;
+        }
+        //获取内容
+        newsDetail.value = mkdata.data;
+        shopType.value = mkdata.data.type_id
+        //获取路径
+        routLevelTitle.value = newsDetail.value.cat_name;
+        routLevelId.value = newsDetail.value.category_id;
+        shopImg.value = mkdata.data.imgurl[0]
+        //获取发布时间
+        time.value = newsDetail.value.updated_at.split(' ')[0];
+        //修正标题长度
+        if (newsDetail.value.name.length >= 20) {
+            routeNewsTtitle.value = newsDetail.value.name.substr(0, 20) + "...";
+        } else {
+            routeNewsTtitle.value = newsDetail.value.name
+        }
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情内容")
+        console.log("后端错误反馈:", mkdata.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+getPageData();
+//4.新闻详情 end ---------------------------------------->
+
+
+//6.设置seo信息 start---------------------------------------->
+const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
+    method: 'GET',
+    query: {
+        'catid': routeId
+    },
+});
+
+if (setData.code == 200) {
+    let seoTitle = setData.data.seo_title;
+    let seoDescription = setData.data.seo_description;
+    let seoKeywords = setData.data.seo_keywords;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoSuffix,
+        meta: [
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+        ]
+    });
+} else {
+    console.log("设置频道页SEO出错!", setData.message)
+}
+//6.设置seo信息 end---------------------------------------->
+
+//8.页面图片放大 start---------------------------------------->
+const previewVisible = ref(false)
+const selectedImage = ref(' ')
+
+const openPreview = (event) => {
+    if (event.target.tagName === 'IMG') {
+        selectedImage.value = event.target.src;
+        previewVisible.value = true;
+    }
+}
+const closePreview = () => {
+    previewVisible.value = false;
+}
+//8.页面图片放大 end---------------------------------------->
+</script>
+
+
+<style lang="less" scoped>
+@import url('@/assets/css/shop/goodsDetail.less');
+@import url('@/assets/css/shop/goodsDetail1.less');
+</style>

+ 539 - 0
components/goods/detail_sec.vue

@@ -0,0 +1,539 @@
+<template>
+    <!-- goods -->
+    <div class="goods">
+        <main class="index_main" v-if="shopType == 1">
+            <section class="index_1 clearfix">
+                <div class="breadcrumb">
+                    <div class="inner">
+                        <span class="location">当前位置 :</span>
+                        <el-breadcrumb :separator-icon="ArrowRight">
+                            <el-breadcrumb-item>
+                                <NuxtLink to="/">首页</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item v-if="p_parent_name != ''">
+                                <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item v-if="parent_name != ''">
+                                <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
+                                </NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item>
+                                {{ routeNewsTtitle }}
+                            </el-breadcrumb-item>
+                        </el-breadcrumb>
+                    </div>
+                </div>
+            </section>
+            <section class="index_2 clearfix">
+                <img class="index_2_img" :src="shopImg" :title="newsDetail.name" alt="">
+                <div class="index_2_left">
+                    <h4 class="index_2_h4 dot1">{{ newsDetail.name }}</h4>
+                    <div class="index_2_title_box clearfix">
+                        <time class="index_2_title"> 更新日期:{{ newsDetail.updated_at }}</time>
+                        <span class="index_2_title">浏览次数:{{ newsDetail.hits }}</span>
+                    </div>
+                    <div class="index_2_ul clearfix">
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">公 司 名</label>
+                            <span class="index_2_li_text "> {{ newsDetail.com }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">所 在 地</label>
+                            <span class="index_2_li_text ">{{ newsDetail.address }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">联 系 人</label>
+                            <span class="index_2_li_text ">{{ newsDetail.contact }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">产品单价</label>
+
+                            <span class="index_2_li_text">
+                                {{ newsDetail.price }}
+                                元/
+                                {{ newsDetail.unit }}
+                            </span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">最小定量</label>
+                            <span class="index_2_li_text ">{{ newsDetail.min }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">供货总量</label>
+                            <span class="index_2_li_text ">{{ newsDetail.max }}</span>
+                        </div>
+                        <div class="index_2_li clearfix">
+                            <label class="index_2_li_label">有 效 期</label>
+                            <span class="index_2_li_text ">{{ getTime(newsDetail.validity, 'year', 1) }}</span>
+                        </div>
+                    </div>
+                </div>
+            </section>
+            <!-- 选项卡1 -->
+            <section class="index_3 clearfix">
+                <div class="shop_head_1 clearfix">
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 1 }"
+                        @mouseover="supply_num = 1">详情信息</div>
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 2 }"
+                        @mouseover="supply_num = 2">联系方式</div>
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 3 }"
+                        @mouseover="supply_num = 3">图片展示</div>
+                </div>
+                <div class="card_out clearfix">
+                    <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 1" v-html="newsDetail.detail">
+                    </div>
+                    <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 2">
+                        <p class="supply_art_box_p">公司名称:{{ newsDetail.com }}</p>
+                        <p class="supply_art_box_p">电子邮箱:{{ newsDetail.email }}</p>
+                        <p class="supply_art_box_p">邮政编码:{{ newsDetail.postal }}</p>
+                        <p class="supply_art_box_p">联系地址:{{ newsDetail.address }}</p>
+                    </div>
+                    <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 3">
+                        <div class="supply_art_box_img">
+                            <img :src="item" v-for="item in newsDetail.imgurl">
+                        </div>
+                    </div>
+                </div>
+            </section>
+            <!-- 选项卡2 -->
+            <section class="index_4 clearfix">
+                <div class="box_1 clearfix">
+                    <div class="box_1_head">
+                        <div class="box_1_head_name">点击排行</div>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in pageData1" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
+                                </div>
+                                <div class="img_li_1_dot2">{{ item.name }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+                <div class="box_1 clearfix">
+                    <div class="box_1_head">
+                        <div class="box_1_head_name">最新商机</div>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in pageData2" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
+                                </div>
+                                <div class="img_li_1_dot2">{{ item.name }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+            </section>
+        </main>
+
+        <main class="index_main" v-if="shopType == 2">
+            <section class=" clearfix">
+                <div class="index_out_1_left clearfix">
+                    <section class="index_1 clearfix">
+                        <div class="breadcrumb">
+                            <div class="inner">
+                                <span class="location">当前位置 :</span>
+                                <el-breadcrumb :separator-icon="ArrowRight">
+                                    <el-breadcrumb-item>
+                                        <NuxtLink to="/">首页</NuxtLink>
+                                    </el-breadcrumb-item>
+                                    <el-breadcrumb-item v-if="p_parent_name != ''">
+                                        <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
+                                    </el-breadcrumb-item>
+                                    <el-breadcrumb-item v-if="parent_name != ''">
+                                        <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`">
+                                            {{ parent_name }}
+                                        </NuxtLink>
+                                    </el-breadcrumb-item>
+                                    <el-breadcrumb-item>
+                                        {{ routeNewsTtitle }}
+                                    </el-breadcrumb-item>
+                                </el-breadcrumb>
+                            </div>
+                        </div>
+                    </section>
+                    <section class="index_2 clearfix">
+                        <img class="index_2_img" :src="shopImg" :title="newsDetail.name" alt="">
+                        <div class="index_2_right">
+                            <h4 class="index_2_h4 dot1">求购:{{ newsDetail.name }}</h4>
+                            <div class="index_2_ul clearfix">
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">发布日期</label>
+                                    <span class="index_2_li_text">{{ getTime(newsDetail.updated_at, 'year', 1) }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">截止日期</label>
+                                    <span class="index_2_li_text">{{ getTime(newsDetail.validity, 'year', 1) }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">浏览次数</label>
+                                    <span class="index_2_li_text">{{ newsDetail.hits }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">联 系 人</label>
+                                    <span class="index_2_li_text">{{ newsDetail.contact }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">发布地区</label>
+                                    <span class="index_2_li_text">{{ newsDetail.address }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">座 机</label>
+                                    <span class="index_2_li_text">{{ newsDetail.landline }}</span>
+                                </div>
+                                <div class="index_2_li clearfix">
+                                    <label class="index_2_li_label">联系电话</label>
+                                    <span class="index_2_li_text">{{ newsDetail.phone }}</span>
+                                </div>
+                            </div>
+                        </div>
+                    </section>
+                </div>
+                <div class="shop_3_right clearfix">
+                    <div class="choice_1_box clearfix">
+                        <div class="choice_1_btn_box clearfix">
+                            <div class="choice_1_btn" :class="{ choice_1_btn_only: supply_buy == 1 }"
+                                @mouseover="supply_buy = 1">
+                                <span class="choice_1_btn_a" title="供应商品">供应商品</span>
+                            </div>
+                            <div class="choice_1_btn " :class="{ choice_1_btn_only: supply_buy == 2 }"
+                                @mouseover="supply_buy = 2">
+                                <a class="choice_1_btn_a" title="求购商品">求购商品</a>
+                            </div>
+                        </div>
+                        <div class="choice_1_card_box">
+                            <!-- 供应商品 -->
+                            <div class="shop_ul_img_2 choice_1_card clearfix" v-show="supply_buy == 1">
+                                <div class="shop_li_img_2" v-for="(item, index) in pageData3" :key="index">
+                                    <NuxtLink class="shop_li_img_2_a" :href="getLinkPathDetail(item)"
+                                        :title="item.name">
+                                        <div class="shop_li_img_2_num"> {{ index + 1 }} </div>
+                                        <div class="shop_li_img_2_right clearfix">
+                                            <img class="shop_li_img_2_img" :src="item.imgurl" :title="item.name" alt="">
+                                            <div class="shop_li_img_2_text">
+                                                {{ item.name }}
+                                            </div>
+                                        </div>
+                                    </NuxtLink>
+                                </div>
+                            </div>
+                            <!-- 供应商品 -->
+                            <!-- 求购商品 -->
+                            <div class="shop_ul_img_2 choice_1_card clearfix" v-show="supply_buy == 2">
+                                <div class="shop_li_img_2" v-for="(item, index) in pageData4" :key="index">
+                                    <NuxtLink class="shop_li_img_2_a" :href="getLinkPathDetail(item)"
+                                        :title="item.name">
+                                        <div class="shop_li_img_2_num"> {{ index + 1 }} </div>
+                                        <div class="shop_li_img_2_right clearfix">
+                                            <img class="shop_li_img_2_img" :src="item.imgurl" :title="item.name" alt="">
+                                            <div class="shop_li_img_2_text">
+                                                {{ item.name }}
+                                            </div>
+                                        </div>
+                                    </NuxtLink>
+                                </div>
+                            </div>
+                            <!-- 求购商品 -->
+                        </div>
+                    </div>
+                </div>
+            </section>
+            <!-- 选项卡1 -->
+            <section class="index_3 clearfix">
+                <div class="shop_head_1 clearfix">
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: buy_num == 1 }"
+                        @mouseover="buy_num = 1">详情信息</div>
+                    <div class="shop_head_1_name" :class="{ shop_head_1_name_only: buy_num == 2 }"
+                        @mouseover="buy_num = 2">发布人信息</div>
+                </div>
+                <div class="card_out clearfix">
+                    <div class="card_1_box clearfix card_1_box_only" v-show="buy_num == 1" v-html="newsDetail.detail">
+                    </div>
+                    <div class="card_1_box clearfix card_1_box_only" v-show="buy_num == 2">
+                        <P>公司名称:{{ newsDetail.com }}</P>
+                        <P>电子邮箱:{{ newsDetail.email }}</P>
+                        <P>邮政编码:{{ newsDetail.postal }}</P>
+                        <P>联系地址:{{ newsDetail.address }}</P>
+                    </div>
+                </div>
+            </section>
+            <!-- 选项卡2 -->
+            <section class="index_4 clearfix">
+                <div class="box_1 clearfix">
+                    <div class="box_1_head">
+                        <div class="box_1_head_name">点击排行</div>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in pageData1" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
+                                </div>
+                                <div class="img_li_1_dot2">{{ item.name }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+                <div class="box_1 clearfix">
+                    <div class="box_1_head">
+                        <div class="box_1_head_name">最新商机</div>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in pageData2" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
+                                </div>
+                                <div class="img_li_1_dot2">{{ item.name }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+            </section>
+        </main>
+    </div>
+</template>
+
+<script setup>
+//0.页面依赖 start ---------------------------------------->
+import { onMounted, ref } from 'vue'
+import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox, ElCheckboxGroup, ElMessage, ElInput } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+//0.页面依赖 end ---------------------------------------->
+
+//1.获得路由id start ---------------------------------------->
+const route = useRoute();
+const articleId = parseInt(route.params.id);
+const targetSegment = getRoutePath(1);
+const targetSegment1 = getRoutePath(2);
+const targetSegment2 = getRoutePath(3);
+const supply_num = ref(1)
+const buy_num = ref(1)
+const supply_buy = ref(1)
+
+//1.1 获得当前的路由id
+let routeId;
+let routeType;
+let navTitle = ref('')//二级导航标题
+let navCid = ref('')//二级导航id
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment2,
+    },
+});
+console.log("getRouteId", getRouteId);
+
+if (getRouteId.code == 200) {
+    navTitle.value = getRouteId.data.alias
+    navCid.value = getRouteId.data.category_id
+} else {
+    console.log("获得路由id出错!", getRouteId.message)
+}
+//1.2 获取二级栏目
+let parent_name = ref('');//父级名称
+let parent_id = ref('');//父级id
+let parent_pinyin = ref('');//父级拼音
+const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment1,
+    },
+});
+console.log("getRoutePName", getRoutePName);
+
+if (getRoutePName.code == 200) {
+    routeId = getRoutePName.data.category_id
+    parent_id.value = getRoutePName.data.category_id
+    parent_name.value = getRoutePName.data.alias
+    routeType = getRoutePName.data.type
+} else {
+    console.log("获得路由id出错!", getRoutePName.message)
+}
+//1.3 获取一级栏目
+let p_parent_name = ref('');//父级名称
+let p_parent_id = ref('');//父级id
+let p_parent_pinyin = ref('');//父级拼音
+const getRoutePName_parent = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+console.log("getRoutePName_parent", getRoutePName_parent);
+
+if (getRoutePName_parent.code == 200) {
+    p_parent_id.value = getRoutePName_parent.data.category_id
+    p_parent_name.value = getRoutePName_parent.data.alias
+    // p_parent_pinyin.value = getRoutePName_parent.data.aLIas_pinyin
+} else {
+    console.log("获得路由id出错!", getRoutePName_parent.message)
+}
+//1.4 获取某个栏目
+const getParentId = await requestDataPromise('/web/getOneWebsiteCategory', {
+    method: 'GET',
+    query: {
+        'catid': parent_id.value,
+    },
+});
+console.log("getParentId", getParentId);
+
+if (getParentId.code == 200) {
+    parent_pinyin.value = getParentId.data.aLIas_pinyin
+} else {
+    console.log("获得路由id出错!", getParentId.message)
+}
+//1.获得路由id end ---------------------------------------->
+
+//2.获得模块数据 start ---------------------------------------->
+const pageData1 = ref([])//点击排行
+const pageData2 = ref([])//最新商机
+const pageData3 = ref([])//供应商品
+const pageData4 = ref([])//求购商品
+
+//创建请求数据json
+let getJson = [
+    { "level": "3,0,8" },//点击排行
+    { "level": "4,0,8" },//最新商机
+    { "level": "5,0,6" },//供应商品
+    { "level": "6,0,6" },//求购商品
+]
+let jsonString = JSON.stringify(getJson)
+
+//获取所有数据
+async function getPageAllData() {
+    const mkdata = await requestDataPromise('/web/getWebsiteshop', {
+        method: 'GET',
+        query: {
+            'id': jsonString,
+            'catid': 713,
+        },
+    });
+    if (mkdata.code == 200) {
+        //点击排行
+        pageData1.value = mkdata.data.goods[0];
+        //最新商机
+        pageData2.value = mkdata.data.goods[1];
+        //供应商品
+        pageData3.value = mkdata.data.goods[2];
+        //求购商品
+        pageData4.value = mkdata.data.goods[3];
+    } else {
+        ElMessage.error(mkdata.message)
+    }
+}
+getPageAllData();
+
+//2.获得模块数据 end ---------------------------------------->
+
+
+//4.新闻详情 start ---------------------------------------->
+//4.1 资讯详情
+const newsDetail = ref({})
+const routeNewsTtitle = ref("");
+//4.2 发布日期
+const time = ref("");
+//4.3 路径
+const routLevelTitle = ref("");
+const routLevelId = ref("");
+//4.4 是否展示投票
+const articleChoice = ref(false);
+//4.5 获取详情
+let shopImg = ref('')
+let shopType = ref(1)
+async function getPageData() {
+    const mkdata = await requestDataPromise('/web/getWebsiteshopInfo', {
+        method: 'GET',
+        query: {
+            'id': articleId
+        },
+    });
+    if (mkdata.code == 200) {
+        //判断是否显示投票
+        if (mkdata.data.is_survey == 1) {
+            console.log("本篇文章含有投票!")
+            articleChoice.value = true;
+        }
+        //获取内容
+        newsDetail.value = mkdata.data;
+        shopType.value = mkdata.data.type_id
+        //获取路径
+        routLevelTitle.value = newsDetail.value.cat_name;
+        routLevelId.value = newsDetail.value.category_id;
+        shopImg.value = mkdata.data.imgurl[0]
+        //获取发布时间
+        time.value = newsDetail.value.updated_at.split(' ')[0];
+        //修正标题长度
+        if (newsDetail.value.name.length >= 20) {
+            routeNewsTtitle.value = newsDetail.value.name.substr(0, 20) + "...";
+        } else {
+            routeNewsTtitle.value = newsDetail.value.name
+        }
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情内容")
+        console.log("后端错误反馈:", mkdata.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+getPageData();
+//4.新闻详情 end ---------------------------------------->
+
+
+//6.设置seo信息 start---------------------------------------->
+const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
+    method: 'GET',
+    query: {
+        'catid': routeId
+    },
+});
+
+if (setData.code == 200) {
+    let seoTitle = setData.data.seo_title;
+    let seoDescription = setData.data.seo_description;
+    let seoKeywords = setData.data.seo_keywords;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoSuffix,
+        meta: [
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+        ]
+    });
+} else {
+    console.log("设置频道页SEO出错!", setData.message)
+}
+//6.设置seo信息 end---------------------------------------->
+
+//8.页面图片放大 start---------------------------------------->
+const previewVisible = ref(false)
+const selectedImage = ref(' ')
+
+const openPreview = (event) => {
+    if (event.target.tagName === 'IMG') {
+        selectedImage.value = event.target.src;
+        previewVisible.value = true;
+    }
+}
+const closePreview = () => {
+    previewVisible.value = false;
+}
+//8.页面图片放大 end---------------------------------------->
+</script>
+
+
+<style lang="less" scoped>
+@import url('@/assets/css/shop/goodsDetail.less');
+@import url('@/assets/css/shop/goodsDetail1.less');
+</style>

+ 6 - 2
components/home/pageHead.vue

@@ -235,8 +235,12 @@ let getLogo = async () => {
         method: 'GET',
         query: {},
     });
-    logo.value = responseStatus.data.logo;
-    webSiteName.value = responseStatus.data.website_name;
+    if (responseStatus.code == 200) {
+        logo.value = responseStatus.data.logo;
+        webSiteName.value = responseStatus.data.website_name;
+    } else if (responseStatus.code == 0) {
+        window.location.href = $CwebUrl + '/404';
+    }
 }
 getLogo();
 //3.跳转菜单逻辑 end ---------------------------------------->

+ 301 - 0
components/news/detail.vue

@@ -0,0 +1,301 @@
+<template>
+    <!-- 资讯详情 -->
+    <div class="news">
+        <main class="index_main">
+            <section class="clearfix">
+                <div class="info_1_left">
+                    <div class="breadcrumb">
+                        <div class="inner">
+                            <span class="location">当前位置 :</span>
+                            <el-breadcrumb :separator-icon="ArrowRight">
+                                <el-breadcrumb-item>
+                                    <NuxtLink to="/">首页</NuxtLink>
+                                </el-breadcrumb-item>
+                                <el-breadcrumb-item v-if="p_parent_name != ''">
+                                    <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
+                                </el-breadcrumb-item>
+                                <el-breadcrumb-item v-if="parent_name != ''">
+                                    <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
+                                    </NuxtLink>
+                                </el-breadcrumb-item>
+                                <el-breadcrumb-item>{{ navTitle }}</el-breadcrumb-item>
+                            </el-breadcrumb>
+                        </div>
+                    </div>
+                    <h4 class="show_1_h4">{{ newsDetail.title }}</h4>
+                    <div class="show_1_title_box clearfix">
+                        <span class="show_1_title">来源:{{ newsDetail.copyfrom }}</span>
+                        <span class="show_1_title">作者:{{ newsDetail.author }}</span>
+                        <span class="show_1_title">时间:{{ getTime(newsDetail.updated_at, 'year', 1) }}</span>
+                    </div>
+                    <article class="show_1_article" v-html="newsDetail.content">
+                    </article>
+                    <footer class="show_foot" v-if="newsDetail.copyfrom != '本网'">
+                        原文链接:{{ newsDetail.fromurl }}
+                        <br>
+                        [免责声明]本文来源于网络转载,仅供学习交流使用,不构成商业目的。 版权归原作者所有,如涉及作品内容,版权和其他问题,请在30日与本网联系,我们将第一时间处理。
+                    </footer>
+                </div>
+                <aside class="info_1_aside">
+                    <DetailHotNews></DetailHotNews>
+                    <DetailHotNews2></DetailHotNews2>
+                    <!-- <div class="shop_head_1 clearfix">
+                        <div class="shop_head_1_name">供求信息</div>
+                    </div>
+                    <div class="shop_img_ul_1 clearfix">
+                        <div class="shop_img_li_1 clearfix" v-for="(per_obj, per_index) in 2" :key="per_obj">
+                            <a class="shop_img_li_1_a" href="" title="">
+                                <img class="shop_img_li_1_img" src="@/public/img/7.png" title="" alt="">
+                                <div class="shop_img_li_1_right clearfix">
+                                    <div class="shop_img_li_1_dot3 dot3 clearfix">
+                                        供求信息供求信息供求信息供求信息供求信息供求信息供求信息供求信息供求信息供求信息供求信息
+                                    </div>
+                                    <div class="shop_img_li_1_btn">供应</div>
+                                </div>
+                            </a>
+                        </div>
+                    </div>
+                    <div class="shop_ul_1 clearfix">
+                        <a class="shop_li_1 clearfix dot1" href="" title="" v-for="(per_obj, per_index) in 4"
+                            :key="per_obj">农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态</a>
+                    </div>
+                    <div class="shop_head_2 clearfix">
+                        <div class="shop_head_2_name">名品之窗</div>
+                    </div>
+                    <div class="shop_img_ul_2 clearfix">
+                        <div class="shop_img_li_2 clearfix" v-for="(per_obj, per_index) in 2" :key="per_obj">
+                            <a class="shop_img_li_2_a" href="" title="">
+                                <img class="shop_img_li_2_img" src="@/public/img/7.png" title="" alt="">
+                                <div class="shop_img_li_2_right clearfix">
+                                    <div class="shop_img_li_2_dot3 dot3 clearfix">
+                                        供求信息供求信息供求信息供求信息供求信息供求信息供求信息供求信息供求信息供求信息供求信息
+                                    </div>
+                                    <div class="shop_img_li_2_btn">供应</div>
+                                </div>
+                            </a>
+                        </div>
+                    </div>
+                    <div class="shop_ul_2 clearfix">
+                        <a class="shop_li_2 clearfix dot1" href="" title="" v-for="(per_obj, per_index) in 4"
+                            :key="per_obj">农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态农产动态</a>
+                    </div> -->
+                </aside>
+            </section>
+        </main>
+    </div>
+</template>
+<script setup>
+//0.页面依赖 start ---------------------------------------->
+import { onMounted } from 'vue'
+import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox, ElCheckboxGroup, ElMessage, ElInput } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+//0.页面依赖 end ---------------------------------------->
+
+//1.获得路由id start ---------------------------------------->
+const route = useRoute();
+const articleId = parseInt(route.params.id);
+const targetSegment = getRoutePath(1);
+const targetSegment1 = getRoutePath(2);
+const targetSegment2 = getRoutePath(3);
+//1.1 获得当前的路由id
+let routeId;
+let routeType;
+let navTitle = ref('')//二级导航标题
+let navCid = ref('')//二级导航id
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment2,
+    },
+});
+console.log("getRouteId", getRouteId);
+
+if (getRouteId.code == 200) {
+    navTitle.value = getRouteId.data.alias
+    navCid.value = getRouteId.data.category_id
+} else {
+    console.log("获得路由id出错!", getRouteId.message)
+}
+//1.2 获取二级栏目
+let parent_name = ref('');//父级名称
+let parent_id = ref('');//父级id
+let parent_pinyin = ref('');//父级拼音
+const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment1,
+    },
+});
+console.log("getRoutePName", getRoutePName);
+
+if (getRoutePName.code == 200) {
+    routeId = getRoutePName.data.category_id
+    parent_id.value = getRoutePName.data.category_id
+    parent_name.value = getRoutePName.data.alias
+    routeType = getRoutePName.data.type
+} else {
+    console.log("获得路由id出错!", getRoutePName.message)
+}
+//1.3 获取一级栏目
+let p_parent_name = ref('');//父级名称
+let p_parent_id = ref('');//父级id
+let p_parent_pinyin = ref('');//父级拼音
+const getRoutePName_parent = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+console.log("getRoutePName_parent", getRoutePName_parent);
+
+if (getRoutePName_parent.code == 200) {
+    p_parent_id.value = getRoutePName_parent.data.category_id
+    p_parent_name.value = getRoutePName_parent.data.alias
+    // p_parent_pinyin.value = getRoutePName_parent.data.aLIas_pinyin
+} else {
+    console.log("获得路由id出错!", getRoutePName_parent.message)
+}
+//1.4 获取某个栏目
+const getParentId = await requestDataPromise('/web/getOneWebsiteCategory', {
+    method: 'GET',
+    query: {
+        'catid': parent_id.value,
+    },
+});
+console.log("getParentId", getParentId);
+
+if (getParentId.code == 200) {
+    parent_pinyin.value = getParentId.data.aLIas_pinyin
+} else {
+    console.log("获得路由id出错!", getParentId.message)
+}
+//1.获得路由id end ---------------------------------------->
+
+
+//4.新闻详情 start ---------------------------------------->
+//4.1 资讯详情
+const newsDetail = ref({})
+const routeNewsTtitle = ref("");
+//4.2 发布日期
+const time = ref("");
+//4.3 路径
+const routLevelTitle = ref("");
+const routLevelId = ref("");
+//4.4 是否展示投票
+const articleChoice = ref(false);
+//4.5 获取详情
+async function getPageData() {
+    const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
+        method: 'GET',
+        query: {
+            'articleid': articleId
+        },
+    });
+    console.log('111111111111111', mkdata.data);
+
+    if (mkdata.code == 200) {
+        //判断是否显示投票
+        if (mkdata.data.is_survey == 1) {
+            console.log("本篇文章含有投票!")
+            articleChoice.value = true;
+        }
+        //获取内容
+        newsDetail.value = mkdata.data;
+        //获取路径
+        routLevelTitle.value = newsDetail.value.cat_name;
+        routLevelId.value = newsDetail.value.category_id;
+        //获取发布时间
+        time.value = newsDetail.value.updated_at.split(' ')[0];
+        //修正标题长度
+        if (newsDetail.value.title.length >= 20) {
+            routeNewsTtitle.value = newsDetail.value.title.substr(0, 20) + "...";
+        } else {
+            routeNewsTtitle.value = newsDetail.value.title
+        }
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情内容")
+        console.log("后端错误反馈:", mkdata.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+getPageData();
+//4.新闻详情 end ---------------------------------------->
+
+
+//5.广告 start ---------------------------------------->
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+onMounted(async () => {
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snscw_detail_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=snscw_detail_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];
+})
+//5.广告 end ---------------------------------------->
+
+//6.设置seo信息 start---------------------------------------->
+// const setData = await requestDataPromise('/web/selectWebsiteArticleInfo', {
+//     method: 'GET',
+//     query: {
+//         'articleid': articleId
+//     },
+// });
+// if (setData.code == 200) {
+//     let seoTitle = setData.data.title;
+//     let seoDescription = setData.data.introduce;
+//     let seoKeywords = setData.data.keyword;
+//     let seoSuffix = setData.data.suffix;
+//     let seoName = setData.data.website_name;
+
+//     useSeoMeta({
+//         title: seoTitle + "_" + seoName + "_" + seoSuffix,
+//         meta: [
+//             { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+//             { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+//         ]
+//     });
+// } else {
+//     console.log("获取广告数据失败!", setData.message)
+// }
+//6.设置seo信息 end---------------------------------------->
+
+//8.页面图片放大 start---------------------------------------->
+const previewVisible = ref(false)
+const selectedImage = ref(' ')
+
+const openPreview = (event) => {
+    if (event.target.tagName === 'IMG') {
+        selectedImage.value = event.target.src;
+        previewVisible.value = true;
+    }
+}
+const closePreview = () => {
+    previewVisible.value = false;
+}
+//8.页面图片放大 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/shop/newsDetail.less');
+</style>

+ 241 - 0
components/news/detail_sec.vue

@@ -0,0 +1,241 @@
+<template>
+    <div class="newsDetail">
+        <div class="inner">
+            <div class="innerLeft">
+                <!-- 面包屑导航 -->
+                <div class="breadcrumb">
+                    <div class="inner">
+                        <span class="location">当前位置:</span>
+                        <el-breadcrumb :separator-icon="ArrowRight">
+                            <el-breadcrumb-item>
+                                <NuxtLink to="/">首页</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item v-if="parent_name != ''">
+                                <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item>
+                                <NuxtLink :to="`list-1.html`"> {{ routLevelTitle }}</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
+                        </el-breadcrumb>
+                    </div>
+                </div>
+                <div class="LeftTop">
+                    <h1>{{ newsDetail.title }}</h1>
+                    <p>
+                        来源: <span>{{ newsDetail.copyfrom }}</span>
+                        作者: <span>{{ newsDetail.author }}</span>
+                        发布时间: <span>{{ time }}</span>
+                    </p>
+                </div>
+                <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content" @click="openPreview">
+                </div>
+                <div v-if="previewVisible" class="preview-modal" @click="closePreview">
+                    <img :src="selectedImage" alt="Preview">
+                </div>
+                <!-- 免责声明: -->
+                <div class="disclaimer" v-if="newsDetail.copyfrom != '本网'">
+                    <p>原文链接:{{ newsDetail.fromurl }}</p>
+                    <p>[免责声明]本文来源于网络转载,仅供学习交流使用,不构成商业目的。 版权归原作者所有,如涉及作品内容,版权和其他问题,请在30日与本网联系,我们将第一时间处理。</p>
+                </div>
+                <div v-if="articleChoice">
+                    <HomeSurveyvote></HomeSurveyvote>
+                </div>
+            </div>
+            <div class="innerRight">
+                <!-- 热点资讯1 -->
+                <div class="hotList1">
+                    <DetailHotNews></DetailHotNews>
+                </div>
+                <!-- 热点资讯2 -->
+                <div class="hotList2">
+                    <DetailHotNews2></DetailHotNews2>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { onMounted } from 'vue'
+import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox, ElCheckboxGroup, ElMessage, ElInput } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+//1.页面依赖 end ---------------------------------------->
+
+//2.页面路径 start ---------------------------------------->
+const route = useRoute();
+const articleId = parseInt(route.params.id);
+const targetSegment = getRoutePath(1);
+
+let routeId;
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+if (getRouteId.code == 200) {
+    routeId = getRouteId.data.category_id
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:通过url路径查询导航池id")
+    console.log("后端错误反馈:", getRouteId.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+//2.页面路径 end ---------------------------------------->
+
+//3.面包屑 start ---------------------------------------->
+const parent_name = ref("");
+const parent_id = ref("");
+const parent_pinyin = ref("");
+
+let getParentNav = async () => {
+    const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
+        method: 'GET',
+        query: {
+            'catid': routeId
+        },
+    });
+
+    if (listData.code == 200) {
+        parent_name.value = listData.data.alias;
+        parent_id.value = listData.data.parent_id;
+        parent_pinyin.value = listData.data.aLIas_pinyin;
+
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取面包屑导航")
+        console.log("后端错误反馈:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//获得父级栏目详情
+getParentNav();
+//3.面包屑 end ---------------------------------------->
+
+//4.新闻详情 start ---------------------------------------->
+//4.1 资讯详情
+const newsDetail = ref({})
+const routeNewsTtitle = ref("");
+//4.2 发布日期
+const time = ref("");
+//4.3 路径
+const routLevelTitle = ref("");
+const routLevelId = ref("");
+//4.4 是否展示投票
+const articleChoice = ref(false);
+//4.5 获取详情
+async function getPageData() {
+    const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
+        method: 'GET',
+        query: {
+            'articleid': articleId
+        },
+    });
+    if (mkdata.code == 200) {
+        //判断是否显示投票
+        if (mkdata.data.is_survey == 1) {
+            console.log("本篇文章含有投票!")
+            articleChoice.value = true;
+        }
+        //获取内容
+        newsDetail.value = mkdata.data;
+        //获取路径
+        routLevelTitle.value = newsDetail.value.cat_name;
+        routLevelId.value = newsDetail.value.category_id;
+        //获取发布时间
+        time.value = newsDetail.value.updated_at.split(' ')[0];
+        //修正标题长度
+        if (newsDetail.value.title.length >= 20) {
+            routeNewsTtitle.value = newsDetail.value.title.substr(0, 20) + "...";
+        } else {
+            routeNewsTtitle.value = newsDetail.value.title
+        }
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情内容")
+        console.log("后端错误反馈:", mkdata.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+getPageData();
+//4.新闻详情 end ---------------------------------------->
+
+
+//5.广告 start ---------------------------------------->
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+onMounted(async () => {
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snscw_detail_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=snscw_detail_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];
+})
+//5.广告 end ---------------------------------------->
+
+//6.设置seo信息 start---------------------------------------->
+const setData = await requestDataPromise('/web/selectWebsiteArticleInfo', {
+    method: 'GET',
+    query: {
+        'articleid': articleId
+    },
+});
+if (setData.code == 200) {
+    let seoTitle = setData.data.title;
+    let seoDescription = setData.data.introduce;
+    let seoKeywords = setData.data.keyword;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoName + "_" + seoSuffix,
+        meta: [
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+        ]
+    });
+} else {
+    console.log("获取广告数据失败!", setData.message)
+}
+//6.设置seo信息 end---------------------------------------->
+
+//8.页面图片放大 start---------------------------------------->
+const previewVisible = ref(false)
+const selectedImage = ref(' ')
+
+const openPreview = (event) => {
+    if (event.target.tagName === 'IMG') {
+        selectedImage.value = event.target.src;
+        previewVisible.value = true;
+    }
+}
+const closePreview = () => {
+    previewVisible.value = false;
+}
+//8.页面图片放大 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/detail.less');
+</style>

+ 4 - 2
composables/publicFunction.ts

@@ -60,8 +60,6 @@ const getLinkPath = (item: any) => {
 }
 //3.2跳转到频道页
 const getLinkPath1 = (item: any) => {
-  console.log('11111',item);
-  
   return `/${item.aLIas_pinyin}/list-1.html`;
 }
 //3.3跳转到详情页
@@ -88,6 +86,7 @@ const getRoutePath = (type: Number) => {
   const segments = fullPath.split('/');
   const targetSegmentOne = segments[1];
   const targetSegmentTwo = segments[2];
+  const targetSegmentThree = segments[3];
 
   if (type == 1) {
     return targetSegmentOne;
@@ -95,6 +94,9 @@ const getRoutePath = (type: Number) => {
   if (type == 2) {
     return targetSegmentTwo;
   }
+  if (type == 3) {
+    return targetSegmentThree;
+  }
 }
 
 

+ 11 - 9
middleware/setup.global.js

@@ -42,7 +42,7 @@ function parseRoute(url) {
         parts.pop();
     }
 
-    let all_route, last_route;
+    let all_route, last_route, other_route;
 
     // 如果路径以 xiangcunshangcheng 开头
     // if (parts[0] === "xiangcunshangcheng") {
@@ -70,11 +70,13 @@ function parseRoute(url) {
 
     all_route = parts.join('/');
     last_route = parts.length > 0 ? parts[parts.length - 1] : null;
+    other_route = parts[0]
 
     // 返回结果(只有数字.html 时才包含 id)
     const result = {
         all_route,
-        last_route
+        last_route,
+        other_route,
     };
     if (id !== undefined) {
         result.id = id;
@@ -93,13 +95,13 @@ function getRouteWhiteList(path) {
         const parts = path.split('/').filter(Boolean); // 分割并过滤空字符串
         console.log(parts[0])
         let whiteList = [
-            "404",
-            "search",//搜索页
-            "xiangcunshangcheng",//乡村商城搜索页
-            "topic",//商圈
-            "advertising",//广告
-            "about",//关于我们
-            "zhaogongzhaopin",//招工招聘
+            // "404",
+            // "search",//搜索页
+            // "xiangcunshangcheng",//乡村商城搜索页
+            // "topic",//商圈
+            // "advertising",//广告
+            // "about",//关于我们
+            // "zhaogongzhaopin",//招工招聘
         ]
 
         if (whiteList.includes(parts[0])) {

+ 73 - 0
pages/[dir]/[dir]/[dir]/[id].vue

@@ -0,0 +1,73 @@
+<template>
+    <HomePageHead></HomePageHead>
+    <HomePageNavigation></HomePageNavigation>
+    <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
+    <!-- news -->
+    <NewsDetail v-if="routeType == 1"></NewsDetail>
+    <!-- goods -->
+    <GoodsDetail v-if="routeType == 2"></GoodsDetail>
+    
+    <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>
+    <HomeFoot></HomeFoot>
+</template>
+
+<script setup>
+//1.获得路由id start ---------------------------------------->
+const targetSegment = getRoutePath(3);
+//1.1 获得当前的路由id
+let routeType;
+//通过导航路径反向查询导航id
+
+//1.2 获取二级栏目
+let parent_name = ref('');//父级名称
+let parent_id = ref('');//父级id
+const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+console.log("getRoutePName", getRoutePName);
+
+if (getRoutePName.code == 200) {
+    // routeId = getRoutePName.data.category_id
+    // parent_id.value = getRoutePName.data.category_id
+    // parent_name.value = getRoutePName.data.alias
+    routeType = getRoutePName.data.type
+} else {
+    console.log("获得路由id出错!", getRoutePName.message)
+}
+
+//5.广告 start ---------------------------------------->
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+
+onMounted(async () => {
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snscw_detail_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=snscw_detail_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];
+})
+//5.广告 end ---------------------------------------->
+</script>
+
+<style lang="less" scoped></style>

+ 461 - 0
pages/[dir]/[dir]/[dir]/list-[id].vue

@@ -0,0 +1,461 @@
+<template>
+    <HomePageHead></HomePageHead>
+    <HomePageNavigation></HomePageNavigation>
+    <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
+    <!-- 资讯列表 news -->
+    <main class="index_main" v-if="routeType == 1">
+        <!-- 三农市场网-商城-资讯分类页 1-->
+        <section class="index_1 clearfix">
+            <div class="shop_head_1 clearfix">
+                <div class="shop_head_1_name">{{ parent_name }}</div>
+            </div>
+            <div class="categ_color_box clearfix">
+                <div class="categ_color_name clearfix">直达:</div>
+                <div class="categ_color_in clearfix">
+                    <NuxtLink class="categ_color_a" :href="`/${item.aLIas_pinyin}/list-1.html`" :title="item.title"
+                        v-for="(item, index) in newsData" :key="index"
+                        :class="{ categ_color_a_only: navCid == item.cid }">
+                        {{ item.alias }}
+                    </NuxtLink>
+                </div>
+            </div>
+        </section>
+        <!-- 三农市场网-商城-资讯分类页2 -->
+        <!-- 三农市场网-商城-资讯列表 1-->
+        <section class="clearfix">
+            <div class="info_1_left">
+                <div class="breadcrumb">
+                    <div class="inner">
+                        <span class="location">当前位置 :</span>
+                        <el-breadcrumb :separator-icon="ArrowRight">
+                            <el-breadcrumb-item>
+                                <NuxtLink to="/">首页</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item v-if="p_parent_name != ''">
+                                <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item v-if="parent_name != ''">
+                                <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
+                                </NuxtLink>
+                            </el-breadcrumb-item>
+                            <el-breadcrumb-item>{{ navTitle }}</el-breadcrumb-item>
+                        </el-breadcrumb>
+                    </div>
+                </div>
+                <div class="info_ul_1 clearfix">
+                    <div class="info_li_1 clearfix" v-for="(item, index) in newsList" :key="index">
+                        <NuxtLink class="info_li_1_a dot1" :href="`/${item.pinyin}/${item.id}.html`" title="">
+                            {{ item.title }}
+                        </NuxtLink>
+                        <time class="info_li_1_time">{{ getTime(item.updated_at, 'month', 1) }}</time>
+                    </div>
+                    <div class="empty" v-if="newsList == false">
+                        <img src="@/public/topic/empty.png" alt="" class="empty_img">
+                        <span class="empty_text">当前暂无数据</span>
+                    </div>
+                </div>
+                <!-- 分页器 -->
+                <div class="pagination" v-if="newstotal">
+                    <el-pagination background layout="prev, pager, next" :total="newstotal" :page-size="pageSize_news"
+                        prev-text="上一页" next-text="下一页" @current-change="changePage" />
+                </div>
+            </div>
+            <aside class="info_1_aside">
+                <DetailHotNews></DetailHotNews>
+                <DetailHotNews2></DetailHotNews2>
+            </aside>
+        </section>
+    </main>
+    <!-- 商品列表 goods-->
+    <main class="index_main" v-if="routeType == 2">
+        <section class="index_1 clearfix">
+            <div class="shop_head_1 clearfix">
+                <div class="shop_head_1_name">{{ parent_name }}</div>
+            </div>
+            <div class="categ_color_box clearfix">
+                <div class="categ_color_name clearfix">直达:</div>
+                <div class="categ_color_in clearfix">
+                    <NuxtLink class="categ_color_a" :href="`/${item.aLIas_pinyin}/list-1.html`" :title="item.title"
+                        v-for="(item, index) in goodsData" :key="index"
+                        :class="{ categ_color_a_only: navCid == item.cid }">
+                        {{ item.alias }}
+                    </NuxtLink>
+                </div>
+            </div>
+        </section>
+        <!-- 三农市场网-商城-商品列表 1-->
+        <section class="">
+            <div class="breadcrumb">
+                <div class="inner">
+                    <span class="location">当前位置 :</span>
+                    <el-breadcrumb :separator-icon="ArrowRight">
+                        <el-breadcrumb-item>
+                            <NuxtLink to="/">首页</NuxtLink>
+                        </el-breadcrumb-item>
+                        <el-breadcrumb-item v-if="p_parent_name != ''">
+                            <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
+                        </el-breadcrumb-item>
+                        <el-breadcrumb-item v-if="parent_name != ''">
+                            <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
+                            </NuxtLink>
+                        </el-breadcrumb-item>
+                        <el-breadcrumb-item>{{ navTitle }}</el-breadcrumb-item>
+                    </el-breadcrumb>
+                </div>
+            </div>
+            <div class="categ_table clearfix">
+                <div class="categ_table_head_box">
+                    <div class="categ_table_td_1">产品图片</div>
+                    <div class="categ_table_td_2">供求信息/公司</div>
+                    <div class="categ_table_td_3">发布时间</div>
+                    <div class="categ_table_td_4">地区</div>
+                </div>
+                <div class="categ_table_li" v-for="(item, index) in goodsList" :key="index">
+                    <a class="categ_table_li_a" :href="`/${item.pinyin}/${item.id}.html`" title="">
+                        <div class="categ_table_td_1">
+                            <img class="categ_table_td_1_img" :src="item.imgurl" title="" alt="">
+                        </div>
+                        <div class="categ_table_td_2 ">
+                            <div class="categ_table_td_2_in">
+                                <div class="categ_table_td_2_dot1 dot1">
+                                    {{ item.name }}
+                                </div>
+                                <div class="categ_table_td_2_dot2 dot2">
+                                    {{ item.description }}
+                                </div>
+                            </div>
+                        </div>
+                        <div class="categ_table_td_3">{{ getTime(item.updated_at, 'year', 1) }}</div>
+                        <div class="categ_table_td_4 dot1">{{ item.city_name }}</div>
+                    </a>
+                </div>
+                <div class="empty" v-if="goodsList == false">
+                    <img src="@/public/topic/empty.png" alt="" class="empty_img">
+                    <span class="empty_text">当前暂无数据</span>
+                </div>
+            </div>
+            <div class="pagination1" v-if="goodstotal > 0">
+                <el-pagination background layout="prev, pager, next" :total="goodstotal" :page-size="pageSize_goods"
+                    prev-text="上一页" next-text="下一页" />
+            </div>
+        </section>
+        <!-- 三农市场网-商城-商品列表 2-->
+    </main>
+    <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>
+    <HomeFoot></HomeFoot>
+</template>
+
+<script setup>
+//0.加载页面依赖 start ---------------------------------------->
+import { ref, onMounted } from 'vue';
+import { ElMessage, ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus';
+import { ArrowRight } from '@element-plus/icons-vue'
+import { NuxtLink } from '#components';
+//0.加载页面依赖 end ---------------------------------------->
+
+//1.获得路由id start ---------------------------------------->
+const targetSegment = getRoutePath(1);
+const targetSegment1 = getRoutePath(2);
+const targetSegment2 = getRoutePath(3);
+//1.1 获得当前的路由id
+let routeId;
+let routeType;
+let navTitle = ref('')//二级导航标题
+let navCid = ref('')//二级导航id
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment2,
+    },
+});
+console.log("getRouteId", getRouteId);
+
+if (getRouteId.code == 200) {
+    navTitle.value = getRouteId.data.alias
+    navCid.value = getRouteId.data.category_id
+} else {
+    console.log("获得路由id出错!", getRouteId.message)
+}
+//1.2 获取二级栏目
+let parent_name = ref('');//父级名称
+let parent_id = ref('');//父级id
+let parent_pinyin = ref('');//父级拼音
+const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment1,
+    },
+});
+console.log("getRoutePName", getRoutePName);
+
+if (getRoutePName.code == 200) {
+    routeId = getRoutePName.data.category_id
+    parent_id.value = getRoutePName.data.category_id
+    parent_name.value = getRoutePName.data.alias
+    routeType = getRoutePName.data.type
+} else {
+    console.log("获得路由id出错!", getRoutePName.message)
+}
+//1.3 获取一级栏目
+let p_parent_name = ref('');//父级名称
+let p_parent_id = ref('');//父级id
+let p_parent_pinyin = ref('');//父级拼音
+const getRoutePName_parent = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+console.log("getRoutePName_parent", getRoutePName_parent);
+
+if (getRoutePName_parent.code == 200) {
+    p_parent_id.value = getRoutePName_parent.data.category_id
+    p_parent_name.value = getRoutePName_parent.data.alias
+    // p_parent_pinyin.value = getRoutePName_parent.data.aLIas_pinyin
+} else {
+    console.log("获得路由id出错!", getRoutePName_parent.message)
+}
+//1.4 获取某个栏目
+const getParentId = await requestDataPromise('/web/getOneWebsiteCategory', {
+    method: 'GET',
+    query: {
+        'catid': parent_id.value,
+    },
+});
+console.log("getParentId", getParentId);
+
+if (getParentId.code == 200) {
+    parent_pinyin.value = getParentId.data.aLIas_pinyin
+} else {
+    console.log("获得路由id出错!", getParentId.message)
+}
+//1.获得路由id end ---------------------------------------->
+
+//2.选项卡 start ---------------------------------------->
+let showTabs = ref(1)
+let qhtabs = function (number) {
+    console.log(number)
+    showTabs.value = number
+}
+//2.选项卡 end ---------------------------------------->
+
+//3.广告 start ---------------------------------------->
+let adImg1 = ref({})
+let adImg2 = ref({})
+onMounted(async () => {
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snscw_list_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=snscw_list_0002`
+    const responseAd2 = await fetch(url2, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd2 = await responseAd2.json();
+    adImg2.value = resultAd2.data[0];
+})
+//3.广告 end ---------------------------------------->
+
+//4.页面数据 start ---------------------------------------->
+const pageData = ref([
+    //示例:
+    // {
+    //     id: 1, 
+    //     title: "", //该导航的标题
+    //     data: [], //数据1
+    //     data1: [], //数据2
+    //     data2: [], //数据3
+    //     data3: [], //数据4
+    //     data4: [], //数据5
+    //     category_id1: "",  //子导航id1
+    //     category_id2: "", 
+    //     category_id3: "",
+    //     category_id4: "",
+    //     title1: "", //子导航标题1
+    //     title2: "",
+    //     title3: "",
+    //     title4: "",
+    //     cid: "" //该导航的id
+    // },
+])
+const newsData = ref([])
+const goodsData = ref([])
+
+//4.1 获取所有导航
+try {
+    const navigateData = await requestDataPromise('/web/getWebsiteModelCategory', {
+        method: 'GET',
+        query: {
+            'placeid': 1,
+            'pid': routeId,
+            'num': 8,
+            'type': 1
+        },
+    });
+    console.log('获取三级导航1111111', navigateData);
+
+    if (navigateData.code == 200) {
+        // 遍历可用的导航池放到页面中
+        for (let index in navigateData.data) {
+            let data = {
+                title: navigateData.data[index].name,
+                cid: navigateData.data[index].category_id,
+                children_count: navigateData.data[index].children_count,
+                alias: navigateData.data[index].alias,
+                aLIas_pinyin: targetSegment + "/" + targetSegment1 + "/" + navigateData.data[index].aLIas_pinyin,
+                type: navigateData.data[index].type,
+                // data: [],
+                // data1: [],
+                // data2: [],
+                // data3: [],
+                // data4: [],
+                // category_id1: "",
+                // category_id2: "",
+                // category_id3: "",
+                // category_id4: "",
+                // title1: "",
+                // title2: "",
+                // title3: "",
+                // title4: ""
+            };
+            if (navigateData.data[index].is_url == 1) {
+                // 处理 URL 的逻辑
+            } else {
+                if (navigateData.data[index].type == 2) {
+                    goodsData.value.push(data);
+                } else if (navigateData.data[index].type == 1) {
+                    newsData.value.push(data);
+                }
+                //每个页面最多8个模块
+                pageData.value.push(data);
+            }
+        }
+        console.log('获取三级导航pageData', pageData.value);
+        console.log('获取三级导航goods', goodsData.value);
+        console.log('获取三级导航news', newsData.value);
+
+    } else {
+        console.log("错误:渲染8个模块环节出错,请检查是否存在没有数据的模块!")
+    }
+} catch (error) {
+    console.log("错误:导航池渲染执行接口出错!请检查频道页渲染的模块数据是否完整!")
+}
+// 获取新闻数据列表 start--------------------------------------->
+const newsList = ref()
+const page_news = ref(1)
+const pageSize_news = ref(20)
+const newstotal = ref('')
+const getNewsList = await requestDataPromise('/web/getWebsiteArticleList', {
+    method: 'GET',
+    query: {
+        'page': page_news.value,
+        'pageSize': pageSize_news.value,
+        'catid': navCid.value,
+    },
+});
+console.log("获取数据列表news", getNewsList.data);
+
+if (getNewsList.code == 200) {
+    newsList.value = getNewsList.data.rows
+    newstotal.value = getNewsList.data.count
+}
+// 获取新闻数据 end----------------------------------------->
+
+// 获取商品数据列表 start--------------------------------------->
+const goodsList = ref()
+const page_goods = ref(1)
+const pageSize_goods = ref(20)
+const goodstotal = ref()
+const getGoodsList = await requestDataPromise('/web/getWebsiteshopList', {
+    method: 'GET',
+    query: {
+        'catid': navCid.value,
+        'page': page_goods.value,
+        'pageSize': pageSize_goods.value,
+        'ismix': 1
+    },
+});
+console.log("获取数据列表goods", getGoodsList);
+
+if (getGoodsList.code == 200) {
+    goodsList.value = getGoodsList.data.goods
+    goodstotal.value = getGoodsList.data.count
+}
+// 获取商品数据 end----------------------------------------->
+
+//4.页面数据 end ---------------------------------------->
+
+//5.设置seo信息 start---------------------------------------->
+const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
+    method: 'GET',
+    query: {
+        'catid': routeId
+    },
+});
+
+if (setData.code == 200) {
+    let seoTitle = setData.data.seo_title;
+    let seoDescription = setData.data.seo_description;
+    let seoKeywords = setData.data.seo_keywords;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + 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信息 end---------------------------------------->
+</script>
+<style lang="less" scoped>
+@import url("@/assets/css/shop/newsList.less");
+@import url("@/assets/css/shop/goodsList.less");
+
+.empty {
+    width: 100%;
+    height: 150px;
+    line-height: 150px;
+    text-align: center;
+}
+
+.empty_img {
+    vertical-align: -30px;
+    margin-right: 20px;
+}
+
+.empty_text {
+    font-size: 26px;
+    color: #999;
+}
+
+.pagination {
+    height: 100px;
+    margin-top: 20px;
+}
+
+.pagination1 {
+    height: 100px;
+    margin-top: 20px;
+}
+</style>

+ 15 - 155
pages/[dir]/[dir]/[id].vue

@@ -6,63 +6,11 @@
     <!-- 列表页广告一 -->
     <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
     <!-- 资讯列表 -->
-    <div class="newsDetail">
-        <div class="inner">
-            <div class="innerLeft">
-                <!-- 面包屑导航 -->
-                <div class="breadcrumb">
-                    <div class="inner">
-                        <span class="location">当前位置:</span>
-                        <el-breadcrumb :separator-icon="ArrowRight">
-                            <el-breadcrumb-item>
-                                <NuxtLink to="/">首页</NuxtLink>
-                            </el-breadcrumb-item>
-                            <el-breadcrumb-item v-if="parent_name != ''">
-                                <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
-                            </el-breadcrumb-item>
-                            <el-breadcrumb-item>
-                                <NuxtLink :to="`list-1.html`"> {{ routLevelTitle }}</NuxtLink>
-                            </el-breadcrumb-item>
-                            <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
-                        </el-breadcrumb>
-                    </div>
-                </div>
-                <div class="LeftTop">
-                    <h1>{{ newsDetail.title }}</h1>
-                    <p>
-                        来源: <span>{{ newsDetail.copyfrom }}</span>
-                        作者: <span>{{ newsDetail.author }}</span>
-                        发布时间: <span>{{ time }}</span>
-                    </p>
-                </div>
-                <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content" @click="openPreview">
-                </div>
-                <div v-if="previewVisible" class="preview-modal" @click="closePreview">
-                    <img :src="selectedImage" alt="Preview">
-                </div>
-                <!-- 免责声明: -->
-                <div class="disclaimer" v-if="newsDetail.copyfrom != '本网'">
-                    <p>原文链接:{{ newsDetail.fromurl }}</p>
-                    <p>[免责声明]本文来源于网络转载,仅供学习交流使用,不构成商业目的。 版权归原作者所有,如涉及作品内容,版权和其他问题,请在30日与本网联系,我们将第一时间处理。</p>
-                </div>
-                <div v-if="articleChoice">
-                    <HomeSurveyvote></HomeSurveyvote>
-                </div>
-            </div>
-            <div class="innerRight">
-                <!-- 热点资讯1 -->
-                <div class="hotList1">
-                    <DetailHotNews></DetailHotNews>
-                </div>
-                <!-- 热点资讯2 -->
-                <div class="hotList2">
-                    <DetailHotNews2></DetailHotNews2>
-                </div>
-            </div>
-        </div>
-    </div>
+    <Detail_news v-if="routeType == 1"></Detail_news>
+    <!-- 商品详情 -->
+    <Detail_goods v-if="routeType == 2"></Detail_goods>
     <!-- 列表页广告一 -->
-    <HomeTopTen :imgurl="adImg1" v-if="adImg2"></HomeTopTen>
+    <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
     <!-- 页面底部 -->
     <HomeFoot1></HomeFoot1>
 </template>
@@ -70,113 +18,39 @@
 <script setup>
 //1.页面依赖 start ---------------------------------------->
 import { onMounted } from 'vue'
-import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox, ElCheckboxGroup, ElMessage, ElInput } from 'element-plus'
-import { ArrowRight } from '@element-plus/icons-vue'
+import Detail_goods from '~/components/goods/detail_sec.vue';
+import Detail_news from '~/components/news/detail_sec.vue';
 //1.页面依赖 end ---------------------------------------->
 
 //2.页面路径 start ---------------------------------------->
 const route = useRoute();
 const articleId = parseInt(route.params.id);
-const targetSegment = getRoutePath(1);
+const targetSegment = getRoutePath(2);
 
-let routeId;
+let routeType;
 //通过导航路径反向查询导航id
-const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+const getRouteType = await requestDataPromise('/web/getWebsiteRoute', {
     method: 'GET',
     query: {
         'pinyin': targetSegment,
     },
 });
-if (getRouteId.code == 200) {
-    routeId = getRouteId.data.category_id
+// console.log('targetSegment', getRouteType);
+
+if (getRouteType.code == 200) {
+    routeType = getRouteType.data.type
 } else {
     console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
     console.log("错误位置:通过url路径查询导航池id")
-    console.log("后端错误反馈:", getRouteId.message)
+    console.log("后端错误反馈:", getRouteType.message)
     console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
 }
 //2.页面路径 end ---------------------------------------->
 
-//3.面包屑 start ---------------------------------------->
-const parent_name = ref("");
-const parent_id = ref("");
-const parent_pinyin = ref("");
-
-let getParentNav = async () => {
-    const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
-        method: 'GET',
-        query: {
-            'catid': routeId
-        },
-    });
-
-    if (listData.code == 200) {
-        parent_name.value = listData.data.alias;
-        parent_id.value = listData.data.parent_id;
-        parent_pinyin.value = listData.data.aLIas_pinyin;
-
-    } else {
-        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-        console.log("错误位置:获取面包屑导航")
-        console.log("后端错误反馈:", listData.message)
-        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-    }
-}
-//获得父级栏目详情
-getParentNav();
-//3.面包屑 end ---------------------------------------->
-
-//4.新闻详情 start ---------------------------------------->
-//4.1 资讯详情
-const newsDetail = ref({})
-const routeNewsTtitle = ref("");
-//4.2 发布日期
-const time = ref("");
-//4.3 路径
-const routLevelTitle = ref("");
-const routLevelId = ref("");
-//4.4 是否展示投票
-const articleChoice = ref(false);
-//4.5 获取详情
-async function getPageData() {
-    const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
-        method: 'GET',
-        query: {
-            'articleid': articleId
-        },
-    });
-    if (mkdata.code == 200) {
-        //判断是否显示投票
-        if (mkdata.data.is_survey == 1) {
-            console.log("本篇文章含有投票!")
-            articleChoice.value = true;
-        }
-        //获取内容
-        newsDetail.value = mkdata.data;
-        //获取路径
-        routLevelTitle.value = newsDetail.value.cat_name;
-        routLevelId.value = newsDetail.value.category_id;
-        //获取发布时间
-        time.value = newsDetail.value.updated_at.split(' ')[0];
-        //修正标题长度
-        if (newsDetail.value.title.length >= 20) {
-            routeNewsTtitle.value = newsDetail.value.title.substr(0, 20) + "...";
-        } else {
-            routeNewsTtitle.value = newsDetail.value.title
-        }
-    } else {
-        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-        console.log("错误位置:获取详情内容")
-        console.log("后端错误反馈:", mkdata.message)
-        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-    }
-}
-getPageData();
-//4.新闻详情 end ---------------------------------------->
-
 
 //5.广告 start ---------------------------------------->
 let adImg1 = ref([]);
+let adImg2 = ref([]);
 onMounted(async () => {
     const { $webUrl, $CwebUrl } = useNuxtApp();
     //广告1
@@ -230,20 +104,6 @@ if (setData.code == 200) {
 }
 //6.设置seo信息 end---------------------------------------->
 
-//8.页面图片放大 start---------------------------------------->
-const previewVisible = ref(false)
-const selectedImage = ref(' ')
-
-const openPreview = (event) => {
-    if (event.target.tagName === 'IMG') {
-        selectedImage.value = event.target.src;
-        previewVisible.value = true;
-    }
-}
-const closePreview = () => {
-    previewVisible.value = false;
-}
-//8.页面图片放大 end---------------------------------------->
 </script>
 
 <style lang="less" scoped>

+ 191 - 71
pages/[dir]/[dir]/index.html.vue

@@ -2,7 +2,7 @@
     <HomePageHead></HomePageHead>
     <HomePageNavigation></HomePageNavigation>
     <!-- 新闻三级分类页 -->
-    <div class="news" v-if="false">
+    <div class="news" v-if="routeType == 1">
         <section class="index_1 clearfix">
             <div class="shop_head_1 clearfix">
                 <div class="shop_head_1_name">{{ secNavTitle }}</div>
@@ -77,12 +77,11 @@
                         <div class="index_3_in clearfix">
                             <div class="shop_img_ul_1 clearfix" v-if="newsData[1].data">
                                 <div class="shop_img_li_1 clearfix">
-                                    <NuxtLink class="shop_img_li_1_a" :href="getLinkPathDetail(newsData[1].data)"
-                                        title="">
-                                        <img class="shop_img_li_1_img" :src="newsData[1].data.imgurl"
-                                            :title="newsData[1].data.title" alt="">
+                                    <NuxtLink class="shop_img_li_1_a" :href="getLinkPathDetail(item)"
+                                        v-for="(item, index) in newsData[1].data" :key="index" :title="item.title">
+                                        <img class="shop_img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
                                         <div class="shop_img_li_1_rgba clearfix dot1">
-                                            {{ newsData[1].data.title }}
+                                            {{ item.title }}
                                         </div>
                                     </NuxtLink>
                                 </div>
@@ -109,12 +108,11 @@
                         <div class="index_3_in_2 clearfix" v-if="newsData.length > 2">
                             <div class="shop_img_ul_2 clearfix">
                                 <div class="shop_img_li_2 clearfix" v-if="newsData[2].data">
-                                    <NuxtLink class="shop_img_li_2_a" :href="getLinkPathDetail(newsData[2].data)"
-                                        :title="newsData[2].data.title">
-                                        <img class="shop_img_li_2_img" :src="newsData[2].data.imgurl"
-                                            :title="newsData[2].data.title" alt="">
+                                    <NuxtLink class="shop_img_li_2_a" :href="getLinkPathDetail(item)"
+                                        v-for="(item, index) in newsData[2].data" :title="item.title">
+                                        <img class="shop_img_li_2_img" :src="item.imgurl" :title="item.title" alt="">
                                         <div class="shop_img_li_2_rgba clearfix dot1">
-                                            {{ newsData[2].data.title }}
+                                            {{ item.title }}
                                         </div>
                                     </NuxtLink>
                                 </div>
@@ -143,12 +141,11 @@
                     </div>
                     <div class="shop_img_ul_3 clearfix">
                         <div class="shop_img_li_3 clearfix" v-if="newsData[3].data">
-                            <NuxtLink class="shop_img_li_3_a" :href="getLinkPathDetail(newsData[3].data)"
-                                :title="newsData[3].data.title">
-                                <img class="shop_img_li_3_img" :src="newsData[3].data.imgurl"
-                                    :title="newsData[3].data.title" alt="">
+                            <NuxtLink class="shop_img_li_3_a" :href="getLinkPathDetail(item)"
+                                v-for="(item, index) in newsData[3].data" :key="index" :title="item.title">
+                                <img class="shop_img_li_3_img" :src="item.imgurl" :title="item.title" alt="">
                                 <div class="shop_img_li_3_rgba clearfix dot1">
-                                    {{ newsData[3].data.title }}
+                                    {{ item.title }}
                                 </div>
                             </NuxtLink>
                         </div>
@@ -169,7 +166,7 @@
     </div>
 
     <!-- 商品三级分类页 -->
-    <div class="goods">
+    <div class="goods" v-if="routeType == 2">
         <section class="index_1 clearfix">
             <div class="shop_head_1 clearfix">
                 <div class="shop_head_1_name">{{ secNavTitle }}</div>
@@ -202,71 +199,178 @@
                     </el-breadcrumb>
                 </div>
             </div>
+            <!-- 商品列表 -->
+            <!-- 第一行 -->
             <section class="index_2 clearfix">
-                <div class="box_1 clearfix">
+                <div class="box_1 clearfix" v-if="goodsData.length > 0">
                     <div class="box_1_head">
-                        <NuxtLink class="box_1_head_name" :href="getLinkPath1(pageData[0])">
-                            {{ pageData[0].alias }}
+                        <NuxtLink class="box_1_head_name" :href="getLinkPath1(goodsData[0])">
+                            {{ goodsData[0].alias }}
                         </NuxtLink>
-                        <NuxtLink class="box_1_head_a" :href="getLinkPath1(pageData[0])" :title="pageData[0].title">
+                        <NuxtLink class="box_1_head_a" :href="getLinkPath1(goodsData[0])" :title="goodsData[0].title">
                             栏目简介
                         </NuxtLink>
                     </div>
                     <div class="img_ul_1 clearfix">
-                        <div class="img_li_1 clearfix" v-for="(item, index) in 4" :key="index">
-                            <a class="img_li_1_a" href="" title="">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in goodsData[0].data" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.name">
                                 <div class="img_li_1_img_box clearfix">
-                                    <img class="img_li_1_img" src="@/public/img/5.png" title="" alt="">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.name" alt="">
                                 </div>
-                                <div class="img_li_1_dot2 dot2">栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介
+                                <div class="img_li_1_dot2 dot2">{{ item.name }}</div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+                <div class="box_1 clearfix" v-if="goodsData.length > 1">
+                    <div class="box_1_head">
+                        <NuxtLink class="box_1_head_name" :href="getLinkPath1(goodsData[1])">
+                            {{ goodsData[1].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="box_1_head_a" :href="getLinkPath1(goodsData[1])" :title="goodsData[1].title">
+                            栏目简介
+                        </NuxtLink>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in goodsData[1].data" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.name">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.name" alt="">
                                 </div>
-                            </a>
+                                <div class="img_li_1_dot2">{{ item.name }}</div>
+                            </NuxtLink>
                         </div>
                     </div>
                 </div>
-                <!-- 蔬菜批发1 -->
-                <div class="box_1 clearfix">
+            </section>
+            <!-- 第二行 -->
+            <section class="index_3 clearfix">
+                <div class="box_2 clearfix" v-if="goodsData.length > 2">
+                    <div class="box_2_head">
+                        <NuxtLink class="box_2_head_name" :href="getLinkPath1(goodsData[2])">
+                            {{ goodsData[2].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="box_2_head_a" :href="getLinkPath1(goodsData[2])" :title="goodsData[2].title">
+                            栏目简介
+                        </NuxtLink>
+                    </div>
+                    <div class="img_ul_2 clearfix">
+                        <div class="img_li_2 clearfix" v-for="(item, index) in goodsData[2].data" :key="index">
+                            <NuxtLink class="img_li_2_a" :href="getLinkPathDetail(item)" :title="item.name">
+                                <div class="img_li_2_img_box clearfix">
+                                    <img class="img_li_2_img" :src="item.imgurl" :title="item.name" alt="">
+                                </div>
+                                <div class="img_li_2_dot2 dot2">{{ item.name }}</div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+            </section>
+            <!-- 第三行 -->
+            <section class="index_4 clearfix">
+                <div class="box_1 clearfix" v-if="goodsData.length > 3">
                     <div class="box_1_head">
-                        <NuxtLink class="box_1_head_name" :href="getLinkPath1(pageData[1])">
-                            {{ pageData[1].alias }}
+                        <NuxtLink class="box_1_head_name" :href="getLinkPath1(goodsData[3])">
+                            {{ goodsData[3].alias }}
                         </NuxtLink>
-                        <NuxtLink class="box_1_head_a" :href="getLinkPath1(pageData[1])" :title="pageData[1].title">
+                        <NuxtLink class="box_1_head_a" :href="getLinkPath1(goodsData[3])" :title="goodsData[3].title">
                             栏目简介
                         </NuxtLink>
                     </div>
                     <div class="img_ul_1 clearfix">
-                        <div class="img_li_1 clearfix" v-for="(item, index) in 4" :key="index">
-                            <a class="img_li_1_a" href="" title="">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in goodsData[3].data" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.name">
                                 <div class="img_li_1_img_box clearfix">
-                                    <img class="img_li_1_img" src="@/public/img/5.png" title="" alt="">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.name" alt="">
                                 </div>
-                                <div class="img_li_1_dot2">栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介
+                                <div class="img_li_1_dot2 dot2">{{ item.name }}</div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+                <div class="box_1 clearfix" v-if="goodsData.length > 4">
+                    <div class="box_1_head">
+                        <NuxtLink class="box_1_head_name" :href="getLinkPath1(goodsData[4])">
+                            {{ goodsData[4].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="box_1_head_a" :href="getLinkPath1(goodsData[4])" :title="goodsData[4].title">
+                            栏目简介
+                        </NuxtLink>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in goodsData[4].data" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.name">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.name" alt="">
                                 </div>
-                            </a>
+                                <div class="img_li_1_dot2 dot2">{{ item.name }}</div>
+                            </NuxtLink>
                         </div>
                     </div>
                 </div>
-                <!-- 蔬菜批发 2-->
             </section>
-            <section class="index_3 clearfix">
-                <div class="box_2 clearfix">
+            <!-- 第四行 -->
+            <section class="index_5 clearfix">
+                <div class="box_2 clearfix" v-if="goodsData.length > 5">
                     <div class="box_2_head">
-                        <NuxtLink class="box_2_head_name" :href="getLinkPath1(pageData[2])">
-                            {{ pageData[2].alias }}
+                        <NuxtLink class="box_2_head_name" :href="getLinkPath1(goodsData[5])">
+                            {{ goodsData[5].alias }}
                         </NuxtLink>
-                        <NuxtLink class="box_2_head_a" :href="getLinkPath1(pageData[2])" :title="pageData[2].title">
+                        <NuxtLink class="box_2_head_a" :href="getLinkPath1(goodsData[5])" :title="goodsData[5].title">
                             栏目简介
                         </NuxtLink>
                     </div>
                     <div class="img_ul_2 clearfix">
-                        <div class="img_li_2 clearfix" v-for="(item, index) in 8" :key="index">
-                            <a class="img_li_2_a" href="" title="">
+                        <div class="img_li_2 clearfix" v-for="(item, index) in goodsData[5].data" :key="index">
+                            <NuxtLink class="img_li_2_a" :href="getLinkPathDetail(item)" :title="item.name">
                                 <div class="img_li_2_img_box clearfix">
-                                    <img class="img_li_2_img" src="@/public/img/5.png" title="" alt="">
+                                    <img class="img_li_2_img" :src="item.imgurl" :title="item.name" alt="">
                                 </div>
-                                <div class="img_li_2_dot2">栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介栏目简介
+                                <div class="img_li_2_dot2 dot2">{{ item.name }}</div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+            </section>
+            <!-- 第五行 -->
+            <section class="index_6 clearfix">
+                <div class="box_1 clearfix" v-if="goodsData.length > 6">
+                    <div class="box_1_head">
+                        <NuxtLink class="box_1_head_name" :href="getLinkPath1(goodsData[6])">
+                            {{ goodsData[6].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="box_1_head_a" :href="getLinkPath1(goodsData[6])" :title="goodsData[6].title">
+                            栏目简介
+                        </NuxtLink>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in goodsData[6].data" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.name">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.name" alt="">
                                 </div>
-                            </a>
+                                <div class="img_li_1_dot2 dot2">{{ item.name }}</div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                </div>
+                <div class="box_1 clearfix" v-if="goodsData.length > 7">
+                    <div class="box_1_head">
+                        <NuxtLink class="box_1_head_name" :href="getLinkPath1(goodsData[7])">
+                            {{ goodsData[7].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="box_1_head_a" :href="getLinkPath1(goodsData[7])" :title="goodsData[7].title">
+                            栏目简介
+                        </NuxtLink>
+                    </div>
+                    <div class="img_ul_1 clearfix">
+                        <div class="img_li_1 clearfix" v-for="(item, index) in goodsData[7].data" :key="index">
+                            <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.name">
+                                <div class="img_li_1_img_box clearfix">
+                                    <img class="img_li_1_img" :src="item.imgurl" :title="item.name" alt="">
+                                </div>
+                                <div class="img_li_1_dot2 dot2">{{ item.name }}</div>
+                            </NuxtLink>
                         </div>
                     </div>
                 </div>
@@ -293,6 +397,7 @@ const targetSegment = getRoutePath(2);
 const targetSegment1 = getRoutePath(1);
 //1.1 获得当前的路由id
 let routeId;
+let routeType;
 let secNavTitle = ref('')//二级导航标题
 //通过导航路径反向查询导航id
 const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
@@ -306,6 +411,7 @@ console.log("getRouteId", getRouteId);
 if (getRouteId.code == 200) {
     routeId = getRouteId.data.category_id
     secNavTitle.value = getRouteId.data.alias
+    routeType = getRouteId.data.type
 } else {
     console.log("获得路由id出错!", getRouteId.message)
 }
@@ -507,22 +613,32 @@ try {
         let jsonString = JSON.stringify(getJson);
         getPageAllData(jsonString);
 
-        // let goodsJson = [
-        //     // { "catid": goodsData.value[0].cid + ",0,12" },//模块1
-        //     // { "catid": goodsData.value[1].cid + ",0,4" },//模块2
-        //     // { "catid": goodsData.value[2].cid + ",0,4" },//模块3
-        // ]
-        // for (let i = 0; i < goodsData.value.length; i++) {
-        //     if (i == 0) {
-        //         goodsJson.push({ "catid": goodsData.value[0].cid + ",0,12" });
-        //     } else if (i == 1) {
-        //         goodsJson.push({ "catid": goodsData.value[1].cid + ",0,4" });
-        //     } else if (i == 2) {
-        //         goodsJson.push({ "catid": goodsData.value[2].cid + ",0,4" });
-        //     }
-        // }
-        // let goodsJsonString = JSON.stringify(goodsJson);
-        // getPageGoodsAllData(goodsJsonString);
+        let goodsJson = [
+            // { "catid": goodsData.value[0].cid + ",0,12" },//模块1
+            // { "catid": goodsData.value[1].cid + ",0,4" },//模块2
+            // { "catid": goodsData.value[2].cid + ",0,4" },//模块3
+        ]
+        for (let i = 0; i < goodsData.value.length; i++) {
+            if (i == 0) {
+                goodsJson.push({ "catid": goodsData.value[0].cid + ",0,4" });
+            } else if (i == 1) {
+                goodsJson.push({ "catid": goodsData.value[1].cid + ",0,4" });
+            } else if (i == 2) {
+                goodsJson.push({ "catid": goodsData.value[2].cid + ",0,8" });
+            } else if (i == 3) {
+                goodsJson.push({ "catid": goodsData.value[3].cid + ",0,4" });
+            } else if (i == 4) {
+                goodsJson.push({ "catid": goodsData.value[4].cid + ",0,4" });
+            } else if (i == 5) {
+                goodsJson.push({ "catid": goodsData.value[5].cid + ",0,8" });
+            } else if (i == 6) {
+                goodsJson.push({ "catid": goodsData.value[6].cid + ",0,4" });
+            } else if (i == 7) {
+                goodsJson.push({ "catid": goodsData.value[7].cid + ",0,4" });
+            }
+        }
+        let goodsJsonString = JSON.stringify(goodsJson);
+        getPageGoodsAllData(goodsJsonString);
     } else {
         console.log("错误:渲染8个模块环节出错,请检查是否存在没有数据的模块!")
     }
@@ -541,17 +657,21 @@ async function getPageGoodsAllData(goodsJsonString) {
 
     if (mkdata.code == 200) {
         //模块1
-        for (let index in mkdata.data[0]) {
-            console.log("获取商品数据", index, mkdata.data[0][index]);
-            if (index < 4) {
-                goodsData.value[0].data.push(mkdata.data[0][index]);
-            } else {
-                goodsData.value[0].data1.push(mkdata.data[0][index]);
-            }
-        }
+        goodsData.value[0].data = mkdata.data[0];
         //模块2
         goodsData.value[1].data = mkdata.data[1];
+        //模块3
         goodsData.value[2].data = mkdata.data[2];
+        //模块4
+        goodsData.value[3].data = mkdata.data[3];
+        //模块5
+        goodsData.value[4].data = mkdata.data[4];
+        //模块6
+        goodsData.value[5].data = mkdata.data[5];
+        //模块7
+        goodsData.value[6].data = mkdata.data[6];
+        //模块8
+        goodsData.value[7].data = mkdata.data[7];
         console.log("获取商品数据111111", goodsData.value);
     }
 }

+ 4 - 3
pages/[dir]/index.html.vue

@@ -1,8 +1,8 @@
 <template>
     <div>
-        <NewsClass></NewsClass>
-        <!-- <NewsClass v-if="routeType == 1"></NewsClass> -->
-        <!-- <GoodsClass v-if="routeType == 2"></GoodsClass> -->
+        <!-- <NewsClass></NewsClass> -->
+        <NewsClass v-if="routeType == 1"></NewsClass>
+        <GoodsClass v-if="routeType == 2"></GoodsClass>
     </div>
 
 </template>
@@ -25,6 +25,7 @@ const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
         'pinyin': targetSegment,
     },
 });
+console.log('getRouteId',getRouteId)
 if (getRouteId.code == 200) {
     console.log("获得路由id成功!", getRouteId.data);
     routeId = getRouteId.data.category_id

+ 938 - 0
pages/index copy.vue

@@ -0,0 +1,938 @@
+<template>
+    <div>
+        <HomePageHead></HomePageHead>
+        <HomePageNavigation></HomePageNavigation>
+        <main class="index_main">
+            <!--头条-->
+            <h1 class="head_h3">
+                <NuxtLink v-if="headline" class="head_h3_a dot1" :href="getLinkPathDetail(headline)"
+                    :title="headline.title" :target="headline.islink == 1 ? '_blank' : '_self'">
+                    {{ headline.title }}
+                </NuxtLink>
+            </h1>
+            <section class="index_1 clearfix">
+                <div class="index_1_left">
+                    <div class="roll_1_box">
+                        <HomeSwiperSnsc></HomeSwiperSnsc>
+                    </div>
+                </div>
+                <div class="index_1_right">
+                    <div class="index_1_ul" v-if="hotNewsList">
+                        <NuxtLink class="index_1_ul_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
+                            v-for="(item, index) in hotNewsList" :key="index"
+                            :target="item.islink == 1 ? '_blank' : '_self'">
+                            {{ item.title }}
+                        </NuxtLink>
+                    </div>
+                </div>
+            </section>
+            <!--广告1-->
+            <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
+            <section class="index_2 clearfix">
+                <div class="index_1_left clearfix">
+                    <!--open 农业市场-->
+                    <div class="index_2_head" v-if="pageData[0]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[0].cid" :href="getLinkPath(pageData[0])"
+                            :title="pageData[0].alias">
+                            {{ pageData[0].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[0].cid" :href="getLinkPath(pageData[0])"
+                            :title="pageData[0].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_1_box_1 clearfix">
+                        <div class="index_img_big_2_ul">
+                            <div class="index_img_big_2_li" v-for="item in boxData1">
+                                <NuxtLink class="index_img_big_2_li_a" :href="getLinkPathDetail(item)"
+                                    :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                                    <img class="index_img_big_2_li_img" :src="item.imgurl" :alt="item.title">
+                                    <div class="index_img_big_2_li_dot1 dot1">{{ item.title }}</div>
+                                </NuxtLink>
+                            </div>
+                        </div>
+                        <div class="index_2_img_ul clearfix">
+                            <div class="index_2_img_li" v-for="item in boxData1data2">
+                                <NuxtLink class="index_2_img_li_a" :href="getLinkPathDetail(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
+                                    <img class="index_2_img_li_img" :src="item.imgurl" :alt="item.title">
+                                    <div class="index_2_img_li_dot1 dot1">{{ item.title }}</div>
+                                </NuxtLink>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="index_1_box_2 clearfix">
+                        <div class="index_ul_2">
+                            <NuxtLink class="index_ul_2_a dot1" v-for="item in boxData1data3"
+                                :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                {{ item.title }}
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <!--end 农业市场-->
+                </div>
+                <div class="index_1_right clearfix">
+                    <!--open 特产商城-->
+                    <div class="index_2_head" v-if="pageData[1]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[1].cid" :href="getLinkPath(pageData[1])"
+                            :title="pageData[1].alias">
+                            {{ pageData[1].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[1].cid" :href="getLinkPath(pageData[1])"
+                            :title="pageData[1].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_img_big_1_ul clearfix">
+                        <div class="index_img_big_1_li" v-for="item in boxData2">
+                            <NuxtLink class="index_img_big_1_li_a" :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                <img class="index_img_big_1_li_img" :src="item.imgurl" alt="item.title">
+                                <div class="index_img_big_1_li_dot1 dot1">
+                                    {{ item.title }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <div class="index_ul_5">
+                        <NuxtLink class="index_ul_5_a dot1" v-for="item in boxData2data2"
+                            :href="getLinkPathDetail(item)" :title="item.title"
+                            :target="item.islink == 1 ? '_blank' : '_self'">
+                            {{ item.title }}
+                        </NuxtLink>
+                    </div>
+                    <!--end 特产商城-->
+                </div>
+            </section>
+            <section class="index_3 clearfix">
+                <div class="index_1_left clearfix">
+                    <!--open 科教商城-->
+                    <div class="index_2_head" v-if="pageData[2]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[2].cid" :href="getLinkPath(pageData[2])"
+                            :title="pageData[2].alias">
+                            {{ pageData[2].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[2].cid" :href="getLinkPath(pageData[2])"
+                            :title="pageData[2].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_1_box_1 clearfix">
+                        <div class="index_img_big_3_ul">
+                            <div class="index_img_big_3_li" v-for="item in boxData3">
+                                <NuxtLink :href="getLinkPathDetail(item)" class="index_img_big_3_li_a"
+                                    :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                                    <img class="index_img_big_3_li_img" :src="item.imgurl" alt="item.title">
+                                    <div class="index_img_big_3_li_dot1 dot1">
+                                        {{ item.title }}
+                                    </div>
+                                </NuxtLink>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="index_1_box_2 clearfix">
+                        <div class="index_ul_3">
+                            <NuxtLink :href="getLinkPathDetail(item)" class="index_ul_3_a dot1"
+                                v-for="item in boxData3data2" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                {{ item.title }}
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <!--end 科教商城-->
+                </div>
+                <div class="index_1_right clearfix">
+                    <!--open 生活商城-->
+                    <div class="index_2_head" v-if="pageData[3]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[3].cid" :href="getLinkPath(pageData[3])"
+                            :title="pageData[3].alias">
+                            {{ pageData[3].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[3].cid" :href="getLinkPath(pageData[3])"
+                            :title="pageData[3].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_2_box_1 clearfix">
+                        <div class="index_img_ul_2 clearfix">
+                            <div class="index_img_ul_2_li" v-for="item in boxData4">
+                                <NuxtLink :href="getLinkPathDetail(item)" class="index_img_ul_2_li_a"
+                                    :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                                    <img class="index_img_ul_2_li_img" :src="item.imgurl" alt="item.title">
+                                    <div class="index_img_ul_2_li_dot1 dot1">
+                                        {{ item.title }}
+                                    </div>
+                                </NuxtLink>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="index_2_box_2 clearfix">
+                        <div class="index_ul_4">
+                            <div class="index_ul_4_li_box" v-for="item in boxData4data2">
+                                <div class="index_ul_4_li">
+                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                        :target="item.islink == 1 ? '_blank' : '_self'" class="index_ul_4_a dot2">
+                                        {{ item.title }}
+                                    </NuxtLink>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <!--end 生活商城-->
+                </div>
+            </section>
+            <section class="index_4 clearfix">
+                <!--open 市场动态-->
+                <div class="index_1_box_1 clearfix">
+                    <div class="index_2_head" v-if="pageData[4]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[4].cid" :href="getLinkPath(pageData[4])"
+                            :title="pageData[4].alias">
+                            {{ pageData[4].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[4].cid" :href="getLinkPath(pageData[4])"
+                            :title="pageData[4].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_img_big_4_ul">
+                        <div class="index_img_big_4_li" v-for="item in boxData5">
+                            <NuxtLink class="index_img_big_4_li_a" :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                <img class="index_img_big_4_li_img" :src="item.imgurl" alt="item.title">
+                                <div class="index_img_big_4_li_dot1 dot1">
+                                    {{ item.title }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <div class="index_ul_6">
+                        <NuxtLink class="index_ul_6_a dot1" :href="getLinkPathDetail(item)"
+                            v-for="item in boxData5data2" :title="item.title"
+                            :target="item.islink == 1 ? '_blank' : '_self'">
+                            {{ item.title }}
+                        </NuxtLink>
+                    </div>
+                    <!--end 市场动态-->
+                </div>
+                <!--open 市场管理-->
+                <div class="index_1_box_2 clearfix">
+                    <div class="index_2_head" v-if="pageData[5]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[5].cid" :href="getLinkPath(pageData[5])"
+                            :title="pageData[5].alias">
+                            {{ pageData[5].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[5].cid" :href="getLinkPath(pageData[5])"
+                            :title="pageData[5].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <HomeAdAdindexmain :imgurl="adImg2"></HomeAdAdindexmain>
+                    <div class="index_ul_7">
+                        <NuxtLink v-for="item in boxData6" class="index_ul_7_a dot1" :href="getLinkPathDetail(item)"
+                            :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                            {{ item.title }}
+                        </NuxtLink>
+                    </div>
+                    <div class="index_ul_8 clearfix">
+                        <NuxtLink v-for="item in boxData6data2" class="index_ul_8_a dot1"
+                            :href="getLinkPathDetail(item)" :title="item.title"
+                            :target="item.islink == 1 ? '_blank' : '_self'">
+                            {{ item.title }}
+                        </NuxtLink>
+                    </div>
+                    <!--end 市场管理-->
+                </div>
+                <!--open 致富信息-->
+                <div class="index_1_right clearfix">
+                    <div class="index_2_head" v-if="pageData[6]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[6].cid" :href="getLinkPath(pageData[6])"
+                            :title="pageData[6].alias">
+                            {{ pageData[6].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[6].cid" :href="getLinkPath(pageData[6])"
+                            :title="pageData[6].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_img_big_5_ul clearfix">
+                        <div class="index_img_big_5_li" v-for="item in boxData7">
+                            <NuxtLink class="index_img_big_5_li_a" :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                <img class="index_img_big_5_li_img" :src="item.imgurl" alt="item.title">
+                                <div class="index_img_big_5_li_dot1 dot1">
+                                    {{ item.title }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <div class="index_ul_9">
+                        <NuxtLink class="index_ul_9_a dot1" :href="getLinkPathDetail(item)"
+                            v-for="item in boxData7data2" :title="item.title"
+                            :target="item.islink == 1 ? '_blank' : '_self'">
+                            {{ item.title }}
+                        </NuxtLink>
+                    </div>
+                    <!--end 致富信息-->
+                </div>
+            </section>
+            <!--广告3-->
+            <HomeAdvertising :imgurl="adImg3"></HomeAdvertising>
+            <section class="index_5 clearfix">
+                <!--open 市场服务-->
+                <div class="index_1_box_1 clearfix">
+                    <div class="index_2_head" v-if="pageData[7]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[7].cid" :href="getLinkPath(pageData[7])"
+                            :title="pageData[7].alias">
+                            {{ pageData[7].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[7].cid" :href="getLinkPath(pageData[7])"
+                            :title="pageData[7].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_img_ul_3">
+                        <div class="index_img_ul_3_li" v-for="item in boxData8">
+                            <NuxtLink class="index_img_ul_3_a" :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                <div class="index_img_ul_3_img_box">
+                                    <img class="index_img_ul_3_img" :src="item.imgurl" alt="item.title">
+                                </div>
+                                <div class="index_img_ul_3_dot2 dot2">
+                                    {{ item.title }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <div class="index_ul_10">
+                        <NuxtLink class="index_ul_10_a dot1" v-for="item in boxData8data2"
+                            :href="getLinkPathDetail(item)" :title="item.title"
+                            :target="item.islink == 1 ? '_blank' : '_self'">
+                            {{ item.title }}
+                        </NuxtLink>
+                    </div>
+                </div>
+                <!--end 市场服务-->
+                <div class="index_1_box_2 clearfix">
+                    <!--open 市场信息-->
+                    <div class="index_2_head" v-if="pageData[8]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[8].cid" :href="getLinkPath(pageData[8])"
+                            :title="pageData[8].alias">
+                            {{ pageData[8].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[8].cid" :href="getLinkPath(pageData[8])"
+                            :title="pageData[8].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_img_ul_4">
+                        <div class="index_img_ul_4_li" v-for="item in boxData9">
+                            <NuxtLink class="index_img_ul_4_a" :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                <div class="index_img_ul_4_img_box">
+                                    <img class="index_img_ul_4_img" :src="item.imgurl" alt="item.title">
+                                </div>
+                                <div class="index_img_ul_4_dot2 dot2">
+                                    {{ item.title }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <div class="index_ul_11">
+                        <NuxtLink class="index_ul_11_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
+                            v-for="item in boxData9data2" :target="item.islink == 1 ? '_blank' : '_self'">
+                            {{ item.title }}
+                        </NuxtLink>
+                    </div>
+                    <!--end 市场信息-->
+                </div>
+                <div class="index_1_right clearfix">
+                    <!--open 三农知识-->
+                    <div class="index_2_head" v-if="pageData[9]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[9].cid" :href="getLinkPath(pageData[9])"
+                            :title="pageData[9].alias">
+                            {{ pageData[9].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[9].cid" :href="getLinkPath(pageData[9])"
+                            :title="pageData[9].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_ul_12">
+                        <div class="index_ul_12_li dot1" v-for="(item, index) in boxData10">
+                            <div class="index_ul_12_li_num">{{ index + 1 }}</div>
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'" class="index_ul_12_a dot1">
+                                {{ item.title }}
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <!--end 三农知识-->
+                </div>
+            </section>
+            <section class="index_6 clearfix">
+                <div class="index_1_left clearfix">
+                    <!--open 农资商城-->
+                    <div class="index_2_head">
+                        <div class="index_2_head_name" v-if="pageData[10]">
+                            <NuxtLink class="index_2_head_name_a" v-if="pageData[10].cid"
+                                :href="getLinkPath(pageData[10])" :title="pageData[10].alias">
+                                {{ pageData[10].alias }}
+                            </NuxtLink>
+                        </div>
+                        <div class="index_2_head_right">
+                            <NuxtLink class="index_6_head_right_a" v-for="item in boxData11menu"
+                                :to="{ path: `/${item.aLIas_pinyin}/list-1.html}` }" :title="item.alias">
+                                {{ item.alias }}
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <div class="index_1_box_1 clearfix">
+                        <div class="index_img_big_6_ul">
+                            <div class="index_img_big_6_li" v-for="item in boxData11">
+                                <NuxtLink class="index_img_big_6_li_a" :href="getLinkPathDetail(item)"
+                                    :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                                    <img :src="item.imgurl" alt="item.title">
+                                    <div class="index_img_big_6_li_dot1 dot1">
+                                        {{ item.title }}
+                                    </div>
+                                </NuxtLink>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="index_1_box_2 clearfix">
+                        <div class="index_ul_13">
+                            <NuxtLink class="index_ul_13_a dot1" :href="getLinkPathDetail(item)"
+                                v-for="item in boxData11data2" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                {{ item.title }}
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <!--end 农资商城-->
+                </div>
+                <div class="index_1_right clearfix">
+                    <!--open 文化商城-->
+                    <div class="index_2_head" v-if="pageData[11]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[11].cid" :href="getLinkPath(pageData[11])"
+                            :title="pageData[11].alias">
+                            {{ pageData[11].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[11].cid" :href="getLinkPath(pageData[11])"
+                            :title="pageData[11].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_2_box_1 clearfix">
+                        <div class="index_img_ul_5">
+                            <div class="index_img_ul_5_li" v-for="item in boxData12">
+                                <NuxtLink class="index_img_ul_5_li_a" :href="getLinkPathDetail(item)"
+                                    :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                                    <img class="index_img_ul_5_li_img" :src="item.imgurl" alt="item.title">
+                                    <div class="index_img_ul_5_li_dot1 dot1">
+                                        {{ item.title }}
+                                    </div>
+                                </NuxtLink>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="index_2_box_2 clearfix">
+                        <div class="index_ul_14">
+                            <div class="index_ul_14_li_box" v-for="item in boxData12data2">
+                                <div class="index_ul_14_li">
+                                    <NuxtLink class="index_ul_14_a dot2" :href="getLinkPathDetail(item)"
+                                        :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                                        {{ item.title }}
+                                    </NuxtLink>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <!--end 文化商城-->
+                </div>
+            </section>
+            <section class="index_7 clearfix">
+                <div class="index_1_left clearfix">
+                    <!--open 农副商城-->
+                    <div class="index_2_head" v-if="pageData[12]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[12].cid" :href="getLinkPath(pageData[12])"
+                            :title="pageData[12].alias">
+                            {{ pageData[12].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[12].cid" :href="getLinkPath(pageData[12])"
+                            :title="pageData[12].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_1_box_1 clearfix">
+                        <div class="index_img_big_7_ul">
+                            <div class="index_img_big_7_li" v-for="item in boxData13" :key="item.id">
+                                <NuxtLink class="index_img_big_7_li_a" :href="getLinkPathDetail(item)"
+                                    :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                                    <img class="index_img_big_7_li_img" :src="item.imgurl" alt="item.title">
+                                    <div class="index_img_big_7_li_dot1 dot1">
+                                        {{ item.title }}
+                                    </div>
+                                </NuxtLink>
+                            </div>
+                        </div>
+                        <div class="index_img_ul_6 clearfix">
+                            <div class="index_img_ul_6_li" v-for="item in boxData13data2" :key="per_obj">
+                                <NuxtLink class="index_img_ul_6_a" :href="getLinkPathDetail(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
+                                    <img class="index_img_ul_6_li_img" :src="item.imgurl" alt="item.title">
+                                    <div class="index_img_ul_6_li_dot1 dot1">
+                                        {{ item.title }}
+                                    </div>
+                                </NuxtLink>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="index_1_box_2 clearfix">
+                        <div class="index_ul_15">
+                            <NuxtLink class="index_ul_15_a dot1" v-for="item in boxData13data3"
+                                :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                {{ item.title }}
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <!--end 农副商城-->
+                </div>
+                <div class="index_1_right clearfix">
+                    <!--open 人才市场-->
+                    <div class="index_2_head" v-if="pageData[13]">
+                        <NuxtLink class="index_2_head_name" v-if="pageData[13].cid" :href="getLinkPath(pageData[13])"
+                            :title="pageData[13].alias">
+                            {{ pageData[13].alias }}
+                        </NuxtLink>
+                        <NuxtLink class="index_2_head_more" v-if="pageData[13].cid" :href="getLinkPath(pageData[13])"
+                            :title="pageData[13].alias">
+                            更多 &gt;
+                        </NuxtLink>
+                    </div>
+                    <div class="index_img_ul_7 clearfix">
+                        <div class="index_img_ul_7_li" v-for="item in boxData14">
+                            <NuxtLink class="index_img_ul_7_a" :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                <img class="index_img_ul_7_li_img" :src="item.imgurl" alt="item.title">
+                                <div class="index_img_ul_7_li_dot1 dot1">
+                                    {{ item.title }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <div class="index_name_ul">
+                        <div class="index_name_ul_li" v-for="(item, index) in boxData14data2" :key="index">
+                            <NuxtLink class="index_name_ul_li_tag" :href="getLinkPath1(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                <div class="index_img_ul_7_li_dot1 dot1">
+                                    {{ item.alias }}
+                                </div>
+                            </NuxtLink>
+                            <NuxtLink class="index_name_ul_li_dot1 dot1" :href="getLinkPathDetail1(item)"
+                                :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
+                                <div class="index_img_ul_7_li_dot1 dot1">
+                                    {{ item.title }}
+                                </div>
+                            </NuxtLink>
+                        </div>
+                    </div>
+                    <!--end 人才市场-->
+                </div>
+            </section>
+
+            <HomeAdvertising :imgurl="adImg4"></HomeAdvertising>
+        </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({})
+
+async function getModelData1() {
+    const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
+        method: 'GET',
+        query: {
+            'imgnum': 1,
+            'textnum': 1,
+            'level': 1,
+            'placeid': 0,
+            'id': 0
+        },
+    });
+    if (mkdata.code == 200) {
+        //填充大标题
+        headline.value = mkdata.data.text[0]
+    } else {
+        console.log("设置大标题错误", mkdata.message)
+    }
+}
+getModelData1()
+
+//1.3 今日热点
+const hotNewsList = ref("")
+async function getModelData3() {
+    const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
+        method: 'GET',
+        query: {
+            'imgnum': 0,
+            'textnum': 10,
+            'level': 6,
+            'placeid': 0,
+            'id': 0
+        },
+    });
+    if (mkdata.code == 200) {
+        hotNewsList.value = mkdata.data.text;
+    } else {
+        console.log("获取首页今日热点错误", mkdata.message)
+    }
+}
+getModelData3()
+//1.获取头条新闻 end---------------------------------------->
+
+
+
+//2.选项卡 start---------------------------------------->
+const hoverStatus = ref(1)
+const qhPic = function (num) {
+    hoverStatus.value = num;
+}
+//2.选项卡 end---------------------------------------->
+
+//3.广告 start---------------------------------------->
+//获得所有广告
+let adImg1 = ref({})
+let adImg2 = ref({})
+let adImg3 = ref({})
+let adImg4 = ref({})
+
+onMounted(async () => {
+    //从客户端获取行政职能部门 加快打开速度//从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+
+    //从客户端启动广告
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snscw_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=snscw_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=snscw_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=snscw_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([])
+//模块2
+const boxData2 = ref([]);
+const boxData2data2 = ref([]);
+//模块3 
+const boxData3 = ref([]);
+const boxData3data2 = ref([]);
+//模块4
+const boxData4 = ref([]);
+const boxData4data2 = ref([]);
+//模块5
+const boxData5 = ref([]);
+const boxData5data2 = ref([]);
+//模块6
+const boxData6 = ref([]);
+const boxData6data2 = ref([]);
+//模块7
+const boxData7 = ref([]);
+const boxData7data2 = ref([]);
+//模块8
+const boxData8 = ref([]);
+const boxData8data2 = ref([]);
+//模块9
+const boxData9 = ref([]);
+const boxData9data2 = ref([]);
+//模块10 
+const boxData10 = ref([]);
+//模块11 带有子导航
+const boxData11 = ref([]);
+const boxData11data2 = ref([]);
+const boxData11menu = ref([]);
+//模块12
+const boxData12 = ref([]);
+const boxData12data2 = ref([]);
+//模块13
+const boxData13 = ref([]);
+const boxData13data2 = ref([]);
+const boxData13data3 = ref([]);
+//模块14
+const boxData14 = ref([]);
+const boxData14data2 = ref([]);
+
+//获得全局配置的导航数据
+const { $pageNav } = useNuxtApp();
+
+//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 农业市场484
+            if (navigateData.data[index].category_id == $pageNav[0]) { pageData.value[0] = data }
+            //2 特产商场490
+            if (navigateData.data[index].category_id == $pageNav[1]) { pageData.value[1] = data }
+            //3 三农科教商城488
+            if (navigateData.data[index].category_id == $pageNav[2]) { pageData.value[2] = data }
+            //4 乡村生活商城483
+            if (navigateData.data[index].category_id == $pageNav[3]) { pageData.value[3] = data }
+            //5 三农市场动态491
+            if (navigateData.data[index].category_id == $pageNav[4]) { pageData.value[4] = data }
+            //6 三农市场管理492
+            if (navigateData.data[index].category_id == $pageNav[5]) { pageData.value[5] = data }
+            //7 致富信息23
+            if (navigateData.data[index].category_id == $pageNav[6]) { pageData.value[6] = data }
+            //8 三农市场服务495
+            if (navigateData.data[index].category_id == $pageNav[7]) { pageData.value[7] = data }
+            //9 三农市场信息493
+            if (navigateData.data[index].category_id == $pageNav[8]) { pageData.value[8] = data }
+            //10 三农知识494
+            if (navigateData.data[index].category_id == $pageNav[9]) { pageData.value[9] = data }
+            //11 农资产品商城43
+            if (navigateData.data[index].category_id == $pageNav[10]) { pageData.value[10] = data }
+            //12 乡村文化商城486
+            if (navigateData.data[index].category_id == $pageNav[11]) { pageData.value[11] = data }
+            //13 农副产品商城46
+            if (navigateData.data[index].category_id == $pageNav[12]) { pageData.value[12] = data }
+            //14 三农人才市场487
+            if (navigateData.data[index].category_id == $pageNav[13]) { pageData.value[13] = data }
+
+        }
+    } else {
+        console.log("获取导航池出错!", navigateData.message)
+    }
+} catch (error) {
+    console.log("错误:导航池渲染执行接口出错!请检查首页的14的模块的具体执行方法!")
+}
+
+let getJson = [
+    { "parent": $pageNav[0] + ",3,9", "child": "" },//模块1 农业市场484
+    { "parent": $pageNav[1] + ",1,2", "child": "" },//模块2 特产商场490
+    { "parent": $pageNav[2] + ",1,6", "child": "" },//模块3 三农科教商城488
+    { "parent": $pageNav[3] + ",2,4", "child": "" },//模块4 乡村生活商城483
+    { "parent": $pageNav[4] + ",1,5", "child": "" },//模块5 三农市场动态491
+    { "parent": $pageNav[5] + ",0,9", "child": "" },//模块6 三农市场管理492
+    { "parent": $pageNav[6] + ",1,4", "child": "" },//模块7 致富信息23
+    { "parent": $pageNav[7] + ",1,6", "child": "" },//模块8 三农市场服务495
+    { "parent": $pageNav[8] + ",1,6", "child": "" },//模块9 三农市场信息493
+    { "parent": $pageNav[9] + ",0,7", "child": "" },//模块10 三农知识494
+    { "parent": $pageNav[10] + ",1,6", "child":  $pageNav[14] +",0,5" },//模块11 农资产品商城43 必须含有一个子导航的id 才能获取到子导航列表
+    { "parent": $pageNav[11] + ",2,4", "child": "" },//模块12 乡村文化商城486
+    { "parent": $pageNav[12] + ",3,9", "child": "" },//模块13 农副产品商城46
+    { "parent": $pageNav[13] + ",2,5", "child": "" },//模块14 三农人才市场487
+]
+
+let jsonString = JSON.stringify(getJson);
+
+async function getPageAllData() {
+    const mkdata = await requestDataPromise('/web/getWebsiteAllArticle', {
+        method: 'GET',
+        query: {
+            'id': jsonString
+        },
+    });
+
+    if (mkdata.code == 200) {
+        //模块1
+        mkdata.data[0].imgnum.forEach((item, index) => {
+            if (index < 1) {
+                boxData1.value.push(item);
+            } else {
+                boxData1data2.value.push(item);
+            }
+        });
+        boxData1data3.value = mkdata.data[0].textnum;
+        //模块2
+        boxData2.value = mkdata.data[1].imgnum;
+        boxData2data2.value = mkdata.data[1].textnum;
+        //模块3
+        boxData3.value = mkdata.data[2].imgnum;
+        boxData3data2.value = mkdata.data[2].textnum;
+        //模块4
+        boxData4.value = mkdata.data[3].imgnum;
+        boxData4data2.value = mkdata.data[3].textnum;
+        //模块5
+        boxData5.value = mkdata.data[4].imgnum;
+        boxData5data2.value = mkdata.data[4].textnum;
+        //模块6
+        mkdata.data[5].textnum.forEach((item, index) => {
+            if (index < 3) {
+                boxData6.value.push(item);
+            } else {
+                boxData6data2.value.push(item);
+            }
+        });
+        //模块7
+        boxData7.value = mkdata.data[6].imgnum;
+        boxData7data2.value = mkdata.data[6].textnum;
+        //模块8
+        boxData8.value = mkdata.data[7].imgnum;
+        boxData8data2.value = mkdata.data[7].textnum;
+        //模块9
+        boxData9.value = mkdata.data[8].imgnum;
+        boxData9data2.value = mkdata.data[8].textnum;
+        //模块10
+        boxData10.value = mkdata.data[9].textnum;
+        //模块11
+        boxData11.value = mkdata.data[10].imgnum;
+        boxData11data2.value = mkdata.data[10].textnum;
+        for (let index in mkdata.data[10].child.all_childcat) {
+            if (index < 6) {
+                boxData11menu.value.push(mkdata.data[10].child.all_childcat[index])
+            }
+        }
+        //模块12
+        boxData12.value = mkdata.data[11].imgnum;
+        boxData12data2.value = mkdata.data[11].textnum;
+        //模块13
+        mkdata.data[12].imgnum.forEach((item, index) => {
+            if (index < 1) {
+                boxData13.value.push(item);
+            } else {
+                boxData13data2.value.push(item);
+            }
+        });
+        boxData13data3.value = mkdata.data[12].textnum;
+        //模块14
+        boxData14.value = mkdata.data[13].imgnum;
+        // boxData14data2.value = mkdata.data[13].textnum;
+
+    } else {
+        ElMessage.error(mkdata.message)
+    }
+}
+getPageAllData();
+//获取模块下的特殊数据
+let getJson1 = [
+    { "parent": "487,0,5" },//模块14 三农人才市场487
+]
+let jsonString1 = JSON.stringify(getJson1);
+//获取模块下的特殊数据
+async function getPageData() {
+    const mkdata = await requestDataPromise('/web/getWebsiteArticles', {
+        method: 'GET',
+        query: {
+            'id': jsonString1
+        },
+    });
+    // console.log("成功获取模块数据2222!", mkdata);
+    if (mkdata.code == 200) {
+        console.log("成功获取模块数据2222!", mkdata);
+        //模块14 三农人才市场477
+        boxData14data2.value = mkdata.data[0].textnum;
+    }
+
+}
+getPageData();
+//4.页面数据 end---------------------------------------->
+
+//5.设置seo数据 start---------------------------------------->
+//获取seo数据
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
+    method: 'GET',
+    query: {},
+});
+if (setData.code == 200) {
+    let seoTitle = setData.data.website_head.title;
+    let seoDescription = setData.data.website_head.description;
+    let seoKeywords = setData.data.website_head.keywords;
+    let seoSuffix = setData.data.website_head.suffix;
+    let seoName = setData.data.website_head.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoSuffix,
+        meta: [
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+        ]
+    });
+} else {
+    console.log("设置首页SEO出错!", setData.message)
+}
+//5.设置seo数据 start---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/index.less');
+</style>

+ 39 - 39
pages/index.vue

@@ -5,12 +5,8 @@
         <main class="index_main">
             <!--头条-->
             <h1 class="head_h3">
-                <NuxtLink 
-                    v-if="headline"
-                    class="head_h3_a dot1" 
-                    :href="getLinkPathDetail(headline)" 
-                    :title="headline.title"
-                    :target="headline.islink == 1 ? '_blank' : '_self'">
+                <NuxtLink v-if="headline" class="head_h3_a dot1" :href="getLinkPathDetail(headline)"
+                    :title="headline.title" :target="headline.islink == 1 ? '_blank' : '_self'">
                     {{ headline.title }}
                 </NuxtLink>
             </h1>
@@ -386,7 +382,8 @@
                         </div>
                         <div class="index_2_head_right">
                             <NuxtLink class="index_6_head_right_a" v-for="item in boxData11menu"
-                                :to="{ path: `/${item.aLIas_pinyin}/list-1.html}` }" :title="item.alias">
+                                :to="{ path: `/${pageData[10].aLIas_pinyin}/${item.aLIas_pinyin}/index.html` }"
+                                :title="item.alias">
                                 {{ item.alias }}
                             </NuxtLink>
                         </div>
@@ -527,7 +524,7 @@
                         </div>
                     </div>
                     <div class="index_name_ul">
-                        <div class="index_name_ul_li" v-for="(item,index) in boxData14data2" :key="index">
+                        <div class="index_name_ul_li" v-for="(item, index) in boxData14data2" :key="index">
                             <NuxtLink class="index_name_ul_li_tag" :href="getLinkPath1(item)" :title="item.title"
                                 :target="item.islink == 1 ? '_blank' : '_self'">
                                 <div class="index_img_ul_7_li_dot1 dot1">
@@ -545,7 +542,7 @@
                     <!--end 人才市场-->
                 </div>
             </section>
-            
+
             <HomeAdvertising :imgurl="adImg4"></HomeAdvertising>
         </main>
         <HomeFoot></HomeFoot>
@@ -571,7 +568,7 @@ async function getModelData1() {
             'textnum': 1,
             'level': 1,
             'placeid': 0,
-            'id': ''
+            'id': 0
         },
     });
     if (mkdata.code == 200) {
@@ -593,7 +590,7 @@ async function getModelData3() {
             'textnum': 10,
             'level': 6,
             'placeid': 0,
-            'id': ''
+            'id': 0
         },
     });
     if (mkdata.code == 200) {
@@ -728,6 +725,9 @@ const boxData13data3 = ref([]);
 const boxData14 = ref([]);
 const boxData14data2 = ref([]);
 
+//获得全局配置的导航数据
+const { $pageNav } = useNuxtApp();
+
 //4.3获得导航数据
 try {
     const navigateData = await requestDataPromise('/web/getWebsiteModelCategory', {
@@ -751,33 +751,33 @@ try {
             };
             //渲染标题
             //1 农业市场484
-            if (navigateData.data[index].category_id == 484) { pageData.value[0] = data }
+            if (navigateData.data[index].category_id == $pageNav[0]) { pageData.value[0] = data }
             //2 特产商场490
-            if (navigateData.data[index].category_id == 490) { pageData.value[1] = data }
+            if (navigateData.data[index].category_id == $pageNav[1]) { pageData.value[1] = data }
             //3 三农科教商城488
-            if (navigateData.data[index].category_id == 488) { pageData.value[2] = data }
+            if (navigateData.data[index].category_id == $pageNav[2]) { pageData.value[2] = data }
             //4 乡村生活商城483
-            if (navigateData.data[index].category_id == 483) { pageData.value[3] = data }
+            if (navigateData.data[index].category_id == $pageNav[3]) { pageData.value[3] = data }
             //5 三农市场动态491
-            if (navigateData.data[index].category_id == 491) { pageData.value[4] = data }
+            if (navigateData.data[index].category_id == $pageNav[4]) { pageData.value[4] = data }
             //6 三农市场管理492
-            if (navigateData.data[index].category_id == 492) { pageData.value[5] = data }
+            if (navigateData.data[index].category_id == $pageNav[5]) { pageData.value[5] = data }
             //7 致富信息23
-            if (navigateData.data[index].category_id == 23) { pageData.value[6] = data }
+            if (navigateData.data[index].category_id == $pageNav[6]) { pageData.value[6] = data }
             //8 三农市场服务495
-            if (navigateData.data[index].category_id == 495) { pageData.value[7] = data }
+            if (navigateData.data[index].category_id == $pageNav[7]) { pageData.value[7] = data }
             //9 三农市场信息493
-            if (navigateData.data[index].category_id == 493) { pageData.value[8] = data }
+            if (navigateData.data[index].category_id == $pageNav[8]) { pageData.value[8] = data }
             //10 三农知识494
-            if (navigateData.data[index].category_id == 494) { pageData.value[9] = data }
+            if (navigateData.data[index].category_id == $pageNav[9]) { pageData.value[9] = data }
             //11 农资产品商城43
-            if (navigateData.data[index].category_id == 43) { pageData.value[10] = data }
+            if (navigateData.data[index].category_id == $pageNav[10]) { pageData.value[10] = data }
             //12 乡村文化商城486
-            if (navigateData.data[index].category_id == 486) { pageData.value[11] = data }
+            if (navigateData.data[index].category_id == $pageNav[11]) { pageData.value[11] = data }
             //13 农副产品商城46
-            if (navigateData.data[index].category_id == 46) { pageData.value[12] = data }
+            if (navigateData.data[index].category_id == $pageNav[12]) { pageData.value[12] = data }
             //14 三农人才市场487
-            if (navigateData.data[index].category_id == 487) { pageData.value[13] = data }
+            if (navigateData.data[index].category_id == $pageNav[13]) { pageData.value[13] = data }
 
         }
     } else {
@@ -788,20 +788,20 @@ try {
 }
 
 let getJson = [
-    { "parent": "484,3,9", "child": "" },//模块1 农业市场484
-    { "parent": "490,1,2", "child": "" },//模块2 特产商场490
-    { "parent": "488,1,6", "child": "" },//模块3 三农科教商城488
-    { "parent": "483,2,4", "child": "" },//模块4 乡村生活商城483
-    { "parent": "491,1,5", "child": "" },//模块5 三农市场动态491
-    { "parent": "492,0,9", "child": "" },//模块6 三农市场管理492
-    { "parent": "23,1,4", "child": "" },//模块7 致富信息23
-    { "parent": "495,1,6", "child": "" },//模块8 三农市场服务495
-    { "parent": "493,1,6", "child": "" },//模块9 三农市场信息493
-    { "parent": "494,0,7", "child": "" },//模块10 三农知识494
-    { "parent": "43,1,6", "child": "189,0,5" },//模块11 农资产品商城43 必须含有一个子导航的id 才能获取到子导航列表
-    { "parent": "486,2,4", "child": "" },//模块12 乡村文化商城486
-    { "parent": "46,3,9", "child": "" },//模块13 农副产品商城46
-    { "parent": "487,2,5", "child": "" },//模块14 三农人才市场487
+    { "parent": $pageNav[0] + ",3,9", "child": "" },//模块1 农业市场484
+    { "parent": $pageNav[1] + ",1,2", "child": "" },//模块2 特产商场490
+    { "parent": $pageNav[2] + ",1,6", "child": "" },//模块3 三农科教商城488
+    { "parent": $pageNav[3] + ",2,4", "child": "" },//模块4 乡村生活商城483
+    { "parent": $pageNav[4] + ",1,5", "child": "" },//模块5 三农市场动态491
+    { "parent": $pageNav[5] + ",0,9", "child": "" },//模块6 三农市场管理492
+    { "parent": $pageNav[6] + ",1,4", "child": "" },//模块7 致富信息23
+    { "parent": $pageNav[7] + ",1,6", "child": "" },//模块8 三农市场服务495
+    { "parent": $pageNav[8] + ",1,6", "child": "" },//模块9 三农市场信息493
+    { "parent": $pageNav[9] + ",0,7", "child": "" },//模块10 三农知识494
+    { "parent": $pageNav[10] + ",1,6", "child": $pageNav[14] + ",0,5" },//模块11 农资产品商城43 必须含有一个子导航的id 才能获取到子导航列表
+    { "parent": $pageNav[11] + ",2,4", "child": "" },//模块12 乡村文化商城486
+    { "parent": $pageNav[12] + ",3,9", "child": "" },//模块13 农副产品商城46
+    { "parent": $pageNav[13] + ",2,5", "child": "" },//模块14 三农人才市场487
 ]
 
 let jsonString = JSON.stringify(getJson);

+ 50 - 0
plugins/category.ts

@@ -0,0 +1,50 @@
+
+//master 环境
+const navMaster: number[] = [
+    484,//模块1 农业市场484
+    490, //模块2 特产商城490
+    488,//模块3 三农科教商城488
+    483,//模块4 乡村生活商城483
+    491,//模块5 三农市场动态491
+    492,//模块6 三农市场管理492
+    23,//模块7 致富信息23
+    495, //模块8 三农市场服务495
+    493,//模块9 三农市场信息493
+    494,//模块10 三农知识494
+    43,//模块11 农资产品商城43
+    486,//模块12 乡村文化商城486
+    46,//模块13 农副产品商城46
+    487,//模块14 三农人才市场487
+
+    // 二级导航
+    791,// 农资产品商城-农资资讯791
+
+]
+
+const navPre: number[] = [
+    474,//模块1 农业市场474
+    479, //模块2 特产商城479
+    478,//模块3 三农科教商城478
+    473,//模块4 乡村生活商城473
+    481,//模块5 三农市场动态481
+    482,//模块6 三农市场管理482
+    23,//模块7 致富信息23
+    485, //模块8 三农市场服务485
+    483,//模块9 三农市场信息483
+    484,//模块10 三农知识484
+    43,//模块11 农资产品商城43
+    476,//模块12 乡村文化商城476
+    46,//模块13 农副产品商城46
+    477,//模块14 三农人才市场477
+
+    // 二级导航
+    688,// 农资产品商城-农资资讯688
+
+]
+
+export default defineNuxtPlugin((nuxtApp) => {
+    //master 环境
+    nuxtApp.provide('pageNav', navMaster)
+    //pre 环境
+    // nuxtApp.provide('pageNav', navPre)
+})

BIN
public/topic/empty.png