Compare commits

...

8 Commits

Author SHA1 Message Date
linkeyu 46587f6b88 优化:明确提现审核状态与超时订单处理
重新梳理微信提现配置和现金账本提示层级,增加检测反馈与校验时间,并将批量对账改为更明确的超时订单处理说明。移除自动查单关闭提示,避免把非阻断运维状态展示为业务异常。
2026-07-24 11:04:25 +08:00
linkeyu ecf8150cfc 修复:优化广告播放状态文案 (#65)
## 修改内容
- 广告播放状态“未满10秒”调整为“观看时长不足”
- 聚合播放状态“混合状态”调整为“部分完成”
- 保持后端状态码、接口结构和判定逻辑不变

## 影响范围
- 仅修改后台广告收益页的前端展示文案

## 验证
- npm run build

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #65
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-22 18:21:39 +08:00
linkeyu 1559d4faf0 修复:激励视频未完成时预估收益显示为零 (#64)
## 问题
后台明细需要与后端有效收益口径一致:激励视频提前关闭或播放时长不足时显示 0,不能继续展示原始 eCPM 折算金额。

## 修改
- 对 reward_video + closed_early/too_short 做防御性归零显示
- 更新收益口径说明和类型注释
- 顶部合计、趋势和分类统计使用后端修正后的有效收益

## 关联后端
WonderableAI/shaguabijia-app-server#160

## 验证
- npm ci --legacy-peer-deps
- npm run build:通过(包含 TypeScript 与页面构建检查)

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #64
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-22 17:38:47 +08:00
linkeyu 9d32234015 后台前端:新增“监控审计”一级目录 (#63)
## 变更
- 左侧导航新增一级目录“监控审计”。
- 将设备存活、埋点成功率、埋点日志和审计日志统一迁入该目录。
- 从“看板”移除技术监控项,并取消埋点日志、审计日志的独立一级入口。
- 保留现有页面权限过滤逻辑:无可见子项时不会展示该目录。

## 验证
- `npm run build` 通过,Next.js 编译、lint 和 TypeScript 检查均成功。

## 后端配套
- WonderableAI/shaguabijia-app-server#159

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #63
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-22 17:22:23 +08:00
linkeyu a2a8451aec 修复:领券记录百分比状态配色 (#61)
## 改动
- 将领券记录表格的「点位成功率」列改名为「百分比」
- 全部点位成功的 x/x 使用与「完成」相同的绿色
- 未全部成功的 x/x 使用与「中途退出」相同的警示色
- 保留点击 x/x 查看点位明细的交互

## 验证
- 提交前已执行 git pull --rebase --autostash origin main
- npm run build

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #61
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-22 13:56:22 +08:00
linkeyu 578819a284 fix(admin): 使用后端常规任务金币汇总 (#60)
## 修改

- 大盘“常规任务金币”直接使用后端 `regular_task_coin_total`
- 移除前端自行将签到、签到膨胀和任务金币相加的兜底逻辑
- 补充卡片口径说明:每日签到、历史签到膨胀、通知/其他任务、上报更低价、反馈采纳

## 验证

- `npx tsc --noEmit`:通过
- `npm run build`:通过

配套后端 PR 会将 `regular_task_coin_total` 改为明确白名单聚合。

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #60
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-22 13:56:13 +08:00
linkeyu efa443ea8a 修复:拆分广告发奖状态与播放状态 (#59)
## 改动
- 将广告收益列表中的混合状态拆为「发奖状态」和「广告播放状态」两列
- 聚合行按全部子记录展示「已发 / 部分已发 / 未发」及「已完成 / 混合状态」
- 保留次数超限、缺 eCPM、未满 10 秒、提前关闭等原因的悬停说明
- 未知后端状态明确显示为「未知」,避免误判为已完成

## 验证
- npm run build

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #59
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-22 12:09:54 +08:00
linkeyu f3cfd622a7 feat(admin): 领券点位分数支持查看明细 (#56)
## 变更内容
- 领券记录列表的点位成功率展示为成功数/尝试数,例如 8/8
- 点击分数弹出点位明细
- 逐条展示点位名称、ID、成功、已领、失败或跳过状态
- 失败点位额外展示失败原因
- 无逐券埋点的旧记录显示 -

## 依赖
- 依赖 app-server #153 提供 point_success_count、point_total_count 和 point_details

## 验证
- npx tsc --noEmit
- npm run build
- 本地实际验证 8/8 全部成功和 7/8 含失败原因两种状态

---------

Co-authored-by: guke <guke@wonderable.ai>
Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #56
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
2026-07-22 11:46:47 +08:00
6 changed files with 339 additions and 75 deletions
+111 -24
View File
@@ -66,21 +66,101 @@ const APP_TAG: Record<string, { color: string; label: string }> = {
test: { color: 'default', label: '测试应用' },
};
// 发奖状态 → 颜色 + 中文(含「不发金币的原因」:提前关闭/未满10秒/缺eCPM/次数超限)
const STATUS_TAG: Record<string, { color: string; label: string }> = {
granted: { color: 'green', label: '已发' },
capped: { color: 'orange', label: '次数超限' },
ecpm_missing: { color: 'red', label: '缺 eCPM' },
too_short: { color: 'gold', label: '未满10秒' },
const REWARD_STATUS_HINT: Record<string, string> = {
granted: '已完成金币发放',
capped: '次数超限,未发金币',
ecpm_missing: '缺少有效 eCPM,未发金币',
too_short: '播放时长未达到发奖条件,未发金币',
closed_early: '用户提前关闭广告,未发金币',
};
const PLAYBACK_STATUS_TAG: Record<string, { color: string; label: string }> = {
completed: { color: 'green', label: '已完成' },
too_short: { color: 'gold', label: '观看时长不足' },
closed_early: { color: 'default', label: '提前关闭' },
unknown: { color: 'default', label: '未知' },
};
const STATUS_HINT: Record<string, string> = {
granted: '已满足当前客户端发奖条件并完成金币发放。',
too_short: '旧版 Draw 信息流观看不足 10 秒,不发金币;新版按观看比例发放时会记为已发。',
closed_early: '用户在达到发奖条件前主动关闭,不发金币。',
capped: '已达到次数上限,不再发金币。',
ecpm_missing: '缺少有效 eCPM,无法计算金币。',
};
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) {
return { color: 'default', label: '无记录', hint: '仅记录到广告展示,没有对应发奖记录。' };
}
const grantedCount = statuses.filter((status) => status === 'granted').length;
const reasonSummary = Object.entries(
statuses
.filter((status) => status !== 'granted')
.reduce<Record<string, number>>((counts, status) => {
counts[status] = (counts[status] ?? 0) + 1;
return counts;
}, {}),
)
.map(([status, count]) => `${REWARD_STATUS_HINT[status] ?? status} ${count}`)
.join('');
if (grantedCount === statuses.length) {
return { color: 'green', label: '已发', hint: `已完成金币发放${statuses.length > 1 ? ` ${statuses.length}` : ''}` };
}
if (grantedCount > 0) {
return {
color: 'blue',
label: '部分已发',
hint: `已发 ${grantedCount} 条,未发 ${statuses.length - grantedCount}${reasonSummary ? `${reasonSummary}` : ''}`,
};
}
return { color: 'default', label: '未发', hint: reasonSummary ? `${reasonSummary}` : '未发放金币。' };
}
function playbackStatusTag(row: AdRevenueRow) {
const statuses = rewardStatuses(row);
if (statuses.length === 0) {
return row.has_impression
? { color: 'blue', label: '仅展示', hint: '记录到广告展示,但没有对应的播放结果。' }
: { color: 'default', label: '无记录', hint: '没有可用的广告播放记录。' };
}
const playbackCounts = statuses.reduce<Record<string, number>>((counts, status) => {
const playbackStatus =
status === 'too_short' || status === 'closed_early'
? status
: status === 'granted' || status === 'capped' || status === 'ecpm_missing'
? 'completed'
: 'unknown';
counts[playbackStatus] = (counts[playbackStatus] ?? 0) + 1;
return counts;
}, {});
const entries = Object.entries(playbackCounts);
if (entries.length === 1) {
const [status, count] = entries[0];
const tag = PLAYBACK_STATUS_TAG[status];
return {
...tag,
hint: `${tag.label}${count > 1 ? ` ${count}` : ''}`,
};
}
const hint = entries
.map(([status, count]) => `${PLAYBACK_STATUS_TAG[status].label} ${count}`)
.join('');
return { color: 'purple', label: '部分完成', hint: `${hint}` };
}
const fmtFactorRange = (a: number | null, b: number | null) => {
if (a == null) return '-';
@@ -478,19 +558,25 @@ 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: '发奖状态',
dataIndex: 'status',
key: 'reward_status',
width: 100,
render: (s: string | null) => {
if (!s) return <Tooltip title="仅记录广告展示,没有对应发奖事件。"><Tag></Tag></Tooltip>;
const t = STATUS_TAG[s] ?? { color: 'default', label: s };
return <Tooltip title={STATUS_HINT[s]}><Tag color={t.color}>{t.label}</Tag></Tooltip>;
render: (_: unknown, row: AdRevenueRow) => {
const tag = rewardStatusTag(row);
return <Tooltip title={tag.hint}><Tag color={tag.color}>{tag.label}</Tag></Tooltip>;
},
},
{
title: '广告播放状态',
key: 'playback_status',
width: 120,
render: (_: unknown, row: AdRevenueRow) => {
const tag = playbackStatusTag(row);
return <Tooltip title={tag.hint}><Tag color={tag.color}>{tag.label}</Tag></Tooltip>;
},
},
{
@@ -532,7 +618,8 @@ export default function AdRevenueReportPage() {
'ecpm_yuan',
'revenue_yuan',
'actual_coin',
'status',
'reward_status',
'playback_status',
'ad_type',
'app_env',
'our_code_id',
@@ -618,7 +705,7 @@ export default function AdRevenueReportPage() {
<br />
<br />
广(onAdShow) eCPM ( ÷1000
),<b>广</b>;穿/,,
);<b> 0 </b>, eCPM 穿,
<b>穿</b> 0广ID / ,
<br />
<br />
+112 -12
View File
@@ -10,9 +10,11 @@ import {
DatePicker,
Divider,
Input,
Popover,
Row,
Select,
Space,
Spin,
Statistic,
Table,
Tag,
@@ -72,9 +74,23 @@ interface CouponDataRow {
app_env: string | null;
started_at: string;
claimed_count: number | null;
point_success_count: number | null;
point_total_count: number | null;
// 兼容旧后端的内嵌明细;新后端不再返回,改为点击后按 trace 加载。
point_details?: CouponPointDetail[];
trace_url: string | null;
ad_revenue_yuan: number | null; // 本次领券看的信息流广告预估收益(元);未填充为 null
}
interface CouponPointDetail {
coupon_id: string;
coupon_name: string | null;
status: string;
reason: string | null;
}
interface CouponPointDetailsOut {
trace_id: string;
items: CouponPointDetail[];
}
interface CouponDataReport {
date_from: string;
date_to: string;
@@ -116,6 +132,100 @@ const STATUS_TAG: Record<string, { color: string; label: string }> = {
abandoned: { color: 'orange', label: '中途退出' },
};
const POINT_STATUS_TAG: Record<string, { color: string; label: string }> = {
success: { color: 'success', label: '成功' },
already_claimed: { color: 'processing', label: '已领' },
failed: { color: 'error', label: '失败' },
skipped: { color: 'default', label: '跳过' },
};
function PointScorePopover({ row }: { row: CouponDataRow }) {
const { message } = App.useApp();
const [details, setDetails] = useState<CouponPointDetail[] | null>(row.point_details ?? null);
const [loading, setLoading] = useState(false);
const [loadError, setLoadError] = useState<string | null>(null);
if (row.point_success_count == null || row.point_total_count == null || row.point_total_count <= 0) {
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);
setLoadError(null);
try {
const response = await api.get<CouponPointDetailsOut>('/admin/api/coupon-data/point-details', {
params: { trace_id: row.trace_id },
});
setDetails(response.data.items);
} catch (error) {
const errorMessage = errMsg(error);
setLoadError(errorMessage);
message.error(errorMessage);
} finally {
setLoading(false);
}
};
return (
<Popover
trigger="click"
placement="bottomLeft"
title={`点位明细(${score}`}
onOpenChange={(open) => {
if (open) void loadDetails();
}}
content={(
<div style={{ width: 380, maxHeight: 360, overflowY: 'auto' }}>
{loading || (details === null && loadError === null) ? (
<Spin size="small" style={{ display: 'block', margin: '24px auto' }} />
) : loadError ? (
<Typography.Text type="danger"></Typography.Text>
) : details && details.length > 0 ? details.map((point, index) => {
const status = POINT_STATUS_TAG[point.status] ?? {
color: 'default', label: point.status,
};
return (
<div
key={`${point.coupon_id}-${index}`}
style={{
padding: '8px 0',
borderBottom: index < details.length - 1 ? '1px solid #f0f0f0' : undefined,
}}
>
<div style={{ display: 'flex', alignItems: 'flex-start', gap: 12 }}>
<div style={{ flex: 1, minWidth: 0 }}>
<Typography.Text>{point.coupon_name || point.coupon_id}</Typography.Text>
{point.coupon_name ? (
<div><Typography.Text type="secondary">{point.coupon_id}</Typography.Text></div>
) : null}
</div>
<Tag color={status.color} style={{ marginInlineEnd: 0 }}>{status.label}</Tag>
</div>
{point.reason ? (
<div style={{ marginTop: 4 }}>
<Typography.Text type="danger">{point.reason}</Typography.Text>
</div>
) : null}
</div>
);
}) : (
<Typography.Text type="secondary"></Typography.Text>
)}
</div>
)}
>
<Button type="link" size="small" style={{ height: 'auto', padding: 0, color: scoreColor }}>
{score}
</Button>
</Popover>
);
}
// ms → "1.5s"(空值显示 -)
const fmtSec = (ms: number | null | undefined): string =>
ms == null ? '-' : `${(ms / 1000).toFixed(1)}s`;
@@ -492,20 +602,10 @@ export default function CouponDataPage() {
render: (v: number | null) => fmtSec(v),
},
{
title: '点位成功率',
title: '百分比',
key: 'point_success_rate',
width: 110,
render: (_: unknown, r: CouponDataRow) => (
<Tooltip title="当前接口未返回本场应领点位及逐点结果,前端不使用全局均值冒充本场成功率。">
{r.trace_url ? (
<a href={r.trace_url} target="_blank" rel="noreferrer">
</a>
) : (
<Typography.Text type="secondary"></Typography.Text>
)}
</Tooltip>
),
render: (_: unknown, r: CouponDataRow) => <PointScorePopover row={r} />,
},
{
title: '广告收益',
+2 -6
View File
@@ -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="本期提现金额"
+11 -4
View File
@@ -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 目录对齐
+102 -28
View File
@@ -142,7 +142,7 @@ function actionLabel(action: string) {
'withdraw.approve': '审核通过',
'withdraw.reject': '审核拒绝',
'withdraw.refresh': '查单刷新',
'withdraw.reconcile': '批量对账',
'withdraw.reconcile': '处理超时订单',
};
return labels[action] || action;
}
@@ -182,8 +182,11 @@ export default function WithdrawsPage() {
const [activeStatus, setActiveStatus] = useState('reviewing');
const [summary, setSummary] = useState<WithdrawSummary | null>(null);
const [health, setHealth] = useState<WxpayHealthCheck | null>(null);
const [healthLoading, setHealthLoading] = useState(false);
const [healthCheckedAt, setHealthCheckedAt] = useState<number | null>(null);
const [ledger, setLedger] = useState<WithdrawLedgerCheck | null>(null);
const [ledgerLoading, setLedgerLoading] = useState(false);
const [ledgerCheckedAt, setLedgerCheckedAt] = useState<number | null>(null);
const [drawerOpen, setDrawerOpen] = useState(false);
const [detail, setDetail] = useState<WithdrawDetail | null>(null);
const [detailLoading, setDetailLoading] = useState(false);
@@ -255,21 +258,36 @@ export default function WithdrawsPage() {
}
}, []);
const loadHealth = useCallback(async () => {
const loadHealth = useCallback(async (showFeedback = false) => {
setHealthLoading(true);
try {
const { data } = await api.get<WxpayHealthCheck>('/admin/api/withdraws/health-check');
setHealth(data);
setHealthCheckedAt(Date.now());
if (showFeedback) {
message.success(data.ok ? '检测完成,微信提现配置正常' : '检测完成,仍有配置项需要处理');
}
} catch (e) {
message.error(errMsg(e));
} finally {
setHealthLoading(false);
}
}, []);
// 账本校验是全表对账、相对重,故只在进页时拉一次 + 提供手动按钮,不随每次写操作重算。
const loadLedger = useCallback(async () => {
const loadLedger = useCallback(async (showFeedback = false) => {
setLedgerLoading(true);
try {
const { data } = await api.get<WithdrawLedgerCheck>('/admin/api/withdraws/ledger-check');
setLedger(data);
setLedgerCheckedAt(Date.now());
if (showFeedback) {
if (data.ok) {
message.success('校验完成,现金账本正常');
} else {
message.warning('校验完成,发现现金账本异常');
}
}
} catch (e) {
message.error(errMsg(e));
} finally {
@@ -465,15 +483,16 @@ export default function WithdrawsPage() {
const reconcile = () => {
modal.confirm({
title: '批量对账?',
content: '扫描超过 15 分钟仍处于打款中的提现单,逐单向微信查实并归一化。',
okText: '开始对账',
title: '处理超时打款订单?',
content:
'将检查超过 15 分钟仍处于“打款中”的订单:微信已成功则更新为“已到账”;失败则退款;仍待用户确认的老单将撤销并退款;仍在处理中则保持不变。',
okText: '开始处理',
onOk: async () => {
try {
const { data } = await api.post<{ checked: number; resolved: number }>(
'/admin/api/withdraws/reconcile',
);
message.success(`对账完成: 检查 ${data.checked} 单,解决 ${data.resolved}`);
message.success(`处理完成:检查 ${data.checked} 单,更新 ${data.resolved}`);
await refreshAfterChange();
} catch (e) {
message.error(errMsg(e));
@@ -652,6 +671,10 @@ export default function WithdrawsPage() {
: '',
].filter(Boolean)
: [];
const payoutReady = Boolean(
health?.wxpay_configured && health.private_key_loadable && health.public_key_loadable,
);
const hasBlockingPayoutIssue = Boolean(health && !payoutReady);
return (
<div>
@@ -662,41 +685,62 @@ export default function WithdrawsPage() {
</div>
{canManage && (
<Button danger icon={<ReloadOutlined />} onClick={reconcile}>
</Button>
)}
</Space>
{(health || ledger) && (
{(hasBlockingPayoutIssue || (ledger && !ledger.ok)) && (
<Space direction="vertical" style={{ width: '100%', marginBottom: 16 }}>
{health && (
{health && hasBlockingPayoutIssue && (
<Alert
showIcon
type={health.ok ? 'success' : 'warning'}
message={health.ok ? '微信提现配置正常' : '微信提现配置需检查'}
type="warning"
message="当前环境无法执行微信打款"
description={
health.ok
? `自动对账已${health.auto_reconcile_enabled ? '开启' : '关闭'},每 ${health.auto_reconcile_interval_sec}s 扫描 ${health.auto_reconcile_older_than_minutes} 分钟前的打款中订单`
: health.issues.join('')
}
/>
)}
{ledger && (
<Alert
showIcon
type={ledger.ok ? 'success' : 'error'}
message={ledger.ok ? '现金账本校验正常' : '现金账本存在异常'}
description={
ledger.ok
? `现金 余额 ${yuan(ledger.cash_balance_total_cents)} / 流水 ${yuan(ledger.cash_transaction_total_cents)};邀请金 余额 ${yuan(ledger.invite_cash_balance_total_cents)} / 流水 ${yuan(ledger.invite_cash_transaction_total_cents)}`
: ledgerIssues.join('')
<Space direction="vertical" size={6}>
<Text></Text>
{healthCheckedAt && (
<Text type="secondary">
{dayjs(healthCheckedAt).format('HH:mm:ss')}
</Text>
)}
<details>
<summary style={{ color: '#1677ff', cursor: 'pointer' }}></summary>
<ul style={{ margin: '8px 0 0', paddingInlineStart: 20 }}>
{health.issues.map((issue) => (
<li key={issue} style={{ marginBottom: 4, overflowWrap: 'anywhere' }}>
{issue}
</li>
))}
</ul>
</details>
</Space>
}
action={
<Button
size="small"
icon={<ReloadOutlined />}
loading={healthLoading}
onClick={() => void loadHealth(true)}
>
</Button>
}
/>
)}
{ledger && !ledger.ok && (
<Alert
showIcon
type="error"
message="现金账本存在异常"
description={ledgerIssues.join('')}
action={
<Button
size="small"
icon={<ReloadOutlined />}
loading={ledgerLoading}
onClick={() => void loadLedger()}
onClick={() => void loadLedger(true)}
>
</Button>
@@ -706,6 +750,36 @@ export default function WithdrawsPage() {
</Space>
)}
{(health || ledger) && (
<Space
size={12}
wrap
style={{ width: '100%', justifyContent: 'flex-end', marginBottom: 12 }}
>
{health && payoutReady && <Tag color="success"></Tag>}
{ledger?.ok && (
<Space size={6}>
<CheckCircleOutlined style={{ color: '#52c41a' }} />
<Text strong></Text>
{ledgerCheckedAt && (
<Text type="secondary">
· {dayjs(ledgerCheckedAt).format('HH:mm:ss')}
</Text>
)}
<Button
type="link"
size="small"
icon={<ReloadOutlined />}
loading={ledgerLoading}
onClick={() => void loadLedger(true)}
>
</Button>
</Space>
)}
</Space>
)}
<Row gutter={12} style={{ marginBottom: 16 }}>
<Col xs={24} sm={12}>
<Card size="small">
+1 -1
View File
@@ -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;纯发奖行为空