fix(vip): keep 开通会员更多内容 inside the modal only
The user-center VIP tab rendered pay_user_vip_more in a muted box below the level cards, which the reference theme does not do: zibpay_user_page_tab_content_vip only renders pay_user_vip_desc in the status box, and pay_user_vip_more appears solely in the two modal builders (purchase and existing-member renew/upgrade). The page block stayed invisible while the setting defaulted to empty and surfaced once the zibll default copy landed. Remove the page-level block; the modal view model and pay-vip.js right-column rendering are untouched. Verification: regression test locks vip-tab.php free of the more block while the modal path keeps carrying it; node --test tests/**/*.test.cjs 635/635 pass; php -l clean.
This commit is contained in:
1 parent
7f556892ad
commit
659b77719c
2 files changed
+13
-6
No files matched your search
@@ -169,10 +169,4 @@ foreach ([1, 2] as $lv) {
|
||||
// 下方的全宽横条;仅非会员 + 积分兑换开启 + 有可兑换套餐时输出)。
|
||||
echo aksrt_get_vip_points_exchange_entry_html($user_id, $level); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 各字段已在生成时转义。
|
||||
?>
|
||||
|
||||
<?php if (!empty($vip_settings['more'])) : ?>
|
||||
<div class="muted-2-color em09 muted-box padding-10 mini-radius mt15">
|
||||
<?php echo $vip_settings['more']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -27,6 +27,9 @@ const vipSchemaJs = read('assets', 'admin', 'src', 'schema', 'sections', 'paymen
|
||||
const schemaPhp = read('src', 'Admin', 'Schema', 'SchemaPayment.php');
|
||||
const paymentRuntime = read('src', 'Settings', 'PaymentRuntime.php');
|
||||
const rechargeJs = read('assets', 'admin', 'src', 'schema', 'sections', 'payment', 'recharge.js');
|
||||
const vipTabPhp = read('inc', 'helpers', 'user-center-renderers', 'vip-tab.php');
|
||||
const modalSource = read('src', 'Content', 'VipServiceModal.php');
|
||||
const payVipJs = read('assets', 'js', 'pay-vip.js');
|
||||
|
||||
const DESC_DEFAULT = '开通VIP会员,享受会员专属折扣以及多项特权';
|
||||
const MORE_DEFAULT = '<div>购买后不支持退款</div><div>VIP权益仅适用于本站</div><div>欢迎与站长联系</div>';
|
||||
@@ -143,3 +146,13 @@ test('会员介绍运行时按单行文本净化', () => {
|
||||
assert.ok(vipSettings.includes("$desc = sanitize_text_field((string) ($settings['pay_user_vip_desc']"));
|
||||
assert.ok(!vipSettings.includes('$desc = sanitize_textarea_field'));
|
||||
});
|
||||
|
||||
test('开通会员更多内容只在弹窗内渲染,不裸露在用户中心页面', () => {
|
||||
// 参考主题 zibpay_user_page_tab_content_vip 只渲染 pay_user_vip_desc;
|
||||
// pay_user_vip_more 仅出现在两个弹窗函数(购买/续费弹窗)中。
|
||||
assert.ok(!vipTabPhp.includes("vip_settings['more']"), '用户中心 VIP 页不应渲染 more');
|
||||
assert.ok(!vipTabPhp.includes('muted-box padding-10 mini-radius mt15'), '用户中心 VIP 页不应有 more 提示盒');
|
||||
// 弹窗侧保持:视图模型透传 more + pay-vip.js 右列渲染。
|
||||
assert.match(modalSource, /'more'\s+=>/);
|
||||
assert.match(payVipJs, /catalog\.more/);
|
||||
});
|
||||
Reference in new issue
Block a user