提交 a76059c7 authored 作者: lidongxu's avatar lidongxu

refactor(mobile/routes): 调整:移动端路由位置等

上级 d03656fe
......@@ -3,7 +3,6 @@ export * from './common/menu'
export * from './common/openQuery'
export * from './common/region'
export * from './common/upload'
export * from './examine/index'
export * from './bi/competitor'
export * from './bi/finance'
export * from './bi/livecate'
......@@ -16,6 +15,7 @@ export * from './jimu/design'
export * from './jimu/ext'
export * from './jimu/list'
export * from './jimu/manager'
export * from './mobile/cp_activity/examine/index'
export * from './other/logistics'
export * from './other/version'
export * from './monitor/cache'
......
......@@ -2,6 +2,7 @@ import { createWebHashHistory, createRouter, createWebHistory } from 'vue-router
/* Layout */
import Layout from '@/layout'
import { isMobile } from '@/utils'
import { constantMobileRoutes } from '@/views/mobile/router/index.js'
/**
* Note: 路由配置项
......@@ -175,61 +176,7 @@ export const dynamicRoutes = [
]
}
]
// 移动端 静态路由
export const constantMobileRoutes = [
{
path: '/login',
component: () => import('@/views/login'),
hidden: true
},
{
path: '/',
redirect: '/m'
},
{
path: '/m',
redirect: '/m/menu',
component: () => import('@/views/mobile/index'),
hidden: true,
children: [
// 菜单页
{
path: 'menu',
component: () => import('@/views/mobile/views/menu'),
name: 'm_menu',
},
// 促销计划
{
path: 'promotion_plan', // 列表
component: () => import('@/views/mobile/views/promotion/plan/index'),
name: 'm_promotion_plan',
meta: { keepAlive: true } // 标记该路由需要缓存
},
{
path: 'promotion_plan_detail/:planId', // 详情
component: () => import('@/views/mobile/views/promotion/plan/detail'),
name: 'm_promotion_detail',
},
{
path: 'promotion_plan_editing/:planId?', // 增改
component: () => import('@/views/mobile/views/promotion/plan/editing'),
name: 'm_promotion_editing',
},
// 稽查
{
path: 'examine/:examineId',
component: () => import('@/views/mobile/views/examine'),
name: 'm_promotion_examine',
}
]
},
// 物流信息页面
{
path: '/logistics',
component: () => import('@/views/mobile/views/other/logistics'),
name: 'logistics'
}
]
const router = createRouter({
// 路由模式:createWebHashHistory,createWebHistory
......
......@@ -7,7 +7,8 @@
</template>
<script setup>
import { constantMobileRoutes } from '@/router'
import { constantMobileRoutes } from '@/views/mobile/router'
// 递归判断有 children 往里走找到所有路由对象 meta 的 keepAlive 是 true 的然后返回 meta 同级的 name 名字的值,组成一个数组
const cachedViews = []
function getKeepAliveName(routes) {
......
// 移动端 静态路由
export const constantMobileRoutes = [
{
path: '/login',
component: () => import('@/views/login'),
hidden: true
},
{
path: '/',
redirect: '/m'
},
{
path: '/m',
redirect: '/m/menu',
component: () => import('@/views/mobile/index'),
hidden: true,
children: [
// 菜单页
{
path: 'menu',
component: () => import('@/views/mobile/views/menu'),
name: 'm_menu',
},
// 促销计划
{
path: 'promotion_plan', // 列表
component: () => import('@/views/mobile/views/cp_activity/promotion/plan/index'),
name: 'm_promotion_plan',
meta: { keepAlive: true } // 标记该路由需要缓存
},
{
path: 'promotion_plan_detail/:planId', // 详情
component: () => import('@/views/mobile/views/cp_activity/promotion/plan/detail'),
name: 'm_promotion_detail',
},
{
path: 'promotion_plan_editing/:planId?', // 增改
component: () => import('@/views/mobile/views/cp_activity/promotion/plan/editing'),
name: 'm_promotion_editing',
},
// 稽查
{
path: 'examine/:examineId',
component: () => import('@/views/mobile/views/cp_activity/examine'),
name: 'm_promotion_examine',
}
]
},
// 物流信息页面
{
path: '/logistics',
component: () => import('@/views/mobile/views/other/logistics'),
name: 'logistics'
}
]
\ No newline at end of file
<template>
<!-- 稽查任务 -->
</template>
<script setup>
</script>
<style scoped></style>
\ No newline at end of file
<template>
<!-- 新建终端 -->
</template>
<script setup>
</script>
<style scoped></style>
\ No newline at end of file
<template>
<!-- 门店列表 -->
</template>
<script setup>
</script>
<style scoped></style>
\ No newline at end of file
<template>
<!-- 任务列表 -->
</template>
<script setup>
</script>
<style scoped></style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论