From e464da852cc99a080783948ce63761af74b39aca Mon Sep 17 00:00:00 2001 From: qian Date: Tue, 4 Aug 2026 00:18:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(payment):=E6=94=AF=E4=BB=98=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/tenant/v1/order_tenant.go | 1 + internal/logic/common/settings_registry.go | 2 ++ internal/logic/tenant/order.go | 2 ++ .../src/views/system/settings/PaymentTab.vue | 18 ++++++++++++ web/tenant/src/views/finance/WalletPage.vue | 29 +++++++++++++++++++ 5 files changed, 52 insertions(+) diff --git a/api/tenant/v1/order_tenant.go b/api/tenant/v1/order_tenant.go index 0f6a447..8b3397a 100644 --- a/api/tenant/v1/order_tenant.go +++ b/api/tenant/v1/order_tenant.go @@ -119,6 +119,7 @@ type TenantPaymentInfoRes struct { AmountDiscount map[int]float64 `json:"amount_discount,omitempty"` MinTopUp int `json:"min_topup,omitempty"` Currency string `json:"currency,omitempty"` + PaymentNotice string `json:"payment_notice,omitempty"` } // TenantOrderExportReq 导出订单列表请求 diff --git a/internal/logic/common/settings_registry.go b/internal/logic/common/settings_registry.go index 76ad4f0..673c249 100644 --- a/internal/logic/common/settings_registry.go +++ b/internal/logic/common/settings_registry.go @@ -158,6 +158,8 @@ var Registry = []SettingDef{ Label: "支付回调基础URL", Description: "为空则使用请求 Host"}, {Key: "payment_exchange_rate_cny_to_usd", Type: SettingTypeFloat, Default: "0.14", Category: "payment", Label: "CNY → USD 兑换比例", Description: "1 人民币兑换多少美元(USD → CNY 自动取倒数,确保往返闭合)", Validation: "min:0.001,max:100"}, + {Key: "payment_notice", Type: SettingTypeString, Default: "", Category: "payment", + Label: "支付说明", Description: "展示在租户端钱包充值页的说明文案,支持纯文本或 HTML 代码(如提示充值后不支持退款、指定渠道折扣活动等)。纯文本换行需用
,富文本请直接粘贴 HTML"}, // ── Performance ── {Key: "global_qps_limit", Type: SettingTypeInt, Default: "10000", Category: "performance", diff --git a/internal/logic/tenant/order.go b/internal/logic/tenant/order.go index e94a9d1..16903cf 100644 --- a/internal/logic/tenant/order.go +++ b/internal/logic/tenant/order.go @@ -309,6 +309,8 @@ func (s *sTenant) PaymentInfo(ctx context.Context, req *v1.TenantPaymentInfoReq) res.MinTopUp = int(settings.MinTopUp) res.Currency = settings.Currency } + // 支付说明由管理员在「系统设置-支付配置」配置,支持纯文本或 HTML,原样下发由前端渲染 + res.PaymentNotice = lcommon.Config().GetString(ctx, "payment_notice") return res, nil } diff --git a/web/admin/src/views/system/settings/PaymentTab.vue b/web/admin/src/views/system/settings/PaymentTab.vue index 2560092..0c6490f 100644 --- a/web/admin/src/views/system/settings/PaymentTab.vue +++ b/web/admin/src/views/system/settings/PaymentTab.vue @@ -86,6 +86,24 @@ function updateCnyToUsd(usdToCny: number | undefined) { + + +
+
支付说明
+
+ + + +
+
diff --git a/web/tenant/src/views/finance/WalletPage.vue b/web/tenant/src/views/finance/WalletPage.vue index 75d2f57..be5347d 100644 --- a/web/tenant/src/views/finance/WalletPage.vue +++ b/web/tenant/src/views/finance/WalletPage.vue @@ -412,6 +412,13 @@ onBeforeUnmount(() => { + + +
+ + +
+
@@ -800,6 +807,28 @@ onBeforeUnmount(() => { flex-shrink: 0; color: #d97706; } +/* 支付说明(管理员配置,支持 HTML) */ +.payment-notice { + display: flex; + align-items: flex-start; + gap: 0.5rem; + border-radius: 0.75rem; + background: #fffbeb; + border: 1px solid rgba(252, 211, 77, 0.6); + padding: 0.75rem 1rem; + color: #92400e; +} +.payment-notice-content { + flex: 1; + min-width: 0; + font-size: 0.8125rem; + line-height: 1.6; +} +.payment-notice-content :deep(p) { margin: 0 0 0.5rem; } +.payment-notice-content :deep(p:last-child) { margin-bottom: 0; } +.payment-notice-content :deep(a) { color: inherit; text-decoration: underline; } +.payment-notice-content :deep(strong) { font-weight: 600; } + .wallet-card { background: rgba(255, 255, 255, 0.94); }