feat(douyu): 查询工作台增加宝典状态与到期时间 (v0.4.28)

This commit is contained in:
yml
2026-11-30 18:25:20 +08:00
parent a3529c54a2
commit ecb987fff0
8 changed files with 168 additions and 19 deletions
@@ -41,7 +41,7 @@ import {
} from '../api/modules';
import { usePermissions } from '../hooks/usePermissions';
import { getErrorMessage } from '../utils/error';
import { formatTime } from '../utils/time';
import { formatTime, formatUnixSeconds } from '../utils/time';
import { message } from '../utils/antdMessage';
import {
formatWaitSeconds,
@@ -734,6 +734,39 @@ export default function DouyuQueryWorkbenchPage() {
</Space>
),
},
{
title: '宝典状态 / 到期',
width: 190,
render: (_, record) => {
const expireSeconds = Number(record.elite_expire_time || 0);
const expired = expireSeconds > 0 && expireSeconds <= nowSeconds;
const opened = record.elite_opened === true && !expired;
const label = expired
? '已过期'
: opened
? '已开通'
: record.elite_opened === false
? '未开通'
: '未查询';
const color = expired ? 'error' : opened ? 'success' : 'default';
return (
<Space direction="vertical" size={2} style={{ lineHeight: 1.35 }}>
<Tag color={color} style={{ marginInlineEnd: 0 }}>
{label}
</Tag>
{expireSeconds > 0 ? (
<Text type="secondary" style={{ fontSize: 12 }}>
到期: {formatUnixSeconds(expireSeconds)}
</Text>
) : record.elite_opened === true ? (
<Text type="secondary" style={{ fontSize: 12 }}>
官方未返回到期时间
</Text>
) : null}
</Space>
);
},
},
{
title: '绑定角色',
width: 190,
@@ -900,7 +933,7 @@ export default function DouyuQueryWorkbenchPage() {
];
return (
<Space size={4}>
<Tooltip title={record.has_cookie === false ? '无 CK 需先重登' : '查询该账号鱼翅/积分/换绑'}>
<Tooltip title={record.has_cookie === false ? '无 CK 需先重登' : '查询该账号鱼翅/积分/宝典/换绑'}>
<Button
size="small"
type="link"
@@ -993,7 +1026,7 @@ export default function DouyuQueryWorkbenchPage() {
) : null}
</Space>
<Text type="secondary" style={{ fontSize: 13 }}>
支持导入斗鱼号(含 CK 失效/无 CK 账号),一键查询鱼翅、积分与换绑时间并导出 CSV;失效 CK 可选中后走人工预算重新登录。
支持导入斗鱼号(含 CK 失效/无 CK 账号),一键查询鱼翅、积分、宝典状态与换绑时间并导出 CSV;失效 CK 可选中后走人工预算重新登录。
</Text>
</Space>
@@ -1042,7 +1075,7 @@ export default function DouyuQueryWorkbenchPage() {
>
{selectedIds.length > 0
? `一键查询已选(${selectedIds.length})`
: '一键查询全部(鱼翅/积分/换绑)'}
: '一键查询全部(鱼翅/积分/宝典/换绑)'}
</Button>
<Button
icon={<SafetyCertificateOutlined />}
@@ -1176,7 +1209,7 @@ export default function DouyuQueryWorkbenchPage() {
loading={loading}
columns={columns}
dataSource={accounts}
scroll={{ x: 1480 }}
scroll={{ x: 1680 }}
rowSelection={{
selectedRowKeys: selectedIds,
preserveSelectedRowKeys: true,