Bläddra i källkod

增加动态路由

增加动态路由
dangyunlong 3 veckor sedan
förälder
incheckning
92f78e70a5
2 ändrade filer med 666 tillägg och 3 borttagningar
  1. 664 1
      app/router.options.ts
  2. 2 2
      components/detail/HotNews2.vue

+ 664 - 1
app/router.options.ts

@@ -5,6 +5,7 @@ export default <RouterConfig> {
   routes: async (routes) => {
     // 静态别名
     const staticAliases = [
+      //前往二级分类
       {
         path: '/tieshenbaobei138/',
         component: () => import('~/pages/primaryNavigation/[id].vue'),
@@ -229,7 +230,669 @@ export default <RouterConfig> {
           routeId: 300, 
           routeName: '农业科普'
         }
-      }
+      },
+      //列表页
+      //1.新农村
+      {
+        path: '/lilunqianyan237/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 237, 
+          routeName: '理论前沿'
+        }
+      },
+      {
+        path: '/dianxingjingyan281/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 281, 
+          routeName: '典型经验'
+        }
+      },
+      {
+        path: '/meilixiangcun33/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 33, 
+          routeName: '魅力乡村'
+        }
+      },
+      {
+        path: '/nongminzhijia34/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 34, 
+          routeName: '农民之家'
+        }
+      },
+      {
+        path: '/nongyetiandi35/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 35, 
+          routeName: '农业天地'
+        }
+      },
+      {
+        path: '/nongcunjianshe36/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 36, 
+          routeName: '农村建设'
+        }
+      },
+      {
+        path: '/gaoduanzixun280/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 280, 
+          routeName: '高端资讯'
+        }
+      },
+      {
+        path: '/shijiantansuo38/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 38, 
+          routeName: '实践探索'
+        }
+      },
+      //2.政策法规
+      {
+        path: '/guojiafalv60/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 60, 
+          routeName: '国家法律'
+        }
+      },
+      {
+        path: '/bubanfalv200/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 200, 
+          routeName: '部颁法律'
+        }
+      },
+      {
+        path: '/faguijiexi201/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 201, 
+          routeName: '法规解析'
+        }
+      },
+      {
+        path: '/zhengcefabu202/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 202, 
+          routeName: '政策发布'
+        }
+      },
+      {
+        path: '/lifayantao203/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 203, 
+          routeName: '立法研讨'
+        }
+      },
+      {
+        path: '/jingdiananli204/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 204, 
+          routeName: '经典案例'
+        }
+      },
+      {
+        path: '/tingzhenghuixun205/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 205, 
+          routeName: '听证会讯'
+        }
+      },
+      {
+        path: '/fazhizaixian206/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 206, 
+          routeName: '法制在线'
+        }
+      },
+      //3.三农之窗
+      {
+        path: '/sannongguoji207/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 207, 
+          routeName: '三农国际'
+        }
+      },
+      {
+        path: '/nongcunjianshe208/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 208, 
+          routeName: '农村建设'
+        }
+      },
+      {
+        path: '/nongcunguanli209/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 209, 
+          routeName: '农村管理'
+        }
+      },
+      {
+        path: '/nongyegongmao210/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 209, 
+          routeName: '农业工贸'
+        }
+      },
+      {
+        path: '/sannongyaowen211/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 211, 
+          routeName: '三农要闻'
+        }
+      },
+      {
+        path: '/nongyekepu240/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 240, 
+          routeName: '农业科普'
+        }
+      },
+      {
+        path: '/nongminshengchan213/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 213, 
+          routeName: '农民生产'
+        }
+      },
+      {
+        path: '/nongminshenghuo214/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 214, 
+          routeName: '农民生活'
+        }
+      },
+      //4.区域经济
+      {
+        path: '/nongminshenghuo214/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 214, 
+          routeName: '农民生活'
+        }
+      },
+      {
+        path: '/kaifaquyu216/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 216, 
+          routeName: '开发区域'
+        }
+      },
+      {
+        path: '/chanyejiqun217/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 217, 
+          routeName: '产业集群'
+        }
+      },
+      {
+        path: '/hezuozuzhi218/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 217, 
+          routeName: '合作组织'
+        }
+      },
+      {
+        path: '/tesexiangzhen219/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 219, 
+          routeName: '特色乡镇'
+        }
+      },
+      {
+        path: '/yicunyipin220/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 220, 
+          routeName: '一村一品'
+        }
+      },
+      {
+        path: '/longtouqiye221/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 221, 
+          routeName: '龙头企业'
+        }
+      },
+      {
+        path: '/zhaoshangyinzi222/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 222, 
+          routeName: '招商引资'
+        }
+      },
+      //5.三农投资
+      {
+        path: '/guojiabokuan223/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 223, 
+          routeName: '国家拨款'
+        }
+      },
+      {
+        path: '/shetuanjijin224/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 224, 
+          routeName: '社团基金'
+        }
+      },
+      {
+        path: '/qiyetouzi225/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 225, 
+          routeName: '企业投资'
+        }
+      },
+      {
+        path: '/difangyinzi226/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 226, 
+          routeName: '地方引资'
+        }
+      },
+      {
+        path: '/gongyihuodong227/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 226, 
+          routeName: '公益活动'
+        }
+      },
+      {
+        path: '/fengxiantouzi228/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 228, 
+          routeName: '风险投资'
+        }
+      },
+      {
+        path: '/waishangduzi229/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 229, 
+          routeName: '外商独资'
+        }
+      },
+      {
+        path: '/yinzifuwu230/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 230, 
+          routeName: '引资服务'
+        }
+      },
+      //6.农贸服务
+      {
+        path: '/guojinongmao198/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 198, 
+          routeName: '国际农贸'
+        }
+      },
+      {
+        path: '/huiyihuizhan199/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 199, 
+          routeName: '会议会展'
+        }
+      },
+      {
+        path: '/difangjieqing231/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 231, 
+          routeName: '地方节庆'
+        }
+      },
+      {
+        path: '/techanzixun232/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 232, 
+          routeName: '特产资讯'
+        }
+      },
+      {
+        path: '/shichangdongtai233/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 233, 
+          routeName: '市场动态'
+        }
+      },
+      {
+        path: '/jishimaoyi234/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 234, 
+          routeName: '集市贸易'
+        }
+      },
+      {
+        path: '/hezuojingji235/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 235, 
+          routeName: '合作经济'
+        }
+      },
+      {
+        path: '/lilunqianyan237/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 237, 
+          routeName: '理论前沿'
+        }
+      },
+      //7.三农科教
+      {
+        path: '/nongcunjiaoyu238/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 238, 
+          routeName: '农村教育'
+        }
+      },
+      {
+        path: '/nongminpeixun239/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 239, 
+          routeName: '农民培训'
+        }
+      },
+      {
+        path: '/nongyekepu240/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 240, 
+          routeName: '农业科普'
+        }
+      },
+      {
+        path: '/kejifuwu241/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 241, 
+          routeName: '科技服务'
+        }
+      },
+      {
+        path: '/zhongzhijishu242/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 242, 
+          routeName: '种植技术'
+        }
+      },
+      {
+        path: '/angzhijishu243/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 243, 
+          routeName: '养殖技术'
+        }
+      },
+      {
+        path: '/zhifujingyan244/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 244, 
+          routeName: '致富经验'
+        }
+      },
+      {
+        path: '/kejiaoxinxi245/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 245, 
+          routeName: '科教信息'
+        }
+      },
+      //8.文化生活
+      {
+        path: '/wenhuashidian195/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 195, 
+          routeName: '文化视点'
+        }
+      },
+      {
+        path: '/lisuwenhua196/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 196, 
+          routeName: '礼俗文化'
+        }
+      },
+      {
+        path: '/chajiuwenhua246/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 246, 
+          routeName: '茶酒文化'
+        }
+      },
+      {
+        path: '/xiuxianwenhua247/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 247, 
+          routeName: '休闲文化'
+        }
+      },
+      {
+        path: '/fushiwenhua248/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 248, 
+          routeName: '服饰文化'
+        }
+      },
+      {
+        path: '/yinshiwenhua249/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 249, 
+          routeName: '饮食文化'
+        }
+      },
+      {
+        path: '/renjuwenhua250/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 250, 
+          routeName: '人居文化'
+        }
+      },
+      {
+        path: '/lvxingwenhua251/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 251, 
+          routeName: '旅行文化'
+        }
+      },
+      //9.三农探索
+      {
+        path: '/jiaodianfangtan276/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 276, 
+          routeName: '焦点访谈'
+        }
+      },
+      {
+        path: '/nongcunjianshe277/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 277, 
+          routeName: '农村建设'
+        }
+      },
+      {
+        path: '/tansuonongyetiandi395/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 395, 
+          routeName: '农业天地'
+        }
+      },
+      {
+        path: '/nongminhuati279/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 279, 
+          routeName: '农民话题'
+        }
+      },
+      {
+        path: '/gaoduanzixun280/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 280, 
+          routeName: '高端资讯'
+        }
+      },
+      {
+        path: '/dianxingjingyan281/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 281, 
+          routeName: '典型经验'
+        }
+      },
+      {
+        path: '/chenggongzhilu282/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 282, 
+          routeName: '成功之路'
+        }
+      },
+      {
+        path: '/shijiantansuo283/',
+        component: () => import('~/pages/newsList/[id].vue'),
+        meta: { 
+          isAlias: true, 
+          routeId: 283, 
+          routeName: '实践探索'
+        }
+      },
+      //10.三农人物
+
+
+
     ]
 
 

+ 2 - 2
components/detail/HotNews2.vue

@@ -25,8 +25,8 @@ async function getPageData() {
     const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
         method: 'GET',
         query: {
-            'pageSize': 10,
-            'level': 4,
+            'pageSize': 30,
+            'level': 5,
             'placeid': 0,
             'id': 0
         },