feat(mpuniapp): 落地智能销售移动工作台与5栏TabBar纯正架构(工作台、名片、雷达、潜客、我的)

这个提交包含在:
wikiboss
2026-09-21 15:34:21 +08:00
父节点 17882ca1cb
当前提交 2d0b655200
共有 10 个文件被更改,包括 1971 次插入 和 241 次删除

查看文件

@@ -8,33 +8,36 @@ const pagesJsonPath = path.join(MP_ROOT, 'pages.json');
const profileUvuePath = path.join(MP_ROOT, 'pages/owner/profile/index.uvue');
const cardHomeUtsPath = path.join(MP_ROOT, 'pages/owner/card/useCardHome.uts');
test('1. pages.json TabBar 信息架构纯正性审查 (只保留名片主 4 大工作台,移除微官网)', () => {
test('1. pages.json TabBar 信息架构纯正性审查 (工作台、名片、雷达、潜客、我的 5 栏标准)', () => {
assert.ok(fs.existsSync(pagesJsonPath), 'pages.json 必须存在');
const content = fs.readFileSync(pagesJsonPath, 'utf-8');
const config = JSON.parse(content);
const tabBarList = config.tabBar?.list || [];
assert.equal(tabBarList.length, 4, 'TabBar 应当仅包含 4 个核心工作台 Tab');
assert.equal(tabBarList.length, 5, 'TabBar 应当精确包含 5 个核心工作台 Tab');
// 验证不包含微官网 pages/portal/index
const hasPortalInTabBar = tabBarList.some((item: any) => item.pagePath === 'pages/portal/index');
assert.equal(hasPortalInTabBar, false, '微官网 pages/portal/index 严禁作为 TabBar 常驻项,应作为独立落地页');
// 验证 4 个 Tab 顺序与路由
assert.equal(tabBarList[0].pagePath, 'pages/owner/card/index', 'TabBar 第 1 项必须是名片');
assert.equal(tabBarList[0].text, '名片');
// 验证 5 个 Tab 顺序与路由
assert.equal(tabBarList[0].pagePath, 'pages/owner/workplace/index', 'TabBar 第 1 项必须是工作台');
assert.equal(tabBarList[0].text, '工作台');
assert.equal(tabBarList[1].pagePath, 'pages/owner/radar', 'TabBar 第 2 项必须是雷达');
assert.equal(tabBarList[1].text, '雷达');
assert.equal(tabBarList[1].pagePath, 'pages/owner/card/index', 'TabBar 第 2 项必须是名片');
assert.equal(tabBarList[1].text, '名片');
assert.equal(tabBarList[2].pagePath, 'pages/owner/leads', 'TabBar 第 3 项必须是潜客');
assert.equal(tabBarList[2].text, '潜客');
assert.equal(tabBarList[2].pagePath, 'pages/owner/radar', 'TabBar 第 3 项必须是雷达');
assert.equal(tabBarList[2].text, '雷达');
assert.equal(tabBarList[3].pagePath, 'pages/owner/profile/index', 'TabBar 第 4 项必须是我的');
assert.equal(tabBarList[3].text, '我的');
assert.equal(tabBarList[3].pagePath, 'pages/owner/leads', 'TabBar 第 4 项必须是潜客');
assert.equal(tabBarList[3].text, '潜客');
// 验证 pages[0] 首屏页面为名片页
assert.equal(config.pages[0].path, 'pages/owner/card/index', '应用首屏 pages[0] 应设为名片首页');
assert.equal(tabBarList[4].pagePath, 'pages/owner/profile/index', 'TabBar 第 5 项必须是我的');
assert.equal(tabBarList[4].text, '我的');
// 验证 pages[0] 首屏页面为工作台首页
assert.equal(config.pages[0].path, 'pages/owner/workplace/index', '应用首屏 pages[0] 应设为工作台首页');
// 验证微官网依然保留在 pages 路由列表中供扫码和独立预览访问
const hasPortalInPages = config.pages.some((item: any) => item.path === 'pages/portal/index');
@@ -44,7 +47,8 @@ test('1. pages.json TabBar 信息架构纯正性审查 (只保留名片主 4 大
test('2. profile/index.uvue 的 openPage 导航守卫与新 TabBar 保持 100% 一致', () => {
const content = fs.readFileSync(profileUvuePath, 'utf-8');
// 验证 tabPages 数组不包含 portal/index,且包含 4 个管理页
// 验证 tabPages 数组不包含 portal/index,且包含 5 个工作台管理页
assert.ok(content.includes("'/pages/owner/workplace/index'"), 'tabPages 必须包含 /pages/owner/workplace/index');
assert.ok(content.includes("'/pages/owner/card/index'"), 'tabPages 必须包含 /pages/owner/card/index');
assert.ok(content.includes("'/pages/owner/radar'"), 'tabPages 必须包含 /pages/owner/radar');
assert.ok(content.includes("'/pages/owner/leads'"), 'tabPages 必须包含 /pages/owner/leads');