Quellcode durchsuchen

完成动态路由

完成动态路由
dangyunlong vor 3 Wochen
Ursprung
Commit
88f15eef29

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

@@ -1 +1 @@
-{"id":"dev","timestamp":1743120488124}
+{"id":"dev","timestamp":1743418904456}

+ 1 - 0
.nuxt/manifest/meta/01417fcb-bfc8-4dd1-82dd-187170d0044e.json

@@ -0,0 +1 @@
+{"id":"01417fcb-bfc8-4dd1-82dd-187170d0044e","timestamp":1743402059104,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 0 - 1
.nuxt/manifest/meta/70bf4e3f-0ede-48cb-ab16-61946fae6c91.json

@@ -1 +0,0 @@
-{"id":"70bf4e3f-0ede-48cb-ab16-61946fae6c91","timestamp":1743064608913,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 1 - 1
.nuxt/manifest/meta/dev.json

@@ -1 +1 @@
-{"id":"dev","timestamp":1743120488124,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
+{"id":"dev","timestamp":1743418904456,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

+ 3 - 3
.nuxt/nitro.json

@@ -1,5 +1,5 @@
 {
-  "date": "2025-03-28T00:08:11.854Z",
+  "date": "2025-03-31T11:01:47.107Z",
   "preset": "nitro-dev",
   "framework": {
     "name": "nuxt",
@@ -9,9 +9,9 @@
     "nitro": "2.10.4"
   },
   "dev": {
-    "pid": 4820,
+    "pid": 18296,
     "workerAddress": {
-      "socketPath": "\\\\.\\pipe\\nitro\\worker-4820-1.sock"
+      "socketPath": "\\\\.\\pipe\\nitro\\worker-18296-1.sock"
     }
   }
 }

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

@@ -22,6 +22,7 @@ type NuxtAppInjections =
   InjectionType<typeof import("../../node_modules/nuxt/dist/app/plugins/check-if-layout-used.js")> &
   InjectionType<typeof import("../../plugins/element-plus.js")> &
   InjectionType<typeof import("../../plugins/request.js")> &
+  InjectionType<typeof import("../../plugins/client-dynamic-routes.js")> &
   InjectionType<typeof import("../../plugins/globals.js")> &
   InjectionType<typeof import("../../plugins/pinia.js")>
 

+ 43 - 0
app/router.options.js

@@ -0,0 +1,43 @@
+// app/router.options.js
+export default {
+  routes: async (routes) => {
+
+    //动态路由不能写到此处,这里的路由会在页面加载完毕后才加载
+    // //路由地址
+    // let routeUrl = 'http://apipre1.bjzxtw.org.cn:29501/web/getWebsiteParentCategory'
+    // const responseRoute = await fetch(routeUrl, {
+    //     headers: {
+    //         'Content-Type': 'application/json',
+    //         'Userurl': 'http://apipre1.bjzxtw.org.cn:29501',
+    //         'Origin': 'http://apipre1.bjzxtw.org.cn:29501'
+    //     }
+    // });
+    // //获得原始的路由数据
+    // const getRouteData = await responseRoute.json();
+    // const routeData = [];
+   
+    // for(let index in getRouteData.data.parent){
+    //   if(getRouteData.data.parent[index].path!=undefined){
+    //     let data = {
+    //       path: getRouteData.data.parent[index].path,
+    //       component: () => import('~/pages/primaryNavigation/[id].vue'),
+    //       meta: { 
+    //         isAlias: true, 
+    //         routeId: getRouteData.data.parent[index].cid, 
+    //         routeName: getRouteData.data.parent[index].name,
+    //         path: getRouteData.data.parent[index].path
+    //       }
+    //     }
+    //     routeData.push(data)
+    //   }
+    // }
+
+    //console.log(routeData)
+
+    return [
+      ...routes,
+      //...routeData,
+    ]
+    
+  }
+}

+ 0 - 1576
app/router.options.ts

@@ -1,1576 +0,0 @@
-// app/router.options.ts
-import type { RouterConfig } from "@nuxt/schema"
-
-export default <RouterConfig> {
-  routes: async (routes) => {
-    // 静态别名
-    const staticAliases = [
-      //前往二级分类
-      {
-        path: '/tieshenbaobei138/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 138, 
-          routeName: '贴身宝贝',
-          path: '/tieshenbaobei138/'
-        }
-      },
-      {
-        path: '/xinnongcun11/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 11, 
-          routeName: '新农村',
-          path: '/xinnongcun11/'
-        }
-      },
-      {
-        path: '/nongmingong317/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 317, 
-          routeName: '农民工',
-          path: '/nongmingong317/'
-        }
-      },
-      {
-        path: '/zhengcefagui1/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 1, 
-          routeName: '政策法规',
-          path: '/zhengcefagui1/'
-        }
-      },
-      {
-        path: '/sannongzhichuang2/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 2, 
-          routeName: '三农之窗',
-          path: '/sannongzhichuang2/'
-        }
-      },
-      {
-        path: '/quyujingji5/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 5, 
-          routeName: '区域经济',
-          path: '/quyujingji5/'
-        }
-      },
-      {
-        path: '/sannongtouzi12/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 12, 
-          routeName: '三农投资',
-          path: '/sannongtouzi12/'
-        }
-      },
-      {
-        path: '/nongmaozixun13/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 13, 
-          routeName: '农贸资讯',
-          path: '/nongmaozixun13/'
-        }
-      },
-      {
-        path: '/sannongkejiao14/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 14, 
-          routeName: '三农科教',
-          path: '/sannongkejiao14/'
-        }
-      },
-      {
-        path: '/wenhuashenghuo15/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 15, 
-          routeName: '文化生活',
-          path: '/wenhuashenghuo15/'
-        }
-      },
-      {
-        path: '/sannongtansuo16/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 16, 
-          routeName: '三农探索',
-          path: '/sannongtansuo16/'
-        }
-      },
-      {
-        path: '/sannongrenwu18/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 18, 
-          routeName: '三农人物',
-          path: '/sannongrenwu18/'
-        }
-      },
-      {
-        path: '/xiezuodaquan150/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 150, 
-          routeName: '写作大全',
-          path: '/xiezuodaquan150/'
-        }
-      },
-      {
-        path: '/zhaogongzhaopin20/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 20, 
-          routeName: '招工招聘',
-          path: '/zhaogongzhaopin20/'
-        }
-      },
-      {
-        path: '/nongzigouxiao21/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 21, 
-          routeName: '农资购销',
-          path: '/nongzigouxiao21/'
-        }
-      },
-      {
-        path: '/nongchangouxiao153/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 153, 
-          routeName: '农产购销',
-          path: '/nongchangouxiao153/'
-        }
-      },
-      {
-        path: '/zhifuxinxi23/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 23, 
-          routeName: '致富信息',
-          path: '/zhifuxinxi23/'
-        }
-      },
-      {
-        path: '/shukanxinxi24/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 24, 
-          routeName: '书刊信息',
-          path: '/shukanxinxi24/'
-        }
-      },
-      {
-        path: '/nongwangdaohang25/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 25, 
-          routeName: '农网导航',
-          path: '/nongwangdaohang25/'
-        }
-      },
-      {
-        path: '/dajiaweiquan26/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 26, 
-          routeName: '打假维权',
-          path: '/dajiaweiquan26/'
-        }
-      },
-      {
-        path: '/sannongfuwu27/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 27, 
-          routeName: '三农服务',
-          path: '/sannongfuwu27/'
-        }
-      },
-      {
-        path: '/sannongdiaocha28/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 28, 
-          routeName: '三农调查',
-          path: '/sannongdiaocha28/'
-        }
-      },
-      {
-        path: '/sannongluntan29/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 29, 
-          routeName: '三农论坛',
-          path: '/sannongluntan29/'
-        }
-      },
-      {
-        path: '/sannongneican30/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 30, 
-          routeName: '三农内参',
-          path: '/sannongneican30/'
-        }
-      },
-      {
-        path: '/nongyekepu300/',
-        component: () => import('~/pages/primaryNavigation/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 300, 
-          routeName: '农业科普',
-          path: '/nongyekepu300/'
-        }
-      },
-
-
-      //前往列表页
-      //1.新农村
-      {
-        path: '/lilunqianyan31/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 31, 
-          routeName: '理论前沿',
-          path: '/lilunqianyan31/'
-        }
-      },
-      {
-        path: '/dianxingjingyan32/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 32, 
-          routeName: '典型经验',
-          path: '/dianxingjingyan32/'
-        }
-      },
-      {
-        path: '/meilixiangcun33/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 33, 
-          routeName: '魅力乡村',
-          path: '/meilixiangcun33/'
-        }
-      },
-      {
-        path: '/nongminzhijia34/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 34, 
-          routeName: '农民之家',
-          path: '/nongminzhijia34/'
-        }
-      },
-      {
-        path: '/nongyetiandi35/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 35, 
-          routeName: '农业天地',
-          path: '/nongyetiandi35/'
-        }
-      },
-      {
-        path: '/nongcunjianshe36/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 36, 
-          routeName: '农村建设',
-          path: '/nongcunjianshe36/'
-        }
-      },
-      {
-        path: '/gaoduanzixun280/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 280, 
-          routeName: '高端资讯',
-          path: '/gaoduanzixun280/'
-        }
-      },
-      {
-        path: '/shijiantansuo38/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 38, 
-          routeName: '实践探索',
-          path: '/shijiantansuo38/'
-        }
-      },
-      //2.政策法规
-      {
-        path: '/guojiafalv60/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 60, 
-          routeName: '国家法律',
-          path: '/guojiafalv60/'
-        }
-      },
-      {
-        path: '/bubanfalv200/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 200, 
-          routeName: '部颁法律',
-          path: '/bubanfalv200/'
-        }
-      },
-      {
-        path: '/faguijiexi201/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 201, 
-          routeName: '法规解析',
-          path: '/faguijiexi201/'
-        }
-      },
-      {
-        path: '/zhengcefabu202/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 202, 
-          routeName: '政策发布',
-          path: '/zhengcefabu202/'
-        }
-      },
-      {
-        path: '/lifayantao203/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 203, 
-          routeName: '立法研讨',
-          path: '/lifayantao203/'
-        }
-      },
-      {
-        path: '/jingdiananli204/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 204, 
-          routeName: '经典案例',
-          path: '/jingdiananli204/'
-        }
-      },
-      {
-        path: '/tingzhenghuixun205/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 205, 
-          routeName: '听证会讯',
-          path: '/tingzhenghuixun205/'
-        }
-      },
-      {
-        path: '/fazhizaixian206/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 206, 
-          routeName: '法制在线',
-          path: '/fazhizaixian206/'
-        }
-      },
-      //3.三农之窗
-      {
-        path: '/sannongguoji207/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 207, 
-          routeName: '三农国际',
-          path: '/sannongguoji207/'
-        }
-      },
-      {
-        path: '/nongcunjianshe208/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 208, 
-          routeName: '农村建设',
-          path: '/nongcunjianshe208/'
-        }
-      },
-      {
-        path: '/nongcunguanli209/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 209, 
-          routeName: '农村管理',
-          path: '/nongcunguanli209/'
-        }
-      },
-      {
-        path: '/nongyegongmao210/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 210, 
-          routeName: '农业工贸',
-          path: '/nongyegongmao210/'
-        }
-      },
-      {
-        path: '/sannongyaowen211/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 211, 
-          routeName: '三农要闻',
-          path: '/sannongyaowen211/'
-        }
-      },
-      {
-        path: '/nongyekepu240/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 240, 
-          routeName: '农业科普',
-          path: '/nongyekepu240/'
-        }
-      },
-      {
-        path: '/nongminshengchan213/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 213, 
-          routeName: '农民生产',
-          path: '/nongminshengchan213/'
-        }
-      },
-      {
-        path: '/nongminshenghuo214/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 214, 
-          routeName: '农民生活',
-          path: '/nongminshenghuo214/'
-        }
-      },
-      //4.区域经济
-      {
-        path: '/mingchengmingzhen215/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 215, 
-          routeName: '名城名镇',
-          path: '/mingchengmingzhen215/'
-        }
-      },
-      {
-        path: '/kaifaquyu216/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 216, 
-          routeName: '开发区域',
-          path: '/kaifaquyu216/'
-        }
-      },
-      {
-        path: '/chanyejiqun217/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 217, 
-          routeName: '产业集群',
-          path: '/chanyejiqun217/'
-        }
-      },
-      {
-        path: '/hezuozuzhi218/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 217, 
-          routeName: '合作组织',
-          path: '/hezuozuzhi218/'
-        }
-      },
-      {
-        path: '/tesexiangzhen219/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 219, 
-          routeName: '特色乡镇',
-          path: '/tesexiangzhen219/'
-        }
-      },
-      {
-        path: '/yicunyipin220/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 220, 
-          routeName: '一村一品',
-          path: '/yicunyipin220/'
-        }
-      },
-      {
-        path: '/longtouqiye221/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 221, 
-          routeName: '龙头企业',
-          path: '/longtouqiye221/'
-        }
-      },
-      {
-        path: '/zhaoshangyinzi222/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 222, 
-          routeName: '招商引资',
-          path: '/zhaoshangyinzi222/'
-        }
-      },
-      //5.三农投资
-      {
-        path: '/guojiabokuan223/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 223, 
-          routeName: '国家拨款',
-          path: '/guojiabokuan223/'
-        }
-      },
-      {
-        path: '/shetuanjijin224/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 224, 
-          routeName: '社团基金',
-          path: '/shetuanjijin224/'
-        }
-      },
-      {
-        path: '/qiyetouzi225/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 225, 
-          routeName: '企业投资',
-          path: '/qiyetouzi225/'
-        }
-      },
-      {
-        path: '/difangyinzi226/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 226, 
-          routeName: '地方引资',
-          path: '/difangyinzi226/'
-        }
-      },
-      {
-        path: '/gongyihuodong227/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 226, 
-          routeName: '公益活动',
-          path: '/gongyihuodong227/'
-        }
-      },
-      {
-        path: '/fengxiantouzi228/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 228, 
-          routeName: '风险投资',
-          path: '/fengxiantouzi228/'
-        }
-      },
-      {
-        path: '/waishangduzi229/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 229, 
-          routeName: '外商独资',
-          path: '/waishangduzi229/'
-        }
-      },
-      {
-        path: '/yinzifuwu230/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 230, 
-          routeName: '引资服务',
-          path: '/yinzifuwu230/'
-        }
-      },
-      //6.农贸服务
-      {
-        path: '/guojinongmao198/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 198, 
-          routeName: '国际农贸',
-          path: '/guojinongmao198/'
-        }
-      },
-      {
-        path: '/huiyihuizhan199/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 199, 
-          routeName: '会议会展',
-          path: '/huiyihuizhan199/'
-        }
-      },
-      {
-        path: '/difangjieqing231/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 231, 
-          routeName: '地方节庆',
-          path: '/difangjieqing231/'
-        }
-      },
-      {
-        path: '/techanzixun232/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 232, 
-          routeName: '特产资讯',
-          path: '/techanzixun232/'
-        }
-      },
-      {
-        path: '/shichangdongtai233/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 233, 
-          routeName: '市场动态',
-          path: '/shichangdongtai233/'
-        }
-      },
-      {
-        path: '/jishimaoyi234/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 234, 
-          routeName: '集市贸易',
-          path: '/jishimaoyi234/'
-        }
-      },
-      {
-        path: '/hezuojingji235/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 235, 
-          routeName: '合作经济',
-          path: '/hezuojingji235/'
-        }
-      },
-      {
-        path: '/lilunqianyan237/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 237, 
-          routeName: '理论前沿',
-          path: '/lilunqianyan237/'
-        }
-      },
-      //7.三农科教
-      {
-        path: '/nongcunjiaoyu238/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 238, 
-          routeName: '农村教育',
-          path: '/nongcunjiaoyu238/'
-        }
-      },
-      {
-        path: '/nongminpeixun239/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 239, 
-          routeName: '农民培训',
-          path: '/nongminpeixun239/'
-        }
-      },
-      {
-        path: '/nongyekepu240/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 240, 
-          routeName: '农业科普',
-          path: '/nongyekepu240/'
-        }
-      },
-      {
-        path: '/kejifuwu241/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 241, 
-          routeName: '科技服务',
-          path: '/kejifuwu241/'
-        }
-      },
-      {
-        path: '/zhongzhijishu242/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 242, 
-          routeName: '种植技术',
-          path: '/zhongzhijishu242/'
-        }
-      },
-      {
-        path: '/angzhijishu243/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 243, 
-          routeName: '养殖技术',
-          path: '/angzhijishu243/'
-        }
-      },
-      {
-        path: '/zhifujingyan244/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 244, 
-          routeName: '致富经验',
-          path: '/zhifujingyan244/'
-        }
-      },
-      {
-        path: '/kejiaoxinxi245/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 245, 
-          routeName: '科教信息',
-          path: '/kejiaoxinxi245/'
-        }
-      },
-      //8.文化生活
-      {
-        path: '/wenhuashidian195/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 195, 
-          routeName: '文化视点',
-          path: '/wenhuashidian195/'
-        }
-      },
-      {
-        path: '/lisuwenhua196/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 196, 
-          routeName: '礼俗文化',
-          path: '/lisuwenhua196/'
-        }
-      },
-      {
-        path: '/chajiuwenhua246/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 246, 
-          routeName: '茶酒文化',
-          path: '/chajiuwenhua246/'
-        }
-      },
-      {
-        path: '/xiuxianwenhua247/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 247, 
-          routeName: '休闲文化',
-          path: '/xiuxianwenhua247/'
-        }
-      },
-      {
-        path: '/fushiwenhua248/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 248, 
-          routeName: '服饰文化',
-          path: '/fushiwenhua248/'
-        }
-      },
-      {
-        path: '/yinshiwenhua249/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 249, 
-          routeName: '饮食文化',
-          path: '/yinshiwenhua249/'
-        }
-      },
-      {
-        path: '/renjuwenhua250/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 250, 
-          routeName: '人居文化',
-          path: '/renjuwenhua250/'
-        }
-      },
-      {
-        path: '/lvxingwenhua251/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 251, 
-          routeName: '旅行文化',
-          path: '/lvxingwenhua251/'
-        }
-      },
-      //9.三农探索
-      {
-        path: '/jiaodianfangtan276/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 276, 
-          routeName: '焦点访谈',
-          path: '/jiaodianfangtan276/'
-        }
-      },
-      {
-        path: '/nongcunjianshe277/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 277, 
-          routeName: '农村建设',
-          path: '/nongcunjianshe277/'
-        }
-      },
-      {
-        path: '/tansuonongyetiandi395/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 395, 
-          routeName: '农业天地',
-          path: '/tansuonongyetiandi395/'
-        }
-      },
-      {
-        path: '/nongminhuati279/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 279, 
-          routeName: '农民话题',
-          path: '/nongminhuati279/'
-        }
-      },
-      {
-        path: '/gaoduanzixun280/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 280, 
-          routeName: '高端资讯',
-          path: '/gaoduanzixun280/'
-        }
-      },
-      {
-        path: '/dianxingjingyan281/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 281, 
-          routeName: '典型经验',
-          path: '/dianxingjingyan281/'
-        }
-      },
-      {
-        path: '/chenggongzhilu282/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 282, 
-          routeName: '成功之路',
-          path: '/chenggongzhilu282/'
-        }
-      },
-      {
-        path: '/shijiantansuo283/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 283, 
-          routeName: '实践探索',
-          path: '/shijiantansuo283/'
-        }
-      },
-      //10.三农人物
-      {
-        path: '/sannongzhengyao284/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 284, 
-          routeName: '三农政要',
-          path: '/sannongzhengyao284/'
-        }
-      },
-      {
-        path: '/kejizhixing285/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 285, 
-          routeName: '科技之星',
-          path: '/kejizhixing285/'
-        }
-      },
-      {
-        path: '/zhongyangnengshou286/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 286, 
-          routeName: '种养能手',
-          path: '/zhongyangnengshou286/'
-        }
-      },
-      {
-        path: '/zhifunengren287/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 287, 
-          routeName: '致富能人',
-          path: '/zhifunengren287/'
-        }
-      },
-      {
-        path: '/xueshuquanwei288/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 288, 
-          routeName: '学术权威',
-          path: '/xueshuquanwei288/'
-        }
-      },
-      {
-        path: '/youxiucunguan180/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 180, 
-          routeName: '优秀村官',
-          path: '/youxiucunguan180/'
-        }
-      },
-      {
-        path: '/nongqijingying290/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 290, 
-          routeName: '农企精英',
-          path: '/nongqijingying290/'
-        }
-      },
-      {
-        path: '/sannongganbu291/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 291, 
-          routeName: '三农干部',
-          path: '/sannongganbu291/'
-        }
-      },
-      //11.农资购销
-      {
-        path: '/nongzizaixian189/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 189, 
-          routeName: '农资在线',
-          path: '/nongzizaixian189/'
-        }
-      },
-      {
-        path: '/hangyedongtai188/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 188, 
-          routeName: '行业动态',
-          path: '/hangyedongtai188/'
-        }
-      },
-      {
-        path: '/nongzihangqing387/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 387, 
-          routeName: '农资行情',
-          path: '/nongzihangqing387/'
-        }
-      },
-      {
-        path: '/yingxiaofuwu388/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 388, 
-          routeName: '营销服务',
-          path: '/yingxiaofuwu388/'
-        }
-      },
-      {
-        path: '/zhuanyinggongsi389/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 389, 
-          routeName: '专营公司',
-          path: '/zhuanyinggongsi389/'
-        }
-      },
-      {
-        path: '/mingpaimingqi390/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 390, 
-          routeName: '名牌名企',
-          path: '/mingpaimingqi390/'
-        }
-      },
-      {
-        path: '/shengchanqiye391/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 391, 
-          routeName: '生产企业',
-          path: '/shengchanqiye391/'
-        }
-      },
-      {
-        path: '/nongzigongying392/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 392, 
-          routeName: '农资供应',
-          path: '/nongzigongying392/'
-        }
-      },
-      //12.农产购销
-      {
-        path: '/nongchanzaixian258/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 258, 
-          routeName: '农产在线',
-          path: '/nongchanzaixian258/'
-        }
-      },
-      {
-        path: '/chanyedongtai259/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 259, 
-          routeName: '产业动态',
-          path: '/chanyedongtai259/'
-        }
-      },
-      {
-        path: '/nongchanhangqing260/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 260, 
-          routeName: '农产行情',
-          path: '/nongchanhangqing260/'
-        }
-      },
-      {
-        path: '/xiaoshoufuwu263/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 263, 
-          routeName: '销售服务',
-          path: '/xiaoshoufuwu263/'
-        }
-      },
-      {
-        path: '/mingyoutechan262/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 262, 
-          routeName: '名优特产',
-          path: '/mingyoutechan262/'
-        }
-      },
-      {
-        path: '/pifaqiye261/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 261, 
-          routeName: '批发企业',
-          path: '/pifaqiye261/'
-        }
-      },
-      {
-        path: '/pifaqiye261/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 261, 
-          routeName: '批发企业',
-          path: '/pifaqiye261/'
-        }
-      },
-      {
-        path: '/nongmaoshichang264/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 264, 
-          routeName: '农贸市场',
-          path: '/nongmaoshichang264/'
-        }
-      },
-      {
-        path: '/gongqiuguanxi265/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 265, 
-          routeName: '供求信息',
-          path: '/gongqiuguanxi265/'
-        }
-      },
-      //13.书刊信息
-      {
-        path: '/dianjishijian275/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 275, 
-          routeName: '典集史鉴',
-          path: '/dianjishijian275/'
-        }
-      },
-      {
-        path: '/dangzhengbaokan268/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 268, 
-          routeName: '党政报刊',
-          path: '/dangzhengbaokan268/'
-        }
-      },
-      {
-        path: '/shenongbaokan269/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 269, 
-          routeName: '涉农报刊',
-          path: '/shenongbaokan269/'
-        }
-      },
-      {
-        path: '/shizhengshuxun270/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 270, 
-          routeName: '时政书讯',
-          path: '/shizhengshuxun270/'
-        }
-      },
-      {
-        path: '/dushudubao271/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 271, 
-          routeName: '读书读报',
-          path: '/dushudubao271/'
-        }
-      },
-      {
-        path: '/wenhuayishu272/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 272, 
-          routeName: '文化艺术',
-          path: '/wenhuayishu272/'
-        }
-      },
-      {
-        path: '/shenghuobaike273/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 273, 
-          routeName: '生活百科',
-          path: '/shenghuobaike273/'
-        }
-      },
-      {
-        path: '/yangshengbaojian274/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 274, 
-          routeName: '养生保健',
-          path: '/yangshengbaojian274/'
-        }
-      },
-      //14.打假维权
-      {
-        path: '/dajiazixun191/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 191, 
-          routeName: '打假资讯',
-          path: '/dajiazixun191/'
-        }
-      },
-      {
-        path: '/redianzhuizong192/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 192, 
-          routeName: '热点追踪',
-          path: '/redianzhuizong192/'
-        }
-      },
-      {
-        path: '/zhuantibaodao296/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 296, 
-          routeName: '专题报道',
-          path: '/zhuantibaodao296/'
-        }
-      },
-      {
-        path: '/jubaotousu297/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 297, 
-          routeName: '举报投诉',
-          path: '/jubaotousu297/'
-        }
-      },
-      {
-        path: '/anlitonggao298/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 298, 
-          routeName: '案例通告',
-          path: '/anlitonggao298/'
-        }
-      },
-      {
-        path: '/qishigonggong299/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 299, 
-          routeName: '启示公告',
-          path: '/qishigonggong299/'
-        }
-      },
-      {
-        path: '/shehuihusheng396/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 396, 
-          routeName: '社会呼声',
-          path: '/shehuihusheng396/'
-        }
-      },
-      {
-        path: '/jiamaoweilie397/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 397, 
-          routeName: '假冒伪劣',
-          path: '/jiamaoweilie397/'
-        }
-      },
-      //15.三农服务
-      {
-        path: '/zhaoshangyinzi193/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 193, 
-          routeName: '招商引资',
-          path: '/zhaoshangyinzi193/'
-        }
-      },
-      {
-        path: '/xiangmutuijian194/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 194, 
-          routeName: '项目推介',
-          path: '/xiangmutuijian194/'
-        }
-      },
-      {
-        path: '/pinpaixingxiang303/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 303, 
-          routeName: '品牌形象',
-          path: '/pinpaixingxiang303/'
-        }
-      },
-      {
-        path: '/zhuanyezhidao304/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 304, 
-          routeName: '专业指导',
-          path: '/zhuanyezhidao304/'
-        }
-      },
-      {
-        path: '/cehuafuwu305/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 305, 
-          routeName: '策划服务',
-          path: '/cehuafuwu305/'
-        }
-      },
-      {
-        path: '/renzhengfuwu306/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 306, 
-          routeName: '认证服务',
-          path: '/renzhengfuwu306/'
-        }
-      },
-      {
-        path: '/peixunfuwu307/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 307, 
-          routeName: '培训服务',
-          path: '/peixunfuwu307/'
-        }
-      },
-      {
-        path: '/xinxifuwu308/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 308, 
-          routeName: '信息服务',
-          path: '/xinxifuwu308/'
-        }
-      },
-      //16.三农调查
-      {
-        path: '/shijianbaodao309/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 309, 
-          routeName: '事件报道',
-          path: '/shijianbaodao309/'
-        }
-      },
-      {
-        path: '/minyidiaocha311/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 311, 
-          routeName: '民意调查',
-          path: '/minyidiaocha311/'
-        }
-      },
-      {
-        path: '/shichangdiaoyan312/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 312, 
-          routeName: '市场调研',
-          path: '/shichangdiaoyan312/'
-        }
-      },
-      {
-        path: '/guanyunongmin313/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 313, 
-          routeName: '关于农民',
-          path: '/guanyunongmin313/'
-        }
-      },
-      {
-        path: '/guanyunongcun314/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 314, 
-          routeName: '关于农村',
-          path: '/guanyunongcun314/'
-        }
-      },
-      {
-        path: '/sannongzhuanti315/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 315, 
-          routeName: '三农专题',
-          path: '/sannongzhuanti315/'
-        }
-      },
-      {
-        path: '/minqingminyi316/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 315, 
-          routeName: '民情民意',
-          path: '/minqingminyi316/'
-        }
-      },
-      {
-        path: '/jiaodianfangtan310/:id',
-        component: () => import('~/pages/newsList/[id].vue'),
-        meta: { 
-          isAlias: true, 
-          routeId: 310, 
-          routeName: '焦点访谈',
-          path: '/jiaodianfangtan310/'
-        }
-      }
-    ]
-
-
-    return [
-      ...routes,
-      ...staticAliases,
-    ]
-  }
-}

