样式
This commit is contained in:
@@ -102,6 +102,11 @@ export default function IndexPage() {
|
||||
Taro.switchTab({ url: '/pages/product/index' })
|
||||
}, [])
|
||||
|
||||
/** 跳转商品详情 */
|
||||
const goDetail = useCallback((id: number) => {
|
||||
Taro.navigateTo({ url: `/pages/product-detail/index?id=${id}` })
|
||||
}, [])
|
||||
|
||||
/** 搜索框聚焦/提交 → 商品页搜索 */
|
||||
const handleSearchFocus = useCallback(() => {
|
||||
goProduct(keyword.trim())
|
||||
@@ -240,7 +245,7 @@ export default function IndexPage() {
|
||||
) : (
|
||||
<View className='product-grid'>
|
||||
{products.map(product => (
|
||||
<View key={product.id} className='product-card' onClick={() => goProduct()}>
|
||||
<View key={product.id} className='product-card' onClick={() => goDetail(product.id)}>
|
||||
<Image
|
||||
className='product-card__image'
|
||||
src={getProductCover(product) || 'https://img.yzcdn.cn/vant/cat.jpeg'}
|
||||
|
||||
Reference in New Issue
Block a user