From b0eb441bfe1b1363fe16845c9a7d80380214e595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E5=96=B5=E5=92=AA?= <15233722133@163.com> Date: Fri, 7 Aug 2026 16:26:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E7=AB=8B=E5=8D=B3=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E3=80=81=E5=BB=B6=E8=BF=9F=E5=8F=91=E8=B4=A7=E3=80=81=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E8=AE=A2=E5=8D=95=E6=8C=89=E9=92=AE=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/orderItem/AiOrderActionBar.vue | 16 +++++----- components/orderItem/orderItem.vue | 2 +- pages/order/detail.vue | 39 +++++++++++++++++++++++ 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/components/orderItem/AiOrderActionBar.vue b/components/orderItem/AiOrderActionBar.vue index dbd24ae..2477c12 100644 --- a/components/orderItem/AiOrderActionBar.vue +++ b/components/orderItem/AiOrderActionBar.vue @@ -92,21 +92,21 @@ }, }); + // 延迟发货按钮:仅允许【待发货(10/伪50)、部分发货(15)】状态展示 + // 伪状态 50 = 原生 status=10 + 有 status===1(延迟中)的商品,属于待发货分支 const showDelay = computed(() => { - // 待收货(status=50)不展示延迟发货按钮——货已经发出,不需要延迟/立即发货操作 const s = Number(props.status); - if (s === 50) return false; - if (![10, 15].includes(s)) return false; - if (s === 10 || s === 15) return true; + if (s === 20) return false; // 待收货:不展示 + if (![10, 15, 50].includes(s)) return false; return Boolean(props.canDelayItems); }); + // 立即发货按钮:仅允许【待发货(10/伪50)、部分发货(15)】状态, + // 且必须 delayRecords 里存在 status===1(延迟中)的商品(hasDelayedItems===true) const showNow = computed(() => { - // 待收货(status=50)不展示立即发货按钮 const s = Number(props.status); - if (s === 50) return false; - if (![10, 15].includes(s)) return false; - // 只有存在延迟中(status===1)的商品时才展示立即发货按钮 + if (s === 20) return false; // 待收货:不展示 + if (![10, 15, 50].includes(s)) return false; if (!Boolean(props.hasDelayedItems)) return false; return Boolean(props.canShipItems); }); diff --git a/components/orderItem/orderItem.vue b/components/orderItem/orderItem.vue index d906584..4347f87 100644 --- a/components/orderItem/orderItem.vue +++ b/components/orderItem/orderItem.vue @@ -77,7 +77,7 @@ Number(record?.status) === 1); }); + const getCurrentDelayRecords = () => { + if (Array.isArray(state.delayRecords) && state.delayRecords.length > 0) return state.delayRecords; + const orderRecords = Array.isArray(state.orderInfo?.delayRecords) + ? state.orderInfo.delayRecords + : Array.isArray(state.orderInfo?.delayRecordList) + ? state.orderInfo.delayRecordList + : []; + return orderRecords; + }; + + const canDelayItems = computed(() => { + if (!isAiStoreOrder.value) return false; + if (isPickUpOrder.value) return false; + const delayRecords = getCurrentDelayRecords(); + const hasActivated = delayRecords.some((record) => Number(record?.status) === 2); + if (hasActivated) return true; + if (delayRecords.length === 0) { + const totalCount = Number(state.orderInfo?.productCount || state.orderInfo?.totalCount || 0) || 0; + if (totalCount > 0) return true; + } + return false; + }); + + const canShipItems = computed(() => { + if (!isAiStoreOrder.value) return false; + if (isPickUpOrder.value) return false; + const delayRecords = getCurrentDelayRecords(); + if (delayRecords.length === 0) { + const totalCount = Number(state.orderInfo?.productCount || state.orderInfo?.totalCount || 0) || 0; + return totalCount > 0; + } + return delayRecords.some((record) => { + const status = Number(record?.status); + return status === 1 || status === 2; + }); + }); + const hasLogistics = computed(() => { const info = state.orderInfo || {}; if (Number(info.logisticsId) > 0) return true;