@@ -1,4 +1,5 @@
|
||||
import { Text } from '@tarojs/components';
|
||||
import { Text, View } from '@tarojs/components';
|
||||
import BenefitFigure from './BenefitFigure';
|
||||
|
||||
type CouponBadgeProps = {
|
||||
amount: number | string;
|
||||
@@ -10,8 +11,9 @@ export default function CouponBadge({ amount, label = '好客权益' }: CouponBa
|
||||
const n = Number(amount);
|
||||
const display = Number.isFinite(n) ? (Number.isInteger(n) ? String(n) : n.toFixed(0)) : String(amount);
|
||||
return (
|
||||
<Text className="coupon-badge">
|
||||
享 ¥{display} {label}
|
||||
</Text>
|
||||
<View className="coupon-badge">
|
||||
<Text>享</Text>
|
||||
<BenefitFigure value={`${display} ${label}`} size="sm" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user