Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ecf8150cfc | |||
| 1559d4faf0 | |||
| 9d32234015 | |||
| a2a8451aec | |||
| 578819a284 |
@@ -76,16 +76,28 @@ const REWARD_STATUS_HINT: Record<string, string> = {
|
||||
|
||||
const PLAYBACK_STATUS_TAG: Record<string, { color: string; label: string }> = {
|
||||
completed: { color: 'green', label: '已完成' },
|
||||
too_short: { color: 'gold', label: '未满10秒' },
|
||||
too_short: { color: 'gold', label: '观看时长不足' },
|
||||
closed_early: { color: 'default', label: '提前关闭' },
|
||||
unknown: { color: 'default', label: '未知' },
|
||||
};
|
||||
|
||||
const ZERO_REVENUE_REWARD_VIDEO_STATUSES = new Set(['closed_early', 'too_short']);
|
||||
|
||||
function rewardStatuses(row: AdRevenueRow): string[] {
|
||||
if (row.sub_rewards?.length) return row.sub_rewards.map((reward) => reward.status);
|
||||
return row.status ? [row.status] : [];
|
||||
}
|
||||
|
||||
function effectiveRevenueYuan(row: AdRevenueRow): number {
|
||||
if (
|
||||
row.ad_type === 'reward_video'
|
||||
&& rewardStatuses(row).some((status) => ZERO_REVENUE_REWARD_VIDEO_STATUSES.has(status))
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
return row.row_revenue_yuan ?? row.revenue_yuan;
|
||||
}
|
||||
|
||||
function rewardStatusTag(row: AdRevenueRow) {
|
||||
const statuses = rewardStatuses(row);
|
||||
if (!row.has_reward || statuses.length === 0) {
|
||||
@@ -147,7 +159,7 @@ function playbackStatusTag(row: AdRevenueRow) {
|
||||
const hint = entries
|
||||
.map(([status, count]) => `${PLAYBACK_STATUS_TAG[status].label} ${count} 条`)
|
||||
.join(';');
|
||||
return { color: 'purple', label: '混合状态', hint: `${hint}。` };
|
||||
return { color: 'purple', label: '部分完成', hint: `${hint}。` };
|
||||
}
|
||||
|
||||
const fmtFactorRange = (a: number | null, b: number | null) => {
|
||||
@@ -546,10 +558,8 @@ export default function AdRevenueReportPage() {
|
||||
width: 110,
|
||||
align: 'right',
|
||||
// 一次比价/领券聚合行用 row_revenue_yuan(该次发奖广告 eCPM 折算之和),其它行用展示侧 revenue_yuan
|
||||
render: (v: number, r: AdRevenueRow) => {
|
||||
const rev = r.row_revenue_yuan ?? v;
|
||||
return rev.toFixed(4);
|
||||
},
|
||||
// 激励视频提前关闭/时长不足时防御性显示 0,与后端有效收益口径一致。
|
||||
render: (_v: number, r: AdRevenueRow) => effectiveRevenueYuan(r).toFixed(4),
|
||||
},
|
||||
{
|
||||
title: '发奖状态',
|
||||
@@ -695,7 +705,7 @@ export default function AdRevenueReportPage() {
|
||||
<br />
|
||||
<br />
|
||||
「预估收益」为客户端在广告展示(onAdShow)时上报 eCPM 折算的预估值(每千次展示 ÷1000
|
||||
累加),<b>只要广告展示就计入、不论是否看完发奖</b>;穿山甲会过滤无效/过短曝光,故预估值可能偏高,
|
||||
累加);<b>激励视频提前关闭或播放时长不足时按 0 计</b>,其他有效展示按 eCPM 折算。穿山甲仍可能过滤无效曝光,
|
||||
<b>实际收益一律以穿山甲后台结算为准</b>。测试应用多为 0。「广告位ID / 来源应用」为本期新增,历史记录留空。
|
||||
<br />
|
||||
<br />
|
||||
|
||||
@@ -149,6 +149,10 @@ function PointScorePopover({ row }: { row: CouponDataRow }) {
|
||||
return <Typography.Text type="secondary">-</Typography.Text>;
|
||||
}
|
||||
const score = `${row.point_success_count}/${row.point_total_count}`;
|
||||
const scoreColor =
|
||||
row.point_success_count === row.point_total_count
|
||||
? STATUS_TAG.completed.color
|
||||
: STATUS_TAG.abandoned.color;
|
||||
const loadDetails = async () => {
|
||||
if (details !== null || loading) return;
|
||||
setLoading(true);
|
||||
@@ -215,7 +219,9 @@ function PointScorePopover({ row }: { row: CouponDataRow }) {
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
<Button type="link" size="small" style={{ height: 'auto', padding: 0 }}>{score}</Button>
|
||||
<Button type="link" size="small" style={{ height: 'auto', padding: 0, color: scoreColor }}>
|
||||
{score}
|
||||
</Button>
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
@@ -596,7 +602,7 @@ export default function CouponDataPage() {
|
||||
render: (v: number | null) => fmtSec(v),
|
||||
},
|
||||
{
|
||||
title: '点位成功率',
|
||||
title: '百分比',
|
||||
key: 'point_success_rate',
|
||||
width: 110,
|
||||
render: (_: unknown, r: CouponDataRow) => <PointScorePopover row={r} />,
|
||||
|
||||
@@ -499,12 +499,7 @@ export default function DashboardPage() {
|
||||
const tokenCostYuan = periodData?.comparison.token_cost_total_yuan ?? null;
|
||||
const couponRewardCoinTotal = periodData?.coins.coupon_reward_coin_total;
|
||||
const comparisonRewardCoinTotal = periodData?.coins.comparison_reward_coin_total;
|
||||
const signinCoinTotal = periodData?.coins.signin_coin_total;
|
||||
const signinBoostCoinTotal = periodData?.coins.signin_boost_coin_total;
|
||||
const taskCoinTotal = periodData?.coins.task_coin_total;
|
||||
const regularTaskCoinTotal =
|
||||
periodData?.coins.regular_task_coin_total ??
|
||||
((signinCoinTotal ?? 0) + (signinBoostCoinTotal ?? 0) + (taskCoinTotal ?? 0));
|
||||
const regularTaskCoinTotal = periodData?.coins.regular_task_coin_total;
|
||||
const cpsAvailable = data?.cps.available === true;
|
||||
const meituanCpsCommissionCents = data?.cps.meituan_commission_cents;
|
||||
const jdCpsCommissionCents = data?.cps.jd_commission_cents;
|
||||
@@ -1077,6 +1072,7 @@ export default function DashboardPage() {
|
||||
value={fmtInt(regularTaskCoinTotal)}
|
||||
delta={regularTaskCoinRatio.value}
|
||||
deltaTone={regularTaskCoinRatio.tone}
|
||||
hint="每日签到、历史签到膨胀、通知/其他任务、上报更低价和反馈采纳的实发金币之和。"
|
||||
/>
|
||||
<StatCard
|
||||
title="本期提现金额"
|
||||
|
||||
@@ -67,8 +67,6 @@ const NAV_GROUPS: NavGroup[] = [
|
||||
{ key: '/comparison-records', icon: <ProfileOutlined />, label: '比价记录' },
|
||||
{ key: '/coupon-data', icon: <GiftOutlined />, label: '领券记录' },
|
||||
{ key: '/cps', icon: <ShareAltOutlined />, label: 'CPS收益' },
|
||||
{ key: '/device-liveness', icon: <HeartOutlined />, label: '设备存活' },
|
||||
{ key: '/analytics-health', icon: <LineChartOutlined />, label: '埋点成功率' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -92,9 +90,18 @@ const NAV_GROUPS: NavGroup[] = [
|
||||
{ key: '/users', icon: <UserOutlined />, label: '用户管理' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'monitoring-audit',
|
||||
icon: <FileSearchOutlined />,
|
||||
label: '监控审计',
|
||||
children: [
|
||||
{ key: '/device-liveness', icon: <HeartOutlined />, label: '设备存活' },
|
||||
{ key: '/analytics-health', icon: <LineChartOutlined />, label: '埋点成功率' },
|
||||
{ key: '/event-logs', icon: <DatabaseOutlined />, label: '埋点日志' },
|
||||
{ key: '/audit-logs', icon: <FileSearchOutlined />, label: '审计日志' },
|
||||
],
|
||||
},
|
||||
{ key: '/admins', icon: <TeamOutlined />, label: '权限管理' },
|
||||
{ key: '/event-logs', icon: <DatabaseOutlined />, label: '埋点日志' },
|
||||
{ key: '/audit-logs', icon: <FileSearchOutlined />, label: '审计日志' },
|
||||
];
|
||||
|
||||
// 导航项 key(/dashboard)→ 权限页 key(dashboard),与后端 permissions.py 目录对齐
|
||||
|
||||
+1
-1
@@ -488,7 +488,7 @@ export interface AdRevenueRow {
|
||||
has_impression: boolean; // 是否有广告展示(信息流逐条展示=true,纯发奖行=false)
|
||||
impressions: number; // 本行展示条数 1/0(供日汇总、趋势图复用)
|
||||
ecpm: string | null; // 分/千次;展示行取展示值,纯发奖行取发奖采用值
|
||||
revenue_yuan: number; // 本次展示预估收益(元);纯发奖行=0
|
||||
revenue_yuan: number; // 本次有效展示预估收益(元);纯发奖、激励视频提前关闭/时长不足=0
|
||||
row_revenue_yuan?: number | null; // 主表逐行显示用:一次比价/领券聚合行=该次发奖广告 eCPM 折算之和;其它行空(回退 revenue_yuan)
|
||||
adn: string | null; // 实际填充 ADN;纯发奖行为空
|
||||
slot_id: string | null; // 底层 mediation rit;纯发奖行为空
|
||||
|
||||
Reference in New Issue
Block a user