🐞 fix(ID1001378 面料详情页的图片失真):
This commit is contained in:
parent
45ca81233f
commit
2917f201ec
@ -18,8 +18,9 @@ interface Param {
|
|||||||
onClick?: (val: Param['value']) => void
|
onClick?: (val: Param['value']) => void
|
||||||
round?: boolean
|
round?: boolean
|
||||||
name?: string
|
name?: string
|
||||||
|
suffix?: string
|
||||||
}
|
}
|
||||||
const LabAndImg = ({ value, onClick, showStatus = false, round = false, name = '', customImageStyle = {} }: Param) => {
|
const LabAndImg = ({ value, onClick, showStatus = false, round = false, name = '', customImageStyle = {}, suffix = '!w200' }: Param) => {
|
||||||
const [imgs, setImgs] = useState<string>('')
|
const [imgs, setImgs] = useState<string>('')
|
||||||
|
|
||||||
// lab是否都是0
|
// lab是否都是0
|
||||||
@ -35,7 +36,7 @@ const LabAndImg = ({ value, onClick, showStatus = false, round = false, name = '
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (value?.texture_url) {
|
if (value?.texture_url) {
|
||||||
const imgs = value.texture_url.split(',').map((item) => {
|
const imgs = value.texture_url.split(',').map((item) => {
|
||||||
return formatImgUrl(item)
|
return formatImgUrl(item, suffix)
|
||||||
})
|
})
|
||||||
setImgs(() => imgs[0])
|
setImgs(() => imgs[0])
|
||||||
}
|
}
|
||||||
|
|||||||
@ -405,6 +405,7 @@ const Details = (props: Params) => {
|
|||||||
<View className={styles.productColorDialog_img}>
|
<View className={styles.productColorDialog_img}>
|
||||||
<LabAndImg
|
<LabAndImg
|
||||||
customImageStyle={{ borderRadius: '0' }}
|
customImageStyle={{ borderRadius: '0' }}
|
||||||
|
suffix="!w1000"
|
||||||
value={{ lab: currentDialogDetail.current!.lab, rgb: currentDialogDetail.current!.rgb, texture_url: currentDialogDetail.current!.texture_url, title: currentDialogDetail.current!.code }}
|
value={{ lab: currentDialogDetail.current!.lab, rgb: currentDialogDetail.current!.rgb, texture_url: currentDialogDetail.current!.texture_url, title: currentDialogDetail.current!.code }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user