Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f921f9e16 | |||
| 0c75c4f65a |
@@ -76,7 +76,6 @@ 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;
|
||||
@@ -146,22 +145,15 @@ function PointScorePopover({ row }: { row: CouponDataRow }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [loadError, setLoadError] = useState<string | null>(null);
|
||||
|
||||
const abandonedWithoutScoredResult =
|
||||
row.status === 'abandoned' && row.point_success_count === 0 && row.point_total_count === 0;
|
||||
if (
|
||||
row.point_success_count == null ||
|
||||
row.point_total_count == null ||
|
||||
(row.point_total_count <= 0 && !abandonedWithoutScoredResult)
|
||||
) {
|
||||
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 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 scoreWithRate = `${score}(${(
|
||||
row.point_success_count / row.point_total_count * 100
|
||||
).toFixed(1)}%)`;
|
||||
const scoreColor =
|
||||
row.point_total_count > 0 && row.point_success_count === row.point_total_count
|
||||
row.point_success_count === row.point_total_count
|
||||
? STATUS_TAG.completed.color
|
||||
: STATUS_TAG.abandoned.color;
|
||||
const loadDetails = async () => {
|
||||
@@ -182,14 +174,6 @@ 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"
|
||||
|
||||
@@ -550,7 +550,6 @@ export default function DashboardPage() {
|
||||
const couponPeriod = periodData?.coupon ?? null;
|
||||
const previousCouponPeriod = previousPeriodData?.coupon ?? null;
|
||||
const couponStartedDelta = percentDelta(couponPeriod?.started, previousCouponPeriod?.started);
|
||||
const couponSuccessDenominator = couponPeriod?.success_denominator ?? null;
|
||||
const couponSuccessRateValue =
|
||||
couponPeriod?.success_rate == null ? '--' : (couponPeriod.success_rate * 100).toFixed(1);
|
||||
const couponSuccessRateDelta = pointDelta(couponPeriod?.success_rate, previousCouponPeriod?.success_rate);
|
||||
@@ -876,11 +875,9 @@ export default function DashboardPage() {
|
||||
unit="%"
|
||||
delta={couponSuccessRateDelta.value}
|
||||
deltaTone={couponSuccessRateDelta.tone}
|
||||
hint={`全部点位领成功的次数 ÷(领券发起数-中途退出数);本期 ${fmtInt(
|
||||
couponPeriod?.all_success,
|
||||
)} ÷(${fmtInt(couponPeriod?.started)}-${fmtInt(couponPeriod?.abandoned)}),分母为 ${fmtInt(
|
||||
couponSuccessDenominator,
|
||||
)}。中途退出不计入分母,点位成功口径含「今日已领过」。`}
|
||||
hint={`全部点位领成功的次数 / 领券发起数;本期 ${fmtInt(couponPeriod?.all_success)} / ${fmtInt(
|
||||
couponPeriod?.started,
|
||||
)} 次。点位成功口径含「今日已领过」。`}
|
||||
/>
|
||||
<StatCard
|
||||
title="点位成功率"
|
||||
|
||||
@@ -707,8 +707,6 @@ export interface DashboardOverview {
|
||||
// 点位=一张券;成功口径 success+already_claimed;点位成功率分母=发起数×应领点位数(未跑到视为失败)。
|
||||
coupon?: {
|
||||
started: number;
|
||||
abandoned: number;
|
||||
success_denominator: number;
|
||||
all_success: number; // 全部点位领成功的完成场次数
|
||||
success_rate: number | null;
|
||||
point_success: number;
|
||||
|
||||
Reference in New Issue
Block a user