feat(user): replace distribution modal with dedicated promote page

这个提交包含在:
xcbyy
2026-10-13 15:17:15 +08:00
父节点 831dd4a493
当前提交 7a5e515b8b
共有 4 个文件被更改,包括 1347 次插入 和 203 次删除

查看文件

@@ -130,7 +130,7 @@ describe('ContentSecurityService & Compliance Architecture (TDD 微信内容安
const raw = fs.readFileSync(pagesJsonPath, 'utf-8');
const config = JSON.parse(raw);
expect(Array.isArray(config.pages)).toBe(true);
expect(config.pages.length).toBe(21);
expect(config.pages.length).toBe(22);
for (const pageItem of config.pages) {
const vueFilePath = path.join(rootDir, 'pwuniapp', `${pageItem.path}.vue`);
@@ -437,12 +437,14 @@ describe('ContentSecurityService & Compliance Architecture (TDD 微信内容安
walk(path.join(rootDir, 'pwuniapp'));
});
it('推广赚钱二级分销弹窗必须符合微信4字规范并支持一键复制专属邀请码', () => {
it('推广赚钱二级分销专属页面与功能必须符合微信4字规范并支持一键复制专属邀请码', () => {
const userIndexPath = path.join(rootDir, 'pwuniapp', 'pages', 'user', 'index.vue');
const promotePath = path.join(rootDir, 'pwuniapp', 'pages', 'user', 'promote.vue');
const content = fs.readFileSync(userIndexPath, 'utf-8');
const promoteContent = fs.readFileSync(promotePath, 'utf-8');
expect(content).toContain('showInvitePoster');
expect(content).toContain('一键复制');
expect(content).toContain('setClipboardData');
expect(promoteContent).toContain('一键复制');
expect(promoteContent).toContain('setClipboardData');
});
it('首页 Banner 轮播必须具备防 null 链式安全访问与数据容错过滤', () => {
@@ -877,6 +879,44 @@ describe('ContentSecurityService & Compliance Architecture (TDD 微信内容安
expect(emojiRegex.test(content)).toBe(false);
});
});
describe('20. 独立专属推广赚钱页面规格验证 (pages/user/promote.vue)', () => {
const promotePath = path.join(rootDir, 'pwuniapp', 'pages', 'user', 'promote.vue');
const pagesJsonPath = path.join(rootDir, 'pwuniapp', 'pages.json');
it('pages.json 必须成功注册 pages/user/promote 且物理文件必须存在', () => {
expect(fs.existsSync(promotePath)).toBe(true);
const pagesJson = JSON.parse(fs.readFileSync(pagesJsonPath, 'utf-8'));
const hasPage = pagesJson.pages.some((p: any) => p.path === 'pages/user/promote');
expect(hasPage).toBe(true);
});
it('推广赚钱页面必须包含沉浸式导航栏、分销总览、海报/团队/订单/提现四大板块', () => {
const content = fs.readFileSync(promotePath, 'utf-8');
expect(content).toContain('custom-nav-bar');
expect(content).toContain('推广赚钱');
expect(content).toContain('dist-summary-banner');
expect(content).toContain('tab-pane-poster');
expect(content).toContain('tab-pane-team');
expect(content).toContain('tab-pane-records');
expect(content).toContain('tab-pane-withdraw');
expect(content).toContain('handleBack');
});
it('个人中心页面 (pages/user/index.vue) 推广赚钱入口必须原生跳转至 /pages/user/promote 且杜绝弹窗', () => {
const userIndexPath = path.join(rootDir, 'pwuniapp', 'pages', 'user', 'index.vue');
const content = fs.readFileSync(userIndexPath, 'utf-8');
expect(content).toContain("navTo('/pages/user/promote')");
expect(content).toContain("url: '/pages/user/promote'");
expect(content).not.toContain('class="profile-edit-modal dist-modal-box"');
});
it('推广赚钱页面代码与测试严禁包含任何系统 Emoji 违规字符', () => {
const content = fs.readFileSync(promotePath, 'utf-8');
const emojiRegex = /(?:\p{Extended_Pictographic}|\p{Emoji_Presentation}|[\u2600-\u27BF])/u;
expect(emojiRegex.test(content)).toBe(false);
});
});
});