Jelajahi Sumber

首页搜索功能完成

Jing 1 hari lalu
induk
melakukan
d5220ace92

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

@@ -47,6 +47,10 @@ interface _GlobalComponents {
     'NewsDetailSec': typeof import("../components/news/detail_sec.vue")['default']
     'NewsList': typeof import("../components/news/list.vue")['default']
     'NewsListSec': typeof import("../components/news/list_sec.vue")['default']
+    'SearchCompany': typeof import("../components/search/company.vue")['default']
+    'SearchGoods': typeof import("../components/search/goods.vue")['default']
+    'SearchNews': typeof import("../components/search/news.vue")['default']
+    'SearchProject': typeof import("../components/search/project.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']
@@ -115,6 +119,10 @@ interface _GlobalComponents {
     'LazyNewsDetailSec': typeof import("../components/news/detail_sec.vue")['default']
     'LazyNewsList': typeof import("../components/news/list.vue")['default']
     'LazyNewsListSec': typeof import("../components/news/list_sec.vue")['default']
+    'LazySearchCompany': typeof import("../components/search/company.vue")['default']
+    'LazySearchGoods': typeof import("../components/search/goods.vue")['default']
+    'LazySearchNews': typeof import("../components/search/news.vue")['default']
+    'LazySearchProject': typeof import("../components/search/project.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']
@@ -189,6 +197,10 @@ export const NewsDetail: typeof import("../components/news/detail.vue")['default
 export const NewsDetailSec: typeof import("../components/news/detail_sec.vue")['default']
 export const NewsList: typeof import("../components/news/list.vue")['default']
 export const NewsListSec: typeof import("../components/news/list_sec.vue")['default']
+export const SearchCompany: typeof import("../components/search/company.vue")['default']
+export const SearchGoods: typeof import("../components/search/goods.vue")['default']
+export const SearchNews: typeof import("../components/search/news.vue")['default']
+export const SearchProject: typeof import("../components/search/project.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']
@@ -257,6 +269,10 @@ export const LazyNewsDetail: typeof import("../components/news/detail.vue")['def
 export const LazyNewsDetailSec: typeof import("../components/news/detail_sec.vue")['default']
 export const LazyNewsList: typeof import("../components/news/list.vue")['default']
 export const LazyNewsListSec: typeof import("../components/news/list_sec.vue")['default']
+export const LazySearchCompany: typeof import("../components/search/company.vue")['default']
+export const LazySearchGoods: typeof import("../components/search/goods.vue")['default']
+export const LazySearchNews: typeof import("../components/search/news.vue")['default']
+export const LazySearchProject: typeof import("../components/search/project.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":"75738b2e-5ba5-45ba-9edc-bc7898e94d69","timestamp":1754633814552}
+{"id":"9355e7f4-cd55-417c-9829-3daf706e9b2d","timestamp":1754984563869}

+ 0 - 1
.nuxt/manifest/meta/75738b2e-5ba5-45ba-9edc-bc7898e94d69.json

@@ -1 +0,0 @@
-{"id":"75738b2e-5ba5-45ba-9edc-bc7898e94d69","timestamp":1754633814552,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 1 - 0
.nuxt/manifest/meta/9355e7f4-cd55-417c-9829-3daf706e9b2d.json

@@ -0,0 +1 @@
+{"id":"9355e7f4-cd55-417c-9829-3daf706e9b2d","timestamp":1754984563869,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 1 - 1
.nuxt/tsconfig.json

@@ -102,7 +102,7 @@
         "./imports"
       ],
       "#app-manifest": [
-        "./manifest/meta/75738b2e-5ba5-45ba-9edc-bc7898e94d69.json"
+        "./manifest/meta/9355e7f4-cd55-417c-9829-3daf706e9b2d.json"
       ],
       "#components": [
         "./components"

+ 490 - 0
assets/css/project.less

@@ -0,0 +1,490 @@
+//导航条
+.breadcrumb {
+    width: 100%;
+    height: 22px;
+    margin-bottom: 30px;
+    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;
+
+    :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;
+    }
+}
+
+.empty {
+    width: 100%;
+    min-height: 400px;
+    line-height: 400px;
+    font-size: 26px;
+    color: #CCCCCC;
+
+    div {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+    }
+
+    img {
+        display: inline-block;
+    }
+}
+
+// 资讯列表
+.newsList {
+    width: 1200px;
+    margin: 0 auto;
+    margin-bottom: 70px;
+
+    .inner {
+        width: 1200px;
+
+        .innerLeft {
+            width: 100%;
+        }
+
+        .innerLeft,
+        .innerRight {
+            border-top: 1px solid #CCCCCC;
+            clear: both;
+            float: none;
+        }
+
+        .innerLeft {
+
+            >.list {
+                margin-bottom: 70px;
+
+                >li {
+                    width: 100%;
+                    padding: 10px 0;
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+
+
+                    >a {
+                        display: inline-block;
+                        width: 1150px;
+                        height: 26px;
+                        white-space: nowrap;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                        font-family: Microsoft YaHei, Microsoft YaHei;
+                        font-weight: 400;
+                        font-size: 20px;
+                        color: #333333;
+                        line-height: 26px;
+                        text-align: left;
+                        font-style: normal;
+                        text-transform: none;
+                    }
+
+                    .time {
+                        font-family: Microsoft YaHei, Microsoft YaHei;
+                        font-weight: 400;
+                        font-size: 18px;
+                        color: #333333;
+                    }
+
+                }
+
+                >li:hover>a {
+                    color: #a91b33;
+                }
+
+                >li:nth-child(1)::after,
+                >li:nth-child(2)::after {
+                    content: "热";
+                    margin-left: 13px;
+                    background: #ffb70f;
+                    color: #fff;
+                    font-size: 14px;
+                    padding: 0px 2px;
+                }
+
+                >li:nth-child(5n) {
+                    border-bottom: 1px solid #D9D9D9;
+                    padding-bottom: 30px;
+                }
+
+                >li:nth-child(5n+1) {
+                    span {
+                        font-weight: bold;
+                    }
+
+                    font-weight: bold;
+                    padding-top: 30px;
+
+                }
+            }
+
+            >.pagination {
+                width: 100%;
+                height: 34px;
+                margin-left: 141px;
+                display: flex;
+                justify-content: center;
+                margin: 0;
+
+                // 鼠标移入后字体颜色
+                .el-pagination::v-deep :hover {
+                    color: #a91b33;
+                }
+
+                .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: #a91b33;
+                    color: #fff;
+                }
+
+
+            }
+        }
+
+        .innerRight {
+            width: 381px;
+            height: 605px;
+            clear: both;
+            overflow: hidden;
+        }
+    }
+}
+
+//资讯推荐
+.zixuntuijian {
+    width: 100%;
+    height: 290px;
+    margin-bottom: 70px;
+
+    .innerLeft {
+
+        // 左侧
+        .zixunLeft {
+            margin-right: 30px;
+        }
+
+        .zixunRight,
+        .zixunLeft {
+            float: left;
+            width: 380px;
+            height: 290px;
+
+            // 标题部分
+            >.title {
+                width: 380px;
+            }
+
+            >.title>h3 {
+                height: 36px;
+                font-family: Source Han Sans, Source Han Sans;
+                font-weight: bold;
+                font-size: 24px;
+                color: #000000;
+                line-height: 28px;
+                text-align: left;
+                font-style: normal;
+                text-transform: none;
+                border-bottom: 1px solid #a91b33;
+
+            }
+
+            >.title>h3>span {
+                float: right;
+                width: 56px;
+                height: 20px;
+                line-height: 24px;
+                font-weight: 400;
+                font-size: 14px;
+                color: #999999;
+                font-style: normal;
+                text-transform: none;
+            }
+
+            .photo_text {
+
+                >li:first-child {
+                    width: 380px;
+                    height: 120px;
+                    margin-top: 20px;
+                    margin-bottom: 15px;
+                    position: relative;
+
+                    >img {
+                        float: left;
+                        width: 160px;
+                        height: 120px;
+                    }
+
+                    >div {
+                        float: left;
+                        width: 220px;
+                        height: 120px;
+                        padding-left: 15px;
+                        padding-top: 6px;
+                        box-sizing: border-box;
+                        background-color: #f6f6f6;
+
+
+                        >h5 {
+                            width: 200px;
+                            height: 54px;
+                            display: -webkit-box;
+                            -webkit-box-orient: vertical;
+                            -webkit-line-clamp: 2;
+                            overflow: hidden;
+                            text-overflow: ellipsis;
+                            word-break: break-all;
+                            font-family: Source Han Sans, Source Han Sans;
+                            font-weight: 500;
+                            font-size: 18px;
+                            color: #333333;
+                            line-height: 26px;
+                            text-align: left;
+                            font-style: normal;
+                            text-transform: none;
+                        }
+
+                        >p {
+                            width: 200px;
+                            height: 22px;
+                            line-height: 20px;
+                            position: absolute;
+                            bottom: 5px;
+                            right: 0;
+
+                            >span {
+                                display: inline-block;
+                                // width: 100px;
+                                height: 18px;
+                                font-family: Source Han Sans, Source Han Sans;
+                                font-weight: 400;
+                                font-size: 12px;
+                                color: #999999;
+                                text-align: left;
+                                line-height: 14px;
+                                font-style: normal;
+                                text-transform: none;
+                            }
+
+                            >span:last-child {
+                                // width: 90px;
+                                text-align: right;
+                                margin-left: 20px;
+                            }
+
+                        }
+                    }
+                }
+
+                >li {
+                    width: 380px;
+                    height: 25px;
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                    font-family: PingFang SC, PingFang SC;
+                    font-weight: 500;
+                    font-size: 18px;
+                    color: #333333;
+                    line-height: 21px;
+                    text-align: left;
+                    font-style: normal;
+                    text-transform: none;
+                    margin-bottom: 10px;
+
+                    em {
+                        display: inline-block;
+                        width: 8px;
+                        height: 8px;
+                        border-radius: 8px;
+                        margin-right: 10px;
+                        background-color: #d9d9d9;
+                    }
+                }
+
+                >li:hover {
+                    color: #a91b33;
+                }
+
+                >li:hover em {
+                    background-color: #a91b33;
+                }
+            }
+        }
+    }
+
+    .innerRight {
+        width: 381px;
+        height: 290px;
+        background-color: #fbfbfb;
+
+        >.title {
+            width: 380px;
+            height: 40px;
+            line-height: 40px;
+            border-top: 1px solid #a91b33;
+            border-bottom: 1px solid #e7e7e7;
+
+            >h4 {
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                font-weight: 400;
+                margin-left: 20px;
+                font-size: 20px;
+                color: #000000;
+                text-align: left;
+                font-style: normal;
+                text-transform: none;
+
+                >span {
+                    float: right;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-weight: 400;
+                    font-size: 14px;
+                    margin-right: 10px;
+                    color: #999999;
+                    text-align: left;
+                    font-style: normal;
+                    text-transform: none;
+                }
+            }
+
+        }
+
+        .rightList {
+            height: 540px;
+            margin-top: 20px;
+
+            >li {
+                height: 100px;
+                margin-bottom: 10px;
+
+                >img {
+                    width: 150px;
+                    height: 100px;
+                }
+
+                >p {
+                    width: 219px;
+                    height: 100px;
+                    padding-left: 12px;
+                    font-family: PingFang SC, PingFang SC;
+                    font-weight: 400;
+                    font-size: 16px;
+                    color: #333333;
+                    line-height: 22px;
+                    text-align: left;
+                    font-style: normal;
+                    text-transform: none;
+
+                }
+
+                >p:hover {
+                    box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.1);
+                }
+            }
+        }
+
+    }
+}
+
+.searchBox {
+    text-align: center;
+    padding-bottom: 40px;
+}
+
+.search {
+    width: 100%;
+    height: 100px;
+    margin-top: 40px;
+
+    .inner {
+        width: 1200px;
+        height: 100px;
+        padding-top: 10px;
+        text-align: center;
+
+        input {
+            width: 582px;
+            height: 46px;
+            outline: none;
+            border: 1px solid #E6E6E6;
+            border-radius: 0;
+            padding-left: 20px;
+            vertical-align: 0px;
+            font-size: 16px;
+            color: #666666
+        }
+
+        button {
+            width: 120px;
+            height: 48px;
+            background-color: #a91b33;
+            font-size: 16px;
+            letter-spacing: 4px;
+            color: #fff;
+            border: none;
+            border-radius: 0;
+            cursor: pointer;
+        }
+    }
+}

+ 26 - 2
assets/css/public/nav.less

@@ -1,3 +1,7 @@
+* {
+    font-family: "微软雅黑", "microsoft yahei";
+}
+
 // 导航部分
 .partOne {
     width: 100%;
@@ -214,13 +218,13 @@
             height: 60px;
             line-height: 60px;
             display: flex;
-            justify-content: flex-start;
+            justify-content: space-between;
 
             .serverTitle {
                 font-size: 16px;
                 color: #333;
                 font-weight: bold;
-                margin-right: 30px;
+                margin-right: 50px;
 
                 a {
                     color: #333;
@@ -262,6 +266,26 @@
                 margin-right: 10px;
             }
 
+            // 单选框
+            :deep(.el-radio__input.is-checked .el-radio__inner) {
+                background: #a91b33;
+                border-color: #a91b33;
+            }
+
+            :deep(.el-radio__input.is-checked+.el-radio__label) {
+                color: #333333;
+            }
+
+            :deep(.el-radio__label) {
+                font-size: 16px;
+                font-weight: 400px;
+            }
+
+            .el-radio {
+                --el-radio-input-border-color-hover: #a91b33;
+            }
+
+
         }
 
         .deepServer_right {

+ 5 - 1
assets/css/search.less

@@ -112,8 +112,12 @@
 
 
                     >a {
-                        width: 360px;
+                        display: inline-block;
+                        width: 950px;
                         height: 26px;
+                        white-space: nowrap;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
                         font-family: Microsoft YaHei, Microsoft YaHei;
                         font-weight: 400;
                         font-size: 20px;

+ 93 - 0
assets/css/search/global.less

@@ -0,0 +1,93 @@
+//导航条
+.breadcrumb {
+    width: 100%;
+    height: 22px;
+    margin-bottom: 30px;
+    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;
+
+    :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;
+    }
+}
+
+.search {
+    width: 100%;
+    height: 100px;
+    margin-top: 40px;
+
+    .inner {
+        width: 1200px;
+        height: 100px;
+        padding-top: 10px;
+        text-align: center;
+
+        input {
+            width: 582px;
+            height: 46px;
+            outline: none;
+            border: 1px solid #E6E6E6;
+            border-radius: 0;
+            padding-left: 20px;
+            vertical-align: 0px;
+            font-size: 16px;
+            color: #666666
+        }
+
+        button {
+            width: 120px;
+            height: 48px;
+            background-color: #a91b33;
+            font-size: 16px;
+            letter-spacing: 4px;
+            color: #fff;
+            border: none;
+            border-radius: 0;
+            cursor: pointer;
+        }
+    }
+}

+ 191 - 0
assets/css/search/goods.less

@@ -0,0 +1,191 @@
+.index_main {
+    width: 1200px;
+    margin: 0px auto 30px;
+    border-top: solid 1px #E9E9E9;
+    min-height: 400px;
+}
+
+/* 三农市场网-商城-商品列表 */
+.categ_table {
+    .categ_table_head_box {
+        height: 61px;
+        border-bottom: solid 1px #E9E9E9;
+    }
+
+    .categ_table_head_box>.categ_table_td_1 {
+        height: 61px;
+        line-height: 61px;
+    }
+
+    .categ_table_head_box>.categ_table_td_2 {
+        height: 61px;
+        line-height: 61px;
+    }
+
+    .categ_table_head_box>.categ_table_td_3 {
+        height: 61px;
+        line-height: 61px;
+    }
+
+    .categ_table_head_box>.categ_table_td_4 {
+        height: 61px;
+        line-height: 61px;
+    }
+
+    .categ_table_td_1 {
+        float: left;
+        height: 100%;
+        text-align: center;
+        color: #666;
+        font-size: 16px;
+        width: 155px;
+        margin-right: 126px;
+    }
+
+    .categ_table_td_2 {
+        float: left;
+        height: 100%;
+        text-align: center;
+        color: #666;
+        font-size: 16px;
+        width: 480px;
+        margin-right: 124px;
+    }
+
+    .categ_table_td_3 {
+        float: left;
+        height: 100%;
+        text-align: center;
+        color: #666;
+        font-size: 16px;
+        width: 120px;
+        margin-right: 62px;
+    }
+
+    .categ_table_td_4 {
+        float: left;
+        height: 100%;
+        text-align: center;
+        color: #666;
+        font-size: 16px;
+        width: 133px;
+    }
+
+    .categ_table_li {
+        height: 161px;
+        box-sizing: border-box;
+        padding: 15px 0px;
+        border-bottom: solid 1px #E9E9E9;
+    }
+
+    .categ_table_td_1_img {
+        display: block;
+        width: 130px;
+        height: 130px;
+        margin: 0px auto;
+    }
+
+    .categ_table_li .categ_table_td_1 {
+        line-height: 160px;
+        line-height: 160px;
+    }
+
+    .categ_table_li .categ_table_td_2 {
+        height: 100%;
+        display: flex;
+        align-items: center;
+    }
+
+    .categ_table_td_2_in {
+        display: flex;
+        flex-direction: column;
+        width: 100%;
+    }
+
+    .categ_table_li .categ_table_td_2_dot1 {
+        text-align: left;
+        flex-basis: 100%;
+        height: 21px;
+        line-height: 21px;
+        font-size: 16px;
+        font-weight: bold;
+        color: #333;
+    }
+
+    .categ_table_li .categ_table_td_2_dot2 {
+        flex-basis: 100%;
+        max-height: 36px;
+        text-align: left;
+        line-height: 18px;
+        width: 100%;
+        font-size: 14px;
+        color: #999;
+    }
+
+    .categ_table_li .categ_table_td_3 {
+        line-height: 144px;
+    }
+
+    .categ_table_li .categ_table_td_4 {
+        line-height: 144px;
+    }
+}
+
+.empty {
+    width: 100%;
+    height: 300px;
+    line-height: 300px;
+    text-align: center;
+}
+
+.empty_img {
+    vertical-align: -30px;
+    margin-right: 20px;
+}
+
+.empty_text {
+    font-size: 26px;
+    color: #999;
+}
+
+//分页
+.pagination11 {
+    width: 1200px;
+    margin: 50px auto;
+}
+
+.pagination {
+    width: 1200px;
+    height: 34px;
+    margin-left: 141px;
+    display: flex;
+    justify-content: center;
+    margin: 0;
+
+    // 鼠标移入后字体颜色
+    .el-pagination::v-deep :hover {
+        color: #a91b33;
+    }
+
+    .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: #a91b33;
+        color: #fff;
+    }
+}

+ 10 - 10
components/company/class.vue

@@ -280,16 +280,16 @@
                     </div>
                     <div class="boxheight1 clearfix">
                         <div class="channel_img_ul_5_ul">
-                            <div class="channel_img_ul_5_li" v-if="companyData[6]">
+                            <div class="channel_img_ul_5_li">
                                 <NuxtLink class="channel_img_ul_5_li_a" :href="getLinkPathDetail(item)"
                                     :title="item.title" v-for="item in companyData[6].data" :key="item.id"
                                     :target="item.islink == 1 ? '_blank' : '_self'">
                                     <img class="channel_img_ul_5_li_img" :src="item.imgurl" alt="item.title">
-                                    <div class="channel_img_ul_5_li_dot1 dot1">{{ item.title }}</div>
+                                    <div class="channel_img_ul_5_li_dot1 dot1">{{ item.title }} </div>
                                 </NuxtLink>
                             </div>
                         </div>
-                        <div class="index_ul_7 clearfix" v-if="companyData[6]">
+                        <div class="index_ul_7 clearfix">
                             <NuxtLink class="index_ul_7_a dot1" :href="getLinkPathDetail(item)" :title="item.title"
                                 v-for="item in companyData[6].data2" :key="item.id"
                                 :target="item.islink == 1 ? '_blank' : '_self'">
@@ -525,7 +525,7 @@ async function getPageAllData(jsonString) {
             'id': jsonString
         },
     });
-    console.log('mkdata', mkdata.data);
+    console.log('mkdata', mkdata.data.length);
     if (mkdata.code == 200) {
         // if (mkdata.data.length > 0) {
         //     //模块1 顶部大图和列表
@@ -543,31 +543,31 @@ async function getPageAllData(jsonString) {
                 }
             }
         }
-        if (mkdata.data.length > 1) {
+        if (mkdata.data.length >= 1) {
             //模块3
             companyData.value[1].data = mkdata.data[1].img_num;
             companyData.value[1].data2 = mkdata.data[1].text_num;
         }
-        if (mkdata.data.length > 2) {
+        if (mkdata.data.length >= 2) {
             //模块4
             companyData.value[2].data = mkdata.data[2].img_num;
             companyData.value[2].data2 = mkdata.data[2].text_num;
         }
-        if (mkdata.data.length > 4) {
+        if (mkdata.data.length >= 4) {
             //模块5
             companyData.value[3].data = mkdata.data[3].img_num;
         }
-        if (mkdata.data.length > 5) {
+        if (mkdata.data.length >= 5) {
             //模块6
             companyData.value[4].data = mkdata.data[4].img_num;
             companyData.value[4].data2 = mkdata.data[4].text_num;
         }
-        if (mkdata.data.length > 6) {
+        if (mkdata.data.length >= 6) {
             //模块7
             companyData.value[5].data = mkdata.data[5].img_num;
             companyData.value[5].data2 = mkdata.data[5].text_num;
         }
-        if (mkdata.data.length > 7) {
+        if (mkdata.data.length >= 7) {
             //模块8
             companyData.value[6].data = mkdata.data[6].img_num;
             companyData.value[6].data2 = mkdata.data[6].text_num;

+ 12 - 10
components/home/pageHead.vue

@@ -24,7 +24,8 @@
                             <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon4.png" alt="注册">注册
                         </button>
                         <button class="reg" @click="userCenter" v-show="showToken">
-                            <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon3.png" alt="用户信息">{{ username }}
+                            <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon3.png" alt="用户信息">{{
+                            username }}
                         </button>
                         <button class="reg" @click="goSearch">
                             <img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/searchicon.png" alt="搜索">搜索
@@ -42,9 +43,10 @@
             <div class="inner">
                 <img :src="logo" :alt="webSiteName" class="left" @click="backHome">
                 <div class="titlead" v-if="adImg">
-                    <a href="http://sannongdy.org.cn/" v-if="adImg.image_url==null" target="_blank" :title="adImg.place_name">
+                    <a href="http://sannongdy.org.cn/" v-if="adImg.image_url == null" target="_blank"
+                        :title="adImg.place_name">
                         <img :src="adImg.thumb" :alt="adImg.place_name" data-tag="imgurl.ad_tag">
-                    </a>     
+                    </a>
                     <a :href="adImg.image_url" v-else :title="adImg.ad_name">
                         <img :src="adImg.image_src" :alt="adImg.ad_name" data-tag="imgurl.ad_tag">
                     </a>
@@ -71,7 +73,7 @@
 <script setup>
 //1.加载基本依赖 start ---------------------------------------->
 import { ref, watch, onMounted } from 'vue'
-import { ElDialog,ElMessage } from 'element-plus'
+import { ElDialog, ElMessage } from 'element-plus'
 import { getToken, setToken, removeToken } from '@/store/useCookieStore'
 import { setTicket, removeTicket } from '@/store/useticketStore'
 //网站地址
@@ -193,7 +195,7 @@ let backHome = () => {
 
 //点击搜索按钮
 let goSearch = () => {
-    const route = `/search/search?keyword=${keyword.value}`;
+    const route = `/search/search?keyword=${keyword.value}&type=1`;
     window.location.href = route;
 }
 
@@ -254,7 +256,7 @@ let adImg = ref({})
 
 //5.获取登录状态 start ---------------------------------------->
 onMounted(async () => {
-    
+
     //从客户端获取登录状态
     //从客户端阶段开始 持续查询登录状态
     let getLoginStatus = async () => {
@@ -262,12 +264,12 @@ onMounted(async () => {
         const token = getToken();
         const { $webUrl, $CwebUrl } = useNuxtApp();
 
-        if(token == undefined){
+        if (token == undefined) {
             //如果没有获取到token 不访问后端获取在线状态
             console.log("没有获取到token!无需查询登录状态!")
             showToken.value = false;
 
-        }else{
+        } else {
             //如果获取到了token 访问后端查询状态
             console.log("已获取到用户token,开始查询登录状态!")
             const queryParams = new URLSearchParams({
@@ -285,7 +287,7 @@ onMounted(async () => {
             });
             const result = await responseStatus.json();
             console.log(result)
-            
+
             if (result.code == 200) {
                 console.log("用户已经登录!");
                 showToken.value = true;
@@ -342,5 +344,5 @@ onMounted(async () => {
 </script>
 
 <style lang="less" scoped>
-    @import url('@/assets/css/public/head.less');
+@import url('@/assets/css/public/head.less');
 </style>

+ 12 - 12
components/home/pageNavigation.vue

@@ -63,13 +63,12 @@
                             网站首页
                         </NuxtLink>
                     </div>
-                    <el-checkbox-group v-model="checkList">
-                        <el-checkbox label="产品" value="1" disabled />
-                        <el-checkbox label="企业" value="2" disabled />
-                        <el-checkbox label="人才" value="3" disabled />
-                        <el-checkbox label="展会" value="4" disabled />
-                        <el-checkbox label="资讯" value="5" checked disabled />
-                    </el-checkbox-group>
+                    <el-radio-group v-model="checkList">
+                        <el-radio value="1">资讯</el-radio>
+                        <el-radio value="2">商城</el-radio>
+                        <el-radio value="6">企业</el-radio>
+                        <el-radio value="7">项目</el-radio>
+                    </el-radio-group>
                     <!-- <div class="serverTitle1">
                         <a href="">
                             农资商务中心
@@ -92,7 +91,7 @@
 
 <script setup>
 //1.获取导航菜单 start ---------------------------------------->
-import { ElCheckbox, ElCheckboxGroup, ElMessage } from 'element-plus'
+import { ElCheckbox, ElCheckboxGroup, ElMessage, ElRadio, ElRadioGroup } from 'element-plus'
 let showTwo = ref(false);
 
 //第一行导航菜单 10个
@@ -168,15 +167,16 @@ getNavigation4();
 
 //2.搜索 start ---------------------------------------->
 const typeValue = ref("")
-const checkList = ref([]);// 多选框
+const checkList = ref("1");// 单选
+
 
 const inputValue = ref("") //关键词搜索
 //2.1跳转到搜索页面
 let goToPrimary = async () => {
-    if (inputValue.value == "") {
-        ElMessage.error('搜索项不能为空!')
+    if (checkList.value == "") {
+        ElMessage.error('搜索项类型不能为空!')
     } else {
-        const route = `/search/search?keyword=${inputValue.value}`;
+        const route = `/search/search?keyword=${inputValue.value}&type=${checkList.value}`;
         window.location.href = route;
     }
 }

+ 60 - 34
components/home/pageNavigation1.vue

@@ -13,10 +13,17 @@
                     </div>
                 </div>
                 <ul class="navigationOne">
-                    <li v-for="item in navigation1">
-                        <NuxtLink 
-                            :href="getLinkPath(item)" 
-                            :title="item.alias"
+                    <li v-for="item in navigation1"
+                        @mousemove="item.alias == '供求信息' ? showTwo = true : showTwo = false">
+                        <NuxtLink :href="getLinkPath(item)" :title="item.alias"
+                            :target="item.is_url == 1 ? '_blank' : '_self'">
+                            {{ item.alias }}
+                        </NuxtLink>
+                    </li>
+                </ul>
+                <ul class="navigationTwo" v-if="showTwo" @mouseleave="showTwo = false">
+                    <li v-for="(item, index) in secNav" :key="index">
+                        <NuxtLink :href="`/gongqiuxinxi/${item.aLIas_pinyin}/index.html`" :title="item.alias"
                             :target="item.is_url == 1 ? '_blank' : '_self'">
                             {{ item.alias }}
                         </NuxtLink>
@@ -30,9 +37,7 @@
                 <ul class="part2_left">
                     <li>农资商城</li>
                     <li class="part2_navList" v-for="item in navigation2">
-                        <NuxtLink 
-                            :href="getLinkPath(item)" 
-                            :title="item.alias"
+                        <NuxtLink :href="getLinkPath(item)" :title="item.alias"
                             :target="item.is_url == 1 ? '_blank' : '_self'">
                             {{ item.alias }}
                         </NuxtLink>
@@ -40,9 +45,7 @@
                 </ul>
                 <ul class="part2_right">
                     <li class="part2_right_navList" v-for="(item, index) in navigation3">
-                        <NuxtLink 
-                            :href="getLinkPath(item)" 
-                            :title="item.alias"
+                        <NuxtLink :href="getLinkPath(item)" :title="item.alias"
                             :target="item.is_url == 1 ? '_blank' : '_self'">
                             {{ item.alias }}
                         </NuxtLink>
@@ -56,22 +59,16 @@
             <div class="inner">
                 <div class="deepServer_left">
                     <div class="serverTitle">
-                        <NuxtLink href="/" >
+                        <NuxtLink href="/">
                             网站首页
                         </NuxtLink>
                     </div>
-                    <el-checkbox-group v-model="checkList">
-                        <el-checkbox label="产品" value="1" disabled />
-                        <el-checkbox label="企业" value="2" disabled/>
-                        <el-checkbox label="人才" value="3" disabled/>
-                        <el-checkbox label="展会" value="4" disabled/>
-                        <el-checkbox label="资讯" value="5" checked disabled/>
-                    </el-checkbox-group>
-                    <!-- <div class="serverTitle1">
-                        <a href="">
-                            农资商务中心
-                        </a>
-                    </div> -->
+                    <el-radio-group v-model="checkList">
+                        <el-radio value="1">资讯</el-radio>
+                        <el-radio value="2">商城</el-radio>
+                        <el-radio value="6">企业</el-radio>
+                        <el-radio value="7">项目</el-radio>
+                    </el-radio-group>
                 </div>
                 <div class="deepServer_right">
                     <div class="searchRole">
@@ -89,7 +86,12 @@
 
 <script setup>
 //1.获取导航菜单 start ---------------------------------------->
-import { ElCheckbox, ElCheckboxGroup,ElMessage  } from 'element-plus'
+import { ElCheckbox, ElCheckboxGroup, ElMessage, ElRadio, ElRadioGroup } from 'element-plus'
+let showTwo = ref(false);
+
+const props = defineProps({
+    type: String
+});
 
 //第一行导航菜单 10个
 const navigation1 = ref([]);
@@ -117,7 +119,7 @@ async function getNavigation2() {
         query: {
             'pid': 0,
             'num': 10,
-            'placeid': 28
+            'placeid': 29
         },
     });
     navigation2.value = mkdata.data;
@@ -136,27 +138,51 @@ async function getNavigation3() {
     navigation3.value = mkdata.data;
 }
 getNavigation3();
+
+// 1.4 获取供求信息二级导航
+//引入导航
+const { $pageNav } = useNuxtApp();
+const pid = $pageNav[14];
+console.log('供求信息二级栏目', pid);
+
+
+const secNav = ref([]);
+async function getNavigation4() {
+    const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
+        method: 'GET',
+        query: {
+            'pid': pid,
+            'num': 2,
+            'placeid': 1,
+            'type': 1
+        },
+    });
+    console.log("供求信息二级栏目", mkdata.data);
+
+    secNav.value = mkdata.data;
+}
+getNavigation4();
 //1.获取导航菜单 end ---------------------------------------->
 
 //2.搜索 start ---------------------------------------->
-const typeValue = ref("")
-const checkList = ref([]);// 多选框
+const checkList = ref("1");// 单选
+if(props.type) {
+    checkList.value = props.type;
+}else{
+    checkList.value = "1";
+}
 
 const inputValue = ref("") //关键词搜索
 //2.1跳转到搜索页面
 let goToPrimary = async () => {
-    if (inputValue.value=="") {
+    if (checkList.value == "") {
         ElMessage.error('搜索项不能为空!')
-    }else{
-        const route = `/search/search?keyword=${inputValue.value}`;
+    } else {
+        const route = `/search/search?keyword=${inputValue.value}&type=${checkList.value}`;
         window.location.href = route;
     }
 }
 
-
-onMounted(async () => {
-        
-})
 //2.搜索 end ---------------------------------------->
 
 </script>

+ 177 - 0
components/search/company.vue

@@ -0,0 +1,177 @@
+<template>
+    <div id="newsList">
+        <!-- 页面头部 -->
+        <HomePageHead></HomePageHead>
+        <!-- 导航栏 -->
+        <HomePageNavigation1 :type="type"></HomePageNavigation1>
+        <!-- 列表页广告一 -->
+        <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
+        <!-- 搜索框 -->
+        <div class="search">
+            <div class="inner">
+                <input v-model="keywordInput" type="text" placeholder="请输入搜索内容">
+                <button @click="goSearch">搜索</button>
+            </div>
+        </div>
+        <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>搜索</el-breadcrumb-item>
+                    <el-breadcrumb-item>企业</el-breadcrumb-item>
+                </el-breadcrumb>
+            </div>
+        </div>
+        <div class="newsList">
+            <div class="inner">
+                <div class="innerLeft">
+                    <ul class="list" v-if="companyList.length >= 0">
+                        <li v-for="(item, index) in companyList" :key="index">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                {{ item.title }}
+                            </NuxtLink>
+                            <span class="time right">{{ getTime(item.updated_at, 'month', 1) }}</span>
+                        </li>
+                    </ul>
+                    <div v-if="companyList.length == 0" class="empty">
+                        <div>
+                            <img src="../../public/search/empty.png" alt="暂无内容">
+                            <p>暂无搜索数据</p>
+                        </div>
+                    </div>
+                    <!-- 分页器 -->
+                    <div class="pagination" v-if="total > 0">
+                        <el-pagination size="small" background layout="prev, pager, next" :total="total" class="mt-4"
+                            :page-size="pageSize" prev-text="上一页" next-text="下一页" @change="changePage" />
+                    </div>
+                </div>
+            </div>
+        </div>
+        <!-- 列表页广告二 -->
+        <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
+        <!-- 页面底部 -->
+        <HomeFoot1></HomeFoot1>
+    </div>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+import { ref, onMounted } from 'vue';
+//1.页面依赖 end ---------------------------------------->
+
+
+//2.获取url中的参数 start ---------------------------------------->
+const route = useRoute();
+let keywordInput = ref(route.query.keyword);
+let type = ref(route.query.type);
+
+
+//2.获取url中的参数 end ---------------------------------------->
+
+//3.在该页进行搜索 start ---------------------------------------->
+//3.1 分页
+let total = useState("total", () => 0)
+let page = useState("page", () => 1)
+let pageSize = useState("pageSize", () => 20)
+
+//3.2 获得新闻列表
+const companyList = ref([]);
+
+//3.3 在本页进行搜索的方法
+let goSearch = async () => {
+    console.log(page.value)
+    console.log(pageSize.value)
+    console.log(keywordInput.value)
+
+    const listData = await requestDataPromise('/web/getWebsiteCompanyList', {
+        method: 'GET',
+        query: {
+            'page': page.value,
+            'pageSize': pageSize.value,
+            'keyword': keywordInput.value,
+        },
+    });
+    if (listData.code == 200) {
+        console.log(listData)
+        companyList.value = listData.data.data;
+        total.value = listData.data.count;
+    }
+}
+
+goSearch();
+
+//3.4 分页事件
+let changePage = (value) => {
+    console.log("当前页码", value);
+    page.value = value
+    console.log(page.value);
+    goSearch()
+}
+//3.在该页进行搜索 end ---------------------------------------->
+
+
+//4.广告 start ---------------------------------------->
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+
+onMounted(async () => {
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_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];
+})
+//4.页面数据 end ---------------------------------------->
+
+
+//5.设置seo信息 start---------------------------------------->
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
+    method: 'GET',
+    query: {},
+});
+
+let seoTitle = setData.data.website_head.title;
+let seoDescription = setData.data.website_head.description;
+let seoKeywords = setData.data.website_head.keywords;
+let seoSuffix = setData.data.website_head.suffix;
+let seoName = setData.data.website_head.website_name;
+
+useSeoMeta({
+    title: seoTitle + "_" + seoSuffix,
+    meta: [
+        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+    ]
+});
+//5.设置seo信息 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/search.less');
+</style>

+ 212 - 0
components/search/goods.vue

@@ -0,0 +1,212 @@
+<template>
+    <div id="newsList">
+        <!-- 页面头部 -->
+        <HomePageHead></HomePageHead>
+        <!-- 导航栏 -->
+        <HomePageNavigation1 :type="type"></HomePageNavigation1>
+        <!-- 列表页广告一 -->
+        <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
+        <!-- 搜索框 -->
+        <div class="search">
+            <div class="inner">
+                <input v-model="keywordInput" type="text" placeholder="请输入商品名称">
+                <button @click="goSearch">搜索</button>
+            </div>
+        </div>
+        <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>搜索</el-breadcrumb-item>
+                    <el-breadcrumb-item>商品</el-breadcrumb-item>
+                </el-breadcrumb>
+            </div>
+        </div>
+        <!-- 商品列表页 -->
+        <main class="index_main">
+            <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="pagination11" v-if="goodsList != false">
+                <div class="pagination">
+                    <el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize"
+                        prev-text="上一页" next-text="下一页" @current-change="changePage" />
+                </div>
+            </div>
+        </main>
+        <!-- 列表页广告二 -->
+        <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
+        <!-- 页面底部 -->
+        <HomeFoot1></HomeFoot1>
+    </div>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+import { ref, onMounted } from 'vue';
+//1.页面依赖 end ---------------------------------------->
+
+
+//2.获取url中的参数 start ---------------------------------------->
+const route = useRoute();
+let keywordInput = ref(route.query.keyword);
+let type = ref(route.query.type);
+//2.获取url中的参数 end ---------------------------------------->
+
+//3.在该页进行搜索 start ---------------------------------------->
+//3.1 分页
+let total = useState("total", () => 0)
+let page = useState("page", () => 1)
+let pageSize = useState("pageSize", () => 10)
+
+//3.2 获得求职列表
+const goodsList = ref('')
+const getGoodsList = await requestDataPromise('/web/getWebsiteshopList', {
+    method: 'GET',
+    query: {
+        'page': page.value,
+        'pageSize': pageSize.value,
+        'ismix': 1
+    },
+});
+if (getGoodsList.code == 200) {
+    goodsList.value = getGoodsList.data.goods
+    total.value = getGoodsList.data.count
+} else {
+    goodsList.value = [];
+    total.value = 0;
+}
+
+
+//3.3 在本页进行搜索的方法
+let goSearch = async () => {
+    // console.log(page.value)
+    // console.log(pageSize.value)
+    // console.log(keywordInput.value)
+
+    const listData = await requestDataPromise('/web/getWebsiteshopList', {
+        method: 'GET',
+        query: {
+            'page': page.value,
+            'pageSize': pageSize.value,
+            'keyword': keywordInput.value,
+            'ismix': 1
+        },
+    });
+    if (listData.code == 200) {
+        goodsList.value = listData.data.goods
+        total.value = listData.data.count
+    } else {
+        goodsList.value = [];
+        total.value = 0;
+    }
+}
+
+goSearch();
+
+//3.4 分页事件
+let changePage = (value) => {
+    console.log("当前页码", value);
+    page.value = value
+    console.log(page.value);
+    goSearch()
+}
+//3.在该页进行搜索 end ---------------------------------------->
+
+
+//4.广告 start ---------------------------------------->
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+
+onMounted(async () => {
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_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];
+})
+//4.页面数据 end ---------------------------------------->
+
+
+//5.设置seo信息 start---------------------------------------->
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
+    method: 'GET',
+    query: {},
+});
+
+let seoTitle = setData.data.website_head.title;
+let seoDescription = setData.data.website_head.description;
+let seoKeywords = setData.data.website_head.keywords;
+let seoSuffix = setData.data.website_head.suffix;
+let seoName = setData.data.website_head.website_name;
+
+useSeoMeta({
+    title: seoTitle + "_" + seoSuffix,
+    meta: [
+        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+    ]
+});
+//5.设置seo信息 end---------------------------------------->
+
+
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/search/global.less');
+@import url("@/assets/css/search/goods.less");
+</style>

+ 179 - 0
components/search/news.vue

@@ -0,0 +1,179 @@
+<template>
+    <div id="newsList">
+        <!-- 页面头部 -->
+        <HomePageHead></HomePageHead>
+        <!-- 导航栏 -->
+        <HomePageNavigation1 :type="type"></HomePageNavigation1>
+        <!-- 列表页广告一 -->
+        <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
+        <!-- 搜索框 -->
+        <div class="search">
+            <div class="inner">
+                <input v-model="keywordInput" type="text" placeholder="请输入搜索内容">
+                <button @click="goSearch">搜索</button>
+            </div>
+        </div>
+        <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>搜索</el-breadcrumb-item>
+                    <el-breadcrumb-item>资讯</el-breadcrumb-item>
+                </el-breadcrumb>
+            </div>
+        </div>
+        <div class="newsList">
+            <div class="inner">
+                <div class="innerLeft">
+                    <ul class="list" v-if="newsList.length >= 0">
+                        <li v-for="(item, index) in newsList" :key="index">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                {{ item.title }}
+                            </NuxtLink>
+                            <span class="time right">{{ getTime(item.updated_at, 'month', 1) }}</span>
+                        </li>
+                    </ul>
+                    <div v-if="newsList.length == 0" class="empty">
+                        <div>
+                            <img src="../../public/search/empty.png" alt="暂无内容">
+                            <p>暂无搜索数据</p>
+                        </div>
+                    </div>
+                    <!-- 分页器 -->
+                    <div class="pagination" v-if="total > 0">
+                        <el-pagination size="small" background layout="prev, pager, next" :total="total" class="mt-4"
+                            :page-size="pageSize" prev-text="上一页" next-text="下一页" @change="changePage" />
+                    </div>
+                </div>
+            </div>
+        </div>
+        <!-- 列表页广告二 -->
+        <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
+        <!-- 页面底部 -->
+        <HomeFoot1></HomeFoot1>
+    </div>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+import { ref, onMounted } from 'vue';
+//1.页面依赖 end ---------------------------------------->
+
+
+//2.获取url中的参数 start ---------------------------------------->
+const route = useRoute();
+let keywordInput = ref(route.query.keyword);
+let type = ref(route.query.type);
+
+//2.获取url中的参数 end ---------------------------------------->
+
+//3.在该页进行搜索 start ---------------------------------------->
+//3.1 分页
+let total = useState("total", () => 0)
+let page = useState("page", () => 1)
+let pageSize = useState("pageSize", () => 20)
+
+//3.2 获得新闻列表
+const newsList = ref([]);
+
+//3.3 在本页进行搜索的方法
+let goSearch = async () => {
+    console.log(page.value)
+    console.log(pageSize.value)
+    console.log(keywordInput.value)
+
+    const listData = await requestDataPromise('/web/selectWebsiteCategory', {
+        method: 'GET',
+        query: {
+            'page': page.value,
+            'pageSize': pageSize.value,
+            'keyword': keywordInput.value,
+        },
+    });
+    if (listData.data.rows) {
+        console.log(listData)
+        newsList.value = listData.data.rows;
+        total.value = listData.data.count;
+    } else {
+        newsList.value = [];
+        total.value = 0;
+    }
+}
+
+goSearch();
+
+//3.4 分页事件
+let changePage = (value) => {
+    console.log("当前页码", value);
+    page.value = value
+    console.log(page.value);
+    goSearch()
+}
+//3.在该页进行搜索 end ---------------------------------------->
+
+
+//4.广告 start ---------------------------------------->
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+
+onMounted(async () => {
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_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];
+})
+//4.页面数据 end ---------------------------------------->
+
+
+//5.设置seo信息 start---------------------------------------->
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
+    method: 'GET',
+    query: {},
+});
+
+let seoTitle = setData.data.website_head.title;
+let seoDescription = setData.data.website_head.description;
+let seoKeywords = setData.data.website_head.keywords;
+let seoSuffix = setData.data.website_head.suffix;
+let seoName = setData.data.website_head.website_name;
+
+useSeoMeta({
+    title: seoTitle + "_" + seoSuffix,
+    meta: [
+        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+    ]
+});
+//5.设置seo信息 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/search.less');
+</style>

+ 180 - 0
components/search/project.vue

@@ -0,0 +1,180 @@
+<template>
+    <div id="projectList">
+        <!-- 页面头部 -->
+        <HomePageHead></HomePageHead>
+        <!-- 导航栏 -->
+        <HomePageNavigation1 :type="type"></HomePageNavigation1>
+        <!-- 列表页广告一 -->
+        <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
+        <!-- 搜索框 -->
+        <div class="search">
+            <div class="inner">
+                <input v-model="keywordInput" type="text" placeholder="请输入搜索内容">
+                <button @click="goSearch">搜索</button>
+            </div>
+        </div>
+        <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>搜索</el-breadcrumb-item>
+                    <el-breadcrumb-item>项目</el-breadcrumb-item>
+                </el-breadcrumb>
+            </div>
+        </div>
+        <div class="newsList">
+            <div class="inner">
+                <div class="innerLeft">
+                    <ul class="list" v-if="projectList.length >= 0">
+                        <li class="listItem" v-for="(item, index) in projectList" :key="index">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                {{ item.title }}
+                            </NuxtLink>
+                            <!-- <span class="time right">{{ getTime(item.updated_at, 'month', 1) }}</span> -->
+                        </li>
+                    </ul>
+                    <div v-if="projectList.length == 0" class="empty">
+                        <div>
+                            <img src="../../public/search/empty.png" alt="暂无内容">
+                            <p>暂无搜索数据</p>
+                        </div>
+                    </div>
+                    <!-- 分页器 -->
+                    <div class="pagination" v-if="total > 0">
+                        <el-pagination size="small" background layout="prev, pager, next" :total="total" class="mt-4"
+                            :page-size="pageSize" prev-text="上一页" next-text="下一页" @change="changePage" />
+                    </div>
+                </div>
+            </div>
+        </div>
+        <!-- 列表页广告二 -->
+        <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
+        <!-- 页面底部 -->
+        <HomeFoot1></HomeFoot1>
+    </div>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+import { ref, onMounted } from 'vue';
+//1.页面依赖 end ---------------------------------------->
+
+
+//2.获取url中的参数 start ---------------------------------------->
+const route = useRoute();
+let keywordInput = ref(route.query.keyword);
+let type = ref(route.query.type);
+
+//2.获取url中的参数 end ---------------------------------------->
+
+//3.在该页进行搜索 start ---------------------------------------->
+//3.1 分页
+let total = useState("total", () => 0)
+let page = useState("page", () => 1)
+let pageSize = useState("pageSize", () => 20)
+
+//3.2 获得新闻列表
+const projectList = ref([]);
+
+//3.3 在本页进行搜索的方法
+let goSearch = async () => {
+    console.log(page.value)
+    console.log(pageSize.value)
+    console.log(keywordInput.value)
+
+    const listData = await requestDataPromise('/web/getWebsiteProjectList', {
+        method: 'GET',
+        query: {
+            'page': page.value,
+            'pageSize': pageSize.value,
+            'keyword': keywordInput.value,
+        },
+    });
+    if (listData.code == 200) {
+        console.log('listData', listData)
+        projectList.value = listData.data.rows;
+        total.value = listData.data.count;
+    } else {
+        projectList.value = [];
+        total.value = 0;
+    }
+}
+
+goSearch();
+
+//3.4 分页事件
+let changePage = (value) => {
+    console.log("当前页码", value);
+    page.value = value
+    console.log(page.value);
+    goSearch()
+}
+//3.在该页进行搜索 end ---------------------------------------->
+
+
+//4.广告 start ---------------------------------------->
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+
+onMounted(async () => {
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_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];
+})
+//4.页面数据 end ---------------------------------------->
+
+
+//5.设置seo信息 start---------------------------------------->
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
+    method: 'GET',
+    query: {},
+});
+
+let seoTitle = setData.data.website_head.title;
+let seoDescription = setData.data.website_head.description;
+let seoKeywords = setData.data.website_head.keywords;
+let seoSuffix = setData.data.website_head.suffix;
+let seoName = setData.data.website_head.website_name;
+
+useSeoMeta({
+    title: seoTitle + "_" + seoSuffix,
+    meta: [
+        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+    ]
+});
+//5.设置seo信息 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/project.less');
+
+</style>

+ 8 - 201
pages/search/[id].vue

@@ -1,206 +1,13 @@
 <template>
-    <div id="newsList">
-        <!-- 页面头部 -->
-        <HomePageHead></HomePageHead>
-        <!-- 导航栏 -->
-        <HomePageNavigation1></HomePageNavigation1>
-        <!-- 列表页广告一 -->
-        <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
-        <!-- 搜索框 -->
-        <div class="search">
-            <div class="inner">
-                <input v-model="keywordInput" type="text" placeholder="请输入搜索内容">
-                <button @click="goSearch">搜索</button>
-            </div>
-        </div>
-        <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>搜索</el-breadcrumb-item>
-                </el-breadcrumb>
-            </div>
-        </div>
-        <div class="newsList">
-            <div class="inner">
-                <div class="innerLeft">
-                    <ul class="list" v-if="newsList.length >= 0">
-                        <li v-for="(item, index) in newsList" :key="index">
-                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" :target="item.islink == 1 ? '_blank' : '_self'">
-                                {{ item.title }}
-                            </NuxtLink>
-                            <span class="time right">{{getTime(item.updated_at,'month',1)}}</span>
-                        </li>
-                    </ul>
-                    <div v-if="newsList.length == 0" class="empty">
-                        <div>
-                            <img src="../../public/search/empty.png" alt="暂无内容">
-                            <p>暂无搜索数据</p>
-                        </div>
-                    </div>
-                    <!-- 分页器 -->
-                    <div class="pagination" v-if="total > 0">
-                        <el-pagination 
-                            size="small" 
-                            background 
-                            layout="prev, pager, next" 
-                            :total="total" 
-                            class="mt-4"
-                            :page-size="pageSize" 
-                            prev-text="上一页" 
-                            next-text="下一页" 
-                            @change="changePage"
-                         />
-                    </div>
-                </div>
-            </div>
-        </div>
-        <!-- 列表页广告二 -->
-        <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
-        <!-- 页面底部 -->
-        <HomeFoot1></HomeFoot1>
-    </div>
+    <SearchNews v-if="type == 1"></SearchNews>
+    <SearchGoods v-if="type == 2"></SearchGoods>
+    <SearchCompany v-if="type == 6"></SearchCompany>
+    <SearchProject v-if="type == 7"></SearchProject>
 </template>
 
 <script setup>
-//1.页面依赖 start ---------------------------------------->
-import { ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus'
-import { ArrowRight } from '@element-plus/icons-vue'
-import { ref, onMounted } from 'vue';
-//1.页面依赖 end ---------------------------------------->
-
-
-//2.获取url中的参数 start ---------------------------------------->
+import { useRoute } from 'vue-router'
 const route = useRoute();
-const pageCatids = ""
-let keywordInput = ref("");
-
-if(route.params.id=='search'){
-    //该处用于带有文字出入的搜索栏跳转
-    console.log("检测到从搜索栏跳转的搜索!")
-    console.log(route.query.type)//左侧搜索下拉框的值
-    console.log(route.query.keyword)//右侧输入框的值
-
-    //目前route.query.type 1=资讯 2=商城 3=招工招聘
-    //但是商城和招工招聘暂没有开发完,所以这里不需要考虑 只给keyword赋值即可
-    keywordInput.value = route.query.keyword;
-    
-}else{
-    //该处用于搜索栏中含有地区的跳转
-    const pageCatids = route.params.id
-}
-const pageDepartment_id = route.query.department_id;
-//2.获取url中的参数 end ---------------------------------------->
-
-//3.在该页进行搜索 start ---------------------------------------->
-//3.1 分页
-let total = useState("total", () => 0)
-let page = useState("page", () => 1)
-let pageSize = useState("pageSize", () => 20)
-
-//3.2 获得新闻列表
-const newsList = ref([]);
-
-
-//3.3 在本页进行搜索的方法
-let goSearch = async () => {
-    console.log(page.value)
-    console.log(pageSize.value)
-    console.log(keywordInput.value)
-    console.log(pageCatids)
-    console.log(pageDepartment_id)
-    
-    const listData =  await requestDataPromise('/web/selectWebsiteCategory', {
-        method: 'GET',
-        query: {
-            'page': page.value,
-            'pageSize': pageSize.value,
-            'keyword':keywordInput.value,
-            'cityid':pageCatids,
-            'department_id':pageDepartment_id
-        },
-    });
-    if(listData.data.rows){
-        console.log(listData)
-        newsList.value = listData.data.rows;
-        total.value = listData.data.count;
-    }else{
-        newsList.value = [];
-        total.value = 0;
-    }
-}
-
-goSearch();
-
-//3.4 分页事件
-let changePage = (value) => {
-    console.log("当前页码", value);
-    page.value = value
-    console.log(page.value);
-    goSearch()
-}
-//3.在该页进行搜索 end ---------------------------------------->
-
-
-//4.广告 start ---------------------------------------->
-let adImg1 = ref([]);
-let adImg2 = ref([]);
-
-onMounted(async ()  => {
-    //从客户端获取行政职能部门 加快打开速度
-    const { $webUrl, $CwebUrl } = useNuxtApp();
-    //广告1
-    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_0001`
-    const responseAd1 = await fetch(url, {
-        headers: {
-            'Content-Type': 'application/json',
-            'Userurl': $CwebUrl,
-            'Origin': $CwebUrl
-        }
-    });
-    const resultAd1 = await responseAd1.json();
-    adImg1.value = resultAd1.data[0];
-    
-    //广告2
-    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_search_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];
-})
-//4.页面数据 end ---------------------------------------->
-
-
-//5.设置seo信息 start---------------------------------------->
-const setData =  await requestDataPromise('/web/getWebsiteFootInfo', {
-    method: 'GET',
-    query: {},
-});
-
-let seoTitle = setData.data.website_head.title;
-let seoDescription = setData.data.website_head.description;
-let seoKeywords = setData.data.website_head.keywords;
-let seoSuffix = setData.data.website_head.suffix;
-let seoName = setData.data.website_head.website_name;
-
-useSeoMeta({
-    title: seoTitle + "_" + seoSuffix,
-    meta: [
-        { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix , tagPriority: 10 },
-        { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix , tagPriority: 10 }
-    ]
-});
-//5.设置seo信息 end---------------------------------------->
-</script>
-
-<style lang="less" scoped>
-@import url('@/assets/css/search.less');
-</style>
+let type = route.query.type
+let keyword = route.query.keyword
+</script>