From e68b97e1048b4a9e06014272ded356ed6a3ac406 Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Thu, 8 Dec 2022 19:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E5=9B=BE=E7=89=87=E9=97=AE?= =?UTF-8?q?=E9=A2=98):=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=9B=BE=E7=89=87=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/constant.ts | 2 +- src/components/goodsItem/index.tsx | 15 +++++++++++++-- src/pages/orderDetails/index.tsx | 10 ++++++++-- src/pages/submitOrder/index.tsx | 11 +++++++++-- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/common/constant.ts b/src/common/constant.ts index cf1a448..8c53c74 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -5,7 +5,7 @@ export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.89:40001/lymarket` // export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞 // export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境 -// export const BASE_URL = `https://pre.zzfzyc.com/lymarket` // 预发布 +// export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布 // export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发 // export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发 // export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发 diff --git a/src/components/goodsItem/index.tsx b/src/components/goodsItem/index.tsx index af2b8a5..43aa285 100644 --- a/src/components/goodsItem/index.tsx +++ b/src/components/goodsItem/index.tsx @@ -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 ( - { + + {/* { props?.value?.rgb?.r == 0 && props?.value?.rgb?.g == 0 && props?.value?.rgb?.b == 0 && } { (props?.value?.rgb?.r != 0 || props?.value?.rgb?.g != 0 || props?.value?.rgb?.b != 0) && - } + } */} + + + {props.value?.code} {props.value?.name} diff --git a/src/pages/orderDetails/index.tsx b/src/pages/orderDetails/index.tsx index 8bb9448..6c3a359 100644 --- a/src/pages/orderDetails/index.tsx +++ b/src/pages/orderDetails/index.tsx @@ -33,7 +33,7 @@ import { formatDateTime, formatPriceDiv, formatWeightDiv } from '@/common/format import IconFont from '@/components/iconfont/iconfont' import { PAY_H5_CODE_URL } from '@/common/constant' import SaleCodeList from '@/components/SaleCodeList' - +import LabAndImg from '@/components/LabAndImg' // 卡片盒子元素 interface Obs { title?: string @@ -79,6 +79,9 @@ interface PropGoods { } const GoodsItem = (porps: PropGoods) => { const { list = [], obj = {} } = porps + const labAndImgObj = useCallback((item) => { + return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url } + }, []) return ( <> { @@ -91,7 +94,10 @@ const GoodsItem = (porps: PropGoods) => { item.product_colors.map((it, inx) => { return ( - + + + + {/* */} {it.code}# {it.name} diff --git a/src/pages/submitOrder/index.tsx b/src/pages/submitOrder/index.tsx index 864c301..bfca299 100644 --- a/src/pages/submitOrder/index.tsx +++ b/src/pages/submitOrder/index.tsx @@ -16,7 +16,7 @@ import { alert } from '@/common/common' import { formatDateTime, formatPriceDiv, formatWeightDiv } from '@/common/format' import IconFont from '@/components/iconfont/iconfont' import { MpPurchaserAddressList } from '@/api/addressList' - +import LabAndImg from '@/components/LabAndImg' // 卡片盒子元素 interface Obs { title?: string @@ -62,6 +62,10 @@ interface PropGoods { } const GoodsItem = (porps: PropGoods) => { const { list = [], obj = {} } = porps + + const labAndImgObj = useCallback((item) => { + return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url } + }, []) return ( <> { @@ -74,7 +78,10 @@ const GoodsItem = (porps: PropGoods) => { item.product_colors.map((it, inx) => { return ( - + + + + {/* */} {it.code} {it.name}