feat(protocol): add dedicated full-text legal protocol page with smooth scroll view and link from login and user center
这个提交包含在:
@@ -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(15);
|
||||
expect(config.pages.length).toBe(16);
|
||||
|
||||
for (const pageItem of config.pages) {
|
||||
const vueFilePath = path.join(rootDir, 'pwuniapp', `${pageItem.path}.vue`);
|
||||
@@ -483,6 +483,45 @@ describe('ContentSecurityService & Compliance Architecture (TDD 微信内容安
|
||||
expect(content).toContain('white-space: nowrap');
|
||||
});
|
||||
});
|
||||
|
||||
describe('13. 专属独立法律协议与隐私政策长文阅读页面验证 (pages/common/protocol.vue)', () => {
|
||||
it('pages.json 必须成功注册 pages/common/protocol 且物理文件必须存在', () => {
|
||||
const protoPath = path.join(rootDir, 'pwuniapp', 'pages', 'common', 'protocol.vue');
|
||||
expect(fs.existsSync(protoPath)).toBe(true);
|
||||
const pagesJsonPath = path.join(rootDir, 'pwuniapp', 'pages.json');
|
||||
const pagesJson = fs.readFileSync(pagesJsonPath, 'utf-8');
|
||||
expect(pagesJson).toContain('pages/common/protocol');
|
||||
expect(pagesJson).toContain('服务协议与隐私政策');
|
||||
});
|
||||
|
||||
it('协议页面必须支持动态章节结构化拆分、长文上下滚动与双主题适配', () => {
|
||||
const protoPath = path.join(rootDir, 'pwuniapp', 'pages', 'common', 'protocol.vue');
|
||||
const content = fs.readFileSync(protoPath, 'utf-8');
|
||||
expect(content).toContain('scroll-view');
|
||||
expect(content).toContain('formattedSections');
|
||||
expect(content).toContain('getPlatformConfigs');
|
||||
expect(content).toContain('applyThemeToNativeUI');
|
||||
expect(content).toContain('theme-warm');
|
||||
});
|
||||
|
||||
it('登录页与个人中心必须实现对专属协议页面的原生导航跳转', () => {
|
||||
const loginPath = path.join(rootDir, 'pwuniapp', 'pages', 'auth', 'login.vue');
|
||||
const loginContent = fs.readFileSync(loginPath, 'utf-8');
|
||||
expect(loginContent).toContain('/pages/common/protocol?type=service');
|
||||
expect(loginContent).toContain('/pages/common/protocol?type=privacy');
|
||||
|
||||
const userPath = path.join(rootDir, 'pwuniapp', 'pages', 'user', 'index.vue');
|
||||
const userContent = fs.readFileSync(userPath, 'utf-8');
|
||||
expect(userContent).toContain('/pages/common/protocol?type=');
|
||||
});
|
||||
|
||||
it('协议阅读页面代码严禁包含任何系统 Emoji', () => {
|
||||
const protoPath = path.join(rootDir, 'pwuniapp', 'pages', 'common', 'protocol.vue');
|
||||
const content = fs.readFileSync(protoPath, 'utf-8');
|
||||
const emojiRegex = /(?:\p{Extended_Pictographic}|\p{Emoji_Presentation}|[\u2600-\u27BF])/u;
|
||||
expect(emojiRegex.test(content)).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户