Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c55ceccf8 |
@@ -137,11 +137,6 @@ const slotRateMean = (rows: CouponSlotRow[]): number | null => {
|
||||
return rates.length ? rates.reduce((a, b) => a + b, 0) / rates.length : null;
|
||||
};
|
||||
|
||||
// 汇总卡成功率口径 tooltip 文案
|
||||
const POINT_RATE_HINT =
|
||||
'点位成功率(合计):当前区间内全部券成功率的算术平均(每张券等权);' +
|
||||
'单券成功率=成功(含已领)÷尝试(不含跳过),源自领券每券记录。';
|
||||
|
||||
// 按券表:coupon_id 平台 → 中文
|
||||
const SLOT_PLATFORM: Record<string, string> = {
|
||||
'meituan-waimai': '美团',
|
||||
@@ -597,6 +592,10 @@ export default function CouponDataPage() {
|
||||
const successDenominator = summary ? Math.max(0, summary.started_count - abandonedCount) : 0;
|
||||
const couponSuccessRate =
|
||||
summary && successDenominator > 0 ? summary.completed_count / successDenominator : null;
|
||||
const validCouponSlots = couponSlots.filter((r) => r.success_rate != null);
|
||||
const pointSuccessRate = slotRateMean(validCouponSlots);
|
||||
const pointSucceededTotal = validCouponSlots.reduce((total, r) => total + r.succeeded, 0);
|
||||
const pointTriedTotal = validCouponSlots.reduce((total, r) => total + r.tried, 0);
|
||||
const items = data?.items ?? [];
|
||||
|
||||
return (
|
||||
@@ -714,8 +713,19 @@ export default function CouponDataPage() {
|
||||
<Statistic
|
||||
title={
|
||||
<span>
|
||||
领券成功率{' '}
|
||||
<Tooltip title="领券完成数 ÷(领券发起数-中途退出数)">
|
||||
领券完成率{' '}
|
||||
<Tooltip
|
||||
overlayStyle={{ maxWidth: 520 }}
|
||||
title={
|
||||
<div>
|
||||
<div>计算逻辑:领券完成数 ÷(领券发起数-中途退出数)</div>
|
||||
<div style={{ marginTop: 6 }}>
|
||||
本期:{summary.completed_count} ÷({summary.started_count}-{abandonedCount})
|
||||
= {fmtPct(couponSuccessRate)}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<InfoCircleOutlined style={{ color: '#999' }} />
|
||||
</Tooltip>
|
||||
</span>
|
||||
@@ -728,12 +738,33 @@ export default function CouponDataPage() {
|
||||
title={
|
||||
<span>
|
||||
点位成功率{' '}
|
||||
<Tooltip title={POINT_RATE_HINT}>
|
||||
<Tooltip
|
||||
overlayStyle={{ maxWidth: 560 }}
|
||||
title={
|
||||
<div>
|
||||
<div>计算逻辑:全部单券成功率的算术平均,每张券等权。</div>
|
||||
<div>单券成功率=成功数(含已领)÷ 尝试数(不含跳过)。</div>
|
||||
<div style={{ marginTop: 6 }}>
|
||||
本期共 {validCouponSlots.length} 张有效券:
|
||||
</div>
|
||||
{validCouponSlots.map((slot) => (
|
||||
<div key={slot.coupon_id}>
|
||||
{slot.coupon_name || slot.coupon_id}:{slot.succeeded} ÷ {slot.tried}=
|
||||
{fmtPct(slot.success_rate)}
|
||||
</div>
|
||||
))}
|
||||
<div style={{ marginTop: 6 }}>
|
||||
等权平均={fmtPct(pointSuccessRate)};累计成功/尝试=
|
||||
{pointSucceededTotal}/{pointTriedTotal}(累计数仅辅助核对,不作为当前加权公式)。
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<InfoCircleOutlined style={{ color: '#999' }} />
|
||||
</Tooltip>
|
||||
</span>
|
||||
}
|
||||
value={fmtPct(slotRateMean(couponSlots))}
|
||||
value={fmtPct(pointSuccessRate)}
|
||||
/>
|
||||
</Col>
|
||||
<Col flex="1 1 0">
|
||||
|
||||
Reference in New Issue
Block a user