前端部分,调试 完善

This commit is contained in:
Little Write
2025-09-08 23:25:30 +08:00
parent 99b9a34e19
commit dc6fbffa96
3 changed files with 630 additions and 3 deletions

View File

@@ -3,9 +3,11 @@ import { Card, Spin } from '@douyinfe/semi-ui';
import SettingsGeneralPayment from '../../pages/Setting/Payment/SettingsGeneralPayment.js';
import SettingsPaymentGateway from '../../pages/Setting/Payment/SettingsPaymentGateway.js';
import SettingsPaymentGatewayStripe from '../../pages/Setting/Payment/SettingsPaymentGatewayStripe.js';
import SettingsPaymentGatewayCreem from '../../pages/Setting/Payment/SettingsPaymentGatewayCreem.js';
import { API, showError, toBoolean } from '../../helpers';
import { useTranslation } from 'react-i18next';
const PaymentSetting = () => {
const { t } = useTranslation();
let [inputs, setInputs] = useState({
@@ -24,6 +26,9 @@ const PaymentSetting = () => {
StripePriceId: '',
StripeUnitPrice: 8.0,
StripeMinTopUp: 1,
CreemApiKey: '',
CreemProducts: '[]',
});
let [loading, setLoading] = useState(false);
@@ -43,6 +48,14 @@ const PaymentSetting = () => {
newInputs[item.key] = item.value;
}
break;
case 'CreemProducts':
try {
newInputs[item.key] = item.value;
} catch (error) {
console.error('解析CreemProducts出错:', error);
newInputs[item.key] = '[]';
}
break;
case 'Price':
case 'MinTopUp':
case 'StripeUnitPrice':
@@ -92,6 +105,9 @@ const PaymentSetting = () => {
<Card style={{ marginTop: '10px' }}>
<SettingsPaymentGatewayStripe options={inputs} refresh={onRefresh} />
</Card>
<Card style={{ marginTop: '10px' }}>
<SettingsPaymentGatewayCreem options={inputs} refresh={onRefresh} />
</Card>
</Spin>
</>
);