🐞 fix(图片问题):修改部分商品图片展示
This commit is contained in:
@@ -2,6 +2,7 @@ import { Image, Input, ScrollView, View } from '@tarojs/components'
|
||||
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import classnames from 'classnames'
|
||||
import styles from './index.module.scss'
|
||||
import LabAndImg from '@/components/LabAndImg'
|
||||
|
||||
interface props {
|
||||
clickAdd: (any) => void
|
||||
@@ -17,6 +18,8 @@ interface props {
|
||||
weight_cut_price?: Number
|
||||
code?: string
|
||||
rgb?: { r: number; g: number; b: number }
|
||||
lab?: { l: number; a: number; b: number }
|
||||
texture_url: string
|
||||
name?: string
|
||||
roll?: number | string
|
||||
buyNums?: number | string
|
||||
@@ -56,15 +59,23 @@ const GoodsItem = (props: props) => {
|
||||
return 'digit'
|
||||
}
|
||||
}, [props.modeFont])
|
||||
|
||||
const labAndImgObj = useCallback((item) => {
|
||||
return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url }
|
||||
}, [])
|
||||
return (
|
||||
<View className={styles.goodsBox}>
|
||||
{
|
||||
|
||||
{/* {
|
||||
props?.value?.rgb?.r == 0 && props?.value?.rgb?.g == 0 && props?.value?.rgb?.b == 0 && <Image className={styles.pic} mode="aspectFill" src="https://test.cdn.zzfzyc.com/mall/no_img.png"></Image>
|
||||
}
|
||||
{
|
||||
(props?.value?.rgb?.r != 0 || props?.value?.rgb?.g != 0 || props?.value?.rgb?.b != 0)
|
||||
&& <View className={styles.pic} style={{ backgroundColor: `rgb(${props?.value?.rgb?.r} ${props?.value?.rgb?.g} ${props?.value.rgb?.b})` }}></View>
|
||||
}
|
||||
} */}
|
||||
<View className={styles.pic}>
|
||||
<LabAndImg value={labAndImgObj(props.value)} />
|
||||
</View>
|
||||
<View className={styles.rightGoodbox}>
|
||||
<View className={styles.leftFontsbox}>
|
||||
<View className={styles.title}>{props.value?.code} {props.value?.name}</View>
|
||||
|
||||
Reference in New Issue
Block a user