From 7f29dc3872e6ac470fd0b5d61958eb32e11d7045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Mon, 26 Oct 2026 14:09:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=AE=A2=E5=8D=95=E7=89=A9=E6=B5=81):=20?= =?UTF-8?q?=E5=88=B0=E5=BA=97=E8=87=AA=E6=8F=90=E4=B8=8E=E4=B8=8A=E9=97=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=9A=90=E8=97=8F=E3=80=8C=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E7=89=A9=E6=B5=81=E3=80=8D=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../normal/handler/NormalOrderAdapter.php | 39 ++++++++++++++----- .../src/components/orderGoods/index.vue | 2 +- .../src/pages/goods/order_details/index.vue | 2 +- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/backend/modules/product/normal/handler/NormalOrderAdapter.php b/backend/modules/product/normal/handler/NormalOrderAdapter.php index 6c3c5818a..9ec266293 100644 --- a/backend/modules/product/normal/handler/NormalOrderAdapter.php +++ b/backend/modules/product/normal/handler/NormalOrderAdapter.php @@ -348,17 +348,20 @@ class NormalOrderAdapter extends BaseOrderTypeAdapter public function getStatusButtons(string $statusCode, array $detail = []): array { if ($statusCode === self::STATUS_PROCESSING) { - return $this->getProcessingButtons($detail); + $buttons = $this->getProcessingButtons($detail); + } else { + // 其他状态:从 STATUS_TREE 静态读取 + $node = $this->centerStatusMap[$statusCode][0] ?? null; + if ($node) { + $buttons = $node['user_buttons'] ?? []; + } else { + // 回退:纯扩展状态节点(after_sale / refunded) + $buttons = $this->extStatusMap[$statusCode]['user_buttons'] ?? []; + } } - // 其他状态:从 STATUS_TREE 静态读取 - $node = $this->centerStatusMap[$statusCode][0] ?? null; - if ($node) { - return $node['user_buttons'] ?? []; - } - - // 回退:纯扩展状态节点(after_sale / refunded) - return $this->extStatusMap[$statusCode]['user_buttons'] ?? []; + // 到店自提 / 上门服务无快递物流,列表与详情都不展示「查看物流」 + return $this->filterLogisticsButtons($buttons, $detail); } public function getOrderButtons(array $detail): array @@ -373,7 +376,23 @@ class NormalOrderAdapter extends BaseOrderTypeAdapter 'params' => ['order_no' => (string)($detail['order_no'] ?? '')], ]); } - return $buttons; + // parent 已走 getStatusButtons 过滤;此处再滤一次,防止后续插入按钮后遗漏 + return $this->filterLogisticsButtons($buttons, $detail); + } + + /** + * 到店自提(shipping_type=2)/ 上门服务(shipping_type=3)去掉「查看物流」 + */ + protected function filterLogisticsButtons(array $buttons, array $detail): array + { + $shippingType = (int)($detail['shipping_type'] ?? 0); + if (!in_array($shippingType, [2, 3], true)) { + return $buttons; + } + return array_values(array_filter( + $buttons, + static fn($btn) => ($btn['action'] ?? '') !== 'viewLogistics' + )); } /** diff --git a/frontend/uni-app/src/components/orderGoods/index.vue b/frontend/uni-app/src/components/orderGoods/index.vue index dcf608add..790a45897 100644 --- a/frontend/uni-app/src/components/orderGoods/index.vue +++ b/frontend/uni-app/src/components/orderGoods/index.vue @@ -67,7 +67,7 @@ @click.stop="openSubcribe(item)"> {{$t(`申请退款`)}} - {{$t(`查看物流`)}} + {{$t(`查看物流`)}} {{$t(`确认收货`)}} diff --git a/frontend/uni-app/src/pages/goods/order_details/index.vue b/frontend/uni-app/src/pages/goods/order_details/index.vue index 0f9de314b..e0d60404e 100644 --- a/frontend/uni-app/src/pages/goods/order_details/index.vue +++ b/frontend/uni-app/src/pages/goods/order_details/index.vue @@ -487,7 +487,7 @@