From 671b94b961e01766c76522f7e90e40130d6b5522 Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Fri, 2 Sep 2022 11:24:22 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=84=20refactor:85%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../searchPage/compoents/goods/index.module.scss | 6 ++++++ src/pages/searchPage/compoents/goods/index.tsx | 14 ++++++++++---- src/pages/searchPage/index.tsx | 5 +++++ 3 files changed, 21 insertions(+), 4 deletions(-) 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]) } //返回