From 2ef02e28652fa5d6f065dcfc78ca8b43f9672c9b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Sep 2026 21:15:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(user-center):=20=E4=BD=99=E9=A2=9D?= =?UTF-8?q?=E5=8D=A1=E5=AF=86=E5=85=91=E6=8D=A2=E7=A7=BB=E5=85=A5=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=B9=B6=E5=9C=A8=E4=BD=99=E9=A2=9D=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 余额卡片右下角新增「卡密兑换」点击区(data-aksrt-card-pass-open) - 内联 uc-card-pass 区块替换为 uc-modal 弹窗,兑换逻辑不变 - initCardPass 增加弹窗开关绑定(防重复绑定) - 清理 :first-child > .uc-card-pass 死选择器片段 --- assets/css/routes/user-center/credits.css | 3 +- assets/js/credits.js | 14 ++++++ .../user-center-renderers/credits-wallet.php | 47 ++++++++++++------- 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/assets/css/routes/user-center/credits.css b/assets/css/routes/user-center/credits.css index e8b3ce12..8a6ce139 100644 --- a/assets/css/routes/user-center/credits.css +++ b/assets/css/routes/user-center/credits.css @@ -30,8 +30,7 @@ .uc-assets-row--dual > .uc-assets-col { display: contents; } -.uc-assets-row--dual > .uc-assets-col:first-child > .uc-asset-card, -.uc-assets-row--dual > .uc-assets-col:first-child > .uc-card-pass { +.uc-assets-row--dual > .uc-assets-col:first-child > .uc-asset-card { grid-column: 1; } .uc-assets-row--dual > .uc-assets-col:last-child > .uc-asset-card, diff --git a/assets/js/credits.js b/assets/js/credits.js index 9e3b5406..cebda6c0 100644 --- a/assets/js/credits.js +++ b/assets/js/credits.js @@ -271,6 +271,20 @@ var roots = document.querySelectorAll('[data-aksrt-card-pass]'); if (!roots || !roots.length) return; + var modal = document.querySelector('[data-aksrt-card-pass-modal]'); + if (modal) { + modal.querySelectorAll('[data-aksrt-card-pass-close]').forEach(function (btn) { + if (btn.dataset.aksrtCardPassCloseBound === '1') return; + btn.dataset.aksrtCardPassCloseBound = '1'; + btn.addEventListener('click', function () { closeModal(modal); }); + }); + } + document.querySelectorAll('[data-aksrt-card-pass-open]').forEach(function (btn) { + if (btn.dataset.aksrtCardPassOpenBound === '1') return; + btn.dataset.aksrtCardPassOpenBound = '1'; + btn.addEventListener('click', function () { openModal(modal); }); + }); + Array.prototype.forEach.call(roots, function (root) { var tip = root.querySelector('[data-aksrt-card-tip]'); var busy = false; diff --git a/inc/helpers/user-center-renderers/credits-wallet.php b/inc/helpers/user-center-renderers/credits-wallet.php index 95eb7e51..cfb76696 100644 --- a/inc/helpers/user-center-renderers/credits-wallet.php +++ b/inc/helpers/user-center-renderers/credits-wallet.php @@ -92,30 +92,41 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元'); - -
- formatted())); ?> + +
+ + formatted())); ?> + + + + + +
-
-
- - +