diff --git a/web/src/components/table/subscriptions/SubscriptionsColumnDefs.jsx b/web/src/components/table/subscriptions/SubscriptionsColumnDefs.jsx
index 1cff521bc..6bf18ba51 100644
--- a/web/src/components/table/subscriptions/SubscriptionsColumnDefs.jsx
+++ b/web/src/components/table/subscriptions/SubscriptionsColumnDefs.jsx
@@ -27,8 +27,9 @@ import {
Popover,
Divider,
Badge,
+ Tooltip,
} from '@douyinfe/semi-ui';
-import { IconEdit, IconStop, IconPlay } from '@douyinfe/semi-icons';
+import { renderQuota } from '../../../helpers';
import { convertUSDToCurrency } from '../../../helpers/render';
const { Text } = Typography;
@@ -81,7 +82,13 @@ const renderPlanTitle = (text, record, t) => {
{convertUSDToCurrency(Number(plan?.price_amount || 0), 2)}
{t('总额度')}
- {plan?.total_amount > 0 ? plan.total_amount : t('不限')}
+ {plan?.total_amount > 0 ? (
+
+ {renderQuota(plan.total_amount)}
+
+ ) : (
+ {t('不限')}
+ )}
{t('升级分组')}
{plan?.upgrade_group ? plan.upgrade_group : t('不升级')}
{t('购买上限')}
@@ -165,7 +172,13 @@ const renderTotalAmount = (text, record, t) => {
const total = Number(record?.plan?.total_amount || 0);
return (
0 ? 'secondary' : 'tertiary'}>
- {total > 0 ? total : t('不限')}
+ {total > 0 ? (
+
+ {renderQuota(total)}
+
+ ) : (
+ t('不限')
+ )}
);
};
@@ -236,30 +249,22 @@ const renderOperations = (text, record, { openEdit, setPlanEnabled, t }) => {
return (
}
onClick={() => openEdit(record)}
>
{t('编辑')}
{isEnabled ? (
- }
- onClick={handleToggle}
- >
+
) : (
}
onClick={handleToggle}
>
{t('启用')}
diff --git a/web/src/components/table/subscriptions/modals/AddEditSubscriptionModal.jsx b/web/src/components/table/subscriptions/modals/AddEditSubscriptionModal.jsx
index 2183f066a..cb8fee404 100644
--- a/web/src/components/table/subscriptions/modals/AddEditSubscriptionModal.jsx
+++ b/web/src/components/table/subscriptions/modals/AddEditSubscriptionModal.jsx
@@ -39,12 +39,11 @@ import {
IconSave,
} from '@douyinfe/semi-icons';
import { Clock, RefreshCw } from 'lucide-react';
+import { API, showError, showSuccess } from '../../../../helpers';
import {
- API,
- showError,
- showSuccess,
- renderQuotaWithPrompt,
-} from '../../../../helpers';
+ quotaToDisplayAmount,
+ displayAmountToQuota,
+} from '../../../../helpers/quota';
import { useIsMobile } from '../../../../hooks/common/useIsMobile';
const { Text, Title } = Typography;
@@ -118,7 +117,9 @@ const AddEditSubscriptionModal = ({
enabled: p.enabled !== false,
sort_order: Number(p.sort_order || 0),
max_purchase_per_user: Number(p.max_purchase_per_user || 0),
- total_amount: Number(p.total_amount || 0),
+ total_amount: Number(
+ quotaToDisplayAmount(p.total_amount || 0).toFixed(2),
+ ),
upgrade_group: p.upgrade_group || '',
stripe_price_id: p.stripe_price_id || '',
creem_product_id: p.creem_product_id || '',
@@ -161,7 +162,7 @@ const AddEditSubscriptionModal = ({
: 0,
sort_order: Number(values.sort_order || 0),
max_purchase_per_user: Number(values.max_purchase_per_user || 0),
- total_amount: Number(values.total_amount || 0),
+ total_amount: displayAmountToQuota(values.total_amount),
upgrade_group: values.upgrade_group || '',
},
};
@@ -307,23 +308,16 @@ const AddEditSubscriptionModal = ({
-
diff --git a/web/src/components/topup/SubscriptionPlansCard.jsx b/web/src/components/topup/SubscriptionPlansCard.jsx
index cf30bd3d9..701f958e6 100644
--- a/web/src/components/topup/SubscriptionPlansCard.jsx
+++ b/web/src/components/topup/SubscriptionPlansCard.jsx
@@ -359,7 +359,8 @@ const SubscriptionPlansCard = ({