feat(payment):支付提示功能

This commit is contained in:
qian committed 2026-08-04 00:18:10 +08:00
1 parent 66f857a26b
commit e464da852c
5 files changed
+52

No files matched your search

+1
View File
@@ -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 导出订单列表请求
@@ -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 代码(如提示充值后不支持退款、指定渠道折扣活动等)。纯文本换行需用 <br>,富文本请直接粘贴 HTML"},
// ── Performance ──
{Key: "global_qps_limit", Type: SettingTypeInt, Default: "10000", Category: "performance",
+2
View File
@@ -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
}
@@ -86,6 +86,24 @@ function updateCnyToUsd(usdToCny: number | undefined) {
</AFormItem>
</div>
</div>
<!-- 支付说明 -->
<div class="section">
<div class="section-title">支付说明</div>
<div class="section-grid">
<AFormItem
label="钱包页说明"
help="展示在租户端钱包充值页,支持纯文本或 HTML 代码(如提示充值后不支持退款、指定渠道折扣活动等)。纯文本换行需用 <br>"
class="field-full"
>
<ATextarea
v-model="values['payment_notice']"
:auto-size="{ minRows: 3, maxRows: 10 }"
placeholder="例如:充值后不支持退款;使用支付宝支付享 95 折;指定渠道优惠见说明..."
/>
</AFormItem>
</div>
</div>
</div>
</template>
@@ -412,6 +412,13 @@ onBeforeUnmount(() => {
<Icon name="chevronRight" size="xs" class="text-slate-300" />
</div>
</button>
<!-- 支付说明(管理员配置,支持纯文本或 HTML) -->
<div v-if="paymentInfo?.payment_notice" class="payment-notice mt-3">
<Icon name="infoCircle" size="xs" class="mt-0.5 flex-shrink-0" />
<!-- 内容由平台管理员配置,信任来源,支持 HTML 渲染 -->
<div v-html="paymentInfo.payment_notice" class="payment-notice-content"></div>
</div>
</template>
</div>
@@ -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);
}