+ 2 - 2
assets/css/index.less

@@ -601,11 +601,11 @@
         overflow: hidden;
         a {
             display: block;
-            width: 450px;
             height: 290px;
         }
         img {
-            width: 100%;
+            width: 450px;
+            height: 290px;
         }
     }
     .scienceLeft {

+ 5 - 4
components/home/Advertising.vue

@@ -1,11 +1,11 @@
 <template>
     <div class="adversing" v-if="imgurl">
         <div class="inner">
-            <a href="http://nzgxw.org.cn/" v-if="imgurl.image_url==null" target="_blank">
-                <img :src="imgurl.thumb">
+            <a href="http://nzgxw.org.cn/" v-if="imgurl.image_url==null" target="_blank" :title="imgurl.place_name" data-tag="imgurl.ad_tag">
+                <img :src="imgurl.thumb" :alt="imgurl.place_name">
             </a>
-            <a :href="imgurl.image_url" v-else>
-                <img :src="imgurl.image_src">
+            <a :href="imgurl.image_url" v-else :title="imgurl.ad_name" data-tag="imgurl.ad_tag">
+                <img :src="imgurl.image_src" :alt="imgurl.ad_name">
             </a>
         </div>
     </div>
@@ -33,6 +33,7 @@ const props = defineProps({
     }
     img {
         width: 100%;
+        height: 90px;
     }  
 }
 </style>

+ 10 - 17
components/home/SecondaryHeading.vue

@@ -9,7 +9,7 @@
                 <strong>频道介绍</strong>
                 <div v-for="(item,index) in titleData">
                     <span v-if="index<=7">
-                        <NuxtLink :to="{ path: `/newsList/${item.cid}`}">{{item.alias}}</NuxtLink>
+                        <NuxtLink :to="{ path: `/newsList/${item.cid}`,query:{page:1} }">{{item.alias}}</NuxtLink>
                     </span>
                     <b v-else></b>
                 </div>
@@ -29,23 +29,16 @@ const props = defineProps({
 
 //1.获得路由id start ---------------------------------------->
 const route = useRoute();
-let routeId = 0;//路由id
 
-//判断用户是由于别名跳转还是直接访问二级分类,正常来说只会从别名访问
-const getRoute = () => {
-    if(route.meta.isAlias){
-        //如果用户从别名访问,数据需要从meta中获取
-        routeId = route.meta.routeId;
-    }else{
-        routeId = route.params.id;
-    }
-}
-
-// 监听路由变化
-watch(() => route.path, (newPath) => {
-    //每当路径变化的时候重新获取routeId
-    getRoute()
-}, { immediate: true })
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//路由id
+//let routeId = 11 //排除路径错误可以打开这个
+let routeId = numberPart;
 //1.获得路由id end ---------------------------------------->
 
 //2.设置组件标题 start ---------------------------------------->

+ 3 - 4
components/home/Slider.vue

@@ -107,7 +107,8 @@ const getLinkPath = (item) => {
     if (item.children_count == 0) {
         return `/newsList/${item.cid}`;
     } else {
-        return `/${item.url}/`;
+        //return `/${item.url}/`;
+        return `/primaryNavigation/${item.cid}`;
     }
 }
 //格式化跳转路径 - 到详情
@@ -221,7 +222,7 @@ const getLinkPathDetail = (item) => {
 }
 .box {
     width: 720px;
-    height: 700px;
+    height: 662px;
     position: relative;
     overflow: hidden;
     .boxcontent {
@@ -230,8 +231,6 @@ const getLinkPathDetail = (item) => {
         padding-top: 30px;
         .boxleft {
             width: 349px;
-            height: 700px;
-            padding-bottom: 30px;
         }
     }
     .boxMainImg {

+ 6 - 5
components/home/TopTen.vue

@@ -1,11 +1,11 @@
 <template>
     <div class="topTenTitle">
         <div class="inner" v-if="imgurl">
-            <a href="http://nzgxw.org.cn/" v-if="imgurl.image_url==null" target="_blank">
-                <img :src="imgurl.thumb" >
+            <a href="http://nzgxw.org.cn/" v-if="imgurl.image_url==null" target="_blank" :title="imgurl.place_name" data-tag="imgurl.ad_tag">
+                <img :src="imgurl.thumb" :alt="imgurl.place_name">
             </a>
-            <a :href="imgurl.image_url" v-else>
-                <img :src="imgurl.image_src">
+            <a :href="imgurl.image_url" v-else :title="imgurl.ad_name" data-tag="imgurl.ad_tag">
+                <img :src="imgurl.image_src" :alt="imgurl.ad_name">
             </a>
         </div>
     </div>
@@ -28,12 +28,13 @@
     overflow: hidden;
     a {
         display: block;
-        width: 1200px;
+        
         height: 90px;
         overflow: hidden;
     }
     img {
         width: 1200px;
+        height: 90px;
     }
 }
 </style>

+ 2 - 2
components/home/foot.vue

@@ -13,10 +13,10 @@
         </div>
         <div class="call_us_box">
             <span v-for="(item, index) in bottomMenu" :key="index">
-                <NuxtLink :to="{ path: `/specialList/${item.id}` }" v-if="item.type == 1" :title="item.name">
+                <NuxtLink :to="{ path: `/about/${item.name_pinyin}/1.html` }" v-if="item.type == 1" :title="item.name">
                     {{ item.name }}
                 </NuxtLink>
-                <NuxtLink :to="{ path: `/speciaArticle/${item.id}` }" v-if="item.type == 0" :title="item.name">
+                <NuxtLink :to="{ path: `/about/${item.name_pinyin}/` }" v-if="item.type == 0" :title="item.name">
                     {{ item.name }}
                 </NuxtLink>
             </span>

+ 2 - 2
components/home/foot1.vue

@@ -2,10 +2,10 @@
     <footer class="index_foot">
         <div class="call_us_box">
             <span v-for="(item, index) in bottomMenu" :key="index">
-                <NuxtLink :to="{ path: `/specialList/${item.id}` }" v-if="item.type == 1" :title="item.name">
+                <NuxtLink :to="{ path: `/about/${item.name_pinyin}/1.html` }" v-if="item.type == 1" :title="item.name">
                     {{ item.name }}
                 </NuxtLink>
-                <NuxtLink :to="{ path: `/speciaArticle/${item.id}` }" v-if="item.type == 0" :title="item.name">
+                <NuxtLink :to="{ path: `/about/${item.name_pinyin}/` }" v-if="item.type == 0" :title="item.name">
                     {{ item.name }}
                 </NuxtLink>
             </span>

+ 19 - 13
components/home/pageHead.vue

@@ -40,11 +40,11 @@
             <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">
-                        <img :src="adImg.thumb" >
+                    <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 :href="adImg.image_url" v-else>
-                        <img :src="adImg.image_src">
+                    <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>
                 </div>
             </div>
@@ -75,17 +75,18 @@ const { $webUrl, $CwebUrl, $BwebUrl} = useNuxtApp()
 let ticket = ref('')
 let token = ref('')
 let route = useRoute()
+
+//页面每次刷新先判断一下用户状态是否已经过期了
+//如果没有过期再储存token
 ticket.value = route.query.ticket
 token.value = route.query.admintoken
+
 if (ticket.value) {
     setTicket(ticket.value)
 }
 if (token.value) {
     setToken(token.value)
 }
-definePageMeta({
-    middleware: 'auth'
-});
 
 //搜索框
 let keyword = useState('keyword', () => '')
@@ -284,6 +285,7 @@ let adImg = ref({})
 
 //5.获取登录状态 start ---------------------------------------->
 onMounted(async () => {
+    
     //从客户端获取登录状态
     //从客户端阶段开始 持续查询登录状态
     let getLoginStatus = async () => {
@@ -304,26 +306,30 @@ onMounted(async () => {
             }
         });
         const result = await responseStatus.json();
-        console.log(result.data.islogin)
+        console.log(result)
         if(result.code == 200){
             if(result.data.isLogin == true){
                 console.log("用户已经登录!");
-                showToken.value = true 
+                showToken.value = true; 
+
             }else{
                 console.log("用户未登录!");
-                showToken.value = false
+                showToken.value = false;
                 //退出登录
                 isShow.value = false;
                 removeToken();
                 removeTicket();
             }
-        }else if(result.data.code == 0){
+        }else{
+            console.log("用户已退出登录!");
             //退出登录
             isShow.value = false;
+            showToken.value = false;
             removeToken();
             removeTicket();
         }
     }
+    getLoginStatus();
     setInterval(getLoginStatus, 5000);
 
     //从客户端获取广告
@@ -519,12 +525,12 @@ header {
         overflow: hidden;
         a {
             display: block;
-            width: 830px;
             height: 110px;
             overflow: hidden;
         }
         img {
             width: 100%;
+            height: 110px;
         }
     }
     .inner {
@@ -534,7 +540,7 @@ header {
     .inner>img {
         // width: 342px;
         //height: 120px;
-        margin-top: 47px;
+        margin-top: 31px;
         cursor: pointer;
     }
 

+ 15 - 4
components/home/pageNavigation.vue

@@ -96,15 +96,26 @@ async function getPageData2() {
 getPageData2();
 
 //格式化跳转路径
+// const getLinkPath = (item) => {
+//     if(item.is_url==1){
+//         return `${item.web_url}`;
+//     }else if(item.children_count == 0){
+//         //return `/${item.aLIas_pinyin}/`;
+//         return `/newsList/${item.category_id}?page=1`;
+//     }else{
+//         //return `/${item.aLIas_pinyin}/`;
+//         return `/primaryNavigation/${item.category_id}`;
+//     }
+// }
 const getLinkPath = (item) => {
     if(item.is_url==1){
         return `${item.web_url}`;
     }else if(item.children_count == 0){
-        //return `/${item.aLIas_pinyin}/1.html`;
-        return `/newsList/${item.category_id}?page=1`;
+        //return `/newsList/${item.category_id}?page=1`;
+        return `/news/${item.aLIas_pinyin}/1.html`;
     }else{
-        //return `/${item.aLIas_pinyin}/`;
-        return `/primaryNavigation/${item.category_id}`;
+        //return `/primaryNavigation/${item.aLIas_pinyin}/`;
+        return `/news/${item.aLIas_pinyin}/`;
     }
 }
 //2.加载模块数据 end ---------------------------------------->

+ 4 - 4
components/home/pageNavigation1.vue

@@ -69,11 +69,11 @@ const getLinkPath = (item) => {
     if(item.is_url==1){
         return `${item.web_url}`;
     }else if(item.children_count == 0){
-        //return `/${item.aLIas_pinyin}/1.html`;
-        return `/newsList/${item.category_id}?page=1`;
+        //return `/newsList/${item.category_id}?page=1`;
+        return `/news/${item.aLIas_pinyin}/1.html`;
     }else{
-        //return `/${item.aLIas_pinyin}/`;
-        return `/primaryNavigation/${item.category_id}`;
+        //return `/primaryNavigation/${item.aLIas_pinyin}/`;
+        return `/news/${item.aLIas_pinyin}/`;
     }
 }
 //2.加载模块数据 end ---------------------------------------->

+ 7 - 4
middleware/auth.js

@@ -1,4 +1,7 @@
-export default function (to, from) {
-    // to是目标路由对象,from是来源路由对象
-    console.log('进入路由中间件,目标路由:', to.path,"当前路由:",from.path);
-  }
+// middleware/auth.js
+export default defineNuxtRouteMiddleware(async (to) => {
+  //局部中间件 使用此方法你必须在页面中调用
+  // definePageMeta({
+  //   middleware: 'auth'
+  // })
+});

+ 48 - 0
middleware/setup.global.js

@@ -0,0 +1,48 @@
+export default defineNuxtRouteMiddleware(async (to, from) => {
+  // const router = useRouter()
+  // const responseRoute = await $fetch('http://apipre1.bjzxtw.org.cn:29501/web/getWebsiteParentCategory', {
+  //   headers: {
+  //     'Content-Type': 'application/json',
+  //     'Userurl': 'http://apipre1.bjzxtw.org.cn:29501',
+  //     'Origin': 'http://apipre1.bjzxtw.org.cn:29501'
+  //   }
+  // })
+  
+  // //添加所有分类页路由
+  // for(let index in responseRoute.data.parent){
+  //   if(responseRoute.data.parent[index].path!=undefined){
+      
+  //     router.addRoute({
+  //       path: responseRoute.data.parent[index].path,
+  //       component: () => import('~/pages/primaryNavigation/[id].vue'),
+  //       meta: {
+  //         isAlias: true,
+  //         routeId: responseRoute.data.parent[index].cid,
+  //         routeName: responseRoute.data.parent[index].name
+  //       }
+  //     })
+
+  //   }
+  // }
+  // //添加所有列表路由
+  // for(let index in responseRoute.data.child){
+  //   if(responseRoute.data.child[index].path!=undefined){
+      
+  //     router.addRoute({
+  //       path: responseRoute.data.child[index].path,
+  //       component: () => import('~/pages/newsList/[id].vue'),
+  //       meta: {
+  //         isAlias: true,
+  //         routeId: responseRoute.data.child[index].cid,
+  //         routeName: responseRoute.data.child[index].name
+  //       }
+  //     })
+
+  //   }
+  // }
+
+
+  // console.log('进入路由中间件,目标路由:', to.path, "当前路由:", from.path);
+
+})
+

+ 27 - 7
pages/specialList/[id].vue → pages/about/[dir]/[id].vue

@@ -34,7 +34,7 @@
                     <div class="innerTitle">本网招聘</div>
                     <ul class="list">
                         <li v-for="(item, index) in newsList" :key="index">
-                            <NuxtLink :to="{ path: `/speciaArticle/${item.id}` }" :title="item.con_title">{{item.con_title}}</NuxtLink>
+                            <NuxtLink :to="{ path: `zhaopin/${item.id}.html` }" :title="item.con_title">{{item.con_title}}</NuxtLink>
                             <!-- <NuxtLink :to="{ path: `/speciaArticle/${item.id}` }" target="_blank" v-if="item.islink == 0">{{ item.list_title }}</NuxtLink> -->
                         </li>
                     </ul>
@@ -48,10 +48,21 @@
                     <div class="rightMenuTitle">导航列表</div>
                     <ul>
                         <li v-for="(item, index) in bottomMenu" :key="index">
-                            <NuxtLink :to="`/speciaArticle/${item.id}`" v-if="item.id == pageId && item.id != 7" class="active" :title="item.name">{{ item.name }}</NuxtLink>
-                            <NuxtLink :to="`/speciaArticle/${item.id}`" v-else-if="item.id != pageId && item.id != 7" :title="item.name">{{ item.name }}</NuxtLink>
-                            <NuxtLink :to="`/specialList/${item.id}`" v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active" :title="item.name">{{item.name}}</NuxtLink>
-                            <NuxtLink :to="`/specialList/${item.id}`" v-else-if="item.id == 7" :title="item.name">{{item.name}}</NuxtLink>
+                            <NuxtLink :to="`/about/${item.name_pinyin}/`" :title="item.name"
+                                v-if="item.id == pageId && item.id != 7" class="active">
+                                {{ item.name }}
+                            </NuxtLink>
+                            <NuxtLink :to="`/about/${item.name_pinyin}/`" :title="item.name"
+                                v-else-if="item.id != pageId && item.id != 7">
+                                {{ item.name }}
+                            </NuxtLink>
+                            <NuxtLink :to="`/about/${item.name_pinyin}/1.html`" :title="item.name"
+                                v-if="item.id == 7 && pageId == 7" class="active">
+                                {{item.name }}
+                            </NuxtLink>
+                            <NuxtLink :to="`/about/${item.name_pinyin}/1.html`" :title="item.name" v-else-if="item.id == 7">
+                                {{ item.name}}
+                            </NuxtLink>
                         </li>
                     </ul>
                 </div>
@@ -70,10 +81,19 @@
 import { ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus'
 import { ArrowRight } from '@element-plus/icons-vue'
 import { ref, onMounted } from 'vue';
+
 //获得跳转过来的id
 const route = useRoute();
-const pageId = route.params.id;
-const routeHref = route.href;
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//路由id
+//let routeId = 11 //排除路径错误可以打开这个
+const pageId = numberPart;//左侧菜单选中哪个
+
 //1.页面依赖 end ---------------------------------------->
 
 //2.页面数据 start ---------------------------------------->

+ 17 - 12
pages/speciaArticle/[id].vue → pages/about/[dir]/index.vue

@@ -13,9 +13,6 @@
                 <el-breadcrumb-item>
                     <NuxtLink to="/">首页</NuxtLink>
                 </el-breadcrumb-item>
-                <el-breadcrumb-item  v-show="name">
-                    <NuxtLink :to="{ path: `/primaryNavigation/${listid}`}">{{name}}</NuxtLink>
-                </el-breadcrumb-item>
                 <el-breadcrumb-item>
                     {{ newsDetail.con_title }}
                 </el-breadcrumb-item>
@@ -33,19 +30,19 @@
                 <div class="rightMenuTitle">导航列表</div>
                 <ul>
                     <li v-for="(item, index) in bottomMenu" :key="index">
-                        <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
+                        <NuxtLink :to="`/about/${item.name_pinyin}/`" :title="item.name"
                             v-if="item.id == pageId && item.id != 7" class="active">
                             {{ item.name }}
                         </NuxtLink>
-                        <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
+                        <NuxtLink :to="`/about/${item.name_pinyin}/`" :title="item.name"
                             v-else-if="item.id != pageId && item.id != 7">
                             {{ item.name }}
                         </NuxtLink>
-                        <NuxtLink :to="`/specialList/${item.id}`" :title="item.name"
+                        <NuxtLink :to="`/about/${item.name_pinyin}/1.html`" :title="item.name"
                             v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active">
                             {{item.name }}
                         </NuxtLink>
-                        <NuxtLink :to="`/specialList/${item.id}`" :title="item.name" v-else-if="item.id == 7">
+                        <NuxtLink :to="`/about/${item.name_pinyin}/1.html`" :title="item.name" v-else-if="item.id == 7">
                             {{ item.name}}
                         </NuxtLink>
                     </li>
@@ -68,15 +65,23 @@ import { ref, onMounted } from 'vue';
 
 //获得跳转过来的id
 const route = useRoute();
-const articleId = route.params.id; //获得该页面的id
-const listid = route.query.listId; //获得该页面的id
-const name = route.query.listName; //获得该页面的id
-const pageId = route.params.id; //获得该页面的id
-const routeHref = route.href;
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//路由id
+//let routeId = 11 //排除路径错误可以打开这个
+let articleId = numberPart;
+const pageId = numberPart;//左侧菜单选中哪个
+// const routeHref = route.href;
+
 //1.页面依赖 end ---------------------------------------->
 
 //2.页面数据 start ---------------------------------------->
 //广告列表
+const adList = ref([]);
 let adImg1 = ref([]);
 let adImg2 = ref([]);
 async function getAdData(){

+ 368 - 0
pages/about/[dir]/zhaopin/[id].vue

@@ -0,0 +1,368 @@
+<template>
+    <!-- 页面头部 -->
+    <HomePageHead></HomePageHead>
+    <!-- 导航栏 -->
+    <HomePageNavigation1></HomePageNavigation1>
+    <!-- 列表页广告一 -->
+    <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
+    <!-- 面包屑导航 -->
+    <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>
+                    {{ newsDetail.con_title }}
+                </el-breadcrumb-item>
+            </el-breadcrumb>
+        </div>
+    </div>
+    <!-- 资讯列表 -->
+    <div class="newsDetail">
+        <div class="inner">
+            <div class="innerLeft">
+                <div class="leftBottomTitle">{{ newsDetail.con_title }}</div>
+                <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
+            </div>
+            <div class="innerRight">
+                <div class="rightMenuTitle">导航列表</div>
+                <ul>
+                    <li v-for="(item, index) in bottomMenu" :key="index">
+                        <NuxtLink :to="`/about/${item.name_pinyin}/`" :title="item.name"
+                            v-if="item.id == pageId && item.id != 7" class="active">
+                            {{ item.name }}
+                        </NuxtLink>
+                        <NuxtLink :to="`/about/${item.name_pinyin}/`" :title="item.name"
+                            v-else-if="item.id != pageId && item.id != 7">
+                            {{ item.name }}
+                        </NuxtLink>
+                        <NuxtLink :to="`/about/${item.name_pinyin}/1.html`" :title="item.name"
+                            v-if="item.id == 7 && pageId == 7 " class="active">
+                            {{item.name }}
+                        </NuxtLink>
+                        <NuxtLink :to="`/about/${item.name_pinyin}/1.html`" :title="item.name" v-else-if="item.id == 7">
+                            {{ item.name}}
+                        </NuxtLink>
+                    </li>
+                </ul>
+            </div>
+            <div style="clear: both;"></div>
+        </div>
+    </div>
+    <!-- 广告二 -->
+    <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
+    <!-- 页面底部 -->
+    <HomeFoot1></HomeFoot1>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+import { ref, onMounted } from 'vue';
+
+//获得跳转过来的id
+const route = useRoute();
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//路由id
+//let routeId = 11 //排除路径错误可以打开这个
+let articleId = numberPart;
+const pageId = numberPart;//左侧菜单选中哪个
+// const routeHref = route.href;
+
+//1.页面依赖 end ---------------------------------------->
+
+//2.页面数据 start ---------------------------------------->
+//广告列表
+const adList = ref([]);
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+async function getAdData(){
+    const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'PAGE'}});
+    adList.value = adData.data;
+    if(adData.code==200){
+        for(let item of adData.data){
+            if(item.ad_tag == 'PAGE_0001'){
+                adImg1.value = item;
+            }
+            if(item.ad_tag == 'PAGE_0002'){
+                adImg2.value = item;
+            }
+        }
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情页广告列表")
+        console.log("后端错误反馈:",adData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+getAdData();
+
+const newsDetail = ref({})
+const bottomMenu = ref([]);
+
+async function getPageData() {
+    const mkdata =  await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
+        method: 'GET',
+        query: {
+            'fcat_id': articleId
+        },
+    });
+    newsDetail.value = mkdata.data;
+}
+getPageData();
+
+async function getPageMenu() {
+    const mkdata =  await requestDataPromise('/web/getWebsiteFooterCategory', {
+        method: 'GET',
+        query: {},
+    });
+    bottomMenu.value = mkdata.data;
+}
+getPageMenu();
+//2.页面数据 end ---------------------------------------->
+
+
+//4.设置seo信息 start---------------------------------------->
+//4.1 设置seo信息
+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 }
+    ]
+});
+//4.设置seo信息 end---------------------------------------->
+
+onMounted(async ()  => {
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+    
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_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];
+})
+</script>
+
+<style lang="less" scoped>
+//导航条
+.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;
+
+    .el-breadcrumb::v-deep {
+        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;
+    }
+}
+
+// 资讯列表
+.newsDetail {
+    width: 100%;
+    //height: 1400px;
+    margin-bottom: 70px;
+
+    .inner {
+        width: 1200px;
+        //height: 1400px;
+        font-size: 16px;
+
+        .innerLeft {
+            //height: 1400px;
+
+            float: right;
+
+            .LeftTop {
+                //height: 522px;
+                margin-top: 50px;
+
+                >h1 {
+
+                    line-height: 40px;
+                    margin-bottom: 30px;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-weight: bold;
+                    font-size: 30px;
+                    color: #333333;
+                }
+
+                >p {
+                    height: 18px;
+                    line-height: 18px;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-weight: 400;
+                    font-size: 14px;
+                    color: #999999;
+
+                    span {
+                        margin-right: 40px;
+                    }
+                }
+
+                >img {
+                    width: 680px;
+                    height: 382px;
+                    padding: 50px 0px 60px 55px;
+                }
+            }
+
+            .leftBottomTitle {
+                color: #028E21;
+                font-size: 24px;
+                font-weight: bold;
+                height: 60px;
+                line-height: 60px;
+            }
+
+            .leftBottom {
+                width: 790px;
+                font-size: 20px;
+                border-top: 1px solid #139602;
+                padding-top: 40px;
+
+                >h3,
+                >p {
+                    text-indent: 2em;
+                    width: 790px;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-size: 20px;
+                    color: #333333;
+                    line-height: 23px;
+                    padding-bottom: 30px;
+                }
+
+                >h3 {
+                    font-weight: 600px;
+                }
+
+                >p {
+                    font-weight: 400;
+                }
+
+            }
+        }
+
+
+        .innerRight {
+            width: 279px;
+
+            .rightMenuTitle {
+                width: 279px;
+                height: 69px;
+                font-size: 22px;
+                font-weight: bold;
+                line-height: 58px;
+                text-align: center;
+                color: #fff;
+                background: url("http://img.bjzxtw.org.cn/master/bjzxtw/public/special/projectMoreTitle.png") no-repeat;
+                margin-bottom: 30px;
+            }
+
+            ul {
+                li {
+                    a {
+                        border-left: 5px solid #028E21;
+                        margin-bottom: 15px;
+                        font-size: 22px;
+                        display: block;
+                        height: 61px;
+                        line-height: 61px;
+                        color: #333333;
+                        text-align: center;
+                        background: #FBFBFB;
+                    }
+                }
+            }
+
+            .active {
+                border-left: 0;
+                border: 1px solid #028E21;
+                background: #fff;
+            }
+        }
+    }
+}
+</style>

+ 16 - 14
pages/index.vue

@@ -85,12 +85,12 @@
                     <HomeSlider :message="pageData[2]"></HomeSlider>
                 </div>
                 <div class="scienceRight" v-if="pageData.length>=4">
-                    <div class="adBox1" v-if="adImg3">
-                        <a href="http://nzgxw.org.cn/" v-if="adImg2.image_url==null" target="_blank">
-                            <img :src="adImg2.thumb" >
+                    <div class="adBox1" v-if="adImg2">
+                        <a href="http://nzgxw.org.cn/" v-if="adImg2.image_url==null" target="_blank" :title="adImg2.place_name" data-tag="adImg2.ad_tag">
+                            <img :src="adImg2.thumb" :alt="adImg2.place_name">
                         </a>
-                        <a :href="adImg2.image_url" v-else>
-                            <img :src="adImg2.image_src">
+                        <a :href="adImg2.image_url" v-else :title="adImg2.ad_name" data-tag="adImg2.ad_tag">
+                            <img :src="adImg2.image_src" :alt="adImg2.ad_name">
                         </a>
                     </div>
                     <h3 v-if="pageData[3].cid">
@@ -522,11 +522,11 @@
             </div>
         </section>
         <div class="titleBox" v-if="adImg4">
-            <a href="http://nzgxw.org.cn/" v-if="adImg4.image_url==null" target="_blank">
-                <img :src="adImg4.thumb">
+            <a href="http://nzgxw.org.cn/" v-if="adImg4.image_url==null" target="_blank" :title="adImg4.place_name" data-tag="adImg4.ad_tag">
+                <img :src="adImg4.thumb" alt="adImg4.place_name">
             </a>
-            <a :href="adImg4.image_url" v-else target="_blank">
-                <img :src="adImg4.image_src">
+            <a :href="adImg4.image_url" v-else target="_blank" :title="adImg4.ad_name" data-tag="adImg4.ad_tag">
+                <img :src="adImg4.image_src" alt="adImg4.ad_name">
             </a>
         </div>
         <div class="lastPart3">
@@ -796,9 +796,11 @@ import { useSeoMeta } from '#imports';
 //首页分类栏目标题,不需要考虑外链
 const getLinkPath = (item) => {
     if (item.children_count == 0) {
-        return `/newsList/${item.cid}?page=1`;
+        //return `/newsList/${item.cid}?page=1`;
+        return `/news/${item.aLIas_pinyin}/1.html`;
     } else {
-        return `/${item.url}/`;
+        //return `/primaryNavigation/${item.cid}`;
+        return `/news/${item.aLIas_pinyin}/`;
     }
 }
 //首页跳转到详情,这里需要考虑外链
@@ -806,7 +808,7 @@ const getLinkPathDetail = (item) => {
     if (item.islink == 1) {
         return `${item.linkurl}`;
     } else {
-        return `/newsDetail/${item.id}`;
+        return `/news${item.pinyin}a/${item.id}.html`;
     }
 }
 //1.加载页面必备组件 end---------------------------------------->
@@ -1295,7 +1297,7 @@ try {
                 cid: navigateData.data[index].category_id,
                 children_count: navigateData.data[index].children_count,
                 alias: navigateData.data[index].alias,
-                url: navigateData.data[index].aLIas_pinyin
+                aLIas_pinyin: navigateData.data[index].aLIas_pinyin
             };
             //主体渲染 第一层
             //新农村11
@@ -1359,7 +1361,7 @@ let getJson = [
     {"parent":"5,1,1","child":""},//模块5区域经济
     {"parent":"12,0,3","child":""},//模块6三农投资 
     {"parent":"13,0,4","child":""},//模块7农贸信息 
-    {"parent":"24,2,8","child":""},//模块8书刊信息
+    {"parent":"24,2,7","child":""},//模块8书刊信息
     {"parent":"14,2,8","child":""},//模块9三农科教 
     {"parent":"15,2,8","child":""},//模块10文化生活
     {"parent":"27,2,4","child":""},//模块11三农服务27

+ 0 - 246
pages/login.vue

@@ -1,246 +0,0 @@
-<!-- <template>
-  <div class="login">
-    <h1></h1>
-
-  </div>
-</template>
-
-<script setup>
-import { onMounted, onUnmounted } from 'vue';
-// import { EventSource } from 'eventsource'
-import EventSource from 'eventsource';
-
-// 创建 EventSource 实例,订阅事件流
-// const eventSource = new EventSource('http://192.168.126.42/gap/nodes');
-// const EventSource = require('eventsource');
-// var EventSource = {};
-// var myCustomVariable = {};
-const eventSource = new EventSource('http://192.168.1.201:9501/collector/zhipu');
-
-
-const express = require('express');
-const app = express();
-
-app.get('/events', (req, res) => {
-  res.setHeader('Content-Type', 'text/event-stream');
-
-  // 这里可以编写逻辑来持续推送事件数据,例如
-  const interval = setInterval(() => {
-    res.write('data: Some data here\n\n');
-  }, 1000);
-
-  req.on('close', () => {
-    clearInterval(interval);
-    res.end();
-  });
-
-});
-
-app.listen(3000, () => {
-  console.log('Server started on port 3000');
-});
-
-onUnmounted(() => {
-  eventSource.close();
-});
-
-// 页面加载时
-onMounted(() => {
-  // getTableData();
-  // 创建 EventSource 实例,订阅事件流
-  eventSource.onmessage = (event) => {
-
-    console.log(event);
-
-    // 处理收到的数据
-    console.log(JSON.parse(event.data));
-  };
-  eventSource.onerror = (event) => {
-    // 处理错误
-  };
-});
-
-</script> -->
-
-
-<!-- 
-<template>
-  <div>
-    <div v-for="(message, index) in messages" :key="index">{{ message }}</div>
-  </div>
-</template>
-
-<script>
-import { ref } from 'vue';
-import axios from 'axios';
-
-export default {
-  setup() {
-    const messages = ref([]);
-
-    const eventSource = axios.create({
-      baseURL: 'http://192.168.1.201:9501',
-      headers: { 'Content-Type': 'text/event-stream' }
-    });
-
-    const setupEventSource = () => {
-      const source = new EventSource(eventSource.getUri({ path: '/collector/zhipu' }));
-
-      source.onmessage = (event) => {
-        const data = JSON.parse(event.data);
-        messages.value.push(data.message);
-      };
-
-      source.onerror = (error) => {
-        console.error(error);
-      };
-    };
-
-    setupEventSource();
-
-    return { messages };
-  }
-};
-</script> -->
-
-
-
-<!-- <template>
-  <div>
-    <button @click="startEventSource">开始接收事件</button>
-    <button @click="stopEventSource">停止接收事件</button>
-    <div v-for="event in events" :key="event.id">
-      {{ event.data }}
-    </div>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'EventSourceExample',
-  data() {
-    return {
-      events: [],
-      eventSource: null
-    };
-  },
-  methods: {
-    startEventSource() {
-      if (!this.eventSource) {
-        this.eventSource = new EventSource('http://192.168.1.201:9501/collector/zhipu');
-        this.eventSource.onmessage = this.handleMessage;
-        this.eventSource.onerror = this.handleError;
-      }
-    },
-    stopEventSource() {
-      if (this.eventSource) {
-        this.eventSource.close();
-        this.eventSource = null;
-      }
-    },
-    handleMessage(event) {
-      // 处理接收到的消息
-      console.log('收到消息:', event.data);
-      this.events.push({ id: this.events.length, data: event.data });
-    },
-    handleError(event) {
-      // 处理错误
-      console.error('EventSource 错误:', event);
-      this.stopEventSource();
-    }
-  },
-  beforeDestroy() {
-    // 组件销毁前停止 EventSource
-    this.stopEventSource();
-  }
-};
-</script> -->
-
-<template>
-  <div>
-    <h2>事件流数据</h2>
-    <ul>
-      <li v-for="(item, index) in dataStream" :key="index">{{ item }}</li>
-    </ul>
-    <button @click="startStream">启动事件流</button>
-    <button @click="stopStream">停止事件流</button>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      dataStream: [], // 用于存储从事件流接收的数据
-      eventSource: null, // 保存 EventSource 实例
-    };
-  },
-  methods: {
-    // 启动事件流
-    startStream() {
-      if (this.eventSource) {
-        console.log("事件流已经启动!");
-        return;
-      }
-
-      // 连接到 PHP SSE 后端接口
-      // const apiUrl = "http://192.168.1.201:8989/";
-      const apiUrl = "http://192.168.1.201:9501/stream";
-      this.eventSource = new EventSource(apiUrl);
-
-      // 监听普通消息
-      this.eventSource.onmessage = (event) => {
-        console.log(event);
-
-        console.log("收到事件流数据:", event.data);
-        this.dataStream.push(JSON.parse(event.data)); // 将数据存储到 dataStream 中
-      };
-
-      // 监听自定义事件(如关闭事件)
-      this.eventSource.addEventListener("close", (event) => {
-        console.log("事件流关闭:", event.data);
-        this.stopStream(); // 停止事件流
-      });
-
-      // 监听错误事件
-      this.eventSource.onerror = (error) => {
-        console.error("事件流错误:", error);
-        this.stopStream(); // 遇到错误时停止事件流
-      };
-    },
-
-    // 停止事件流
-    stopStream() {
-      if (this.eventSource) {
-        this.eventSource.close(); // 关闭事件流
-        this.eventSource = null;
-        console.log("事件流已停止");
-      }
-    },
-  },
-  beforeDestroy() {
-    // 在组件销毁前关闭事件流
-    this.stopStream();
-  },
-};
-</script>
-
-<style scoped>
-h2 {
-  color: #333;
-}
-
-button {
-  margin: 5px;
-  padding: 10px;
-  background-color: #007bff;
-  color: white;
-  border: none;
-  border-radius: 5px;
-  cursor: pointer;
-}
-
-button:hover {
-  background-color: #0056b3;
-}
-</style>

