Files
dukang/apps/mini-user/src/components/CouponBadge.tsx
T
jacy a01217539c
CI / verify (pull_request) Has been cancelled
v3.5.4版本提交
2026-08-21 15:48:15 +08:00

21 lines
569 B
TypeScript

import { Text, View } from '@tarojs/components';
type CouponBadgeProps = {
amount: number | string;
label?: string;
};
/** 首页商品角标:纯文案「享{amount}好客权益」(无门店图标) */
export default function CouponBadge({ amount, label = '好客权益' }: CouponBadgeProps) {
const n = Number(amount);
const display = Number.isFinite(n) ? (Number.isInteger(n) ? String(n) : n.toFixed(0)) : String(amount);
return (
<View className="coupon-badge">
<Text>
{display}
{label}
</Text>
</View>
);
}