170 lines
5.0 KiB
JavaScript
Raw Normal View History

2025-01-25 02:48:00 +00:00
/*
* @Description: router
* @Author: zenghua.wang
* @Date: 2023-06-20 11:48:41
* @LastEditors: zenghua.wang
2025-04-07 10:28:47 +01:00
* @LastEditTime: 2025-04-07 17:24:45
2025-01-25 02:48:00 +00:00
*/
import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/layouts/index.vue';
import Views from '@/layouts/Views.vue';
2025-04-11 17:32:55 +08:00
import userCentre from '@/layouts/userCentre.vue';
2025-01-25 02:48:00 +00:00
export const constantRoutes = [
{
path: '/sub-operation-service/404',
2025-01-25 02:48:00 +00:00
name: '404',
component: () => import('@/views/error/404.vue'),
hidden: true,
},
{
path: '/sub-operation-service/403',
2025-01-25 02:48:00 +00:00
name: '403',
component: () => import('@/views/error/403.vue'),
hidden: true,
},
{
path: '/sub-operation-service',
2025-01-25 02:48:00 +00:00
name: 'layout',
component: Layout,
redirect: '/sub-operation-service/home',
2025-04-03 17:20:49 +08:00
meta: { title: '首页' },
2025-01-25 02:48:00 +00:00
children: [
{
path: '/sub-operation-service/home',
2025-01-25 02:48:00 +00:00
component: () => import('@/views/home/index.vue'),
name: 'home',
2025-04-03 17:20:49 +08:00
meta: { title: '首页' },
2025-01-25 02:48:00 +00:00
},
],
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce',
name: 'ecommerce',
component: Layout,
2025-04-09 17:25:08 +08:00
redirect: '/sub-operation-service/ecommerce-agricultural',
2025-04-03 17:20:49 +08:00
meta: { title: '电商交易' },
children: [
{
2025-04-09 17:25:08 +08:00
path: '/ecommerce',
component: Views,
redirect: '/sub-operation-service/ecommerce-agricultural',
name: 'agriculturalParent',
2025-04-03 17:20:49 +08:00
meta: { title: '农资交易' },
2025-04-09 17:25:08 +08:00
children: [
{
path: '/sub-operation-service/ecommerce-agricultural',
component: () => import('@/views/ecommerce/index.vue'),
name: 'agricultural',
meta: { title: '农资交易' },
},
{
2025-04-11 17:32:55 +08:00
path: '/sub-operation-service/ecommerce-agriculturalDetail',
2025-04-09 17:25:08 +08:00
component: () => import('@/views/ecommerce/agriculturalDetail.vue'),
name: 'agriculturalDetail',
meta: { title: '农资详情' },
},
2025-04-11 17:32:55 +08:00
{
path: '/sub-operation-service/ecommerce-sourceCodeDetail',
component: () => import('@/views/ecommerce/sourceCodeDetail.vue'),
name: 'sourceCodeDetail',
meta: { title: '溯源详情' },
},
2025-04-09 17:25:08 +08:00
],
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/purchaser',
2025-04-03 17:20:49 +08:00
component: Views,
2025-04-09 17:25:08 +08:00
redirect: '/sub-operation-service/ecommerce-purchaser',
2025-04-03 17:20:49 +08:00
name: 'purchaserParent',
meta: { title: '采购商服务' },
children: [
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-purchaser',
2025-04-03 17:20:49 +08:00
component: () => import('@/views/ecommerce/purchaser.vue'),
name: 'purchaser',
meta: { title: '采购商服务' },
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-purchaserDetail',
2025-04-03 17:20:49 +08:00
component: () => import('@/views/ecommerce/purchaserDetail.vue'),
name: 'purchaserDetail',
meta: { title: '采购详情' },
},
],
},
2025-04-03 17:20:49 +08:00
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-supplier',
component: () => import('@/views/ecommerce/supplier.vue'),
name: 'supplier',
2025-04-03 17:20:49 +08:00
meta: { title: '供应商服务' },
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-land',
2025-04-03 17:20:49 +08:00
component: Views,
2025-04-09 17:25:08 +08:00
redirect: '/sub-operation-service/ecommerce-land',
2025-04-03 17:20:49 +08:00
name: 'landParent',
meta: { title: '土地交易' },
children: [
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-land',
2025-04-03 17:20:49 +08:00
component: () => import('@/views/ecommerce/land.vue'),
name: 'land',
meta: { title: '土地交易' },
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-landDetail',
2025-04-03 17:20:49 +08:00
component: () => import('@/views/ecommerce/landDetail.vue'),
name: 'landDetail',
meta: { title: '土地详情' },
},
],
},
],
},
2025-04-11 17:32:55 +08:00
{
path: '/sub-operation-service/userCenter',
name: 'userCentre',
component: userCentre,
redirect: '/sub-operation-service/userCenter-shoppingCart',
meta: { title: '个人中心' },
children: [
{
path: '/sub-operation-service/userCenter-shoppingCart',
component: () => import('@/views/userCenter/shoppingCart.vue'),
name: 'ShoppingCar',
meta: { title: '我的购物车' },
},
{
path: '/sub-operation-service/userCenter-userOrders',
component: () => import('@/views/userCenter/userOrders.vue'),
name: 'userOrders',
meta: { title: '我的订单' },
},
{
path: '/sub-operation-service/userCenter-userLands',
component: () => import('@/views/userCenter/userLands.vue'),
name: 'userLands',
meta: { title: '我的土地' },
},
],
},
2025-01-25 02:48:00 +00:00
];
/**
* @Title notFoundRouter(找不到路由)
*/
export const notFoundRouter = {
path: '/sub-operation-service/:pathMatch(.*)',
2025-01-25 02:48:00 +00:00
name: 'notFound',
redirect: '/sub-operation-service/404',
2025-01-25 02:48:00 +00:00
};
const router = createRouter({
history: createWebHistory(), // history
2025-01-25 02:48:00 +00:00
routes: constantRoutes,
});
export default router;