+ 29 - 46
pages/newsList/[id].vue → pages/news/[dir]/[dir]/[id].vue

@@ -20,7 +20,7 @@
                     <strong>频道介绍</strong>
                 <div v-for="(item, index) in secondNav" :key="index">
                     <span v-if="index <= 7">
-                        <NuxtLink :to="{ path: `/newsList/${item.category_id}` }">{{ item.alias }}</NuxtLink>
+                        <NuxtLink :to="{ path: `/newsList/${item.category_id}`,query:{page:1}}">{{ item.alias }}</NuxtLink>
                     </span>
                     <b v-else></b>
                 </div>
@@ -56,18 +56,18 @@
                         </li>
                     </ul>
                     <!-- 分页器 -->
-                    <div class="pagination" v-if="total">
+                    <div class="pagination">
                         <el-pagination 
                             size="small" 
                             background 
                             layout="prev, pager, next" 
                             :total="total" 
                             class="mt-4"
-                            v-model:page-size="pageSize" 
-                            v-model:current-page="page"
+                            :page-size="pageSize" 
+                            :current-page="pageNum"
                             prev-text="上一页" 
                             next-text="下一页" 
-                            @change="changePage" 
+                            @current-change="changePage" 
                         />
                     </div>
                 </div>
@@ -93,44 +93,34 @@ import { ArrowRight } from '@element-plus/icons-vue'
 import { ref, onMounted } from 'vue';
 //当前列表名称
 const name = ref('')
