优化金额显示等

This commit is contained in:
liu
2026-08-29 13:52:57 +08:00
parent 2317c9d973
commit 130ef2c949
17 changed files with 93 additions and 159 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
// 购物车悬浮球:右下角,底部避让自定义 tabBar(110rpx + 安全区)
.cart-ball {
position: fixed;
right: 24rpx;
left: 24rpx;
bottom: calc(150rpx + env(safe-area-inset-bottom));
z-index: 998;
display: flex;
+5 -3
View File
@@ -15,13 +15,15 @@ interface PriceTextProps {
* - block 独占一行(窄卡片:首页推荐、商品列表、购物车)
*/
mode?: 'inline' | 'block'
/** 单位 */
price_unit?: string | null
}
/**
* 商品价格:售价 + 零售价标注(小字)
* price=30、spec=15 → ¥30 零售价:¥2
*/
export default function PriceText({ price, spec, className, mode = 'inline' }: PriceTextProps) {
export default function PriceText({ price, spec, className, mode = 'inline', price_unit }: PriceTextProps) {
const retail = formatRetailPrice(price, spec)
// 窄卡片:大价格 / 零售价上下两行,避免与右侧按钮(+/步进器)挤压换行
@@ -30,7 +32,7 @@ export default function PriceText({ price, spec, className, mode = 'inline' }: P
<View className={`price-text ${className ?? ''}`}>
<Text className='price-text__main'>{price}</Text>
{retail !== null && (
<Text className='price-text__retail'>{retail}</Text>
<Text className='price-text__retail'>{retail} {price_unit}</Text>
)}
</View>
)
@@ -40,7 +42,7 @@ export default function PriceText({ price, spec, className, mode = 'inline' }: P
<Text className={className}>
{price}
{retail !== null && (
<Text className='price-text__retail price-text__retail--inline'>{retail}</Text>
<Text className='price-text__retail price-text__retail--inline'>{retail} {price_unit}</Text>
)}
</Text>
)