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
|
|
|
{
|
|
|
|
|
path: 'receipt-record',
|
|
|
|
|
name: 'accountReceiptRecord',
|
|
|
|
|
component: () => import('../views/account/receiptRecord.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']
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'purchased',
|
|
|
|
|
name: 'accountPurchased',
|
|
|
|
|
component: () => import('../views/account/purchased.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-09-26 16:40:38 +08:00
|
|
|
{
|
2025-10-31 14:09:58 +08:00
|
|
|
path: 'purchased-detail/:id',
|
2025-09-26 16:40:38 +08:00
|
|
|
name: 'PurchasedDetail',
|
|
|
|
|
component: () => import('../views/account/purchasedDetail.vue'),
|
|
|
|
|
meta: {
|
|
|
|
|
title: '已购商品详情',
|
|
|
|
|
description: '查看已购商品详细信息',
|
|
|
|
|
allAuthority: ['all']
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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
|