Compare commits

..

4 Commits

Author SHA1 Message Date
guke 497ea36346 Merge branch 'main' into codex/price-report-badge-refresh 2026-07-27 16:03:04 +08:00
linkeyu c3b2aabc4d 合并:解决审核红点刷新冲突
同步最新主分支,保留邀请提现等新增页面,并继续在聚焦、页面恢复可见及定时轮询时同步低价审核、提现审核与用户反馈数据。
2026-07-27 15:17:23 +08:00
linkeyu 52acff8243 修复:同步反馈与提现审核状态
补充用户反馈页自动刷新,并让公共红点支持邀请提现与其他提现独立统计。
2026-07-27 10:20:03 +08:00
linkeyu 8c5e6bcef8 修复:同步低价审核红点与列表数据
进入页面、窗口重新聚焦及标签页恢复可见时刷新审核数据,并在页面可见期间每分钟同步一次,避免已无待审核记录时仍显示旧红点。
2026-07-27 10:09:56 +08:00
3 changed files with 5 additions and 63 deletions
+4 -54
View File
@@ -46,41 +46,6 @@ const fmtTok = (inTok: number | null, outTok: number | null) =>
inTok == null && outTok == null ? '-' : `${inTok ?? 0}/${outTok ?? 0}`;
const fmtRate = (value: number | null) => (value == null ? '-' : `${(value * 100).toFixed(1)}%`);
function deviceName(record: ComparisonRecordListItem): string {
return record.device_model_name || record.device_model || '-';
}
function romName(record: ComparisonRecordListItem): string {
return [
record.rom_vendor,
record.rom_name,
record.rom_version != null ? String(record.rom_version) : null,
]
.filter(Boolean)
.join(' ') || '-';
}
function renderDevice(record: ComparisonRecordListItem): ReactNode {
const readableName = deviceName(record);
const showRawModel =
record.device_model_name
&& record.device_model
&& record.device_model_name !== record.device_model;
return (
<Space direction="vertical" size={0}>
<span>{readableName}</span>
{showRawModel ? (
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
{record.device_model}
</Typography.Text>
) : null}
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
{romName(record)}
</Typography.Text>
</Space>
);
}
// LLM 价格快照只展示 prices 里各模型的单价(元/每百万 token),忽略 mode/_source 等元字段。
function llmPriceRows(snapshot: Record<string, unknown> | null): string[] {
const prices = snapshot?.prices;
@@ -333,14 +298,6 @@ export default function ComparisonRecordsPage() {
<b style={{ color: r.saved_amount_cents > 0 ? '#3f8600' : '#999' }}>{yuan(r.saved_amount_cents)}</b>
),
},
{
title: '是否下单',
dataIndex: 'ordered',
width: 84,
render: (ordered: boolean) => (
<Tag color={ordered ? 'green' : 'default'}>{ordered ? '已下单' : '未下单'}</Tag>
),
},
{ title: 'LLM', dataIndex: 'llm_call_count', width: 56, render: (v) => v ?? '-' },
{
title: 'TOKEN',
@@ -351,9 +308,9 @@ export default function ComparisonRecordsPage() {
{
title: '机型/ROM',
key: 'device',
width: 180,
width: 150,
ellipsis: true,
render: (_, r) => renderDevice(r),
render: (_, r) => [r.device_model, r.rom_name].filter(Boolean).join(' / ') || '-',
},
{
title: 'traceid',
@@ -542,15 +499,8 @@ export default function ComparisonRecordsPage() {
<Card size="small" title="设备环境">
<Descriptions size="small" column={2}>
<Descriptions.Item label="机型">
{deviceName(detail)}
{detail.device_model_name && detail.device_model_name !== detail.device_model
? `${[detail.device_manufacturer, detail.device_model].filter(Boolean).join(' · ')}`
: detail.device_manufacturer
? `${detail.device_manufacturer}`
: ''}
</Descriptions.Item>
<Descriptions.Item label="ROM">{romName(detail)}</Descriptions.Item>
<Descriptions.Item label="机型">{detail.device_model || '-'}{detail.device_manufacturer || '-'}</Descriptions.Item>
<Descriptions.Item label="ROM">{[detail.rom_vendor, detail.rom_name, detail.rom_version].filter(Boolean).join(' ') || '-'}</Descriptions.Item>
<Descriptions.Item label="Android">{detail.android_version || '-'}SDK {detail.android_sdk ?? '-'}</Descriptions.Item>
<Descriptions.Item label="App 版本">{detail.app_version || '-'}{detail.app_version_code ?? '-'}</Descriptions.Item>
<Descriptions.Item label="源 App 版本" span={2}>{detail.source_app_version || '-'}</Descriptions.Item>
@@ -124,10 +124,7 @@ function summaryCount(summary: WithdrawSummary | null, key: string) {
if (!summary) return undefined;
if (key === 'reviewing') return summary.reviewing_count;
if (key === 'pending') return summary.pending_count;
if (key === 'success') return summary.success_count;
if (key === 'rejected') return summary.rejected_count;
if (key === 'failed') return summary.failed_count;
if (key === 'all') return summary.total_count;
return undefined;
}
+1 -6
View File
@@ -167,10 +167,7 @@ export interface WithdrawSummary {
reviewing_count: number;
reviewing_amount_cents: number;
pending_count: number;
success_count: number;
rejected_count: number;
failed_count: number;
total_count: number;
today_success_count: number;
today_success_amount_cents: number;
today_rejected_count: number;
@@ -457,7 +454,6 @@ export interface ComparisonRecordListItem {
source_price_cents: number | null;
best_price_cents: number | null;
saved_amount_cents: number | null;
ordered: boolean;
total_ms: number | null;
step_count: number | null;
llm_call_count: number | null;
@@ -466,10 +462,8 @@ export interface ComparisonRecordListItem {
output_tokens: number | null;
llm_cost_yuan: number | null; // 后端按「当时价」冻结的实际成本(元);旧记录 null → 「成本」列回退估算
device_model: string | null;
device_model_name: string | null;
rom_vendor: string | null;
rom_name: string | null;
rom_version: number | null;
android_version: string | null;
app_version: string | null;
ad_revenue_yuan: number; // 本次比价看的信息流广告预估收益(元)
@@ -520,6 +514,7 @@ export interface ComparisonRecordDetail extends ComparisonRecordListItem {
comparison_results: Record<string, unknown>[];
skipped_dish_names: string[];
device_manufacturer: string | null;
rom_version: number | null;
android_sdk: number | null;
app_version_code: number | null;
source_app_version: string | null;