feat: 1.统一右侧抽屉关闭按钮布局 2.统一 UI 组件为 Ant Design 移除 radix-ui、floating-ui 组件 3. 修复 ESLint 文件格式错误的问题
This commit is contained in:
@@ -28,12 +28,7 @@ import {
|
||||
Spin,
|
||||
Tooltip,
|
||||
} from '@/components/ui';
|
||||
import {
|
||||
CreditCard,
|
||||
Coins,
|
||||
Wallet,
|
||||
Receipt,
|
||||
} from 'lucide-react';
|
||||
import { CreditCard, Coins, Wallet, Receipt } from 'lucide-react';
|
||||
import {
|
||||
AlipayBrandIcon,
|
||||
WechatBrandIcon,
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
|
||||
import React, { useEffect, useState, useContext, useRef } from 'react';
|
||||
import {
|
||||
API,
|
||||
@@ -467,12 +468,13 @@ const TopUp = () => {
|
||||
else showError(t('复制失败,请手动复制'));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const onMount = useEffectEvent(() => {
|
||||
if (!userState?.user?.id) {
|
||||
getUserQuota().then();
|
||||
}
|
||||
setTransferAmount(getQuotaPerUnit());
|
||||
}, []);
|
||||
});
|
||||
useEffect(() => onMount(), [onMount]);
|
||||
|
||||
useEffect(() => {
|
||||
if (affFetchedRef.current) return;
|
||||
@@ -481,9 +483,10 @@ const TopUp = () => {
|
||||
}, []);
|
||||
|
||||
// 在 statusState 可用时获取充值信息
|
||||
useEffect(() => {
|
||||
const onMount2 = useEffectEvent(() => {
|
||||
getTopupInfo().then();
|
||||
}, []);
|
||||
});
|
||||
useEffect(() => onMount2(), [onMount2]);
|
||||
|
||||
useEffect(() => {
|
||||
if (statusState?.status) {
|
||||
|
||||
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { useEffectEvent } from '../../../hooks/common/useEffectEvent';
|
||||
import React, { useState, useEffect, useMemo } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
@@ -112,11 +113,15 @@ const TopupHistoryModal = ({ visible, onCancel, t }) => {
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const onVisibilityChange = useEffectEvent(() => {
|
||||
if (visible) {
|
||||
loadTopups(page, pageSize);
|
||||
}
|
||||
}, [visible, page, pageSize, keyword]);
|
||||
});
|
||||
useEffect(
|
||||
() => onVisibilityChange(),
|
||||
[onVisibilityChange, visible, page, pageSize, keyword],
|
||||
);
|
||||
|
||||
const handlePageChange = (currentPage) => {
|
||||
setPage(currentPage);
|
||||
@@ -187,7 +192,7 @@ const TopupHistoryModal = ({ visible, onCancel, t }) => {
|
||||
// 检查是否为管理员
|
||||
const userIsAdmin = useMemo(() => isAdmin(), []);
|
||||
|
||||
const columns = useMemo(() => {
|
||||
const columns = (() => {
|
||||
const baseColumns = [
|
||||
{
|
||||
title: t('订单号'),
|
||||
@@ -273,7 +278,7 @@ const TopupHistoryModal = ({ visible, onCancel, t }) => {
|
||||
});
|
||||
|
||||
return baseColumns;
|
||||
}, [t, userIsAdmin]);
|
||||
})();
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
||||
@@ -17,15 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useEffectEvent } from '../../../hooks/common/useEffectEvent';
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
Button,
|
||||
Spin,
|
||||
Typography,
|
||||
Space,
|
||||
Toast,
|
||||
} from '@/components/ui';
|
||||
import { Modal, Button, Spin, Typography, Space, Toast } from '@/components/ui';
|
||||
import { IconRefresh, IconClose } from '@/components/ui/icons';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import QRCode from 'qrcode';
|
||||
@@ -46,7 +40,7 @@ const WechatQRModal = ({ visible, onClose, orderData, pollFn }) => {
|
||||
const errorCountRef = useRef(0); // 错误计数
|
||||
|
||||
// 生成二维码
|
||||
useEffect(() => {
|
||||
const onVisibilityChange = useEffectEvent(() => {
|
||||
if (visible && orderData && orderData.code_url) {
|
||||
// 【Bug#5修复】重置过期状态,避免上一个过期订单影响新订单的展示
|
||||
setExpired(false);
|
||||
@@ -60,7 +54,11 @@ const WechatQRModal = ({ visible, onClose, orderData, pollFn }) => {
|
||||
stopPolling();
|
||||
stopExpireTimer();
|
||||
};
|
||||
}, [visible, orderData]);
|
||||
});
|
||||
useEffect(
|
||||
() => onVisibilityChange(),
|
||||
[onVisibilityChange, visible, orderData],
|
||||
);
|
||||
|
||||
const generateQRCode = async (url) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user