Files
webs/power_leasing/src/router/routes.js

339 lines
8.8 KiB
JavaScript
Raw Normal View History

2025-09-26 16:40:38 +08:00
/**
* @file 路由配置文件
* @description 定义所有电商页面的路由配置
*/
2025-12-24 15:19:57 +08:00
// 认证相关路由独立布局无Header
export const authRoutes = [
{
path: '/login',
name: 'Login',
component: () => import('../views/auth/login.vue'),
meta: {
title: '用户登录',
description: '登录到您的账户',
requiresAuth: false // 不需要登录即可访问
}
},
{
path: '/register',
name: 'Register',
component: () => import('../views/auth/register.vue'),
meta: {
title: '用户注册',
description: '创建新账户',
requiresAuth: false
}
},
{
path: '/reset-password',
name: 'ResetPassword',
component: () => import('../views/auth/reset-password.vue'),
meta: {
title: '重置密码',
description: '重置您的账户密码',
requiresAuth: false
}
}
]
2025-09-26 16:40:38 +08:00
// 商品相关路由
export const productRoutes = [
{
path: '/productList',
name: 'productList',
component: () => import('../views/productList/index.vue'),
meta: {
title: '商品列表',
description: '浏览所有可用商品',
allAuthority: ['all']
}
},
{
path: '/product/:id',
name: 'productDetail',
component: () => import('../views/productDetail/index.vue'),
meta: {
title: '商品详情',
description: '查看商品详细信息',
allAuthority: ['all']
}
}
]
// 购物车相关路由
export const cartRoutes = [
{
path: '/cart',
name: 'cart',
component: () => import('../views/cart/index.vue'),
meta: {
title: '购物车',
description: '管理购物车商品',
allAuthority: ['all']
}
}
]
// 结算相关路由
export const checkoutRoutes = [
{
path: '/checkout',
name: 'checkout',
component: () => import('../views/checkout/index.vue'),
meta: {
title: '订单结算',
description: '完成订单结算',
allAuthority: ['all']
}
}
]
// 个人中心相关路由
export const accountRoutes = [
{
path: '/account',
name: 'account',
component: () => import('../views/account/index.vue'),
2025-10-20 10:15:13 +08:00
redirect: '/account/shops',
2025-09-26 16:40:38 +08:00
meta: {
title: '个人中心',
description: '管理个人资料和店铺',
allAuthority: ['all']
},
children: [
{
path: 'wallet',
name: 'Wallet',
component: () => import('../views/account/wallet.vue'),
meta: {
title: '我的钱包',
description: '查看钱包余额、充值和提现',
allAuthority: ['all']
}
},
{//充值记录
path: 'rechargeRecord',
name: 'RechargeRecord',
component: () => import('../views/account/rechargeRecord.vue'),
meta: {
title: '充值记录',
description: '查看充值记录',
allAuthority: ['all']
}
},
{//提现记录
path: 'withdrawalHistory',
name: 'WithdrawalHistory',
component: () => import('../views/account/withdrawalHistory.vue'),
meta: {
title: '提现记录',
description: '查看提现记录',
allAuthority: ['all']
}
},
2025-10-20 10:15:13 +08:00
{
path: 'receipt-record',
name: 'accountReceiptRecord',
2025-12-24 15:19:57 +08:00
component: () => import('../views/account/receiptRecord.vue'),
2025-10-20 10:15:13 +08:00
meta: {
title: '收款记录',
description: '卖家收款流水记录',
allAuthority: ['all']
}
},
2025-12-05 16:24:20 +08:00
{
path: 'withdraw-record',
name: 'accountWithdrawRecord',
2025-12-24 15:19:57 +08:00
component: () => import('../views/account/withdrawRecord.vue'),
2025-12-05 16:24:20 +08:00
meta: {
title: '提现记录',
description: '卖家提现流水记录',
allAuthority: ['all']
}
},
2025-09-26 16:40:38 +08:00
{
path: 'shop-new',
name: 'accountShopNew',
component: () => import('../views/account/shopNew.vue'),
meta: {
title: '新增店铺',
description: '创建新的店铺',
allAuthority: ['all']
}
},
{
path: 'shop-config',
name: 'accountShopConfig',
component: () => import('../views/account/shopConfig.vue'),
meta: {
2025-10-31 14:09:58 +08:00
title: '钱包绑定',
description: '绑定店铺收款钱包',
2025-09-26 16:40:38 +08:00
allAuthority: ['all']
}
},
{
path: 'shops',
name: 'accountMyShops',
component: () => import('../views/account/myShops.vue'),
meta: {
title: '我的店铺',
description: '查看我的店铺信息',
allAuthority: ['all']
}
},
{
path: 'product-new',
name: 'accountProductNew',
component: () => import('../views/account/productNew.vue'),
meta: {
title: '新增商品',
description: '创建新的商品',
allAuthority: ['all']
}
},
{
path: 'products',
name: 'accountProducts',
component: () => import('../views/account/products.vue'),
meta: {
title: '商品列表',
description: '管理店铺下的商品列表',
allAuthority: ['all']
}
},
{
2025-12-19 15:40:53 +08:00
path: 'purchased-machine-config',
name: 'accountPurchasedMachineConfig',
component: () => import('../views/account/purchasedMachineConfig.vue'),
2025-09-26 16:40:38 +08:00
meta: {
title: '已购商品',
2025-12-19 15:40:53 +08:00
description: '查看已购买商品的配置信息',
2025-09-26 16:40:38 +08:00
allAuthority: ['all']
}
},
{
path: 'purchased-machine-detail/:id',
name: 'purchasedMachineDetail',
component: () => import('../views/account/purchasedMachineDetail.vue'),
meta: {
title: '已购商品详情',
description: '查看已购买商品的详细信息',
allAuthority: ['all']
}
},
2025-10-20 10:15:13 +08:00
{
path: 'funds-flow',
name: 'accountFundsFlow',
component: () => import('../views/account/fundsFlow.vue'),
meta: {
title: '资金流水',
description: '充值/提现/消费记录切换查看',
allAuthority: ['all']
}
},
2025-12-26 10:58:16 +08:00
{
path: 'seller-funds-flow',
name: 'accountSellerFundsFlow',
component: () => import('../views/account/sellerFundsFlow.vue'),
meta: {
title: '资金流水',
description: '卖家收款/提现流水记录',
allAuthority: ['all']
}
},
2025-09-26 16:40:38 +08:00
{
path: 'orders',
name: 'accountOrders',
component: () => import('../views/account/orders.vue'),
meta: {
title: '订单列表',
description: '查看与管理订单(按状态筛选)',
allAuthority: ['all']
}
},
{
path: 'seller-orders',
name: 'accountSellerOrders',
component: () => import('../views/account/SellerOrders.vue'),
meta: {
title: '已售出订单',
description: '卖家侧订单列表',
allAuthority: ['all']
}
},
{
path: 'order-detail/:id',
name: 'accountOrderDetail',
component: () => import('../views/account/orderDetail.vue'),
meta: {
title: '订单详情',
description: '查看订单详细信息',
allAuthority: ['all']
}
},
{
path: 'product-detail/:id',
name: 'accountProductDetail',
component: () => import('../views/account/productDetail.vue'),
meta: {
title: '商品详情',
description: '个人中心 - 商品详情',
allAuthority: ['all']
}
},
{
path: 'product-machine-add',
name: 'accountProductMachineAdd',
component: () => import('../views/account/productMachineAdd.vue'),
meta: {
title: '添加出售机器',
description: '为商品添加出售机器',
allAuthority: ['all']
}
},
{
path: 'security-settings',
name: 'accountSecuritySettings',
component: () => import('../views/account/securitySettings.vue'),
meta: {
title: '安全设置',
description: '管理账户安全选项',
allAuthority: ['all']
}
2025-09-26 16:40:38 +08:00
}
]
}
]
// 所有子路由
export const childrenRoutes = [
...productRoutes,
...cartRoutes,
...checkoutRoutes,
...accountRoutes
]
// 主路由配置
export const mainRoutes = [
2025-12-24 15:19:57 +08:00
// 认证路由独立布局无Header
...authRoutes,
// 主应用路由带Layout
2025-09-26 16:40:38 +08:00
{
path: '/',
name: 'Home',
component: () => import('../Layout/idnex.vue'),
redirect: '/productList',
children: childrenRoutes
},
2025-12-24 15:19:57 +08:00
2025-09-26 16:40:38 +08:00
// 404页面重定向到商品列表
{
path: '*',
redirect: '/productList'
}
]
export default mainRoutes