fix(user-center): use the reference trend sprite for experience task rows

Each experience task row closed with a solid `fa-bolt` glyph. The reference
marks the same slot with the colour `trend-color` sprite followed by "+ N",
and uses that sprite for the 成长体系 heading as well, so the level page also
carried a stray `fa-chart-line` there.

The sprite already ships in the theme (`jiosvg-trend-color`); its path data is
byte-identical to the reference sheet. Both slots now render it, sized to
match the reference (`icon mr6 em09` for the rows, `icon mr6 em12` for the
heading). The "动态" rows keep their wording without a "+", which is how they
read before.

The check-in experience badges in src/Credits/Signin.php stay on
`fa-line-chart` — the reference uses the same monochrome glyph there.

Verification: rendered the real level page through a PHP stub — all ten task
rows emit `#icon-trend-color`, the only Font Awesome glyph left is the
"每日详情" arrow, matching the reference. Screenshotted against the real
stylesheet. A contract test pins both sprite usages and rejects a regression
to `fa-bolt` / `fa-chart-line`; 862 widget/navigation tests pass.
This commit is contained in:
kate522 committed 2026-11-04 17:17:49 +08:00
1 parent 09b1e535e4
commit 6d01e7489a
2 files changed
+11 -2

No files matched your search

@@ -78,7 +78,7 @@ $percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
<div class="jio-level-card__growth-inner">
<div class="jio-level-card__growth-head">
<div>
<strong><i class="fa fas fa-chart-line" aria-hidden="true"></i><?php esc_html_e('成长体系', 'jio'); ?></strong>
<strong><?php echo function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-trend-color', 'icon mr6 em12') : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><?php esc_html_e('成长体系', 'jio'); ?></strong>
<a class="muted-2-color" data-jio-level-tab="tab_integral_my" href="#tab_integral_my"><?php printf(esc_html__('我的经验值:%d', 'jio'), $integral); ?></a>
</div>
<a id="tab-integral-date-link" class="muted-2-color" data-jio-level-tab="tab_integral_date" href="#tab_integral_date"><?php echo $today_integral > 0 ? esc_html(sprintf(__('今日 +%d', 'jio'), $today_integral)) : esc_html__('查看详情', 'jio'); ?><i class="fa fas fa-angle-right ml6" aria-hidden="true"></i></a>
@@ -134,7 +134,7 @@ $percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
<div class="border-bottom padding-h10 jio-level-list-row">
<div class="flex jsb ac">
<div class="flex1 mr20"><div class="font-bold mb6"><?php echo esc_html($labels[$key] ?? $key); ?></div><div class="muted-2-color em09"><?php echo in_array($key, ['checkin', 'shop_gift'], true) ? esc_html__('按活动或商品配置发放', 'jio') : esc_html__('完成后自动计入经验', 'jio'); ?></div></div>
<span class="focus-color em14 shrink0"><i class="fa fas fa-bolt mr6" aria-hidden="true"></i><?php echo $value > 0 ? '+' . esc_html((string) $value) : esc_html__('动态', 'jio'); ?></span>
<span class="focus-color em14 shrink0"><?php echo function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-trend-color', 'icon mr6 em09') : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php echo $value > 0 ? '+ ' . esc_html((string) $value) : esc_html__('动态', 'jio'); ?></span>
</div>
</div>
<?php endforeach; ?>
@@ -193,3 +193,12 @@ test('余额/积分资产卡的标题图标与参考主题一致', () => {
assert.doesNotMatch(title, /fa fas fa-money-bill|fa fas fa-coins/, name);
}
});
test('等级页经验任务行使用参考主题的 trend-color 图标', () => {
const level = read('inc/helpers/user-center-renderers/profile-level.php');
// 参考主题:每条经验任务 = trend-color + 「+ N」,成长体系标题同图标。
assert.match(level, /jio_icon_markup\('jiosvg-trend-color', 'icon mr6 em09'\)/);
assert.match(level, /jio_icon_markup\('jiosvg-trend-color', 'icon mr6 em12'\)/);
assert.doesNotMatch(level, /fa fas fa-bolt|fa fas fa-chart-line/);
});