feat(user-center): 1:1 port reference sidebar VIP bar and creator/promotion cards
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5dd7d14334
commit
9fbfab54c2
4 files changed
+190
-200
No files matched your search
@@ -56,8 +56,10 @@ test('服务/设置网格使用参考主题 icon-but-box 外壳与 sprite 图标
|
||||
assert.doesNotMatch(nav, /data-onclick/);
|
||||
});
|
||||
|
||||
test('侧栏五个部件均不再出现 Font Awesome 字形', () => {
|
||||
for (const file of sidebarFiles) {
|
||||
test('侧栏部件(VIP 与创作/推广卡除外)不再出现 Font Awesome 字形', () => {
|
||||
// VIP 入口与创作/推广卡 1:1 参考主题,箭头沿用 fa-chevron-circle-right / fa-angle-right。
|
||||
const faAllowed = new Set(['sidebar-vip.php', 'sidebar-creator.php']);
|
||||
for (const file of sidebarFiles.filter((f) => !faAllowed.has(f))) {
|
||||
const source = read(sidebarDir + file);
|
||||
assert.doesNotMatch(source, /fa\s+fas\s+fa-/, `${file} still renders a Font Awesome glyph`);
|
||||
assert.doesNotMatch(source, /<i class="fa/, `${file} still renders a Font Awesome <i>`);
|
||||
@@ -71,13 +73,25 @@ test('其余侧栏部件按参考主题选型替换为 sprite 图标', () => {
|
||||
assert.match(commerce, /aksrt_icon_markup\('zibsvg-right'\)/);
|
||||
|
||||
const creator = read(sidebarDir + 'sidebar-creator.php');
|
||||
assert.match(creator, /aksrt_icon_markup\('zibsvg-merchant-color'\)/);
|
||||
assert.match(creator, /aksrt_icon_markup\('zibsvg-money-color'\)/);
|
||||
assert.match(creator, /aksrt_icon_markup\('zibsvg-right'\)/);
|
||||
assert.match(creator, /aksrt_icon_markup\('zibsvg-merchant-color', 'mr6'\)/);
|
||||
assert.match(creator, /aksrt_icon_markup\('zibsvg-money-color', 'mr6'\)/);
|
||||
assert.match(creator, /class="mb10-sm zib-widget padding-10 flex1 pointer"/);
|
||||
assert.match(creator, /flex ab jsb col-ml6/);
|
||||
assert.match(creator, /<i class="ml6 fa fas fa-angle-right em12"/);
|
||||
for (const label of ['创作中心', '推广中心', '商品', '比例', '今日收入', '收入', '待提现', '累计佣金']) {
|
||||
assert.ok(creator.includes(`'${label}'`), `creator card missing label: ${label}`);
|
||||
}
|
||||
assert.doesNotMatch(creator, /data-onclick/);
|
||||
|
||||
const vip = read(sidebarDir + 'sidebar-vip.php');
|
||||
assert.match(vip, /aksrt_icon_markup\('zibsvg-vip_1'\)/);
|
||||
assert.match(vip, /aksrt_icon_markup\('zibsvg-right', 'uc-sidebar-vip__arrow'\)/);
|
||||
assert.match(vip, /aksrt_icon_markup\('zibsvg-vip_1', 'em12 mr6'\)/);
|
||||
assert.match(vip, /aksrt_icon_markup\('zibsvg-time', 'mr3'\)/);
|
||||
assert.match(vip, /mb20 mb10-sm main-radius payvip-icon btn-block badg pointer/);
|
||||
assert.match(vip, /style="padding: 14px 10px;"/);
|
||||
assert.match(vip, /fa-chevron-circle-right abs-right/);
|
||||
assert.match(vip, /开通会员 尊享会员权益/);
|
||||
assert.match(vip, /data-tab="vip"/);
|
||||
assert.doesNotMatch(vip, /data-onclick/);
|
||||
|
||||
const profile = read(sidebarDir + 'profile-sidebar.php');
|
||||
assert.match(profile, /aksrt_icon_markup\('zibsvg-menu'\)/);
|
||||
@@ -102,14 +116,17 @@ test('旧 uc-service-grid 外壳与色调底色已彻底移除', () => {
|
||||
|
||||
// 卡片上的 <i> 已换成 <svg>,元素选择器需覆盖两者。
|
||||
assert.match(shell, /\.uc-summary-card__body > svg/);
|
||||
assert.match(shell, /\.uc-center-card > svg/);
|
||||
// 旧的琥珀 VIP 券与 uc-center-card 已被参考主题结构替换。
|
||||
assert.doesNotMatch(shell, /uc-center-card/);
|
||||
assert.doesNotMatch(shell, /uc-sidebar-vip__/);
|
||||
assert.match(shell, /\.uc-sidebar-centers > \.zib-widget/);
|
||||
});
|
||||
|
||||
test('所用 sprite key 均在前端 sprite 中定义', () => {
|
||||
const sprite = read('assets/js/runtime/svg-icon.js');
|
||||
const keys = [
|
||||
'trend-color', 'user-auth', 'order-color', 'msg-color', 'user-color', 'security-color',
|
||||
'money-color-2', 'points-color', 'merchant-color', 'money-color', 'vip_1', 'menu', 'right',
|
||||
'money-color-2', 'points-color', 'merchant-color', 'money-color', 'vip_1', 'time', 'menu', 'right',
|
||||
];
|
||||
for (const key of keys) {
|
||||
assert.match(sprite, new RegExp(`aksrt_svgs\\['${key}'\\]\\s*=`), `sprite key missing: ${key}`);
|
||||
|
||||
Reference in new issue
Block a user