优化金额显示等
This commit is contained in:
@@ -2,17 +2,15 @@ import { useCallback, useMemo, useState } from 'react'
|
||||
import Taro, { useDidShow } from '@tarojs/taro'
|
||||
import { View, Text, Image } from '@tarojs/components'
|
||||
import { Grid, GridItem, Icon, Search, Swiper, SwiperItem } from '@antmjs/vantui'
|
||||
import useAuthStore from '@/stores/auth/useAuthStore'
|
||||
import useCartStore from '@/stores/cart/useCartStore'
|
||||
import { getHomeConfigApi } from '@/services/home'
|
||||
import type { HomeConfig } from '@/services/home'
|
||||
import { getProductListApi } from '@/services/product'
|
||||
import { getProductCover } from '@/types/product'
|
||||
import type { Product, ProductCartPatch } from '@/types/product'
|
||||
import PriceText from '@/components/PriceText'
|
||||
import CartBall from '@/components/CartBall'
|
||||
import CartStepper from '@/components/CartStepper'
|
||||
import { formatSpec } from '@/utils/format'
|
||||
import {formatRetailPrice, formatSpec} from '@/utils/format'
|
||||
import './index.less'
|
||||
|
||||
/** 首页 → 商品页的本地存储传参 key(switchTab 无法带参) */
|
||||
@@ -265,10 +263,15 @@ export default function IndexPage() {
|
||||
/>
|
||||
<View className='product-card__info'>
|
||||
<Text className='product-card__name'>{product.name}</Text>
|
||||
<Text className='product-card__spec'>{formatSpec(product.spec, product.unit)}</Text>
|
||||
<View className='product-card__spec'>
|
||||
{formatSpec(product.spec, product.unit)}{' '}
|
||||
{product.price !== null && <>
|
||||
单价:{formatRetailPrice(product.price, product.spec)} {product.price_unit}
|
||||
</>}
|
||||
</View>
|
||||
<View className='product-card__bottom'>
|
||||
{product.price !== null ? (
|
||||
<PriceText className='product-card__price' price={product.price} spec={product.spec} mode='block' />
|
||||
<Text className='product-card__price'>¥{product.price}</Text>
|
||||
) : (
|
||||
<Text className='product-card__price product-card__price--none'>登陆后查看价格</Text>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user