From f27605086cd679f45104a757bd757a1bf4ad0c8b Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Sat, 10 Dec 2022 20:00:38 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(ID1000796):2.2=E9=9D=A2?= =?UTF-8?q?=E6=96=99=E8=AF=A6=E6=83=85=E9=A1=B5=EF=BC=9A=E8=89=B2=E5=8F=B7?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E4=BB=85=E9=9C=80=E5=B1=95=E7=A4=BA=E6=A0=87?= =?UTF-8?q?=E5=87=86=E6=8A=A5=E4=BB=B7=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/orderCount/index.module.scss | 17 +++++++++-- .../details/components/orderCount/index.tsx | 28 ++++++++++++++++--- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/pages/details/components/orderCount/index.module.scss b/src/pages/details/components/orderCount/index.module.scss index d8d319c..f003bf6 100644 --- a/src/pages/details/components/orderCount/index.module.scss +++ b/src/pages/details/components/orderCount/index.module.scss @@ -96,11 +96,22 @@ font-weight: 700; @include common_ellipsis(); } - .num { - font-size: $font_size; - color: $color_main; + .flexBox { padding-top: 10px; + display: flex; + align-items: center; + .numone { + font-size: $font_size; + color: #9e9e9e; + margin-right: 10px; + text-decoration: line-through; + } + .num { + font-size: $font_size; + color: $color_main; + } } + .weight_error { font-size: 28px; color: #666666; diff --git a/src/pages/details/components/orderCount/index.tsx b/src/pages/details/components/orderCount/index.tsx index 6c46d4b..f05f225 100644 --- a/src/pages/details/components/orderCount/index.tsx +++ b/src/pages/details/components/orderCount/index.tsx @@ -29,8 +29,8 @@ const OrderCount = ({ show = false, onClose, title = '', productId = 0 }: param) const { adminUserInfo } = useSelector(state => state.userInfo) const [selectList, _] = useState([ - { id: 0, step: 1, digits: 0, maxNum: 100000, defaultNum: 1, title: '大货', unit: '条', eunit: 'kg', priceField: 'bulk_price' }, - { id: 1, step: 1, digits: 2, maxNum: 9.99, defaultNum: 1, title: '剪板', unit: '米', eunit: 'm', priceField: 'length_cut_price' }, + { id: 0, step: 1, digits: 0, maxNum: 100000, defaultNum: 1, title: '大货', unit: '条', eunit: 'kg', priceField: 'bulk_price', originalPrice: 'last_bulk_price' }, + { id: 1, step: 1, digits: 2, maxNum: 9.99, defaultNum: 1, title: '剪板', unit: '米', eunit: 'm', priceField: 'length_cut_price', originalPrice: 'last_length_cut_price' }, { id: 2, step: 1, @@ -43,6 +43,7 @@ const OrderCount = ({ show = false, onClose, title = '', productId = 0 }: param) unit: '米', eunit: 'kg', priceField: 'weight_cut_price', + originalPrice: 'last_weight_cut_price', }, ]) const [selectIndex, setSelectIndex] = useState(0) @@ -216,6 +217,21 @@ const OrderCount = ({ show = false, onClose, title = '', productId = 0 }: param) [selectIndex], ) + const formatOriginalPrice = useCallback( + (item) => { + if (selectIndex === 1 || selectIndex === 2) { return } + const price = Number(formatPriceDiv(item[selectList[selectIndex].originalPrice])) + return ( + + ¥ + {price} + /{selectList[selectIndex].eunit} + + ) + }, + [selectIndex], + ) + // 显示图片弹窗 const [showLabImage, setShowLabImage] = useState(false) const [labImageValue, setLabImageValue] = useState() @@ -237,8 +253,12 @@ const OrderCount = ({ show = false, onClose, title = '', productId = 0 }: param) {formatHashTag(item.code, item.name)} - {selectIndex == 0 && 空差:{formatWeightDiv(item.weight_error)}kg} - {formatPrice(item)} + {/* {selectIndex == 0 && 空差:{formatWeightDiv(item.weight_error)}kg} */} + + {selectIndex === 0 && {formatOriginalPrice(item)}} + {formatPrice(item)} + + {(!item.show && (