diff --git a/src/app/(main)/withdraws/page.tsx b/src/app/(main)/withdraws/page.tsx index 68edc87..7acef8b 100644 --- a/src/app/(main)/withdraws/page.tsx +++ b/src/app/(main)/withdraws/page.tsx @@ -29,7 +29,6 @@ import { CheckCircleOutlined, ClearOutlined, CloseCircleOutlined, - FilterOutlined, ReloadOutlined, SearchOutlined, SortAscendingOutlined, @@ -86,42 +85,6 @@ const STATUS_TABS = [ ]; const REJECT_TEMPLATES = ['账号异常', '提现金额异常', '微信实名不匹配', '风控拦截', '其他原因']; -const QUICK_FILTER_OPTIONS = [ - { value: 'abnormal', label: '异常单' }, - { value: 'failed', label: '打款失败' }, - { value: 'overdue_reviewing', label: '待审核超30分钟' }, - { value: 'pending_overdue', label: '打款中超15分钟' }, - { value: 'today', label: '今日申请' }, - { value: 'high_risk', label: '高风险用户' }, -]; -const QUICK_FILTER_STATUS: Record = { - abnormal: 'all', - failed: 'failed', - overdue_reviewing: 'reviewing', - pending_overdue: 'pending', - high_risk: 'all', -}; -const SORT_OPTIONS = [ - { value: 'created_at', label: '申请时间' }, - { value: 'amount_cents', label: '提现金额' }, -]; -// 提现类型:coin_cash=福利页提现(金币兑换现金) / invite_cash=邀请提现(邀请奖励金) -const SOURCE_LABEL: Record = { - coin_cash: '福利页提现', - invite_cash: '邀请提现', -}; -const SOURCE_COLOR: Record = { - coin_cash: 'blue', - invite_cash: 'purple', -}; -const SOURCE_OPTIONS = [ - { value: 'coin_cash', label: '福利页提现' }, - { value: 'invite_cash', label: '邀请提现' }, -]; -const DATE_FIELD_OPTIONS = [ - { value: 'created_at', label: '申请时间' }, - { value: 'updated_at', label: '更新时间' }, -]; function statusTag(status: string) { return {STATUS_LABEL[status] || status}; @@ -197,21 +160,15 @@ export default function WithdrawsPage() { const [searchDraft, setSearchDraft] = useState(''); const [keyword, setKeyword] = useState(''); const [dateRange, setDateRange] = useState<[Dayjs, Dayjs] | null>(null); - const [dateField, setDateField] = useState<'created_at' | 'updated_at'>('created_at'); - const [sortBy, setSortBy] = useState<'created_at' | 'amount_cents'>('created_at'); const [sortOrder, setSortOrder] = useState<'asc' | 'desc'>('desc'); - const [quickFilter, setQuickFilter] = useState(undefined); - const [source, setSource] = useState(undefined); const filters: Record = {}; if (activeStatus !== 'all') filters.status = activeStatus; - if (source) filters.source = source; if (keyword.trim()) filters.keyword = keyword.trim(); if (dateRange?.[0]) filters.date_from = dateRange[0].startOf('day').toISOString(); if (dateRange?.[1]) filters.date_to = dateRange[1].endOf('day').toISOString(); - if (quickFilter) filters.quick_filter = quickFilter; - filters.date_field = dateField; - filters.sort_by = sortBy; + filters.date_field = 'created_at'; + filters.sort_by = 'created_at'; filters.sort_order = sortOrder; const filterKey = JSON.stringify(filters); const { items, total, page, pageSize, loading, onChange: onPageChange, reload } = @@ -226,27 +183,7 @@ export default function WithdrawsPage() { setSearchDraft(''); setKeyword(''); setDateRange(null); - setDateField('created_at'); - setSortBy('created_at'); setSortOrder('desc'); - setQuickFilter(undefined); - setSource(undefined); - }; - - const applyQuickFilter = (value?: string) => { - setQuickFilter(value); - const targetStatus = value ? QUICK_FILTER_STATUS[value] : undefined; - if (targetStatus) setActiveStatus(targetStatus); - }; - - const changeStatus = (status: string) => { - setActiveStatus(status); - setQuickFilter((current) => { - if (!current) return current; - const targetStatus = QUICK_FILTER_STATUS[current]; - if (!targetStatus || status === targetStatus) return current; - return undefined; - }); }; const loadSummary = useCallback(async () => { @@ -520,12 +457,6 @@ export default function WithdrawsPage() { width: 120, render: (v: number) => {yuan(v)}, }, - { - title: '提现类型', - dataIndex: 'source', - width: 110, - render: (v: string) => {SOURCE_LABEL[v] || v}, - }, { title: '累计提现', dataIndex: 'cumulative_success_cents', @@ -798,7 +729,7 @@ export default function WithdrawsPage() { { const count = summaryCount(summary, tab.key); return { @@ -820,89 +751,55 @@ export default function WithdrawsPage() { align="start" style={{ width: '100%', - justifyContent: 'space-between', marginBottom: 12, paddingBottom: 12, borderBottom: '1px solid #f0f0f0', }} > - - } - placeholder="用户手机号" - value={searchDraft} - style={{ width: 240 }} - onChange={(e) => { - const value = e.target.value; - setSearchDraft(value); - if (!value) setKeyword(''); - }} - onSearch={(value) => setKeyword(value.trim())} - /> - } - options={QUICK_FILTER_OPTIONS} - onChange={applyQuickFilter} - /> - } - options={SORT_OPTIONS} - onChange={(value: 'created_at' | 'amount_cents') => setSortBy(value)} - /> - } + options={[ + { value: 'desc', label: '倒序' }, + { value: 'asc', label: '正序' }, + ]} + onChange={(value: 'asc' | 'desc') => setSortOrder(value)} + /> + {canManage && selectedOrders.length > 0 && ( `共 ${t} 条`, onChange: onPageChange, }} - scroll={{ x: 1460 }} + scroll={{ x: 1350 }} onRow={(record) => ({ onClick: () => openDetail(record), style: { cursor: 'pointer' }, @@ -1006,11 +903,6 @@ export default function WithdrawsPage() { {yuan(detail.order.amount_cents)} - - - {SOURCE_LABEL[detail.order.source] || detail.order.source} - - {detail.order.user_name || '-'}