-
 const { $webUrl, $CwebUrl, $BwebUrl } = useNuxtApp()
 //1.页面必备依赖 end ---------------------------------------->
 
-
 //1.获得路由id start ---------------------------------------->
 const route = useRoute();
 let articleId = 0;//路由id
-let page = ref(1)
-let total = useState("total", () => 0)
-let pageSize = useState("pageSize", () => 20)
-
-//判断用户是由于别名跳转还是直接访问二级分类,正常来说只会从别名访问
-const getRoute = () => {
-    if(route.meta.isAlias){
-        //如果有别名,跳转是这样的:http://localhost:3000/zhaogongzhaopin20/1.html
-        //如果用户从别名访问,数据需要从meta中获取
-        articleId = route.meta.routeId;
-        // 获取route.params.id中的数字部分
-        const idString = route.params.id;
-        const idNumber = parseInt(idString.replace(/\D/g, ''), 10);
-        page.value = idNumber;
+let pageNum = ref(2);
+let total = ref(1);
+let pageSize = ref(20);
 
-    }else{
-        //如果没有别名 跳转是这样的:http://localhost:3000/newsList/20?page=1
-        articleId = route.params.id;
-        page.value = route.query.page;
-    }
-}
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//路由id
+//let routeId = 20 //排除路径错误可以打开这个
+articleId = numberPart;
+//获得html前的数字
+const pageUrl = segments[3]; 
+const pageNumber = pageUrl.split('.')[0];
+console.log("当前URL中的页码:")
+console.log(pageNumber)//2
+pageNum.value = parseInt(pageNumber);
 
