🦄 refactor:85%
This commit is contained in:
parent
83d6b1c9d5
commit
671b94b961
@ -46,6 +46,12 @@
|
||||
position: relative;
|
||||
margin-right: 24px;
|
||||
|
||||
.pic {
|
||||
width: 144px;
|
||||
height: 144px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.posBox {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
|
@ -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 (
|
||||
<View className={styles.itemBox}>
|
||||
{
|
||||
!props.lab && <>
|
||||
props.data?.texture_url === '' && <>
|
||||
|
||||
<View className={styles.picBox}>
|
||||
<Image className={styles.pic} mode={'aspectFill'} src={'https://test.cdn.zzfzyc.com/mall/no_img.png'}></Image>
|
||||
@ -16,9 +20,11 @@ export default memo((props: any) => {
|
||||
</>
|
||||
}
|
||||
{
|
||||
props.lab &&
|
||||
props.data?.texture_url !== '' &&
|
||||
<>
|
||||
<View className={styles.leftBox}>
|
||||
<LabAndImg value={labAndImgObj(props.data)} />
|
||||
{/* <Image className={styles.pic} mode={'aspectFill'} src={props.data?.picUrl}></Image> */}
|
||||
<View className={styles.posBox}>{props.data?.product_color_count}色</View>
|
||||
</View>
|
||||
</>
|
||||
|
@ -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])
|
||||
}
|
||||
//返回
|
||||
|
Loading…
x
Reference in New Issue
Block a user