Commit edf46c70 by Little Write

前端部分,调试 完善

parent 51a7aa44
...@@ -3,9 +3,11 @@ import { Card, Spin } from '@douyinfe/semi-ui'; ...@@ -3,9 +3,11 @@ import { Card, Spin } from '@douyinfe/semi-ui';
import SettingsGeneralPayment from '../../pages/Setting/Payment/SettingsGeneralPayment.js'; import SettingsGeneralPayment from '../../pages/Setting/Payment/SettingsGeneralPayment.js';
import SettingsPaymentGateway from '../../pages/Setting/Payment/SettingsPaymentGateway.js'; import SettingsPaymentGateway from '../../pages/Setting/Payment/SettingsPaymentGateway.js';
import SettingsPaymentGatewayStripe from '../../pages/Setting/Payment/SettingsPaymentGatewayStripe.js'; import SettingsPaymentGatewayStripe from '../../pages/Setting/Payment/SettingsPaymentGatewayStripe.js';
import SettingsPaymentGatewayCreem from '../../pages/Setting/Payment/SettingsPaymentGatewayCreem.js';
import { API, showError, toBoolean } from '../../helpers'; import { API, showError, toBoolean } from '../../helpers';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const PaymentSetting = () => { const PaymentSetting = () => {
const { t } = useTranslation(); const { t } = useTranslation();
let [inputs, setInputs] = useState({ let [inputs, setInputs] = useState({
...@@ -24,6 +26,9 @@ const PaymentSetting = () => { ...@@ -24,6 +26,9 @@ const PaymentSetting = () => {
StripePriceId: '', StripePriceId: '',
StripeUnitPrice: 8.0, StripeUnitPrice: 8.0,
StripeMinTopUp: 1, StripeMinTopUp: 1,
CreemApiKey: '',
CreemProducts: '[]',
}); });
let [loading, setLoading] = useState(false); let [loading, setLoading] = useState(false);
...@@ -43,6 +48,14 @@ const PaymentSetting = () => { ...@@ -43,6 +48,14 @@ const PaymentSetting = () => {
newInputs[item.key] = item.value; newInputs[item.key] = item.value;
} }
break; break;
case 'CreemProducts':
try {
newInputs[item.key] = item.value;
} catch (error) {
console.error('解析CreemProducts出错:', error);
newInputs[item.key] = '[]';
}
break;
case 'Price': case 'Price':
case 'MinTopUp': case 'MinTopUp':
case 'StripeUnitPrice': case 'StripeUnitPrice':
...@@ -92,6 +105,9 @@ const PaymentSetting = () => { ...@@ -92,6 +105,9 @@ const PaymentSetting = () => {
<Card style={{ marginTop: '10px' }}> <Card style={{ marginTop: '10px' }}>
<SettingsPaymentGatewayStripe options={inputs} refresh={onRefresh} /> <SettingsPaymentGatewayStripe options={inputs} refresh={onRefresh} />
</Card> </Card>
<Card style={{ marginTop: '10px' }}>
<SettingsPaymentGatewayCreem options={inputs} refresh={onRefresh} />
</Card>
</Spin> </Spin>
</> </>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment