From b6757a831f4d731bab629c37ea1669f19dd0cfac Mon Sep 17 00:00:00 2001 From: erio Date: Mon, 6 Apr 2026 17:51:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20payment=20settings=20UI=20?= =?UTF-8?q?=E2=80=94=20layout,=20i18n,=20image=20upload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix layout: 5-col grid -> 4-col + flex, no more truncated labels - Add easypay to payment type toggles (易支付) - Internationalize provider key options (易支付/支付宝官方/微信官方/Stripe) - Help image: URL input -> ImageUpload component (supports upload) - Help text: input -> textarea (multi-line) - Add i18n keys: providerEasypay/Alipay/Wxpay/Stripe, helpImage, placeholders --- frontend/src/i18n/locales/en.ts | 7 ++ frontend/src/i18n/locales/zh.ts | 7 ++ frontend/src/views/admin/SettingsView.vue | 88 ++++++++++++----------- 3 files changed, 60 insertions(+), 42 deletions(-) diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index 5786b41295..ea6ef6db44 100644 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -4346,6 +4346,13 @@ export default { manageProviders: 'Manage Providers', balancePaymentDisabled: 'Disable Balance Recharge', noLimit: 'Empty = no limit', + helpImage: 'Help Image', + helpImagePlaceholder: 'Upload or enter image URL', + helpTextPlaceholder: 'Enter help text...', + providerEasypay: 'EasyPay', + providerAlipay: 'Alipay (Direct)', + providerWxpay: 'WeChat Pay (Direct)', + providerStripe: 'Stripe', productNamePrefix: 'Product Name Prefix', productNameSuffix: 'Product Name Suffix', preview: 'Preview', diff --git a/frontend/src/i18n/locales/zh.ts b/frontend/src/i18n/locales/zh.ts index ceb5996cda..5dc6e86b20 100644 --- a/frontend/src/i18n/locales/zh.ts +++ b/frontend/src/i18n/locales/zh.ts @@ -4519,6 +4519,13 @@ export default { manageProviders: '管理服务商', balancePaymentDisabled: '禁用余额充值', noLimit: '留空表示不限制', + helpImage: '帮助图片', + helpImagePlaceholder: '上传或输入图片链接', + helpTextPlaceholder: '输入帮助说明文本...', + providerEasypay: '易支付', + providerAlipay: '支付宝官方', + providerWxpay: '微信官方', + providerStripe: 'Stripe', productNamePrefix: '商品名前缀', productNameSuffix: '商品名后缀', preview: '预览', diff --git a/frontend/src/views/admin/SettingsView.vue b/frontend/src/views/admin/SettingsView.vue index 4922f7d51f..4c2836c0d6 100644 --- a/frontend/src/views/admin/SettingsView.vue +++ b/frontend/src/views/admin/SettingsView.vue @@ -1656,56 +1656,59 @@ @@ -2921,6 +2924,7 @@ const PROVIDER_SUPPORTED_TYPES: Record = { } const allPaymentTypes = computed(() => [ + { value: 'easypay', label: t('admin.settings.payment.providerEasypay') }, { value: 'alipay', label: t('payment.methods.alipay') }, { value: 'wxpay', label: t('payment.methods.wxpay') }, { value: 'stripe', label: t('payment.methods.stripe') }, @@ -2957,12 +2961,12 @@ const providerConfig = reactive({ mchId: '', apiV3Key: '', publicKeyId: '', certSerial: '', secretKey: '', publishableKey: '', webhookSecret: '', }) -const providerKeyOptions = [ - { value: 'easypay', label: 'EasyPay' }, - { value: 'alipay', label: 'Alipay (Direct)' }, - { value: 'wxpay', label: 'WeChat Pay (Direct)' }, - { value: 'stripe', label: 'Stripe' }, -] +const providerKeyOptions = computed(() => [ + { value: 'easypay', label: t('admin.settings.payment.providerEasypay') }, + { value: 'alipay', label: t('admin.settings.payment.providerAlipay') }, + { value: 'wxpay', label: t('admin.settings.payment.providerWxpay') }, + { value: 'stripe', label: t('admin.settings.payment.providerStripe') }, +]) const loadBalanceOptions = computed(() => [ { value: 'round-robin', label: t('admin.settings.payment.strategyRoundRobin') }, { value: 'least-amount', label: t('admin.settings.payment.strategyLeastAmount') }, @@ -2995,7 +2999,7 @@ function onProviderKeyChange() { } function providerKeyLabel(key: string): string { - return providerKeyOptions.find(o => o.value === key)?.label || key + return providerKeyOptions.value.find(o => o.value === key)?.label || key } async function loadProviders() { providersLoading.value = true