fix: 保留跳过单券明细入口
This commit is contained in:
@@ -76,6 +76,7 @@ interface CouponDataRow {
|
||||
claimed_count: number | null;
|
||||
point_success_count: number | null;
|
||||
point_total_count: number | null;
|
||||
point_event_count?: number;
|
||||
// 兼容旧后端的内嵌明细;新后端不再返回,改为点击后按 trace 加载。
|
||||
point_details?: CouponPointDetail[];
|
||||
trace_url: string | null;
|
||||
@@ -145,24 +146,22 @@ function PointScorePopover({ row }: { row: CouponDataRow }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [loadError, setLoadError] = useState<string | null>(null);
|
||||
|
||||
const abandonedWithoutPointResult =
|
||||
const abandonedWithoutScoredResult =
|
||||
row.status === 'abandoned' && row.point_success_count === 0 && row.point_total_count === 0;
|
||||
if (abandonedWithoutPointResult) {
|
||||
return (
|
||||
<Tooltip title="本次在第一张券产生终态前中途退出,没有可计入成功/尝试的单券结果;按运营展示口径记为 0.0%,不虚构失败券数量。">
|
||||
<Typography.Text type="warning">0.0%(退出前无结果)</Typography.Text>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
if (row.point_success_count == null || row.point_total_count == null || row.point_total_count <= 0) {
|
||||
if (
|
||||
row.point_success_count == null ||
|
||||
row.point_total_count == null ||
|
||||
(row.point_total_count <= 0 && !abandonedWithoutScoredResult)
|
||||
) {
|
||||
return <Typography.Text type="secondary">-</Typography.Text>;
|
||||
}
|
||||
const score = `${row.point_success_count}/${row.point_total_count}`;
|
||||
const scoreWithRate = `${score}(${(
|
||||
row.point_success_count / row.point_total_count * 100
|
||||
).toFixed(1)}%)`;
|
||||
const hasPointDetails = (row.point_event_count ?? 0) > 0;
|
||||
const scoreWithRate = abandonedWithoutScoredResult
|
||||
? `0.0%(${hasPointDetails ? '无有效结果' : '退出前无结果'})`
|
||||
: `${score}(${(row.point_success_count / row.point_total_count * 100).toFixed(1)}%)`;
|
||||
const scoreColor =
|
||||
row.point_success_count === row.point_total_count
|
||||
row.point_total_count > 0 && row.point_success_count === row.point_total_count
|
||||
? STATUS_TAG.completed.color
|
||||
: STATUS_TAG.abandoned.color;
|
||||
const loadDetails = async () => {
|
||||
@@ -183,6 +182,14 @@ function PointScorePopover({ row }: { row: CouponDataRow }) {
|
||||
}
|
||||
};
|
||||
|
||||
if (abandonedWithoutScoredResult && !hasPointDetails) {
|
||||
return (
|
||||
<Tooltip title="本次在第一张券产生终态前中途退出,没有可计入成功/尝试的单券结果;按运营展示口径记为 0.0%,不虚构失败券数量。">
|
||||
<Typography.Text type="warning">{scoreWithRate}</Typography.Text>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Popover
|
||||
trigger="click"
|
||||
|
||||
Reference in New Issue
Block a user