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

298 lines
7.9 KiB
JavaScript
Raw Normal View History

2025-09-26 16:40:38 +08:00
/**
* @file 路由配置文件
* @description 定义所有电商页面的路由配置
*/
// 商品相关路由
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
{
2025-12-19 15:40:53 +08:00
// 兼容旧入口:收款记录 -> 卖家资金流水收款tab
2025-10-20 10:15:13 +08:00
path: 'receipt-record',
name: 'accountReceiptRecord',
2025-12-19 15:40:53 +08:00
redirect: (to) => ({
path: '/account/seller-funds-flow',
query: { ...(to && to.query ? to.query : {}), tab: 'receipt' }
}),
2025-10-20 10:15:13 +08:00
meta: {
title: '收款记录',
description: '卖家收款流水记录',
allAuthority: ['all']
}
},
2025-12-05 16:24:20 +08:00
{
2025-12-19 15:40:53 +08:00
// 兼容旧入口:提现记录 -> 卖家资金流水提现tab
2025-12-05 16:24:20 +08:00
path: 'withdraw-record',
name: 'accountWithdrawRecord',
2025-12-19 15:40:53 +08:00
redirect: (to) => ({
path: '/account/seller-funds-flow',
query: { ...(to && to.query ? to.query : {}), tab: 'withdraw' }
}),
2025-12-05 16:24:20 +08:00
meta: {
title: '提现记录',
description: '卖家提现流水记录',
allAuthority: ['all']
}
},
2025-12-19 15:40:53 +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: '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']
}
},
2025-12-12 15:33:23 +08:00
{
2025-12-19 15:40:53 +08:00
path: 'purchased-machine-detail/:id',
name: 'purchasedMachineDetail',
component: () => import('../views/account/purchasedMachineDetail.vue'),
2025-12-12 15:33:23 +08:00
meta: {
2025-12-19 15:40:53 +08:00
title: '已购商品详情',
description: '查看已购买商品的详细信息',
2025-12-12 15:33:23 +08:00
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-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']
}
}
]
}
]
// 所有子路由
export const childrenRoutes = [
...productRoutes,
...cartRoutes,
...checkoutRoutes,
...accountRoutes
]
// 主路由配置
export const mainRoutes = [
{
path: '/',
name: 'Home',
component: () => import('../Layout/idnex.vue'),
redirect: '/productList',
children: childrenRoutes
},
// 404页面重定向到商品列表
{
path: '*',
redirect: '/productList'
}
]
export default mainRoutes