修复:明确领券单券成功率展示 (#68)
## 修改内容 - 将含义模糊的“百分比”列改名为“单券成功率”。 - 同时显示成功数量、有效尝试数量和百分比,例如 `7/8(87.5%)`。 - 保留点击数字查看逐张券结果明细的能力。 ## 验证结果 - Next.js 生产构建通过。 --------- Co-authored-by: linkeyu <798648091@qq.com> Reviewed-on: #68 Co-authored-by: linkeyu <linkeyu@wonderable.ai> Co-committed-by: linkeyu <linkeyu@wonderable.ai>
This commit was merged in pull request #68.
This commit is contained in:
@@ -149,6 +149,9 @@ function PointScorePopover({ row }: { row: CouponDataRow }) {
|
||||
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 scoreColor =
|
||||
row.point_success_count === row.point_total_count
|
||||
? STATUS_TAG.completed.color
|
||||
@@ -220,7 +223,7 @@ function PointScorePopover({ row }: { row: CouponDataRow }) {
|
||||
)}
|
||||
>
|
||||
<Button type="link" size="small" style={{ height: 'auto', padding: 0, color: scoreColor }}>
|
||||
{score}
|
||||
{scoreWithRate}
|
||||
</Button>
|
||||
</Popover>
|
||||
);
|
||||
@@ -602,9 +605,9 @@ export default function CouponDataPage() {
|
||||
render: (v: number | null) => fmtSec(v),
|
||||
},
|
||||
{
|
||||
title: '百分比',
|
||||
title: '单券成功率',
|
||||
key: 'point_success_rate',
|
||||
width: 110,
|
||||
width: 150,
|
||||
render: (_: unknown, r: CouponDataRow) => <PointScorePopover row={r} />,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user