-// 监听路由变化
-watch(() => route.path, (newPath) => {
-    //每当路径变化的时候重新获取routeId
-    getRoute()
-}, { immediate: true })
 //1.获得路由id end ---------------------------------------->
 
-
 //2.页面数据 start ---------------------------------------->
 //2.2新闻列表
 const newsList = ref([]);
@@ -138,7 +128,7 @@ let newslists = async () => {
     const listData = await requestDataPromise('/web/getWebsiteArticleList', {
         method: 'GET',
         query: {
-            'page': page.value,
+            'page': pageNum.value,
             'pageSize': pageSize.value,
             'catid': articleId
         },
@@ -146,6 +136,7 @@ let newslists = async () => {
     if (listData.code == 200) {
         newsList.value = listData.data.rows;
         total.value = listData.data.count;
+
     } else {
         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
         console.log("错误位置:获取新闻列表")
@@ -159,16 +150,7 @@ newslists();
 //分页事件
 let changePage = (value) => {
     console.log("当前页码", value);
-    page.value = value
-
-    //判断是否为真路径
-    if(route.meta.isAlias){
-        navigateTo(`${route.meta.path}${page.value}.html`)
-    }else{
-        navigateTo(`/newsList/${articleId}?page=${page.value}`)
-    }
-
-    newslists();
+    navigateTo(`/news/${targetSegment}/${value}.html`)
 }
 
 //2.3获得页面名称
@@ -280,10 +262,11 @@ let adImg1 = ref({});
 let adImg2 = ref({});
 
 onMounted(async ()  => {
+
     //从客户端获取行政职能部门 加快打开速度
     const { $webUrl, $CwebUrl } = useNuxtApp();
     //广告1
-    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_index_0001`
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_list_0001`
     const responseAd1 = await fetch(url, {
         headers: {
             'Content-Type': 'application/json',
@@ -295,7 +278,7 @@ onMounted(async ()  => {
     adImg1.value = resultAd1.data[0];
     
     //广告2
-    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_index_0002`
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_list_0002`
     const responseAd2 = await fetch(url2, {
         headers: {
             'Content-Type': 'application/json',

+ 1 - 1
pages/newsDetail/[id].vue → pages/news/[dir]/[dir]/a/[id].vue

@@ -14,7 +14,7 @@
                     <NuxtLink to="/">首页</NuxtLink>
                 </el-breadcrumb-item>
                 <el-breadcrumb-item >
-                    <NuxtLink :to="{ path: `/newsList/${routLevelId}` }">
+                    <NuxtLink :to="{ path: `/newsList/${routLevelId}`,query:{page:1} }">
                         {{ routLevelTitle }}
                     </NuxtLink>
                 </el-breadcrumb-item>

+ 298 - 0
pages/news/[dir]/[id].vue

@@ -0,0 +1,298 @@
+<template>
+    <div id="newsList">
+        <!-- 页面头部 -->
+        <HomePageHead></HomePageHead>
+
+        <!-- 导航栏 -->
+        <HomePageNavigation1></HomePageNavigation1>
+
+        <!-- 列表页广告一 -->
+        <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
+
+        <!-- 二级标题-->
+        <div class="sannongzhichuang" v-if="parent_name != ''">
+            <div class="inner">
+                <h2>
+                    <NuxtLink :to="`/primaryNavigation/${parent_id}`"> {{ parent_name }}</NuxtLink>
+                    <em class="iconfont icon-xingzhuang-zhijiaosanjiaoxing-copy"></em>
+                </h2>
+                <p class="introduction">
+                    <strong>频道介绍</strong>
+                <div v-for="(item, index) in secondNav" :key="index">
+                    <span v-if="index <= 7">
+                        <NuxtLink :to="{ path: `/newsList/${item.category_id}`,query:{page:1}}">{{ item.alias }}</NuxtLink>
+                    </span>
+                    <b v-else></b>
+                </div>
+                </p>
+            </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 v-if="parent_name != ''">
+                        <NuxtLink :to="`/primaryNavigation/${parent_id}`"> {{ parent_name }}</NuxtLink>
+                    </el-breadcrumb-item>
+                    <el-breadcrumb-item>{{ name }}</el-breadcrumb-item>
+                </el-breadcrumb>
+            </div>
+        </div>
+        <!-- 资讯列表 -->
+        <div class="newsList">
+            <div class="inner">
+                <div class="innerLeft">
+                    <ul class="list">
+                        <li v-for="(item, index) in newsList" :key="index">
+                            <NuxtLink :to="item.linkurl" v-show="item.islink == 1" :title="item.title">{{ item.title }}
+                            </NuxtLink>
+                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">{{
+                                item.title }}</NuxtLink>
+                        </li>
+                    </ul>
+                    <!-- 分页器 -->
+                    <div class="pagination">
+                        <el-pagination 
+                            size="small" 
+                            background 
+                            layout="prev, pager, next" 
+                            :total="total" 
+                            class="mt-4"
+                            :page-size="pageSize" 
+                            :current-page="pageNum"
+                            prev-text="上一页" 
+                            next-text="下一页" 
+                            @current-change="changePage" 
+                        />
+                    </div>
+                </div>
+                <div class="innerRight">
+                    <DetailHotNews></DetailHotNews>
+                    <DetailHotNews2></DetailHotNews2>
+                </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';
+//当前列表名称
+const name = ref('')
+const { $webUrl, $CwebUrl, $BwebUrl } = useNuxtApp()
+//1.页面必备依赖 end ---------------------------------------->
+
+//1.获得路由id start ---------------------------------------->
+const route = useRoute();
+let articleId = 0;//路由id
+let pageNum = ref(2);
+let total = ref(1);
+let pageSize = ref(20);
+
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//路由id
+//let routeId = 20 //排除路径错误可以打开这个
+articleId = numberPart;
+//获得html前的数字
+const pageUrl = segments[3]; 
+const pageNumber = pageUrl.split('.')[0];
+console.log("当前URL中的页码:")
+console.log(pageNumber)//2
+pageNum.value = parseInt(pageNumber);
+
+//1.获得路由id end ---------------------------------------->
+
+//2.页面数据 start ---------------------------------------->
+//2.2新闻列表
+const newsList = ref([]);
+let newslists = async () => {
+    const listData = await requestDataPromise('/web/getWebsiteArticleList', {
+        method: 'GET',
+        query: {
+            'page': pageNum.value,
+            'pageSize': pageSize.value,
+            'catid': articleId
+        },
+    });
+    if (listData.code == 200) {
+        newsList.value = listData.data.rows;
+        total.value = listData.data.count;
+
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取新闻列表")
+        console.log("后端错误反馈:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//获得列表
+newslists();
+
+//分页事件
+let changePage = (value) => {
+    console.log("当前页码", value);
+    navigateTo(`/news/${targetSegment}/${value}.html`)
+}
+
+//2.3获得页面名称
+let getPageName = async () => {
+    const pageName = await requestDataPromise('/web/getOneWebsiteCategory', {
+        method: 'GET',
+        query: {
+            'catid': articleId
+        },
+    });
+    if (pageName.code == 200) {
+        name.value = pageName.data.alias
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:设置页面标题")
+        console.log("后端错误反馈:", pageName.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//获得列表
+getPageName();
+//2.页面数据 end ---------------------------------------->
+
+
+//3.二级栏目 start ---------------------------------------->
+//3.1通过id获取父栏目
+const parent_name = ref([]);
+const parent_id = ref([]);
+let getParentNav = async () => {
+    const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
+        method: 'GET',
+        query: {
+            'catid': articleId
+        },
+    });
+    if (listData.code == 200) {
+        console.log(listData.data);
+        parent_name.value = listData.data.parent_name;
+        parent_id.value = listData.data.parent_id;
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取新闻列表")
+        console.log("后端错误反馈:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+    getSecondNav();
+}
+//获得列表
+getParentNav();
+
+// 3.2获取二级栏目
+const secondNav = ref([]);
+let getSecondNav = async () => {
+    const listData = await requestDataPromise('/web/getWebsiteModelCategory', {
+        method: 'GET',
+        query: {
+            'placeid': 1,
+            'pid': parent_id.value,
+            'num': 8,
+        },
+    });
+    console.log('listData', listData);
+
+    if (listData.code == 200) {
+        secondNav.value = listData.data;
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取新闻列表")
+        console.log("后端错误反馈:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//3.二级栏目 end ---------------------------------------->
+
+//4.设置seo信息 start---------------------------------------->
+//4.1 设置seo信息
+const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
+    method: 'GET',
+    query: {
+        'catid': articleId
+    },
+});
+
+if (setData.code == 200) {
+    let seoTitle = setData.data.seo_title;
+    let seoDescription = setData.data.seo_description;
+    let seoKeywords = setData.data.seo_keywords;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoName + "_" + seoSuffix,
+        meta: [
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix , tagPriority: 10 },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix , tagPriority: 10 }
+        ]
+    });
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:设置列表页面SEO数据")
+    console.log("后端错误反馈:", setData.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+//4.设置seo信息 end---------------------------------------->
+
+
+//5.广告 start---------------------------------------->
+let adImg1 = ref({});
+let adImg2 = ref({});
+
+onMounted(async ()  => {
+
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_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=snzxw_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];
+
+})
+//5.广告 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/list.less');
+</style>

+ 584 - 0
pages/news/[dir]/a/[id].vue

@@ -0,0 +1,584 @@
+<template>
+    <!-- 页面头部 -->
+    <HomePageHead></HomePageHead>
+    <!-- 导航栏 -->
+    <HomePageNavigation1></HomePageNavigation1>
+    <!-- 列表页广告一 -->
+    <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
+    <!-- 面包屑导航 -->
+    <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 >
+                    <NuxtLink :to="{ path: `/newsList/${routLevelId}`,query:{page:1} }">
+                        {{ routLevelTitle }}
+                    </NuxtLink>
+                </el-breadcrumb-item>
+                <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
+            </el-breadcrumb>
+        </div>
+    </div>
+    <!-- 资讯列表 -->
+    <div class="newsDetail">
+        <div class="inner">
+            <div class="innerLeft">
+                <div class="LeftTop">
+                    <h1>{{ newsDetail.title }}</h1>
+                    <p>
+                        来源: <span>{{ newsDetail.copyfrom }}</span>
+                        作者: <span>{{ newsDetail.author }}</span>
+                        发布时间: <span>{{ time }}</span>
+                    </p>
+                    <!-- <img :src="newsDetail.imgurl" v-if="newsDetail.imgurl&&newsDetail.level==2||newsDetail.level==3"> -->
+                </div>
+                <!-- <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></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">
+                    <!-- 投票 start ---------------------------------------->
+                    <div class="index_3_box_vote" v-if="articleChoice">
+                        <div class="voteTitle">投票区</div>
+                        <div class="inquire">
+                            <p v-if="voteList.length>0">{{voteList[0].survey_name}}</p>
+                            <div class="radioBox">
+                            <!--投票选项-->
+                            <div v-if="!isDisabled">
+                                <div class="radio" v-if="isRadio">
+                                    <el-radio-group v-model="radio1" @change="handleRadioChange">
+                                        <el-radio v-for="item in voteList" :key="item.id" :value="item.id" size="large">
+                                            <span v-if="item.is_other == 0">{{item.choice_name}}</span>
+                                            <span v-else>其他</span>
+                                        </el-radio>
+                                    </el-radio-group>
+                                    <el-input
+                                        v-if="showUserChoice"
+                                        v-model="userChoice"
+                                        :rows="2"
+                                        type="textarea"
+                                        resize="none"
+                                        placeholder="请输入.."
+                                    />
+                                </div>
+                                <div class="checkInputBox" v-else>
+                                    <el-checkbox-group v-model="check1" @change="handleCheckboxChange">
+                                        <span v-for="item in voteList" :key="item.id">
+                                            <span v-if="item.is_other == 0">
+                                                <el-checkbox size="large" :label="item.choice_name" :value="item.id"/>
+                                            </span>
+                                            <span v-else>
+                                                <el-checkbox size="large" label="其他" :value="item.id"/>
+                                            </span>
+                                        </span>
+                                    </el-checkbox-group>
+                                    <el-input
+                                        v-if="showUserChoice"
+                                        v-model="userChoice"
+                                        :rows="2"
+                                        type="textarea"
+                                        resize="none"
+                                        placeholder="请输入.."
+                                    />
+                                </div>
+                            </div>
+                            <!--投票结果-->
+                            <div class="inquireData" v-else>
+                                <div v-for="item in websiteSurveyData.data" :key="item.id">
+                                    <div class="inquireDataItem active" v-if="item.status == 1">
+                                        <div class="inquireDataItemTitle">
+                                            <span v-if="item.choice_name == ''">其他</span>
+                                            <span v-else>{{item.choice_name}}</span>
+                                        </div>
+                                        <div class="inquireDataItemNum">{{item.results}}票</div>
+                                    </div>
+                                    <div class="inquireDataItem" v-else>
+                                        <div class="inquireDataItemTitle">
+                                            <span v-if="item.choice_name == ''">其他</span>
+                                            <span v-else>{{item.choice_name}}</span>
+                                        </div>
+                                        <div class="inquireDataItemNum">{{item.results}}票</div>
+                                    </div>
+                                </div>
+                            </div>
+                            </div>
+                            <div class="btn">
+                                <button class="voting" @click="addWebsiteSurvey" :disabled="isDisabled" v-if="!isDisabled">投票</button>
+                            </div>
+                        </div>
+                    </div>
+                    <!-- 投票 end ---------------------------------------->
+                </div>
+            </div>
+            <div class="innerRight">
+                <!-- 热点资讯1 -->
+                <div class="hotList1">
+                    <DetailHotNews></DetailHotNews>
+                </div>
+                <!-- 热点资讯2 -->
+                <div class="hotList2">
+                    <DetailHotNews2></DetailHotNews2>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!-- 页面底部 -->
+    <HomeFoot1></HomeFoot1>
+</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'
+
+const nuxtApp = useNuxtApp();
+const axios = nuxtApp.$axios;
+
+//获得跳转过来的id
+const route = useRoute();
+const articleId = route.params.id; //获得该页面的id
+//1.页面依赖 end ---------------------------------------->
+
+//2.页面数据 start ---------------------------------------->
+//2.1 资讯详情
+const newsDetail = ref({})
+const routeNewsTtitle = ref("");
+//2.2 发布日期
+const time = ref("");
+//2.3 路径
+const routLevelTitle = ref("");
+const routLevelId = ref("");
+//是否展示投票
+const articleChoice = ref(false);
+//2.4获取详情
+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;
+            getVoteList();
+        }
+        //获取内容
+        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 >= 30) {
+            routeNewsTtitle.value = newsDetail.value.title.substr(0, 30) + "...";
+        } 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();
+
+//2.5 获得广告
+//广告列表
+let adImg1 = ref([]);
+// async function getAdData(){
+//     const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'DETAIL'}});
+//     if(adData.code==200){
+//         for(let item of adData.data){
+//             if(item.ad_tag == 'DETAIL_0001'){
+//                 adImg1.value = item;
+//             }
+//         }
+//     }else{
+//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+//         console.log("错误位置:获取详情页广告列表")
+//         console.log("后端错误反馈:",adData.message)
+//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+//     }
+// }
+// getAdData();
+
+onMounted(async ()  => {
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_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.页面数据 end ---------------------------------------->
+
+//3.设置seo信息 start---------------------------------------->
+//3.1 设置seo信息
+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("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:设置详情页面SEO数据")
+    console.log("后端错误反馈:",setData.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+//3.设置seo信息 end---------------------------------------->
+
+//4.投票 start---------------------------------------->
+const radio1 = ref(''); //单选
+const check1 = ref([]); //多选
+const isDisabled = ref(false);//是否禁用提交按钮
+const isRadio = ref(true);//是否渲染单选
+
+const userSurId = ref('');//投票属于哪一篇文章
+const userChoice = ref('');//用于判断用户选择了其他选项以后,输入的值
+const userIsChoice = ref('');//用于判断其他选项目前是什么值
+const showUserChoice = ref(false);//是否显示其他输入框
+const websiteSurveyData = ref([]);//投票结果
+
+//3.2获得投票列表
+let voteList = ref([]);
+async function getVoteList(){
+    const voteData = await requestHome('/web/getWebsiteSurvey',{method:'GET',query:{'art_id':articleId}});
+    console.log(778899)
+    console.log(voteData)
+    if(voteData.code == 200){
+        voteList.value = voteData.data;
+        console.log(voteList.value)
+        //判断显示单选还是多选
+        //survey_type 0是单选 1是多选
+        if(voteData.data[0].survey_type == 0){
+            isRadio.value = true;
+            console.log("1111")
+        }else{
+            isRadio.value = false;
+        }
+        //把最后一个的值拿出来 用于判断用户是否选择了其他
+        for(let item of voteData.data){
+            //如果含有其他
+            if(item.is_other==1){
+                userIsChoice.value = item.id;
+            }
+        }
+        //用户投票属于哪一篇文章
+        userSurId.value = voteData.data[0].sur_id;
+
+    }else{
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:首页投票")
+        console.log("后端错误反馈:",voteData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->") 
+    }
+}
+
+
+//3.2当用户选择了选项,判断是否展示其他输入框
+const handleRadioChange = (value) => {
+    if(value == userIsChoice.value){
+        showUserChoice.value = true;
+    }else{
+        showUserChoice.value = false;
+    }
+}
+
+const handleCheckboxChange = (value) => {
+    if (value.includes(userIsChoice.value)) {
+        showUserChoice.value = true;
+    } else {
+        showUserChoice.value = false;
+    }
+}
+
+//3.2发起投票
+async function addWebsiteSurvey(){
+    //判断当前是单选还是多选
+    console.log(isRadio.value)
+    if(isRadio.value){
+        console.log("用户单选!")
+        if(radio1.value!=''){
+            //先判断一下是否使用了其他选项
+            if(showUserChoice.value){
+                if(userChoice.value!=''){
+                    //文章id
+                    // console.log(userSurId.value)
+                    // 用户输入的值
+                    // console.log(userChoice.value)
+                    //如果使用了其他,其他的选项需要增加进去
+                    const ChoiceData = await requestHome('/web/addWebsiteSurveyOption',{
+                        method:'GET',
+                        query:{
+                            'sur_id':userSurId.value,//投票的新闻id
+                            'choice_name':userChoice.value,//投票的选项id
+                        }
+                    });
+                    if(ChoiceData.code == 200){
+                        //提交完其他选项以后,再正式发起投票
+                        const mkData = await requestHome('/web/addWebsiteSurveyVote',{
+                            method:'GET',
+                            query:{
+                                'sur_id':userSurId.value,
+                                'choice_id':ChoiceData.data
+                            }
+                        });
+                        if(mkData.code == 200){
+                            ElMessage.success('投票成功!')
+                            //把投票结果显示到页面上 禁用投票按钮
+                            isDisabled.value = true;
+                            websiteSurveyData.value = mkData.data;
+                            //遍历一下,把用户选中的那个设置status为1
+                            let data = mkData.data;
+                            //遍历一下,把用户选中的那个设置status为1
+                            for(let item of data.data){
+                                for(let i of data.choice){
+                                    if(item.id == i){
+                                        console.log(item.id)
+                                        item.status = 1;
+                                    }
+                                }
+                            }
+                            websiteSurveyData.value = data;
+                        }else{
+                            ElMessage.error(mkData.message)
+                        }
+                    }else{
+                        ElMessage.error('其他投票失败!')
+                    }
+                }else{
+                    ElMessage.error('请输入选项内容!')
+                }
+            }else{
+                //如果没选择其他,直接提交选择的内容
+                const mkData = await requestHome('/web/addWebsiteSurveyVote',{
+                    method:'GET',
+                    query:{
+                        'sur_id':userSurId.value,
+                        'choice_id':radio1.value
+                    }
+                });
+                if(mkData.code == 200){
+                    ElMessage.success('投票成功!')
+                    //把投票结果显示到页面上 禁用投票按钮
+                    isDisabled.value = true;
+                    let data = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    for(let item of data.data){
+                        for(let i of data.choice){
+                            if(item.id == i){
+                                item.status = 1;
+                            }
+                        }
+                    }
+                    websiteSurveyData.value = data;
+                }else{
+                    ElMessage.error('投票失败!')
+                }
+            }
+        }else{
+            ElMessage.error('请选择一个选项')
+        }
+    }else{
+        console.log("多选!")
+        //多选
+        if(check1.value!=[]){
+             //先判断一下是否使用了其他选项
+            if(showUserChoice.value){
+                if(userChoice.value!=''){
+                    //判断用户是否只选择了一个其他
+                    if(check1.value.length == 1){
+                        const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption',{
+                            method:'GET',
+                            query:{
+                                'sur_id':userSurId.value,//投票的新闻id
+                                'choice_name':userChoice.value,//用户输入的其他选项文字
+                            }
+                        });
+                        if(ChoiceData.code == 200){
+                            //提交完其他选项以后,再正式发起投票
+                            const mkData = await requestDataPromise('/web/addWebsiteSurveyVote',{
+                                method:'GET',
+                                query:{
+                                    'sur_id':userSurId.value,
+                                    'choice_id':ChoiceData.data
+                                }
+                            });
+                            if(mkData.code == 200){
+                                ElMessage.success('投票成功!')
+                                //把投票结果显示到页面上 禁用投票按钮
+                                isDisabled.value = true;
+                                websiteSurveyData.value = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                let data = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                for(let item of data.data){
+                                    for(let i of data.choice){
+                                        if(item.id == i){
+                                            console.log(item.id)
+                                            item.status = 1;
+                                        }
+                                    }
+                                }
+                                websiteSurveyData.value = data;
+                            }else{
+                                ElMessage.error(mkData.message)
+                            }
+                        }else{
+                            ElMessage.error('其他投票失败!')
+                        }
+
+                    }else{
+                        //用户选择了除了其他以外,还包括别的选项
+                        const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption',{
+                            method:'GET',
+                            query:{
+                                'sur_id':userSurId.value,//投票的新闻id
+                                'choice_name':userChoice.value,//用户输入的其他选项文字
+                            }
+                        });
+                        if(ChoiceData.code == 200){
+                            let data = check1.value;
+                            //找到多选的数组,把其他默认值给替换掉
+                            for (let i = 0; i < data.length; i++) {
+                                if (data[i] == userIsChoice.value) {
+                                    data[i] = ChoiceData.data;
+                                }
+                            }
+                            let jsonArray = JSON.stringify(data);
+                            //提交完其他选项以后,再正式发起投票
+                            const mkData = await requestDataPromise('/web/addWebsiteSurveyVote',{
+                                method:'GET',
+                                query:{
+                                    'sur_id':userSurId.value,
+                                    'choice_id':jsonArray
+                                }
+                            });
+                            
+                            if(mkData.code == 200){
+                                ElMessage.success('投票成功!')
+                                //把投票结果显示到页面上 禁用投票按钮
+                                isDisabled.value = true;
+                                websiteSurveyData.value = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                let data = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                for(let item of data.data){
+                                    for(let i of data.choice){
+                                        if(item.id == i){
+                                            //console.log(item.id)
+                                            item.status = 1;
+                                        }
+                                    }
+                                }
+                                websiteSurveyData.value = data;
+                            }else{
+                                ElMessage.error(mkData.message)
+                            }
+                        }else{
+                            ElMessage.error('其他投票失败!')
+                        }
+
+                    }
+                }else{
+                    ElMessage.error('请输入选项内容!')
+                }
+            }else{
+                let jsonArray = JSON.stringify(check1.value);
+                //如果没选择其他,直接提交选择的内容
+                const mkData = await requestDataPromise('/web/addWebsiteSurveyVote',{
+                    method:'GET',
+                    query:{
+                        'sur_id':userSurId.value,
+                        'choice_id':jsonArray
+                    }
+                });
+                if(mkData.code == 200){
+                    ElMessage.success('投票成功!')
+                    //把投票结果显示到页面上 禁用投票按钮
+                    isDisabled.value = true;
+                    websiteSurveyData.value = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    let data = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    for(let item of data.data){
+                        for(let i of data.choice){
+                            if(item.id == i){
+                                console.log(item.id)
+                                item.status = 1;
+                            }
+                        }
+                    }
+                    websiteSurveyData.value = data;
+                }else{
+                    ElMessage.error('投票失败!')
+                }
+            }
+        }else{
+            ElMessage.error('请选择一个选项')
+        }
+    }
+}
+//4.投票 end---------------------------------------->
+
+//5.页面图片放大 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;
+}
+//5.页面图片放大 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/detail.less');
+</style>

+ 11 - 17
pages/primaryNavigation/[id].vue → pages/news/[dir]/index.vue

@@ -19,13 +19,14 @@
                             </span>
                         </h3>
                     </div>
-                    <div class="leftTop" v-if="pageData[0].data[0]">
+                    <div class="leftTop">
                         <div class="leftTopPhoto left" v-if="pageData[0].data[0]">
                             <NuxtLink :href="getLinkPathDetail(pageData[0].data[0])" :title="pageData[0].data[0].title">
                                 <img :src="pageData[0].data[0].imgurl" :alt="pageData[0].data[0].title">
                                 <span>{{pageData[0].data[0].title }}</span>
                             </NuxtLink>
                         </div>
+                        <div class="leftTopPhoto left" v-else></div>
                         <ul class="left">
                             <li v-for="item in pageData[0].data3">
                                 <em></em>
@@ -343,23 +344,16 @@ const getLinkPathDetail = (item) => {
 
 //1.获得路由id start ---------------------------------------->
 const route = useRoute();
-let routeId = 0;//路由id
 
-//判断用户是由于别名跳转还是直接访问二级分类,正常来说只会从别名访问
-const getRoute = () => {
-    if(route.meta.isAlias){
-        //如果用户从别名访问,数据需要从meta中获取
-        routeId = route.meta.routeId;
-    }else{
-        routeId = route.params.id;
-    }
-}
-
-// 监听路由变化
-watch(() => route.path, (newPath) => {
-    //每当路径变化的时候重新获取routeId
-    getRoute()
-}, { immediate: true })
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//路由id
+//let routeId = 11 //排除路径错误可以打开这个
+let routeId = numberPart;
 //1.获得路由id end ---------------------------------------->
 
 //2.页面交互效果 start ---------------------------------------->

+ 11 - 2
pages/search/[id].vue

@@ -65,7 +65,13 @@ import { ref, onMounted } from 'vue';
 
 const route = useRoute();
 //const pageCatids = route.query.catids;
-const pageCatids = route.params.id
+const pageCatids = ""
+if(route.params.id=='search'){
+    
+}else{
+    const pageCatids = route.params.id
+}
+
 const pageDepartment_id = route.query.department_id;
 
 //const category_id = route.query.category_id; //获得该页面的id
@@ -141,12 +147,12 @@ let keywordInput = ref("");
 
 //搜索
 let goSearch = async () => {
-    console.log(111222)
     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: {
@@ -161,6 +167,9 @@ let goSearch = async () => {
         console.log(listData)
         newsList.value = listData.data.rows;
         total.value = listData.data.count;
+    }else{
+        newsList.value = [];
+        total.value = 0;
     }
    
 }

+ 0 - 23
pages/user/about.vue

@@ -1,23 +0,0 @@
-<template>
-    <div :class="['static-class', { 'dynamic-class1': condition1, 'dynamic-class2': condition2 }]">
-        这是一个元素
-    </div>
-</template>
-
-<script>
-export default {
-    data() {
-        return {
-            condition1: false,
-            condition2: false,
-        };
-    },
-    watch: {
-        // 假设某个值变化时触发条件判断
-        someValue() {
-            this.condition1 = this.someValue > 10;
-            this.condition2 = this.someValue < 5;
-        },
-    },
-};
-</script>

+ 33 - 0
plugins/client-dynamic-routes.js

@@ -0,0 +1,33 @@
+//动态路由不能放到这里,会晚于ssr执行
+// export default defineNuxtPlugin(async () => {
+//   const router = useRouter()
+  
+//   try {
+//     const response = await $fetch('http://apipre1.bjzxtw.org.cn:29501/web/getWebsiteParentCategory', {
+//       headers: {
+//         'Content-Type': 'application/json',
+//         'Userurl': 'http://apipre1.bjzxtw.org.cn:29501'
+//       }
+//     })
+    
+//     // 确保数据结构正确
+//     const routes = response.data.parent.filter(item => item.path)
+    
+//     routes.forEach(route => {
+//       router.addRoute({
+//         path: route.path,
+//         name: route.path.replace(/\//g, '-'), // 生成唯一name
+//         component: () => import('~/pages/primaryNavigation/[id].vue'),
+//         meta: {
+//           isAlias: true,
+//           routeId: route.cid,
+//           routeName: route.name
+//         }
+//       })
+//     })
+    
+//     console.log('动态路由添加完成', router.getRoutes())
+//   } catch (error) {
+//     console.error('路由加载失败:', error)
+//   }
+// })