From 659b77719cb316272e0f80445736dd7db8085020 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 18 Oct 2026 14:37:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(vip):=20keep=20=E5=BC=80=E9=80=9A=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E6=9B=B4=E5=A4=9A=E5=86=85=E5=AE=B9=20inside=20the=20?= =?UTF-8?q?modal=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- inc/helpers/user-center-renderers/vip-tab.php | 6 ------ tests/widget-system/vip-modal-copy-fields.test.cjs | 13 +++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/inc/helpers/user-center-renderers/vip-tab.php b/inc/helpers/user-center-renderers/vip-tab.php index 90b86559..1c75ba6b 100644 --- a/inc/helpers/user-center-renderers/vip-tab.php +++ b/inc/helpers/user-center-renderers/vip-tab.php @@ -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 -- 各字段已在生成时转义。 ?> - - -
- -
- diff --git a/tests/widget-system/vip-modal-copy-fields.test.cjs b/tests/widget-system/vip-modal-copy-fields.test.cjs index 27a43827..87196c9d 100644 --- a/tests/widget-system/vip-modal-copy-fields.test.cjs +++ b/tests/widget-system/vip-modal-copy-fields.test.cjs @@ -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 = '
购买后不支持退款
VIP权益仅适用于本站
欢迎与站长联系
'; @@ -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/); +});