diff --git a/src/pages/searchPage/compoents/goods/index.module.scss b/src/pages/searchPage/compoents/goods/index.module.scss index fa336da..6fdeb36 100644 --- a/src/pages/searchPage/compoents/goods/index.module.scss +++ b/src/pages/searchPage/compoents/goods/index.module.scss @@ -46,6 +46,12 @@ position: relative; margin-right: 24px; + .pic { + width: 144px; + height: 144px; + border-radius: 8px; + } + .posBox { position: absolute; bottom: 0px; diff --git a/src/pages/searchPage/compoents/goods/index.tsx b/src/pages/searchPage/compoents/goods/index.tsx index a0a328b..1bd73a7 100644 --- a/src/pages/searchPage/compoents/goods/index.tsx +++ b/src/pages/searchPage/compoents/goods/index.tsx @@ -1,13 +1,17 @@ import { View, Image } from '@tarojs/components' import React, { useCallback, memo, useEffect, useMemo, useRef, useState } from 'react' import styles from "../goods/index.module.scss" - - +import LabAndImg from "@/components/LabAndImg" export default memo((props: any) => { + + + const labAndImgObj = useCallback((item) => { + return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url } + }, []) return ( { - !props.lab && <> + props.data?.texture_url === '' && <> @@ -16,9 +20,11 @@ export default memo((props: any) => { } { - props.lab && + props.data?.texture_url !== '' && <> + + {/* */} {props.data?.product_color_count}色 diff --git a/src/pages/searchPage/index.tsx b/src/pages/searchPage/index.tsx index c988ac4..0e5b5b9 100644 --- a/src/pages/searchPage/index.tsx +++ b/src/pages/searchPage/index.tsx @@ -33,6 +33,11 @@ export default memo(() => { const { fetchData: productFetch } = mpproductlist() const getProduct = async (e) => { const res = await productFetch({ code_or_name: e }) + // res.data.list.map(item=>{ + // if(item.texture_url !==''){ + + // } + // }) setSearchList([...res.data.list]) } //返回