显示格式优化

This commit is contained in:
liu
2026-08-21 11:35:05 +08:00
parent f0d8f6bac4
commit ffe983b9da
10 changed files with 122 additions and 26 deletions
+4 -2
View File
@@ -9,6 +9,8 @@ import type { HomeConfig } from '@/services/home'
import { getProductListApi } from '@/services/product'
import { getProductCover } from '@/types/product'
import type { Product } from '@/types/product'
import PriceText from '@/components/PriceText'
import { formatSpec } from '@/utils/format'
import './index.less'
/** 首页 → 商品页的本地存储传参 key(switchTab 无法带参) */
@@ -247,10 +249,10 @@ export default function IndexPage() {
/>
<View className='product-card__info'>
<Text className='product-card__name'>{product.name}</Text>
<Text className='product-card__spec'>{product.spec} / {product.unit}</Text>
<Text className='product-card__spec'>{formatSpec(product.spec, product.unit)}</Text>
<View className='product-card__bottom'>
{product.price !== null ? (
<Text className='product-card__price'>{product.price}</Text>
<PriceText className='product-card__price' price={product.price} spec={product.spec} mode='block' />
) : (
<Text className='product-card__price product-card__price--none'></Text>
)}