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:
@@ -7,7 +7,7 @@ import type { TableProps } from 'antd';
|
||||
import {
|
||||
ArrowLeftOutlined, EditOutlined, ReloadOutlined, ThunderboltOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { accountApi, douyuApi, userApi, type AccountEventItem, type AccountOverview, type UserInfo } from '../api/modules';
|
||||
import { accountApi, douyuApi, userApi, type AccountEventItem, type AccountOverview, type HighValueAssetState, type HighValueStatus, type UserInfo } from '../api/modules';
|
||||
import AccountOverviewPanel from './douyu-tasks/AccountOverviewPanel';
|
||||
import { getErrorMessage } from '../utils/error';
|
||||
import { message } from '../utils/antdMessage';
|
||||
@@ -64,6 +64,33 @@ const BIND_TONES: Record<string, string> = {
|
||||
unknown: 'default',
|
||||
};
|
||||
|
||||
function highValueShortTag(label: string, status: HighValueAssetState) {
|
||||
if (status === 'owned') return <Tag color="orange">{label}已达上限</Tag>;
|
||||
if (status === 'available') return <Tag color="green">{label}可换</Tag>;
|
||||
return <Tag>{label}待确认</Tag>;
|
||||
}
|
||||
|
||||
function CurrentHighValue({ value }: { value: HighValueStatus }) {
|
||||
if (value.state === 'never') {
|
||||
return <Text type="secondary">尚未成功获取官方商城准入状态</Text>;
|
||||
}
|
||||
if (value.state === 'stale') {
|
||||
return (
|
||||
<Tooltip title={`上次检查:${formatTime(value.checked_at)}`}>
|
||||
<Tag>官方状态已过期,需要重新查询</Tag>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Tooltip title={`官方 storehome 检查于 ${formatTime(value.checked_at)}`}>
|
||||
<Space wrap size={4}>
|
||||
{highValueShortTag('白日梦', value.bairimeng)}
|
||||
{highValueShortTag('萌兔', value.mengtu)}
|
||||
</Space>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
function eventTag(type: string) {
|
||||
const style = EVENT_STYLE[type] ?? { label: type, color: 'default' };
|
||||
return <Tag color={style.color}>{style.label}</Tag>;
|
||||
@@ -665,6 +692,14 @@ export default function AccountDetailPage() {
|
||||
{ovError}
|
||||
</Text>
|
||||
)}
|
||||
{overview?.high_value && (
|
||||
<div style={{ marginBottom: 10 }}>
|
||||
<Text type="secondary" style={{ marginRight: 8 }}>
|
||||
当前官方准入:
|
||||
</Text>
|
||||
<CurrentHighValue value={overview.high_value} />
|
||||
</div>
|
||||
)}
|
||||
{overview?.overview_snapshot ? (
|
||||
<AccountOverviewPanel result={overview.overview_snapshot} />
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user