import { createRouter, createWebHistory } from 'vue-router';
const router = createRouter({
    history: createWebHistory(),
    scrollBehavior: () => ({ left: 0, top: 0 }),
    routes: [
        // ==================== 公开路由 ====================
        {
            path: '/login',
            name: 'Login',
            component: () => import('@/views/auth/login.vue'),
            meta: { title: '登录', hidden: true }
        },
        {
            path: '/404',
            name: 'NotFound',
            component: () => import('@/views/error/404.vue'),
            meta: { title: '404', hidden: true }
        },
        // ==================== 首页 ====================
        {
            path: '/',
            name: 'Home',
            component: () => import('@/views/home/index.vue'),
            meta: { title: '零食商城', keepAlive: true }
        },
        // ==================== 分类页（占位） ====================
        {
            path: '/category/:id?',
            name: 'Category',
            component: () => import('@/views/category/index.vue'),
            meta: { title: '商品分类' }
        },
        // ==================== 全部商品 ====================
        {
            path: '/products',
            name: 'Products',
            component: () => import('@/views/category/index.vue'),
            meta: { title: '全部商品' }
        },
        // ==================== 商品详情（占位） ====================
        {
            path: '/product/:id',
            name: 'ProductDetail',
            component: () => import('@/views/product/detail.vue'),
            meta: { title: '商品详情' }
        },
        // ==================== 搜索（占位） ====================
        {
            path: '/search',
            name: 'Search',
            component: () => import('@/views/product/search.vue'),
            meta: { title: '搜索' }
        },
        // ==================== 购物车（占位） ====================
        {
            path: '/cart',
            name: 'Cart',
            component: () => import('@/views/cart/index.vue'),
            meta: { title: '购物车' }
        },
        // ==================== 确认订单（占位） ====================
        {
            path: '/checkout',
            name: 'Checkout',
            component: () => import('@/views/checkout/index.vue'),
            meta: { title: '确认订单' }
        },
        // ==================== 限时抢购（占位） ====================
        {
            path: '/seckill',
            name: 'Seckill',
            component: () => import('@/views/seckill/index.vue'),
            meta: { title: '限时抢购' }
        },
        // ==================== 公告中心（占位） ====================
        {
            path: '/notice',
            name: 'NoticeList',
            component: () => import('@/views/notice/index.vue'),
            meta: { title: '公告中心' }
        },
        {
            path: '/notice/:id',
            name: 'NoticeDetail',
            component: () => import('@/views/notice/detail.vue'),
            meta: { title: '公告详情' }
        },
        // ==================== 个人中心（占位） ====================
        {
            path: '/user',
            name: 'UserCenter',
            component: () => import('@/views/user/index.vue'),
            meta: { title: '个人中心' }
        },
        // ==================== 客诉/客服（占位） ====================
        {
            path: '/chat',
            name: 'Chat',
            component: () => import('@/views/chat/index.vue'),
            meta: { title: '在线客服' }
        },
        // ==================== 404 兜底 ====================
        {
            path: '/:pathMatch(.*)*',
            redirect: '/404'
        }
    ]
});
export default router;
//# sourceMappingURL=index.js.map