Compare commits

..

6 Commits

Author SHA1 Message Date
linkeyu 9df6a2d792 功能:展示比价记录是否下单
在比价记录的省金额列后新增是否下单列,并同步接口类型。
2026-07-27 14:56:55 +08:00
linkeyu f63378ebd4 修复纯展示广告明细类型字段缺失 (#86)
## 问题

impressionOnlyDetail 返回 AdRevenueDetailRow 时缺少 AdRevenueRecord 的必填字段 adn 和 slot_id,导致 next build 在类型检查阶段失败。

## 修复

- 从 AdRevenueRow 透传 adn
- 从 AdRevenueRow 透传 slot_id
- 保留 source_adn 的现有展示口径

## 验证

- npm run build 通过
- TypeScript 类型检查通过
- 生产静态页面生成通过

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #86
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-27 14:18:40 +08:00
linkeyu 10b82ad564 优化用户反馈设备信息展示 (#85)
## 改动说明
- 反馈列表优先展示可读手机型号
- 同时展示原始硬件编码与厂商信息
- 厂商系统版本和 Android 版本分层展示

## 验证
- Next.js 生产构建通过

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #85
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-27 13:33:53 +08:00
linkeyu f76440cdbf 优化:将空计算因子显示为可读状态 (#82)
## 本次改动

- 因子1、因子2、LT累计条数为空时显示对应的可读发奖状态
- 支持“观看时长不足”“提前关闭”“次数超限”“eCPM 缺失”“仅展示”等状态
- 已发奖但计算字段异常缺失时显示“计算数据缺失”
- 将纯展示事件统一为逐条明细表,避免空值被误认为数据丢失

## 说明

只改变后台展示,不改变金币公式、实发结果或 LT 累计规则。

## 验证

TypeScript `--noEmit` 检查通过。

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #82
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-27 11:51:18 +08:00
linkeyu 5373e3735c 优化比价记录用户信息显示颜色 (#83)
## 改动说明
- 比价记录列表中的手机号和用户名改为蓝色文本
- 保留原有整行点击行为,继续打开比价记录侧边栏
- 不新增用户详情页跳转

## 验证
- TypeScript 类型检查通过
- 本地确认用户信息为蓝色且不包含详情页链接

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #83
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-27 11:36:50 +08:00
linkeyu 590f59dee9 修复:看视频统计包含提现视频 (#79)
## 本次改动

- “看视频收益”合并福利视频与提现视频收益
- “看视频条数”合并两类视频展示记录
- “看视频 eCPM”按合并后的总收益和总展示数计算

## 范围

仅修改 `src/app/(main)/ad-revenue-report/page.tsx`;服务端已分别提供两类 `type_stats`,无需改动。

---------

Co-authored-by: guke <guke@wonderable.ai>
Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #79
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-27 11:36:36 +08:00
4 changed files with 116 additions and 29 deletions
+80 -23
View File
@@ -9,7 +9,6 @@ import {
Card,
Col,
DatePicker,
Descriptions,
Divider,
InputNumber,
Modal,
@@ -192,7 +191,63 @@ const LT_FACTOR_ROWS = [
{ key: '5', lt: '第 11 条及以后', factor: 1.0 },
];
type AdRevenueDetailRow = AdRevenueRecord & { source_adn?: string | null };
type AdRevenueDetailRow = AdRevenueRecord & {
source_adn?: string | null;
is_impression_only?: boolean;
};
const FORMULA_EMPTY_STATUS_LABEL: Record<string, string> = {
capped: '次数超限',
ecpm_missing: 'eCPM 缺失',
too_short: '观看时长不足',
closed_early: '提前关闭',
impression_only: '仅展示',
};
// 未发奖记录用可读状态代替空值,避免误认为数据丢失;悬停时说明为何没有计算因子。
function renderFormulaValue(value: string | number, row: AdRevenueDetailRow) {
if (value !== '-') return value;
const isGrantedButMissing = row.status === 'granted';
const reason = isGrantedButMissing
? '该记录标记为已发奖,但计算因子缺失,需要进一步排查'
: row.is_impression_only
? '该记录只有广告展示,没有对应发奖记录'
: REWARD_STATUS_HINT[row.status] ?? `发奖状态为 ${row.status || '未知'}`;
const statusLabel = isGrantedButMissing
? '计算数据缺失'
: (FORMULA_EMPTY_STATUS_LABEL[row.status] ?? row.status) || '未进入计算';
return (
<Tooltip
title={isGrantedButMissing
? reason
: `${reason};未进入金币计算,不占用 LT 累计条数,因此不展示因子。`}
>
<span>{statusLabel}</span>
</Tooltip>
);
}
function impressionOnlyDetail(row: AdRevenueRow): AdRevenueDetailRow {
return {
record_id: 0,
created_at: row.created_at,
status: 'impression_only',
ecpm: row.ecpm,
ecpm_factor: null,
units: 0,
lt_index_start: null,
lt_index_end: null,
lt_factor_start: null,
lt_factor_end: null,
expected_coin: 0,
actual_coin: 0,
matched: true,
adn: row.adn,
slot_id: row.slot_id,
source_adn: row.adn,
is_impression_only: true,
};
}
// 展开行(逐条事件展开)- 该条的发奖复算明细(还原金币审计的 eCPM/因子1/份数/LT/因子2 等列)
const DETAIL_COLUMNS: ColumnsType<AdRevenueDetailRow> = [
@@ -219,18 +274,25 @@ const DETAIL_COLUMNS: ColumnsType<AdRevenueDetailRow> = [
render: (v: string | null) => (v == null || Number.isNaN(Number(v)) ? '-' : (Number(v) / 100 / 1000).toFixed(4)),
},
{ title: '实发金币数', dataIndex: 'actual_coin', width: 100 },
{ title: '因子1', dataIndex: 'ecpm_factor', width: 70, render: (v: number | null) => v ?? '-' },
{
title: '因子1',
dataIndex: 'ecpm_factor',
width: 70,
render: (v: number | null, row: AdRevenueDetailRow) => renderFormulaValue(v ?? '-', row),
},
{
title: '因子2',
key: 'lt_factor',
width: 90,
render: (_: unknown, r: AdRevenueDetailRow) => fmtFactorRange(r.lt_factor_start, r.lt_factor_end),
render: (_: unknown, row: AdRevenueDetailRow) =>
renderFormulaValue(fmtFactorRange(row.lt_factor_start, row.lt_factor_end), row),
},
{
title: 'LT累计条数',
key: 'lt_index',
width: 100,
render: (_: unknown, r: AdRevenueDetailRow) => fmtIndexRange(r.lt_index_start, r.lt_index_end),
render: (_: unknown, row: AdRevenueDetailRow) =>
renderFormulaValue(fmtIndexRange(row.lt_index_start, row.lt_index_end), row),
},
];
@@ -1150,24 +1212,19 @@ export default function AdRevenueReportPage() {
</div>
) : (
<div>
<Typography.Text strong></Typography.Text>{' '}
<Typography.Text type="secondary">(,,)</Typography.Text>
<Descriptions size="small" column={3} bordered style={{ marginTop: 8 }}>
<Descriptions.Item label="时间">{formatUtcTime(r.created_at)}</Descriptions.Item>
<Descriptions.Item label="eCPM(分)">{r.ecpm ?? '-'}</Descriptions.Item>
<Descriptions.Item label="eCPM(元)">
{r.ecpm != null && !Number.isNaN(Number(r.ecpm))
? (Number(r.ecpm) / 100).toFixed(2)
: '-'}
</Descriptions.Item>
<Descriptions.Item label="预估收益(元)">
{r.has_impression ? r.revenue_yuan.toFixed(4) : '-'}
</Descriptions.Item>
<Descriptions.Item label="底层 ADN">{r.adn ?? '-'}</Descriptions.Item>
<Descriptions.Item label="底层代码位(rit)">{r.slot_id ?? '-'}</Descriptions.Item>
<Descriptions.Item label="我方代码位">{r.our_code_id ?? '-'}</Descriptions.Item>
<Descriptions.Item label="来源应用">{r.app_env ?? '-'}</Descriptions.Item>
</Descriptions>
<Typography.Text strong>广</Typography.Text>{' '}
<Typography.Text type="secondary">
( 1 · 0 / 0)
</Typography.Text>
<Table<AdRevenueDetailRow>
style={{ marginTop: 8 }}
rowKey="record_id"
columns={DETAIL_COLUMNS}
dataSource={[impressionOnlyDetail(r)]}
pagination={false}
size="small"
scroll={{ x: 900 }}
/>
</div>
),
}}
+10 -2
View File
@@ -237,9 +237,9 @@ export default function ComparisonRecordsPage() {
key: 'user',
width: 140,
render: (_, r) => (
<div>
<div style={{ color: '#1677ff' }}>
<div>{r.phone || `#${r.user_id}`}</div>
{r.nickname && <div style={{ color: '#999', fontSize: 12 }}>{r.nickname}</div>}
{r.nickname && <div style={{ fontSize: 12 }}>{r.nickname}</div>}
</div>
),
},
@@ -298,6 +298,14 @@ 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',
+22 -4
View File
@@ -122,13 +122,31 @@ const renderReview = (f: Feedback) => {
// 机型 / OS版本(提交反馈时的端环境;改版前历史反馈无 → -)
const renderDeviceOs = (f: Feedback) => {
const os = [f.android_version ? `Android ${f.android_version}` : null, f.rom_name]
const modelName = f.device_model_name || f.device_model;
const rawModel =
f.device_model_name && f.device_model_name !== f.device_model ? f.device_model : null;
const romHasVersion = /\d/.test(f.rom_name || '');
const vendorOs = [
f.rom_name,
f.rom_version && !romHasVersion ? f.rom_version : null,
]
.filter(Boolean)
.join(' ');
const os = [
vendorOs || null,
f.android_version ? `Android ${f.android_version}` : null,
]
.filter(Boolean)
.join(' · ');
if (!f.device_model && !os) return <Text type="secondary">-</Text>;
if (!modelName && !os) return <Text type="secondary">-</Text>;
return (
<Space direction="vertical" size={0}>
<Text>{f.device_model || '-'}</Text>
<Text>{modelName || '-'}</Text>
{rawModel ? (
<Text type="secondary" style={{ fontSize: 12 }}>
{[f.device_manufacturer, rawModel].filter(Boolean).join(' · ')}
</Text>
) : null}
{os ? (
<Text type="secondary" style={{ fontSize: 12 }}>
{os}
@@ -352,7 +370,7 @@ export default function FeedbacksPage() {
{
title: '机型 / OS版本',
key: 'device',
width: 150,
width: 180,
render: (_: unknown, f: Feedback) => renderDeviceOs(f),
},
{
+4
View File
@@ -377,7 +377,10 @@ export interface Feedback {
// 提交端环境快照:提交版本号 / 机型OS版本;改版前的历史反馈为 null
app_version: string | null;
device_model: string | null;
device_model_name: string | null;
device_manufacturer: string | null;
rom_name: string | null;
rom_version: number | null;
android_version: string | null;
// 联表瞬态:展示完整手机号(点手机号查该用户全部反馈)
phone: string | null;
@@ -446,6 +449,7 @@ 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;