From 0f281f93c9d8831c48ede55e11967523b77b16c1 Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Sat, 8 Oct 2022 17:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf:=E5=B0=86=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E6=8C=AA=E5=87=BA=E6=9D=A5=E5=9C=A8=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BottomBtns/index.tsx | 23 +++++++++++++++++- .../components/BottomApply/index.tsx | 24 +++++-------------- src/pages/orderDetails/index.tsx | 3 ++- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/components/BottomBtns/index.tsx b/src/components/BottomBtns/index.tsx index 0842a19..c80ac50 100644 --- a/src/components/BottomBtns/index.tsx +++ b/src/components/BottomBtns/index.tsx @@ -12,6 +12,8 @@ interface prosObj { cancle?: (any) => void, nextBuy?: (any) => void, toPay?: (any) => void, + handSureGoods?: () => void, + showTuiGoods?: boolean } export default memo((props: prosObj) => { @@ -23,9 +25,11 @@ export default memo((props: prosObj) => { payment_method: 0, settle_mode: '' }, + showTuiGoods = false, cancle, nextBuy, - toPay + toPay, + handSureGoods } = props //判断显示取消订单 @@ -75,8 +79,25 @@ export default memo((props: prosObj) => { } else return false }, [obj]) + //判断显示确认收货 + const showTake = useMemo(() => { + if ( + (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 0) || + (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 1) || + (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 2) || + (obj.sale_mode === 0 && obj.status == 8 && obj.settle_mode == 3) || + (obj.sale_mode === 1 && obj.status == 8) || + (obj.sale_mode === 2 && obj.status == 8) + ) { + return true + } else return false + }, [obj]) + return ( + { + showTake && showTuiGoods && handSureGoods?.()}>确认收货 + } { showCancel && cancle?.(e)}>取消订单 } diff --git a/src/pages/orderDetails/components/BottomApply/index.tsx b/src/pages/orderDetails/components/BottomApply/index.tsx index 1107ba5..fe08c48 100644 --- a/src/pages/orderDetails/components/BottomApply/index.tsx +++ b/src/pages/orderDetails/components/BottomApply/index.tsx @@ -12,7 +12,7 @@ interface prosObj { } handApplyGoods?: () => void, handApplyMoney?: () => void, - handSureGoods?: () => void, + // handSureGoods?: () => void, } export default memo((props: prosObj) => { @@ -26,7 +26,7 @@ export default memo((props: prosObj) => { }, handApplyGoods, handApplyMoney, - handSureGoods + // handSureGoods } = props //判断显示申请退货 @@ -58,19 +58,7 @@ export default memo((props: prosObj) => { return true } else return false }, [obj]) - //判断显示确认收货 - const showTake = useMemo(() => { - if ( - (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 0) || - (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 1) || - (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 2) || - (obj.sale_mode === 0 && obj.status == 8 && obj.settle_mode == 3) || - (obj.sale_mode === 1 && obj.status == 8) || - (obj.sale_mode === 2 && obj.status == 8) - ) { - return true - } else return false - }, [obj]) + return ( @@ -85,13 +73,13 @@ export default memo((props: prosObj) => { showTuikuan && handApplyMoney?.()}>申请退款 } - + {/* { showTake && handSureGoods?.()}>确认收货 - } + } */} { - !showTuihuo && !showTuikuan && !showTake && 暂无更多 + !showTuihuo && !showTuikuan && 暂无更多 } ) diff --git a/src/pages/orderDetails/index.tsx b/src/pages/orderDetails/index.tsx index 08e3e62..6a50a98 100644 --- a/src/pages/orderDetails/index.tsx +++ b/src/pages/orderDetails/index.tsx @@ -684,15 +684,16 @@ export default () => { obj={infoObj} handApplyGoods={() => handApplyGood?.()} handApplyMoney={() => handApplyMoney?.()} - handSureGoods={() => handSureGoods?.()} > } cancle?.(e, infoObj)} nextBuy={(e) => nextBuy?.(e, infoObj)} toPay={(e) => toPay?.(e, infoObj)} + handSureGoods={() => handSureGoods?.()} >