Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 281cfdb0e4 | |||
| 2727eaa929 | |||
| af74ecf9d3 |
@@ -0,0 +1,84 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
// 点收益报表里的用户手机号 → 半屏抽屉展示该用户的广告收益详情(统计卡 + 金币记录)。
|
||||||
|
// 复用「提现详情」里的 UserRewardPanel(数据走 /users/{id}/reward-stats + /coin-records);
|
||||||
|
// 用户基本信息(昵称/注册时间/钱包)取自 /users/{id} 概览。抽屉样式(width 50% 半屏)与提现详情一致。
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { Drawer } from 'antd';
|
||||||
|
import { api } from '@/lib/api';
|
||||||
|
import type { WithdrawUserSnapshot } from '@/lib/types';
|
||||||
|
import UserRewardPanel from '../withdraws/UserRewardPanel';
|
||||||
|
|
||||||
|
// GET /admin/api/users/{id} 概览里我们要用到的子集(前端未单独定义 AdminUserOverview 类型)。
|
||||||
|
interface UserOverviewResp {
|
||||||
|
user: {
|
||||||
|
id: number;
|
||||||
|
phone: string;
|
||||||
|
nickname: string | null;
|
||||||
|
status: string;
|
||||||
|
wechat_nickname: string | null;
|
||||||
|
created_at: string;
|
||||||
|
last_login_at: string;
|
||||||
|
};
|
||||||
|
cash_balance_cents: number;
|
||||||
|
withdraw_total: number;
|
||||||
|
withdraw_success_cents: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
open: boolean;
|
||||||
|
onClose: () => void;
|
||||||
|
userId: number | null;
|
||||||
|
phone: string | null; // 报表行已有的手机号:概览拉取失败时兜底展示
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function UserAdRevenueDrawer({ open, onClose, userId, phone }: Props) {
|
||||||
|
// UserRewardPanel 的 user 快照:它只读 phone/nickname/wechat_nickname/created_at,其余按 snapshot 形状补齐。
|
||||||
|
const [user, setUser] = useState<WithdrawUserSnapshot | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!open || userId == null) return;
|
||||||
|
let alive = true;
|
||||||
|
setUser(null);
|
||||||
|
api
|
||||||
|
.get<UserOverviewResp>(`/admin/api/users/${userId}`)
|
||||||
|
.then((r) => {
|
||||||
|
if (!alive) return;
|
||||||
|
const o = r.data;
|
||||||
|
setUser({
|
||||||
|
id: o.user.id,
|
||||||
|
phone: o.user.phone,
|
||||||
|
nickname: o.user.nickname,
|
||||||
|
status: o.user.status,
|
||||||
|
wechat_nickname: o.user.wechat_nickname, // 概览接口已返回微信昵称
|
||||||
|
wechat_avatar_url: null,
|
||||||
|
created_at: o.user.created_at,
|
||||||
|
last_login_at: o.user.last_login_at,
|
||||||
|
cash_balance_cents: o.cash_balance_cents,
|
||||||
|
withdraw_total: o.withdraw_total,
|
||||||
|
withdraw_success_cents: o.withdraw_success_cents,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// 概览失败:退回只带手机号,昵称/注册天数显示「-」,不阻塞统计/金币记录(它们由 userId 独立拉)
|
||||||
|
if (alive) setUser(phone ? ({ phone } as WithdrawUserSnapshot) : null);
|
||||||
|
});
|
||||||
|
return () => {
|
||||||
|
alive = false;
|
||||||
|
};
|
||||||
|
}, [open, userId, phone]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Drawer
|
||||||
|
title={`用户广告收益详情${phone ? ` · ${phone}` : ''}`}
|
||||||
|
width="50%"
|
||||||
|
open={open}
|
||||||
|
onClose={onClose}
|
||||||
|
destroyOnHidden
|
||||||
|
>
|
||||||
|
{/* userId 就绪即渲染;UserRewardPanel 内部按 userId 自行拉统计与金币记录,user 基本信息随后补上。
|
||||||
|
statsVariant="ad":统计区只显示 6 项看广告统计(累计提现/现金余额/激励视频观看数+eCPM/draw观看数+eCPM) */}
|
||||||
|
{userId != null && <UserRewardPanel userId={userId} user={user} statsVariant="ad" />}
|
||||||
|
</Drawer>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -40,13 +40,15 @@ import type {
|
|||||||
AdRevenueRow,
|
AdRevenueRow,
|
||||||
AdRevenueTypeStat,
|
AdRevenueTypeStat,
|
||||||
} from '@/lib/types';
|
} from '@/lib/types';
|
||||||
|
import UserAdRevenueDrawer from './UserAdRevenueDrawer';
|
||||||
|
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
|
|
||||||
// 广告类型标签
|
// 广告类型标签
|
||||||
const TYPE_TAG: Record<string, { color: string; label: string }> = {
|
const TYPE_TAG: Record<string, { color: string; label: string }> = {
|
||||||
reward_video: { color: 'blue', label: '激励视频' },
|
reward_video: { color: 'blue', label: '激励视频' },
|
||||||
feed: { color: 'purple', label: '信息流' },
|
// 历史误标 feed(领券/比价广告修 adType 之前上报)一律按 Draw 信息流显示——业务已全切 Draw
|
||||||
|
feed: { color: 'geekblue', label: 'Draw 信息流' },
|
||||||
draw: { color: 'geekblue', label: 'Draw 信息流' },
|
draw: { color: 'geekblue', label: 'Draw 信息流' },
|
||||||
withdrawal_video: { color: 'gold', label: '提现激励视频' },
|
withdrawal_video: { color: 'gold', label: '提现激励视频' },
|
||||||
};
|
};
|
||||||
@@ -131,12 +133,6 @@ const DETAIL_COLUMNS: ColumnsType<AdRevenueRecord> = [
|
|||||||
},
|
},
|
||||||
{ title: '应发金币', dataIndex: 'expected_coin', width: 100, render: (v: number) => <b>{v}</b> },
|
{ title: '应发金币', dataIndex: 'expected_coin', width: 100, render: (v: number) => <b>{v}</b> },
|
||||||
{ title: '实发金币', dataIndex: 'actual_coin', width: 100 },
|
{ title: '实发金币', dataIndex: 'actual_coin', width: 100 },
|
||||||
{
|
|
||||||
title: '一致',
|
|
||||||
dataIndex: 'matched',
|
|
||||||
width: 80,
|
|
||||||
render: (m: boolean) => (m ? <Tag color="green">✓</Tag> : <Tag color="red">✗ 不符</Tag>),
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 趋势图(纯 SVG,零依赖):柱=展示条数(左轴),橙线=客户端预估收益元(右轴),
|
// 趋势图(纯 SVG,零依赖):柱=展示条数(左轴),橙线=客户端预估收益元(右轴),
|
||||||
@@ -309,6 +305,8 @@ export default function AdRevenueReportPage() {
|
|||||||
const [queriedLimit, setQueriedLimit] = useState<number>(500);
|
const [queriedLimit, setQueriedLimit] = useState<number>(500);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [formulaOpen, setFormulaOpen] = useState(false);
|
const [formulaOpen, setFormulaOpen] = useState(false);
|
||||||
|
// 点用户手机号弹出的「用户广告收益详情」半屏抽屉(userId + 手机号;null=关闭)
|
||||||
|
const [userDrawer, setUserDrawer] = useState<{ userId: number; phone: string | null } | null>(null);
|
||||||
|
|
||||||
// 当前选择是否跨多天:跨多天时「按小时」无意义,粒度强制按天
|
// 当前选择是否跨多天:跨多天时「按小时」无意义,粒度强制按天
|
||||||
const rangeMultiDay = range[0].format('YYYY-MM-DD') !== range[1].format('YYYY-MM-DD');
|
const rangeMultiDay = range[0].format('YYYY-MM-DD') !== range[1].format('YYYY-MM-DD');
|
||||||
@@ -364,25 +362,39 @@ export default function AdRevenueReportPage() {
|
|||||||
title: '用户',
|
title: '用户',
|
||||||
dataIndex: 'user_phone',
|
dataIndex: 'user_phone',
|
||||||
width: 150,
|
width: 150,
|
||||||
render: (phone: string | null, r: AdRevenueRow) =>
|
render: (phone: string | null, r: AdRevenueRow) => (
|
||||||
phone ? (
|
// 点手机号/用户 → 打开该用户「广告收益详情」半屏抽屉(统计卡 + 金币记录)
|
||||||
<span>
|
<a onClick={() => setUserDrawer({ userId: r.user_id, phone })}>
|
||||||
{phone}
|
{phone ? (
|
||||||
<Typography.Text type="secondary" style={{ fontSize: 11, marginLeft: 6 }}>
|
<span>
|
||||||
#{r.user_id}
|
{phone}
|
||||||
</Typography.Text>
|
<Typography.Text type="secondary" style={{ fontSize: 11, marginLeft: 6 }}>
|
||||||
</span>
|
#{r.user_id}
|
||||||
) : (
|
</Typography.Text>
|
||||||
<Typography.Text type="secondary">#{r.user_id}(无手机号)</Typography.Text>
|
</span>
|
||||||
),
|
) : (
|
||||||
|
<span>#{r.user_id}(无手机号)</span>
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '广告类型',
|
title: '广告类型',
|
||||||
dataIndex: 'ad_type',
|
dataIndex: 'ad_type',
|
||||||
width: 110,
|
width: 130,
|
||||||
render: (s: string) => {
|
render: (s: string, r: AdRevenueRow) => {
|
||||||
const t = TYPE_TAG[s] ?? { color: 'default', label: s };
|
const t = TYPE_TAG[s] ?? { color: 'default', label: s };
|
||||||
return <Tag color={t.color}>{t.label}</Tag>;
|
return (
|
||||||
|
<span>
|
||||||
|
<Tag color={t.color}>{t.label}</Tag>
|
||||||
|
{/* 一次比价/领券聚合了多条广告时标出条数,点「+」展开看逐条 */}
|
||||||
|
{r.sub_count && r.sub_count > 1 ? (
|
||||||
|
<Typography.Text type="secondary" style={{ fontSize: 11 }}>
|
||||||
|
{r.sub_count} 条
|
||||||
|
</Typography.Text>
|
||||||
|
) : null}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -428,7 +440,11 @@ export default function AdRevenueReportPage() {
|
|||||||
dataIndex: 'revenue_yuan',
|
dataIndex: 'revenue_yuan',
|
||||||
width: 110,
|
width: 110,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
render: (v: number, r: AdRevenueRow) => (r.has_impression ? v.toFixed(4) : '-'),
|
// 一次比价/领券聚合行用 row_revenue_yuan(该次发奖广告 eCPM 折算之和),其它行用展示侧 revenue_yuan
|
||||||
|
render: (v: number, r: AdRevenueRow) => {
|
||||||
|
const rev = r.row_revenue_yuan ?? v;
|
||||||
|
return r.has_impression || rev > 0 ? rev.toFixed(4) : '-';
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '发奖状态',
|
title: '发奖状态',
|
||||||
@@ -456,18 +472,6 @@ export default function AdRevenueReportPage() {
|
|||||||
render: (v: number, r: AdRevenueRow) =>
|
render: (v: number, r: AdRevenueRow) =>
|
||||||
r.has_reward ? v : <Typography.Text type="secondary">-</Typography.Text>,
|
r.has_reward ? v : <Typography.Text type="secondary">-</Typography.Text>,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '一致',
|
|
||||||
dataIndex: 'matched',
|
|
||||||
width: 70,
|
|
||||||
align: 'center',
|
|
||||||
render: (m: boolean, r: AdRevenueRow) =>
|
|
||||||
r.has_reward ? (
|
|
||||||
m ? <Tag color="green">✓</Tag> : <Tag color="red">✗ 不符</Tag>
|
|
||||||
) : (
|
|
||||||
<Typography.Text type="secondary">-</Typography.Text>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '广告位ID',
|
title: '广告位ID',
|
||||||
dataIndex: 'our_code_id',
|
dataIndex: 'our_code_id',
|
||||||
@@ -527,6 +531,10 @@ export default function AdRevenueReportPage() {
|
|||||||
title="收益口径说明"
|
title="收益口径说明"
|
||||||
content={
|
content={
|
||||||
<div style={{ maxWidth: 360, fontSize: 13, lineHeight: 1.7 }}>
|
<div style={{ maxWidth: 360, fontSize: 13, lineHeight: 1.7 }}>
|
||||||
|
<b>主表每行 = 一次广告行为</b>(激励视频一次观看 / 一次比价 / 一次领券);比价·领券的 Draw
|
||||||
|
逐条展示不单独占行(其展示数 / eCPM / 预估收益已计入上方合计与大盘),点行左侧「+」展开看该次金币复算。
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
「预估收益」为客户端在广告展示(onAdShow)时上报 eCPM 折算的预估值(每千次展示 ÷1000
|
「预估收益」为客户端在广告展示(onAdShow)时上报 eCPM 折算的预估值(每千次展示 ÷1000
|
||||||
累加),<b>只要广告展示就计入、不论是否看完发奖</b>;穿山甲会过滤无效/过短曝光,故预估值可能偏高,
|
累加),<b>只要广告展示就计入、不论是否看完发奖</b>;穿山甲会过滤无效/过短曝光,故预估值可能偏高,
|
||||||
<b>实际收益一律以穿山甲后台结算为准</b>。测试应用多为 0。「广告位ID / 来源应用」为本期新增,历史记录留空。
|
<b>实际收益一律以穿山甲后台结算为准</b>。测试应用多为 0。「广告位ID / 来源应用」为本期新增,历史记录留空。
|
||||||
@@ -578,7 +586,6 @@ export default function AdRevenueReportPage() {
|
|||||||
style={{ width: 150 }}
|
style={{ width: 150 }}
|
||||||
options={[
|
options={[
|
||||||
{ value: 'reward_video', label: '激励视频' },
|
{ value: 'reward_video', label: '激励视频' },
|
||||||
{ value: 'feed', label: '信息流' },
|
|
||||||
{ value: 'draw', label: 'Draw 信息流' },
|
{ value: 'draw', label: 'Draw 信息流' },
|
||||||
{ value: 'withdrawal_video', label: '提现激励视频' },
|
{ value: 'withdrawal_video', label: '提现激励视频' },
|
||||||
]}
|
]}
|
||||||
@@ -792,22 +799,6 @@ export default function AdRevenueReportPage() {
|
|||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{data && (
|
|
||||||
<Space direction="vertical" style={{ width: '100%', marginBottom: 12 }}>
|
|
||||||
{data.mismatch_count > 0 ? (
|
|
||||||
<Alert
|
|
||||||
type="error"
|
|
||||||
showIcon
|
|
||||||
message={`共 ${data.total} 条广告事件,其中 ${data.mismatch_count} 条应发≠实发(✗);应发−实发 合计 ${
|
|
||||||
derived && derived.coinGap >= 0 ? '+' : ''
|
|
||||||
}${derived?.coinGap ?? 0} 金币(正=少发/负=多发)——公式可能未生效或发奖有问题。定位到具体记录可用后端逐条审计接口。`}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<Alert type="success" showIcon message={`共 ${data.total} 条广告事件,应发与实发全部一致。`} />
|
|
||||||
)}
|
|
||||||
</Space>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{data &&
|
{data &&
|
||||||
(queriedMultiDay
|
(queriedMultiDay
|
||||||
? (data.daily?.length ?? 0) > 0
|
? (data.daily?.length ?? 0) > 0
|
||||||
@@ -884,12 +875,27 @@ export default function AdRevenueReportPage() {
|
|||||||
}}
|
}}
|
||||||
size="small"
|
size="small"
|
||||||
scroll={{ x: 1380 }}
|
scroll={{ x: 1380 }}
|
||||||
rowClassName={(r) => (r.has_reward && !r.matched ? 'row-mismatch' : '')}
|
|
||||||
expandable={{
|
expandable={{
|
||||||
// 每行都可展开(左侧恒有 + 号):有发奖看「金币复算因子」;纯展示看「展示明细」。
|
// 每行都可展开(左侧恒有 + 号):有发奖看「金币复算因子」;纯展示看「展示明细」。
|
||||||
rowExpandable: () => true,
|
rowExpandable: () => true,
|
||||||
expandedRowRender: (r) =>
|
expandedRowRender: (r) =>
|
||||||
r.reward_detail ? (
|
r.sub_rewards && r.sub_rewards.length > 0 ? (
|
||||||
|
<div>
|
||||||
|
<Typography.Text strong>本次广告逐条明细</Typography.Text>{' '}
|
||||||
|
<Typography.Text type="secondary">
|
||||||
|
(共 {r.sub_count ?? r.sub_rewards.length} 条 · 应发 {r.expected_coin} / 实发 {r.actual_coin})
|
||||||
|
</Typography.Text>
|
||||||
|
<Table<AdRevenueRecord>
|
||||||
|
style={{ marginTop: 8 }}
|
||||||
|
rowKey="record_id"
|
||||||
|
columns={DETAIL_COLUMNS}
|
||||||
|
dataSource={r.sub_rewards}
|
||||||
|
pagination={false}
|
||||||
|
size="small"
|
||||||
|
scroll={{ x: 900 }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : r.reward_detail ? (
|
||||||
<div>
|
<div>
|
||||||
<Typography.Text strong>金币复算明细</Typography.Text>{' '}
|
<Typography.Text strong>金币复算明细</Typography.Text>{' '}
|
||||||
<Typography.Text type="secondary">
|
<Typography.Text type="secondary">
|
||||||
@@ -903,7 +909,6 @@ export default function AdRevenueReportPage() {
|
|||||||
pagination={false}
|
pagination={false}
|
||||||
size="small"
|
size="small"
|
||||||
scroll={{ x: 900 }}
|
scroll={{ x: 900 }}
|
||||||
rowClassName={(d) => (d.matched ? '' : 'row-mismatch')}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@@ -979,11 +984,12 @@ export default function AdRevenueReportPage() {
|
|||||||
</Typography.Paragraph>
|
</Typography.Paragraph>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<style jsx global>{`
|
<UserAdRevenueDrawer
|
||||||
.row-mismatch > td {
|
open={!!userDrawer}
|
||||||
background: #fff1f0 !important;
|
userId={userDrawer?.userId ?? null}
|
||||||
}
|
phone={userDrawer?.phone ?? null}
|
||||||
`}</style>
|
onClose={() => setUserDrawer(null)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -932,7 +932,7 @@ export default function DashboardPage() {
|
|||||||
value={fmtInt(periodData?.coins.reward_video_coin_total)}
|
value={fmtInt(periodData?.coins.reward_video_coin_total)}
|
||||||
delta={rewardVideoCoinRatio.value}
|
delta={rewardVideoCoinRatio.value}
|
||||||
deltaTone={rewardVideoCoinRatio.tone}
|
deltaTone={rewardVideoCoinRatio.tone}
|
||||||
hint="激励视频金币已按产品口径计入领券奖励金币,这里单独展示来源占比。"
|
hint="独立统计激励视频发放,不再重复计入领券奖励。"
|
||||||
/>
|
/>
|
||||||
<StatCard
|
<StatCard
|
||||||
title="常规任务金币"
|
title="常规任务金币"
|
||||||
@@ -955,7 +955,7 @@ export default function DashboardPage() {
|
|||||||
实际提现兑付 <b>{fmtCents(periodData?.cash.withdraw_success_cents)}</b>。
|
实际提现兑付 <b>{fmtCents(periodData?.cash.withdraw_success_cents)}</b>。
|
||||||
累计已发放 <b>{fmtCoinAmount(data.coins.granted_total)}</b> 金币但累计真实提现仅
|
累计已发放 <b>{fmtCoinAmount(data.coins.granted_total)}</b> 金币但累计真实提现仅
|
||||||
<b>{fmtCents(data.cash.withdraw_success_cents)}</b>,发放与现金兑付背离属正常(金币沉淀/过期);
|
<b>{fmtCents(data.cash.withdraw_success_cents)}</b>,发放与现金兑付背离属正常(金币沉淀/过期);
|
||||||
需盯紧各来源占比突变与异常领取,防薅羊毛。
|
邀请奖励、后台手动加金币、福利页/老版本未打标签信息流不进入这 4 项,需盯紧各来源占比突变与异常领取。
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -49,6 +49,17 @@ const statusTag = (s: string) => {
|
|||||||
return <Tag color={m.color}>{m.label}</Tag>;
|
return <Tag color={m.color}>{m.label}</Tag>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 反馈类型:comparison=比价反馈 / profile(及旧数据)=普通反馈
|
||||||
|
const SOURCE_META: Record<string, { label: string; color: string }> = {
|
||||||
|
comparison: { label: '比价反馈', color: 'geekblue' },
|
||||||
|
profile: { label: '普通反馈', color: 'default' },
|
||||||
|
};
|
||||||
|
|
||||||
|
const sourceTag = (s: string) => {
|
||||||
|
const m = SOURCE_META[s] ?? { label: '普通反馈', color: 'default' };
|
||||||
|
return <Tag color={m.color}>{m.label}</Tag>;
|
||||||
|
};
|
||||||
|
|
||||||
function FeedbackImages({ images }: { images: string[] | null }) {
|
function FeedbackImages({ images }: { images: string[] | null }) {
|
||||||
if (!images || !images.length) return <Text type="secondary">无截图</Text>;
|
if (!images || !images.length) return <Text type="secondary">无截图</Text>;
|
||||||
return (
|
return (
|
||||||
@@ -113,12 +124,14 @@ export default function FeedbackHandleDrawer({ feedback, open, onClose, onDone }
|
|||||||
await api.post(`/admin/api/feedbacks/${feedback.id}/approve`, {
|
await api.post(`/admin/api/feedbacks/${feedback.id}/approve`, {
|
||||||
reward_coins: v.reward_coins,
|
reward_coins: v.reward_coins,
|
||||||
note: v.note?.trim() || null,
|
note: v.note?.trim() || null,
|
||||||
|
reply: v.reply?.trim() || null,
|
||||||
});
|
});
|
||||||
message.success(`已采纳,发放 ${v.reward_coins} 金币`);
|
message.success(`已采纳,发放 ${v.reward_coins} 金币`);
|
||||||
} else {
|
} else {
|
||||||
await api.post(`/admin/api/feedbacks/${feedback.id}/reject`, {
|
await api.post(`/admin/api/feedbacks/${feedback.id}/reject`, {
|
||||||
reason: v.reason.trim(),
|
reason: v.reason.trim(),
|
||||||
note: v.note?.trim() || null,
|
note: v.note?.trim() || null,
|
||||||
|
reply: v.reply?.trim() || null,
|
||||||
});
|
});
|
||||||
message.success('已拒绝');
|
message.success('已拒绝');
|
||||||
}
|
}
|
||||||
@@ -155,6 +168,14 @@ export default function FeedbackHandleDrawer({ feedback, open, onClose, onDone }
|
|||||||
<Text type="secondary">
|
<Text type="secondary">
|
||||||
用户 {feedback.user_id} · {formatWallTime(feedback.created_at)}
|
用户 {feedback.user_id} · {formatWallTime(feedback.created_at)}
|
||||||
</Text>
|
</Text>
|
||||||
|
<div style={{ marginTop: 6 }}>
|
||||||
|
{sourceTag(feedback.source)}
|
||||||
|
{feedback.scene ? (
|
||||||
|
<Text type="secondary" style={{ marginLeft: 6 }}>
|
||||||
|
场景:{feedback.scene}
|
||||||
|
</Text>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
<Paragraph style={{ whiteSpace: 'pre-wrap', marginTop: 8, marginBottom: 8 }}>
|
<Paragraph style={{ whiteSpace: 'pre-wrap', marginTop: 8, marginBottom: 8 }}>
|
||||||
{feedback.content || '-'}
|
{feedback.content || '-'}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
@@ -200,7 +221,11 @@ export default function FeedbackHandleDrawer({ feedback, open, onClose, onDone }
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div style={{ marginTop: 6 }}>
|
<div style={{ marginTop: 6 }}>
|
||||||
审核备注:{feedback.review_note || <Text type="secondary">(无)</Text>}
|
审核备注(内部):{feedback.review_note || <Text type="secondary">(无)</Text>}
|
||||||
|
</div>
|
||||||
|
<div style={{ marginTop: 6 }}>
|
||||||
|
给用户的回复(用户可见):
|
||||||
|
{feedback.admin_reply || <Text type="secondary">(无)</Text>}
|
||||||
</div>
|
</div>
|
||||||
{isPending(feedback.status) && (
|
{isPending(feedback.status) && (
|
||||||
<div style={{ marginTop: 6 }}>
|
<div style={{ marginTop: 6 }}>
|
||||||
@@ -243,11 +268,23 @@ export default function FeedbackHandleDrawer({ feedback, open, onClose, onDone }
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="note"
|
name="note"
|
||||||
label="采纳要点 / 审核备注(选填)"
|
label="采纳要点 / 审核备注(选填,内部)"
|
||||||
rules={[{ max: 256, message: '最多 256 字' }]}
|
rules={[{ max: 256, message: '最多 256 字' }]}
|
||||||
>
|
>
|
||||||
<Input.TextArea rows={3} maxLength={256} showCount placeholder="如:建议已采纳,将在下个版本上线" />
|
<Input.TextArea rows={3} maxLength={256} showCount placeholder="如:建议已采纳,将在下个版本上线" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="reply"
|
||||||
|
label="给用户的回复(选填,用户端可见)"
|
||||||
|
rules={[{ max: 256, message: '最多 256 字' }]}
|
||||||
|
>
|
||||||
|
<Input.TextArea
|
||||||
|
rows={2}
|
||||||
|
maxLength={256}
|
||||||
|
showCount
|
||||||
|
placeholder="将展示在用户的「我的反馈」里,如:感谢反馈,已收到~"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -268,6 +305,18 @@ export default function FeedbackHandleDrawer({ feedback, open, onClose, onDone }
|
|||||||
>
|
>
|
||||||
<Input.TextArea rows={2} maxLength={256} showCount placeholder="运营内部备注" />
|
<Input.TextArea rows={2} maxLength={256} showCount placeholder="运营内部备注" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="reply"
|
||||||
|
label="给用户的回复(选填,用户端可见)"
|
||||||
|
rules={[{ max: 256, message: '最多 256 字' }]}
|
||||||
|
>
|
||||||
|
<Input.TextArea
|
||||||
|
rows={2}
|
||||||
|
maxLength={256}
|
||||||
|
showCount
|
||||||
|
placeholder="除未采纳原因外,想额外对用户说的话(选填)"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Form>
|
</Form>
|
||||||
@@ -294,7 +343,10 @@ export default function FeedbackHandleDrawer({ feedback, open, onClose, onDone }
|
|||||||
<Text type="secondary">
|
<Text type="secondary">
|
||||||
#{h.id} · {formatWallTime(h.created_at)}
|
#{h.id} · {formatWallTime(h.created_at)}
|
||||||
</Text>
|
</Text>
|
||||||
{statusTag(h.status)}
|
<Space size={4}>
|
||||||
|
{sourceTag(h.source)}
|
||||||
|
{statusTag(h.status)}
|
||||||
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
<Paragraph
|
<Paragraph
|
||||||
style={{ whiteSpace: 'pre-wrap', margin: '6px 0 0' }}
|
style={{ whiteSpace: 'pre-wrap', margin: '6px 0 0' }}
|
||||||
@@ -313,6 +365,9 @@ export default function FeedbackHandleDrawer({ feedback, open, onClose, onDone }
|
|||||||
未采纳:{h.reject_reason || '-'}
|
未采纳:{h.reject_reason || '-'}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
{h.admin_reply ? (
|
||||||
|
<div style={{ fontSize: 12, marginTop: 2 }}>回复:{h.admin_reply}</div>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@@ -49,7 +49,42 @@ const statusTag = (s: string) => {
|
|||||||
return <Tag color={m.color}>{m.label}</Tag>;
|
return <Tag color={m.color}>{m.label}</Tag>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 审核结果展示(采纳=金币+批注 / 未采纳=原因 / 待审核=-),主表与「该用户全部反馈」抽屉共用
|
// 反馈类型:comparison=比价反馈(比价结果页入口) / profile=普通反馈(「我的」页入口)。
|
||||||
|
// 旧数据与未识别来源按普通反馈展示。
|
||||||
|
const SOURCE_META: Record<string, { label: string; color: string }> = {
|
||||||
|
comparison: { label: '比价反馈', color: 'geekblue' },
|
||||||
|
profile: { label: '普通反馈', color: 'default' },
|
||||||
|
};
|
||||||
|
|
||||||
|
const SOURCE_OPTIONS = [
|
||||||
|
{ value: 'comparison', label: '比价反馈' },
|
||||||
|
{ value: 'profile', label: '普通反馈' },
|
||||||
|
];
|
||||||
|
|
||||||
|
// 反馈类型标签 +(比价反馈时)问题场景副标题
|
||||||
|
const renderSource = (f: Feedback) => {
|
||||||
|
const m = SOURCE_META[f.source] ?? { label: '普通反馈', color: 'default' };
|
||||||
|
return (
|
||||||
|
<Space direction="vertical" size={0}>
|
||||||
|
<Tag color={m.color}>{m.label}</Tag>
|
||||||
|
{f.scene ? (
|
||||||
|
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||||
|
{f.scene}
|
||||||
|
</Text>
|
||||||
|
) : null}
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 用户可见的运营回复留言(采纳/未采纳都可能有)
|
||||||
|
const replyLine = (f: Feedback) =>
|
||||||
|
f.admin_reply ? (
|
||||||
|
<Text style={{ fontSize: 12 }} ellipsis>
|
||||||
|
回复:{f.admin_reply}
|
||||||
|
</Text>
|
||||||
|
) : null;
|
||||||
|
|
||||||
|
// 审核结果展示(采纳=金币+批注 / 未采纳=原因 / 回复留言 / 待审核=-),主表与「该用户全部反馈」抽屉共用
|
||||||
const renderReview = (f: Feedback) => {
|
const renderReview = (f: Feedback) => {
|
||||||
if (f.status === 'adopted') {
|
if (f.status === 'adopted') {
|
||||||
return (
|
return (
|
||||||
@@ -60,14 +95,18 @@ const renderReview = (f: Feedback) => {
|
|||||||
{f.review_note}
|
{f.review_note}
|
||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
|
{replyLine(f)}
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (f.status === 'rejected') {
|
if (f.status === 'rejected') {
|
||||||
return (
|
return (
|
||||||
<Text type="secondary" style={{ fontSize: 12 }} ellipsis>
|
<Space direction="vertical" size={0}>
|
||||||
未采纳:{f.reject_reason || '-'}
|
<Text type="secondary" style={{ fontSize: 12 }} ellipsis>
|
||||||
</Text>
|
未采纳:{f.reject_reason || '-'}
|
||||||
|
</Text>
|
||||||
|
{replyLine(f)}
|
||||||
|
</Space>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return <Text type="secondary">-</Text>;
|
return <Text type="secondary">-</Text>;
|
||||||
@@ -95,6 +134,7 @@ const renderDeviceOs = (f: Feedback) => {
|
|||||||
const RECORD_COLUMNS: ColumnsType<Feedback> = [
|
const RECORD_COLUMNS: ColumnsType<Feedback> = [
|
||||||
{ title: '提交时间', dataIndex: 'created_at', width: 150, render: (v: string) => formatWallTime(v) },
|
{ title: '提交时间', dataIndex: 'created_at', width: 150, render: (v: string) => formatWallTime(v) },
|
||||||
{ title: '状态', dataIndex: 'status', width: 80, render: statusTag },
|
{ title: '状态', dataIndex: 'status', width: 80, render: statusTag },
|
||||||
|
{ title: '反馈类型', key: 'source', width: 100, render: (_: unknown, f: Feedback) => renderSource(f) },
|
||||||
{
|
{
|
||||||
title: '内容',
|
title: '内容',
|
||||||
dataIndex: 'content',
|
dataIndex: 'content',
|
||||||
@@ -116,6 +156,7 @@ const RECORD_COLUMNS: ColumnsType<Feedback> = [
|
|||||||
export default function FeedbacksPage() {
|
export default function FeedbacksPage() {
|
||||||
// 筛选草稿:点「查询」才应用(避免输入即刷新)
|
// 筛选草稿:点「查询」才应用(避免输入即刷新)
|
||||||
const [status, setStatus] = useState<string | undefined>();
|
const [status, setStatus] = useState<string | undefined>();
|
||||||
|
const [source, setSource] = useState<string | undefined>();
|
||||||
const [userId, setUserId] = useState('');
|
const [userId, setUserId] = useState('');
|
||||||
const [content, setContent] = useState('');
|
const [content, setContent] = useState('');
|
||||||
const [createdRange, setCreatedRange] = useState<[Dayjs, Dayjs] | null>(null);
|
const [createdRange, setCreatedRange] = useState<[Dayjs, Dayjs] | null>(null);
|
||||||
@@ -158,6 +199,7 @@ export default function FeedbacksPage() {
|
|||||||
const search = () =>
|
const search = () =>
|
||||||
setApplied({
|
setApplied({
|
||||||
status,
|
status,
|
||||||
|
source,
|
||||||
user_id: userId.trim() ? Number(userId.trim()) : undefined,
|
user_id: userId.trim() ? Number(userId.trim()) : undefined,
|
||||||
content: content.trim() || undefined,
|
content: content.trim() || undefined,
|
||||||
created_from: createdRange?.[0] ? createdRange[0].startOf('day').toISOString() : undefined,
|
created_from: createdRange?.[0] ? createdRange[0].startOf('day').toISOString() : undefined,
|
||||||
@@ -166,6 +208,7 @@ export default function FeedbacksPage() {
|
|||||||
|
|
||||||
const resetFilters = () => {
|
const resetFilters = () => {
|
||||||
setStatus(undefined);
|
setStatus(undefined);
|
||||||
|
setSource(undefined);
|
||||||
setUserId('');
|
setUserId('');
|
||||||
setContent('');
|
setContent('');
|
||||||
setCreatedRange(null);
|
setCreatedRange(null);
|
||||||
@@ -216,6 +259,12 @@ export default function FeedbacksPage() {
|
|||||||
width: 120,
|
width: 120,
|
||||||
render: (v: string | null) => v || <Text type="secondary">无昵称</Text>,
|
render: (v: string | null) => v || <Text type="secondary">无昵称</Text>,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '反馈类型',
|
||||||
|
key: 'source',
|
||||||
|
width: 110,
|
||||||
|
render: (_: unknown, f: Feedback) => renderSource(f),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '提交版本号',
|
title: '提交版本号',
|
||||||
dataIndex: 'app_version',
|
dataIndex: 'app_version',
|
||||||
@@ -325,6 +374,14 @@ export default function FeedbacksPage() {
|
|||||||
{ value: 'rejected', label: '未采纳' },
|
{ value: 'rejected', label: '未采纳' },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
<Select
|
||||||
|
placeholder="反馈类型"
|
||||||
|
value={source}
|
||||||
|
onChange={setSource}
|
||||||
|
allowClear
|
||||||
|
style={{ width: 130 }}
|
||||||
|
options={SOURCE_OPTIONS}
|
||||||
|
/>
|
||||||
<Input
|
<Input
|
||||||
placeholder="用户ID"
|
placeholder="用户ID"
|
||||||
value={userId}
|
value={userId}
|
||||||
@@ -367,7 +424,7 @@ export default function FeedbacksPage() {
|
|||||||
onChange: onPageChange,
|
onChange: onPageChange,
|
||||||
}}
|
}}
|
||||||
onChange={onTableChange}
|
onChange={onTableChange}
|
||||||
scroll={{ x: 1610 }}
|
scroll={{ x: 1720 }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FeedbackHandleDrawer
|
<FeedbackHandleDrawer
|
||||||
|
|||||||
+245
-31
@@ -12,7 +12,6 @@ import {
|
|||||||
HeartOutlined,
|
HeartOutlined,
|
||||||
LogoutOutlined,
|
LogoutOutlined,
|
||||||
MessageOutlined,
|
MessageOutlined,
|
||||||
MobileOutlined,
|
|
||||||
MoneyCollectOutlined,
|
MoneyCollectOutlined,
|
||||||
NotificationOutlined,
|
NotificationOutlined,
|
||||||
ProfileOutlined,
|
ProfileOutlined,
|
||||||
@@ -21,26 +20,66 @@ import {
|
|||||||
TeamOutlined,
|
TeamOutlined,
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { Avatar, Dropdown, Layout, Menu } from 'antd';
|
import { Avatar, Dropdown, Layout, Tooltip } from 'antd';
|
||||||
import { clearAuth, getAdmin, getToken } from '@/lib/auth';
|
import { clearAuth, getAdmin, getToken } from '@/lib/auth';
|
||||||
import type { AdminInfo } from '@/lib/types';
|
import type { AdminInfo } from '@/lib/types';
|
||||||
|
|
||||||
const { Sider, Header, Content } = Layout;
|
const { Sider, Header, Content } = Layout;
|
||||||
|
|
||||||
const MENU = [
|
type NavItem = {
|
||||||
{ key: '/dashboard', icon: <DashboardOutlined />, label: '数据大盘' },
|
key: string;
|
||||||
{ key: '/users', icon: <UserOutlined />, label: '用户管理' },
|
icon: React.ReactNode;
|
||||||
{ key: '/devices', icon: <MobileOutlined />, label: '设备管理' },
|
label: string;
|
||||||
{ key: '/device-liveness', icon: <HeartOutlined />, label: '设备存活' },
|
superOnly?: boolean;
|
||||||
{ key: '/withdraws', icon: <MoneyCollectOutlined />, label: '提现管理' },
|
};
|
||||||
{ key: '/price-reports', icon: <FlagOutlined />, label: '低价审核' },
|
|
||||||
{ key: '/comparison-records', icon: <ProfileOutlined />, label: '比价记录' },
|
type NavGroup =
|
||||||
{ key: '/feedbacks', icon: <MessageOutlined />, label: '用户反馈' },
|
| (NavItem & { children?: never })
|
||||||
{ key: '/coupon-data', icon: <GiftOutlined />, label: '领券数据' },
|
| {
|
||||||
{ key: '/ad-revenue', icon: <NotificationOutlined />, label: '广告配置' },
|
key: string;
|
||||||
{ key: '/ad-revenue-report', icon: <BarChartOutlined />, label: '广告收益' },
|
icon: React.ReactNode;
|
||||||
{ key: '/cps', icon: <ShareAltOutlined />, label: 'CPS 分发' },
|
label: string;
|
||||||
{ key: '/config', icon: <SettingOutlined />, label: '系统配置' },
|
children: NavItem[];
|
||||||
|
superOnly?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
const hasChildren = (group: NavGroup): group is NavGroup & { children: NavItem[] } =>
|
||||||
|
Array.isArray(group.children);
|
||||||
|
|
||||||
|
const NAV_GROUPS: NavGroup[] = [
|
||||||
|
{
|
||||||
|
key: 'dashboard',
|
||||||
|
icon: <DashboardOutlined />,
|
||||||
|
label: '看板',
|
||||||
|
children: [
|
||||||
|
{ key: '/dashboard', icon: <DashboardOutlined />, label: '数据大盘' },
|
||||||
|
{ key: '/coupon-data', icon: <GiftOutlined />, label: '领券数据' },
|
||||||
|
{ key: '/ad-revenue-report', icon: <BarChartOutlined />, label: '广告收益' },
|
||||||
|
{ key: '/comparison-records', icon: <ProfileOutlined />, label: '比价记录' },
|
||||||
|
{ key: '/cps', icon: <ShareAltOutlined />, label: 'CPS收益' },
|
||||||
|
{ key: '/device-liveness', icon: <HeartOutlined />, label: '设备存活' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'reward-review',
|
||||||
|
icon: <MoneyCollectOutlined />,
|
||||||
|
label: '奖励审核',
|
||||||
|
children: [
|
||||||
|
{ key: '/withdraws', icon: <MoneyCollectOutlined />, label: '提现审核' },
|
||||||
|
{ key: '/price-reports', icon: <FlagOutlined />, label: '低价审核' },
|
||||||
|
{ key: '/feedbacks', icon: <MessageOutlined />, label: '用户反馈' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'data-config',
|
||||||
|
icon: <SettingOutlined />,
|
||||||
|
label: '数据配置',
|
||||||
|
children: [
|
||||||
|
{ key: '/config', icon: <SettingOutlined />, label: '系统配置' },
|
||||||
|
{ key: '/ad-revenue', icon: <NotificationOutlined />, label: '广告配置' },
|
||||||
|
{ key: '/users', icon: <UserOutlined />, label: '用户管理' },
|
||||||
|
],
|
||||||
|
},
|
||||||
{ key: '/admins', icon: <TeamOutlined />, label: '管理员', superOnly: true },
|
{ key: '/admins', icon: <TeamOutlined />, label: '管理员', superOnly: true },
|
||||||
{ key: '/event-logs', icon: <DatabaseOutlined />, label: '埋点日志' },
|
{ key: '/event-logs', icon: <DatabaseOutlined />, label: '埋点日志' },
|
||||||
{ key: '/audit-logs', icon: <FileSearchOutlined />, label: '审计日志' },
|
{ key: '/audit-logs', icon: <FileSearchOutlined />, label: '审计日志' },
|
||||||
@@ -50,6 +89,7 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const [admin, setAdmin] = useState<AdminInfo | null>(null);
|
const [admin, setAdmin] = useState<AdminInfo | null>(null);
|
||||||
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!getToken()) {
|
if (!getToken()) {
|
||||||
@@ -61,14 +101,19 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
|||||||
|
|
||||||
if (!admin) return null; // 守卫期间不闪烁内容
|
if (!admin) return null; // 守卫期间不闪烁内容
|
||||||
|
|
||||||
const items = MENU.filter((m) => !m.superOnly || admin.role === 'super_admin').map((m) => ({
|
// 选中态:取路径一级(/users/123 -> /users)
|
||||||
key: m.key,
|
|
||||||
icon: m.icon,
|
|
||||||
label: m.label,
|
|
||||||
}));
|
|
||||||
|
|
||||||
// 选中态:取路径一级(/users/123 → /users)
|
|
||||||
const selectedKey = '/' + (pathname.split('/')[1] || 'dashboard');
|
const selectedKey = '/' + (pathname.split('/')[1] || 'dashboard');
|
||||||
|
const canShow = (item: { superOnly?: boolean }) => !item.superOnly || admin.role === 'super_admin';
|
||||||
|
const visibleGroups = NAV_GROUPS
|
||||||
|
.filter(canShow)
|
||||||
|
.map((group) => {
|
||||||
|
if (!hasChildren(group)) return group;
|
||||||
|
return { ...group, children: group.children.filter(canShow) };
|
||||||
|
})
|
||||||
|
.filter((group) => !hasChildren(group) || group.children.length > 0);
|
||||||
|
const flatNavItems = visibleGroups.flatMap((group) =>
|
||||||
|
hasChildren(group) ? group.children : [group],
|
||||||
|
);
|
||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
clearAuth();
|
clearAuth();
|
||||||
@@ -77,7 +122,15 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout style={{ minHeight: '100vh' }}>
|
<Layout style={{ minHeight: '100vh' }}>
|
||||||
<Sider theme="dark" breakpoint="lg" collapsible>
|
<Sider
|
||||||
|
theme="dark"
|
||||||
|
breakpoint="lg"
|
||||||
|
collapsible
|
||||||
|
collapsed={collapsed}
|
||||||
|
collapsedWidth={72}
|
||||||
|
width={220}
|
||||||
|
onCollapse={setCollapsed}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
height: 48,
|
height: 48,
|
||||||
@@ -90,13 +143,61 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
|||||||
>
|
>
|
||||||
运营后台
|
运营后台
|
||||||
</div>
|
</div>
|
||||||
<Menu
|
<nav className={`side-nav${collapsed ? ' side-nav-collapsed' : ''}`} aria-label="后台导航">
|
||||||
theme="dark"
|
{collapsed
|
||||||
mode="inline"
|
? flatNavItems.map((item) => (
|
||||||
selectedKeys={[selectedKey]}
|
<Tooltip key={item.key} title={item.label} placement="right">
|
||||||
items={items}
|
<button
|
||||||
onClick={({ key }) => router.push(key)}
|
type="button"
|
||||||
/>
|
className={`nav-icon-button${selectedKey === item.key ? ' is-selected' : ''}`}
|
||||||
|
onClick={() => router.push(item.key)}
|
||||||
|
aria-label={item.label}
|
||||||
|
>
|
||||||
|
{item.icon}
|
||||||
|
</button>
|
||||||
|
</Tooltip>
|
||||||
|
))
|
||||||
|
: visibleGroups.map((group) => {
|
||||||
|
const isGroup = hasChildren(group);
|
||||||
|
const groupSelected = isGroup
|
||||||
|
? group.children.some((child) => child.key === selectedKey)
|
||||||
|
: selectedKey === group.key;
|
||||||
|
if (!isGroup) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={group.key}
|
||||||
|
type="button"
|
||||||
|
className={`nav-primary nav-direct${groupSelected ? ' is-selected' : ''}`}
|
||||||
|
onClick={() => router.push(group.key)}
|
||||||
|
>
|
||||||
|
<span className="nav-primary-icon">{group.icon}</span>
|
||||||
|
<span>{group.label}</span>
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<section key={group.key} className={`nav-group${groupSelected ? ' is-active' : ''}`}>
|
||||||
|
<div className="nav-primary">
|
||||||
|
<span className="nav-primary-icon">{group.icon}</span>
|
||||||
|
<span>{group.label}</span>
|
||||||
|
</div>
|
||||||
|
<div className="nav-children">
|
||||||
|
{group.children.map((child) => (
|
||||||
|
<button
|
||||||
|
key={child.key}
|
||||||
|
type="button"
|
||||||
|
className={`nav-child${selectedKey === child.key ? ' is-selected' : ''}`}
|
||||||
|
onClick={() => router.push(child.key)}
|
||||||
|
>
|
||||||
|
<span className="nav-child-icon">{child.icon}</span>
|
||||||
|
<span>{child.label}</span>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</nav>
|
||||||
</Sider>
|
</Sider>
|
||||||
<Layout>
|
<Layout>
|
||||||
<Header
|
<Header
|
||||||
@@ -122,6 +223,119 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
|||||||
</Header>
|
</Header>
|
||||||
<Content style={{ margin: 24 }}>{children}</Content>
|
<Content style={{ margin: 24 }}>{children}</Content>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
<style jsx global>{`
|
||||||
|
.side-nav {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 0 10px 14px;
|
||||||
|
}
|
||||||
|
.nav-group {
|
||||||
|
padding: 6px 0 8px;
|
||||||
|
}
|
||||||
|
.nav-group + .nav-group,
|
||||||
|
.nav-group + .nav-direct,
|
||||||
|
.nav-direct + .nav-direct {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
.nav-primary {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
min-height: 36px;
|
||||||
|
padding: 0 12px;
|
||||||
|
color: rgba(255, 255, 255, 0.88);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0;
|
||||||
|
}
|
||||||
|
.nav-primary-icon,
|
||||||
|
.nav-child-icon {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: rgba(255, 255, 255, 0.72);
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.nav-direct,
|
||||||
|
.nav-child,
|
||||||
|
.nav-icon-button {
|
||||||
|
border: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
font: inherit;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.nav-direct {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.nav-direct:hover,
|
||||||
|
.nav-direct.is-selected {
|
||||||
|
background: #1677ff;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.nav-direct:hover .nav-primary-icon,
|
||||||
|
.nav-direct.is-selected .nav-primary-icon {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.nav-children {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
|
margin-left: 34px;
|
||||||
|
margin-top: -2px;
|
||||||
|
padding-right: 2px;
|
||||||
|
}
|
||||||
|
.nav-child {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 34px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: transparent;
|
||||||
|
color: rgba(255, 255, 255, 0.72);
|
||||||
|
font-size: 13px;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
.nav-child:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.08);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.nav-child.is-selected {
|
||||||
|
background: #1677ff;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.nav-child.is-selected .nav-child-icon {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.nav-group.is-active .nav-primary {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.side-nav-collapsed {
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 0 8px 14px;
|
||||||
|
}
|
||||||
|
.nav-icon-button {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: transparent;
|
||||||
|
color: rgba(255, 255, 255, 0.72);
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
.nav-icon-button:hover,
|
||||||
|
.nav-icon-button.is-selected {
|
||||||
|
background: #1677ff;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
`}</style>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,12 @@ const PAGE_SIZE = 10; // 金币记录每页条数
|
|||||||
interface Props {
|
interface Props {
|
||||||
userId: number;
|
userId: number;
|
||||||
user: WithdrawUserSnapshot | null;
|
user: WithdrawUserSnapshot | null;
|
||||||
|
// 统计区字段集:withdraw(默认,提现详情:含提现细分) / ad(广告收益详情:只看看广告观看统计,对齐参考图 6 项)
|
||||||
|
statsVariant?: 'withdraw' | 'ad';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提现详情抽屉:用户基本信息 + 互斥时间筛选 + 看广告/提现统计区 + 金币发放记录表。 */
|
/** 用户看广告/提现详情:基本信息 + 互斥时间筛选 + 统计区(按 statsVariant 取字段集)+ 金币发放记录表。 */
|
||||||
export default function UserRewardPanel({ userId, user }: Props) {
|
export default function UserRewardPanel({ userId, user, statsVariant = 'withdraw' }: Props) {
|
||||||
const [mode, setMode] = useState<'all' | 'range'>('all'); // all=注册至今 / range=自定义区间
|
const [mode, setMode] = useState<'all' | 'range'>('all'); // all=注册至今 / range=自定义区间
|
||||||
const [range, setRange] = useState<[Dayjs, Dayjs] | null>(null);
|
const [range, setRange] = useState<[Dayjs, Dayjs] | null>(null);
|
||||||
const [stats, setStats] = useState<UserRewardStats | null>(null);
|
const [stats, setStats] = useState<UserRewardStats | null>(null);
|
||||||
@@ -164,7 +166,7 @@ export default function UserRewardPanel({ userId, user }: Props) {
|
|||||||
</Space>
|
</Space>
|
||||||
</Space>
|
</Space>
|
||||||
|
|
||||||
{/* 统计区(受时间筛选;现金余额为当前快照) */}
|
{/* 统计区(受时间筛选;现金余额为当前快照)。ad 视图只保留看广告观看统计(对齐参考图 6 项) */}
|
||||||
<Descriptions bordered size="small" column={2} style={{ marginBottom: 8 }}>
|
<Descriptions bordered size="small" column={2} style={{ marginBottom: 8 }}>
|
||||||
<Descriptions.Item label="累计提现">
|
<Descriptions.Item label="累计提现">
|
||||||
{stats ? yuan(stats.withdraw_success_cents) : '-'}
|
{stats ? yuan(stats.withdraw_success_cents) : '-'}
|
||||||
@@ -172,29 +174,51 @@ export default function UserRewardPanel({ userId, user }: Props) {
|
|||||||
<Descriptions.Item label="现金余额">
|
<Descriptions.Item label="现金余额">
|
||||||
{stats ? yuan(stats.cash_balance_cents) : '-'}
|
{stats ? yuan(stats.cash_balance_cents) : '-'}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="提现总次数">{stats?.withdraw_total ?? '-'}</Descriptions.Item>
|
{statsVariant === 'ad' ? (
|
||||||
<Descriptions.Item label="传统任务提现">
|
<>
|
||||||
{stats ? yuan(stats.traditional_task_cash_cents) : '-'}
|
<Descriptions.Item label="激励视频观看数">
|
||||||
</Descriptions.Item>
|
{stats?.reward_video_count ?? '-'}
|
||||||
<Descriptions.Item label="累计激励视频数">
|
</Descriptions.Item>
|
||||||
{stats?.reward_video_count ?? '-'}
|
{/* eCPM 均按元展示(reward_video / feed avg_ecpm 原始为分/千次,÷100 转元) */}
|
||||||
</Descriptions.Item>
|
<Descriptions.Item label="平均激励视频ECPM">
|
||||||
<Descriptions.Item label="平均激励视频ECPM">
|
{stats ? `${(stats.reward_video_avg_ecpm / 100).toFixed(2)} 元/千` : '-'}
|
||||||
{stats ? `${stats.reward_video_avg_ecpm} 分/千` : '-'}
|
</Descriptions.Item>
|
||||||
</Descriptions.Item>
|
<Descriptions.Item label="draw信息流视频观看数">
|
||||||
<Descriptions.Item label="激励视频提现">
|
{stats?.feed_count ?? '-'}
|
||||||
{stats ? yuan(stats.reward_video_cash_cents) : '-'}
|
</Descriptions.Item>
|
||||||
</Descriptions.Item>
|
<Descriptions.Item label="平均draw信息流ECPM">
|
||||||
<Descriptions.Item label="累计信息流广告数">{stats?.feed_count ?? '-'}</Descriptions.Item>
|
{stats ? `${(stats.feed_avg_ecpm / 100).toFixed(2)} 元/千` : '-'}
|
||||||
<Descriptions.Item label="平均信息流广告ECPM">
|
</Descriptions.Item>
|
||||||
{stats ? `${stats.feed_avg_ecpm} 分/千` : '-'}
|
</>
|
||||||
</Descriptions.Item>
|
) : (
|
||||||
<Descriptions.Item label="信息流广告提现">
|
<>
|
||||||
{stats ? yuan(stats.feed_cash_cents) : '-'}
|
<Descriptions.Item label="提现总次数">{stats?.withdraw_total ?? '-'}</Descriptions.Item>
|
||||||
</Descriptions.Item>
|
<Descriptions.Item label="传统任务提现">
|
||||||
|
{stats ? yuan(stats.traditional_task_cash_cents) : '-'}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="累计激励视频数">
|
||||||
|
{stats?.reward_video_count ?? '-'}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="平均激励视频ECPM">
|
||||||
|
{stats ? `${stats.reward_video_avg_ecpm} 分/千` : '-'}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="激励视频提现">
|
||||||
|
{stats ? yuan(stats.reward_video_cash_cents) : '-'}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="累计信息流广告数">{stats?.feed_count ?? '-'}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="平均信息流广告ECPM">
|
||||||
|
{stats ? `${stats.feed_avg_ecpm} 分/千` : '-'}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="信息流广告提现">
|
||||||
|
{stats ? yuan(stats.feed_cash_cents) : '-'}
|
||||||
|
</Descriptions.Item>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||||
统计随上方时间筛选(现金余额除外,为当前快照);eCPM 单位分/千次,同金币审计。
|
{statsVariant === 'ad'
|
||||||
|
? '统计随上方时间筛选(现金余额除外,为当前快照);eCPM 均按元展示(原始分/千次 ÷100)。'
|
||||||
|
: '统计随上方时间筛选(现金余额除外,为当前快照);eCPM 单位分/千次,同金币审计。'}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{/* 金币记录 */}
|
{/* 金币记录 */}
|
||||||
|
|||||||
@@ -104,6 +104,19 @@ const SORT_OPTIONS = [
|
|||||||
{ value: 'created_at', label: '申请时间' },
|
{ value: 'created_at', label: '申请时间' },
|
||||||
{ value: 'amount_cents', label: '提现金额' },
|
{ value: 'amount_cents', label: '提现金额' },
|
||||||
];
|
];
|
||||||
|
// 提现类型:coin_cash=福利页提现(金币兑换现金) / invite_cash=邀请提现(邀请奖励金)
|
||||||
|
const SOURCE_LABEL: Record<string, string> = {
|
||||||
|
coin_cash: '福利页提现',
|
||||||
|
invite_cash: '邀请提现',
|
||||||
|
};
|
||||||
|
const SOURCE_COLOR: Record<string, string> = {
|
||||||
|
coin_cash: 'blue',
|
||||||
|
invite_cash: 'purple',
|
||||||
|
};
|
||||||
|
const SOURCE_OPTIONS = [
|
||||||
|
{ value: 'coin_cash', label: '福利页提现' },
|
||||||
|
{ value: 'invite_cash', label: '邀请提现' },
|
||||||
|
];
|
||||||
const DATE_FIELD_OPTIONS = [
|
const DATE_FIELD_OPTIONS = [
|
||||||
{ value: 'created_at', label: '申请时间' },
|
{ value: 'created_at', label: '申请时间' },
|
||||||
{ value: 'updated_at', label: '更新时间' },
|
{ value: 'updated_at', label: '更新时间' },
|
||||||
@@ -184,9 +197,11 @@ export default function WithdrawsPage() {
|
|||||||
const [sortBy, setSortBy] = useState<'created_at' | 'amount_cents'>('created_at');
|
const [sortBy, setSortBy] = useState<'created_at' | 'amount_cents'>('created_at');
|
||||||
const [sortOrder, setSortOrder] = useState<'asc' | 'desc'>('desc');
|
const [sortOrder, setSortOrder] = useState<'asc' | 'desc'>('desc');
|
||||||
const [quickFilter, setQuickFilter] = useState<string | undefined>(undefined);
|
const [quickFilter, setQuickFilter] = useState<string | undefined>(undefined);
|
||||||
|
const [source, setSource] = useState<string | undefined>(undefined);
|
||||||
|
|
||||||
const filters: Record<string, unknown> = {};
|
const filters: Record<string, unknown> = {};
|
||||||
if (activeStatus !== 'all') filters.status = activeStatus;
|
if (activeStatus !== 'all') filters.status = activeStatus;
|
||||||
|
if (source) filters.source = source;
|
||||||
if (keyword.trim()) filters.keyword = keyword.trim();
|
if (keyword.trim()) filters.keyword = keyword.trim();
|
||||||
if (dateRange?.[0]) filters.date_from = dateRange[0].startOf('day').toISOString();
|
if (dateRange?.[0]) filters.date_from = dateRange[0].startOf('day').toISOString();
|
||||||
if (dateRange?.[1]) filters.date_to = dateRange[1].endOf('day').toISOString();
|
if (dateRange?.[1]) filters.date_to = dateRange[1].endOf('day').toISOString();
|
||||||
@@ -211,6 +226,7 @@ export default function WithdrawsPage() {
|
|||||||
setSortBy('created_at');
|
setSortBy('created_at');
|
||||||
setSortOrder('desc');
|
setSortOrder('desc');
|
||||||
setQuickFilter(undefined);
|
setQuickFilter(undefined);
|
||||||
|
setSource(undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
const applyQuickFilter = (value?: string) => {
|
const applyQuickFilter = (value?: string) => {
|
||||||
@@ -481,6 +497,12 @@ export default function WithdrawsPage() {
|
|||||||
width: 120,
|
width: 120,
|
||||||
render: (v: number) => <Text strong>{yuan(v)}</Text>,
|
render: (v: number) => <Text strong>{yuan(v)}</Text>,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '提现类型',
|
||||||
|
dataIndex: 'source',
|
||||||
|
width: 110,
|
||||||
|
render: (v: string) => <Tag color={SOURCE_COLOR[v] || 'default'}>{SOURCE_LABEL[v] || v}</Tag>,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '累计提现',
|
title: '累计提现',
|
||||||
dataIndex: 'cumulative_success_cents',
|
dataIndex: 'cumulative_success_cents',
|
||||||
@@ -724,6 +746,14 @@ export default function WithdrawsPage() {
|
|||||||
}}
|
}}
|
||||||
onSearch={(value) => setKeyword(value.trim())}
|
onSearch={(value) => setKeyword(value.trim())}
|
||||||
/>
|
/>
|
||||||
|
<Select
|
||||||
|
value={source}
|
||||||
|
allowClear
|
||||||
|
placeholder="提现类型"
|
||||||
|
style={{ width: 140 }}
|
||||||
|
options={SOURCE_OPTIONS}
|
||||||
|
onChange={(value?: string) => setSource(value)}
|
||||||
|
/>
|
||||||
<Select
|
<Select
|
||||||
value={quickFilter}
|
value={quickFilter}
|
||||||
allowClear
|
allowClear
|
||||||
@@ -849,7 +879,7 @@ export default function WithdrawsPage() {
|
|||||||
showTotal: (t) => `共 ${t} 条`,
|
showTotal: (t) => `共 ${t} 条`,
|
||||||
onChange: onPageChange,
|
onChange: onPageChange,
|
||||||
}}
|
}}
|
||||||
scroll={{ x: 1350 }}
|
scroll={{ x: 1460 }}
|
||||||
onRow={(record) => ({
|
onRow={(record) => ({
|
||||||
onClick: () => openDetail(record),
|
onClick: () => openDetail(record),
|
||||||
style: { cursor: 'pointer' },
|
style: { cursor: 'pointer' },
|
||||||
@@ -881,6 +911,11 @@ export default function WithdrawsPage() {
|
|||||||
<Descriptions.Item label="金额">
|
<Descriptions.Item label="金额">
|
||||||
<Text strong>{yuan(detail.order.amount_cents)}</Text>
|
<Text strong>{yuan(detail.order.amount_cents)}</Text>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="提现类型">
|
||||||
|
<Tag color={SOURCE_COLOR[detail.order.source] || 'default'}>
|
||||||
|
{SOURCE_LABEL[detail.order.source] || detail.order.source}
|
||||||
|
</Tag>
|
||||||
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="提现实名">
|
<Descriptions.Item label="提现实名">
|
||||||
{detail.order.user_name || '-'}
|
{detail.order.user_name || '-'}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
|||||||
+11
-1
@@ -117,6 +117,8 @@ export interface WithdrawOrder {
|
|||||||
user_id: number;
|
user_id: number;
|
||||||
out_bill_no: string;
|
out_bill_no: string;
|
||||||
amount_cents: number;
|
amount_cents: number;
|
||||||
|
// 提现类型:coin_cash(福利页提现,金币兑换现金) / invite_cash(邀请提现,邀请奖励金)
|
||||||
|
source: string;
|
||||||
user_name: string | null;
|
user_name: string | null;
|
||||||
status: string; // reviewing / pending / success / failed / rejected
|
status: string; // reviewing / pending / success / failed / rejected
|
||||||
wechat_state: string | null;
|
wechat_state: string | null;
|
||||||
@@ -239,12 +241,17 @@ export interface Feedback {
|
|||||||
user_id: number;
|
user_id: number;
|
||||||
content: string;
|
content: string;
|
||||||
contact: string;
|
contact: string;
|
||||||
|
// 反馈来源入口:profile(「我的」页=普通反馈) / comparison(比价结果页=比价反馈)
|
||||||
|
source: string;
|
||||||
|
// 比价反馈的问题场景(找错商品/优惠不对…);普通反馈为 null
|
||||||
|
scene: string | null;
|
||||||
images: string[] | null;
|
images: string[] | null;
|
||||||
// pending(审核中) / adopted(已采纳) / rejected(未采纳);历史数据可能为 new
|
// pending(审核中) / adopted(已采纳) / rejected(未采纳);历史数据可能为 new
|
||||||
status: string;
|
status: string;
|
||||||
reject_reason: string | null; // 未采纳原因(用户端可见)
|
reject_reason: string | null; // 未采纳原因(用户端可见)
|
||||||
reward_coins: number | null; // 采纳后发放金币
|
reward_coins: number | null; // 采纳后发放金币
|
||||||
review_note: string | null; // 审核批注(采纳要点 / 内部备注)
|
review_note: string | null; // 审核批注(采纳要点 / 内部备注,用户不可见)
|
||||||
|
admin_reply: string | null; // 运营给用户的回复留言(用户端可见)
|
||||||
reviewed_by_admin_id: number | null;
|
reviewed_by_admin_id: number | null;
|
||||||
reviewed_at: string | null;
|
reviewed_at: string | null;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
@@ -425,6 +432,7 @@ export interface AdRevenueRow {
|
|||||||
impressions: number; // 本行展示条数 1/0(供日汇总、趋势图复用)
|
impressions: number; // 本行展示条数 1/0(供日汇总、趋势图复用)
|
||||||
ecpm: string | null; // 分/千次;展示行取展示值,纯发奖行取发奖采用值
|
ecpm: string | null; // 分/千次;展示行取展示值,纯发奖行取发奖采用值
|
||||||
revenue_yuan: number; // 本次展示预估收益(元);纯发奖行=0
|
revenue_yuan: number; // 本次展示预估收益(元);纯发奖行=0
|
||||||
|
row_revenue_yuan?: number | null; // 主表逐行显示用:一次比价/领券聚合行=该次发奖广告 eCPM 折算之和;其它行空(回退 revenue_yuan)
|
||||||
adn: string | null; // 实际填充 ADN;纯发奖行为空
|
adn: string | null; // 实际填充 ADN;纯发奖行为空
|
||||||
slot_id: string | null; // 底层 mediation rit;纯发奖行为空
|
slot_id: string | null; // 底层 mediation rit;纯发奖行为空
|
||||||
// ── 发奖侧 ──
|
// ── 发奖侧 ──
|
||||||
@@ -434,6 +442,8 @@ export interface AdRevenueRow {
|
|||||||
actual_coin: number; // 实发金币;纯展示=0
|
actual_coin: number; // 实发金币;纯展示=0
|
||||||
matched: boolean; // 本条应发==实发;纯展示恒 true(不计对账)
|
matched: boolean; // 本条应发==实发;纯展示恒 true(不计对账)
|
||||||
reward_detail: AdRevenueRecord | null; // 发奖复算明细(点行展开下钻);纯展示为空
|
reward_detail: AdRevenueRecord | null; // 发奖复算明细(点行展开下钻);纯展示为空
|
||||||
|
sub_rewards?: AdRevenueRecord[]; // 一次比价/领券聚合行的组内逐条明细(同整场 ad_session_id 的多条广告);展开渲染多行
|
||||||
|
sub_count?: number; // 本行聚合的发奖条数:一次比价/领券=该次广告条数(≥1);激励视频/纯展示=1
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdRevenueReport {
|
export interface AdRevenueReport {
|
||||||
|
|||||||
Reference in New Issue
Block a user