feat(douyu): 高价值套装改用官方 storehome 三态判定
高价值套装的准入判定改为只认官方精英宝典 storehome 里账号级的 status:0=可兑换、1=已达兑换上限,商品缺失/接口异常=unknown。 兑换记录和积分记录只作历史展示,不参与是否拥有的判定。 原来的 high_value_owned(JSON 名单)无法区分「确认可兑换」和 「官方接口没返回商品」,也无法表达部分失败。改为两套独立状态 + 检查时间(迁移 20261106_0065),旧快照保守回填:status 缺失的 一律 unknown,不猜。 CK 判定失效时在数据层作废结论(降为 unknown),不是展示层降级。 官方 status 是账号维度的,但 CK 失效那段时间账号可能被别人手工 登录并兑换(这些号共享给客服),缓存里的「可兑换」就不成立了; 只在展示层降级的话,CK 恢复后那条陈旧的「可换」会重新变绿。 error(查不到)不作废 —— 查不到不等于账号出问题了。 高价值结论有自己的时钟:资料刷新除了看 overview_queried_at,还看 high_value_checked_at。两者会脱钩(商品接口单独失败时资料时间被刷新、 高价值时间停在原地),少了这一条这类账号会永久停在旧结论。作废的 结论按 6 小时慢速重试,但「从来没查到过」不因此重选 —— 那是接口对 该账号稳定失败,每轮都重选只会反复撞墙。 商城商品列表改用精英宝典的 manualID 拉取,不再寄生在电竞手册分支里 (否则没配电竞手册的配置就永远拉不到商城,三态全部停在待确认)。 筛选拆成三类「查不到」:unqueried(未查资料,旧口径不变)、 high_value_never(从未读到商城)、high_value_unknown(查过但结论 未知/过期)。之前第二类无处可寻 —— 它既不满足 unqueried 也不满足 high_value_unknown。
This commit is contained in:
@@ -2,7 +2,7 @@ import type { TableProps } from 'antd';
|
||||
import { Space, Button, Typography, Tag, Tooltip, Select, Popconfirm } from 'antd';
|
||||
import { CopyOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import type { NavigateFunction } from 'react-router-dom';
|
||||
import type { AccountItem } from '../../../api/modules';
|
||||
import type { AccountItem, HighValueAssetState, HighValueStatus } from '../../../api/modules';
|
||||
import { message } from '../../../utils/antdMessage';
|
||||
import { copyTextToClipboard } from '../../../utils/clipboard';
|
||||
import { formatTimeShort } from '../../../utils/time';
|
||||
@@ -39,6 +39,49 @@ function BindChip({ scope, status }: { scope: string; status?: string }) {
|
||||
);
|
||||
}
|
||||
|
||||
function highValueAssetTag(
|
||||
shortName: string,
|
||||
state: HighValueAssetState,
|
||||
) {
|
||||
if (state === 'owned') {
|
||||
return <Tag color="orange" style={{ marginInlineEnd: 0 }}>{shortName}已换</Tag>;
|
||||
}
|
||||
if (state === 'available') {
|
||||
return <Tag color="green" style={{ marginInlineEnd: 0 }}>{shortName}可换</Tag>;
|
||||
}
|
||||
return <Tag style={{ marginInlineEnd: 0 }}>{shortName}待确认</Tag>;
|
||||
}
|
||||
|
||||
function renderHighValueStatus(highValue: HighValueStatus | undefined) {
|
||||
if (!highValue || highValue.state === 'never') {
|
||||
return (
|
||||
<Tooltip title="尚未成功读取官方商城准入状态,点工具栏「批量一键查询」">
|
||||
<Text type="secondary">未查询</Text>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
if (highValue.state === 'stale') {
|
||||
return (
|
||||
<Tooltip
|
||||
title={`官方商城结果已过期,上次检查:${formatTimeShort(highValue.checked_at)}`}
|
||||
>
|
||||
<Tag>数据已过期</Tag>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
const checked = highValue.checked_at
|
||||
? `官方 storehome 检查于 ${formatTimeShort(highValue.checked_at)}`
|
||||
: '官方 storehome 状态';
|
||||
return (
|
||||
<Tooltip title={checked}>
|
||||
<Space size={4} wrap>
|
||||
{highValueAssetTag('白日梦', highValue.bairimeng)}
|
||||
{highValueAssetTag('萌兔', highValue.mengtu)}
|
||||
</Space>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
export interface UseAccountColumnsOptions {
|
||||
navigate: NavigateFunction;
|
||||
sortKey: AccountSortKey | '';
|
||||
@@ -270,39 +313,23 @@ export function buildAccountColumns({
|
||||
},
|
||||
{
|
||||
title: '高价值套装',
|
||||
dataIndex: 'high_value_owned',
|
||||
dataIndex: 'high_value',
|
||||
...sortProps('high_value', '两个都可兑换在前,未查询在后'),
|
||||
width: 170,
|
||||
render: (owned: string[] | null | undefined, record: AccountItem) => {
|
||||
if (owned === null || owned === undefined || !record.overview_queried_at) {
|
||||
return (
|
||||
<Tooltip title="尚未查询高价值套装准入状态,点工具栏「批量一键查询」">
|
||||
<Text type="secondary">未查询</Text>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
if (owned.length === 0) {
|
||||
return <Tag color="green">两个都可兑换</Tag>;
|
||||
}
|
||||
return (
|
||||
<Space size={4} wrap>
|
||||
{owned.map((n) => (
|
||||
<Tag key={n} color="orange">
|
||||
{n.replace(/^套装-/, '')} 已达上限
|
||||
</Tag>
|
||||
))}
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
width: 190,
|
||||
render: (_, record: AccountItem) => renderHighValueStatus(record.high_value),
|
||||
},
|
||||
{
|
||||
title: '兑换记录',
|
||||
title: '官方兑换记录',
|
||||
dataIndex: 'exchange_count',
|
||||
...sortProps('exchange', '未兑换在前'),
|
||||
...sortProps('exchange', '没有官方记录在前'),
|
||||
width: 170,
|
||||
render: (_, record: AccountItem) => {
|
||||
if (!record.exchange_count) {
|
||||
return <Text type="secondary">未兑换</Text>;
|
||||
return (
|
||||
<Tooltip title="官方兑换列表当前没有记录;官方会清理历史,不能据此推断账号没换过">
|
||||
<Text type="secondary">无官方记录</Text>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Tooltip title="点击查看全部官方兑换记录">
|
||||
|
||||
@@ -217,6 +217,58 @@ export function FilterPanel({
|
||||
setCurrentPage(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'high_value_unknown',
|
||||
label: '高价值待确认',
|
||||
icon: '❓',
|
||||
count: summary.high_value?.high_value_unknown,
|
||||
color: '#8c8c8c',
|
||||
tooltip: '官方商城未返回套装、查询部分失败,或上次结果已超过 7 天',
|
||||
active:
|
||||
highValueFilter === 'high_value_unknown' &&
|
||||
minPoints === undefined &&
|
||||
maxPoints === undefined &&
|
||||
minGold === undefined &&
|
||||
maxGold === undefined &&
|
||||
eliteOpened === undefined &&
|
||||
esportsOpened === undefined &&
|
||||
!roleBindStatus,
|
||||
onClick: () => {
|
||||
if (highValueFilter === 'high_value_unknown') {
|
||||
setHighValueFilter('');
|
||||
} else {
|
||||
onResetAdvancedFiltersState();
|
||||
setHighValueFilter('high_value_unknown');
|
||||
}
|
||||
setCurrentPage(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'high_value_never',
|
||||
label: '未读到商城',
|
||||
icon: '❔',
|
||||
count: summary.high_value?.high_value_never,
|
||||
color: '#8c8c8c',
|
||||
tooltip: '从未成功读到官方商城准入状态:商城接口失败,或未配置精英宝典 manualID',
|
||||
active:
|
||||
highValueFilter === 'high_value_never' &&
|
||||
minPoints === undefined &&
|
||||
maxPoints === undefined &&
|
||||
minGold === undefined &&
|
||||
maxGold === undefined &&
|
||||
eliteOpened === undefined &&
|
||||
esportsOpened === undefined &&
|
||||
!roleBindStatus,
|
||||
onClick: () => {
|
||||
if (highValueFilter === 'high_value_never') {
|
||||
setHighValueFilter('');
|
||||
} else {
|
||||
onResetAdvancedFiltersState();
|
||||
setHighValueFilter('high_value_never');
|
||||
}
|
||||
setCurrentPage(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'high_points',
|
||||
label: '积分≥300',
|
||||
|
||||
@@ -82,6 +82,8 @@ export const HIGH_VALUE_OPTIONS = [
|
||||
{ value: 'owned_mengtu', label: '✓ 已拥有萌兔' },
|
||||
{ value: 'both_owned', label: '✓ 两套均已拥有' },
|
||||
{ value: 'high_value_broken', label: '⚠️ 高价值但CK失效' },
|
||||
{ value: 'high_value_unknown', label: '❓ 高价值待确认/已过期' },
|
||||
{ value: 'high_value_never', label: '❓ 从未读到官方商城状态' },
|
||||
{ value: 'unqueried', label: '❓ 未查过资料' },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user