fix: 有 src_host 时隐藏订单页「返回充值」按钮

从 iframe 嵌入(带 src_host)时不显示返回充值按钮,避免用户跳出。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erio
2026-03-03 03:55:26 +08:00
parent 880f0211f3
commit f4709b784f

View File

@@ -24,6 +24,7 @@ function OrdersContent() {
const token = (searchParams.get('token') || '').trim();
const theme = searchParams.get('theme') === 'dark' ? 'dark' : 'light';
const uiMode = searchParams.get('ui_mode') || 'standalone';
const srcHost = searchParams.get('src_host') || '';
const isDark = theme === 'dark';
const [isIframeContext, setIsIframeContext] = useState(true);
@@ -178,7 +179,7 @@ function OrdersContent() {
actions={
<>
<button type="button" onClick={() => loadOrders(page, pageSize)} className={btnClass}></button>
<a href={buildScopedUrl('/pay')} className={btnClass}></a>
{!srcHost && <a href={buildScopedUrl('/pay')} className={btnClass}></a>}
</>
}
>