From 7fa0d3ff04e3c8ef1ff3bf72618677c18bd428de Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 28 Oct 2026 17:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E6=8C=89=E9=92=AE=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/application/api/controller/Demand.php | 12 +++++++++--- frontend/miniapp/pages/demand/detail/index.wxs | 2 ++ frontend/miniapp/pages/demand/list/index.js | 13 +++++-------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/backend/application/api/controller/Demand.php b/backend/application/api/controller/Demand.php index 7b20f0b..a5bae07 100644 --- a/backend/application/api/controller/Demand.php +++ b/backend/application/api/controller/Demand.php @@ -142,9 +142,15 @@ class Demand extends Api } else { $button = ['key' => DemandService::BUTTON_DELIVER_GOODS, 'name' => '去发货', 'theme' => 'danger']; } + } elseif ((int)$item->status === DemandService::STATUS_ACCEPTING && $item->isMyWin && (int)$item->accept_status === CommonService::ONGOING) { + // 与「我投标的」一致:接单开发者等待客户验收 + $button = ['key' => '', 'name' => '待验收', 'theme' => 'light']; + } elseif (in_array((int)$item->status, [DemandService::STATUS_NO, DemandService::STATUS_CANCEL], true)) { + // 已关闭、已取消不再因为投过标而显示「已投标」 + $button = ['name' => '查看详情', 'theme' => 'light']; } elseif ($item->is_bid) { $button = ['key' => '', 'name' => '已投标', 'theme' => 'light']; - } elseif ($item->status == 1) { + } elseif ((int)$item->status === DemandService::STATUS_BIDDING && !$item->isMy) { $button = ['key' => 'bid', 'name' => '参与投标', 'theme' => 'danger']; } } elseif ($opType == 'myQuote') { @@ -159,7 +165,7 @@ class Demand extends Api } } elseif ($item->status == 3 && $item->isMyWin && $item->winBidding->bidding_status == 2 && $item->winBidding->process_status == 2) { $button = ['key' => DemandService::BUTTON_COMPLETE_WORK, 'name' => '工作完成', 'theme' => 'danger']; - } elseif ($item->status == 4 && $item->accept_status == 1) { + } elseif ((int)$item->status === DemandService::STATUS_ACCEPTING && $item->isMyWin && (int)$item->accept_status === CommonService::ONGOING) { $button = ['key' => '', 'name' => '待验收', 'theme' => 'light']; } elseif ($item->status == 5 && $item->isMyWin && $item->winBidding->bidding_status == 2 && $item->winBidding->process_status == 2) { //客户支付尾款后,开发者发货交付 @@ -168,7 +174,7 @@ class Demand extends Api } else { $button = ['key' => DemandService::BUTTON_DELIVER_GOODS, 'name' => '去发货', 'theme' => 'danger']; } - } elseif ($item->status == 5 && $item->accept_status == 2) { + } elseif ((int)$item->status === DemandService::STATUS_CONFIRM_RECEIPT && $item->isMyWin && (int)$item->accept_status === CommonService::SUCCESS) { $button = ['key' => '', 'name' => '待收货', 'theme' => 'light']; } } elseif ($opType == 'my') { diff --git a/frontend/miniapp/pages/demand/detail/index.wxs b/frontend/miniapp/pages/demand/detail/index.wxs index 3728148..0fc0f33 100644 --- a/frontend/miniapp/pages/demand/detail/index.wxs +++ b/frontend/miniapp/pages/demand/detail/index.wxs @@ -1,6 +1,8 @@ // demandInfo 首屏为 null,所有判断需先做空值保护 var canSubmitBidding = function (demandInfo) { if (!demandInfo) return false; + // 发布者不能给自己的需求报名 + if (demandInfo.isMy) return false; return demandInfo.status == 1 && !demandInfo.myBidding; } diff --git a/frontend/miniapp/pages/demand/list/index.js b/frontend/miniapp/pages/demand/list/index.js index 339ab1e..c02874b 100644 --- a/frontend/miniapp/pages/demand/list/index.js +++ b/frontend/miniapp/pages/demand/list/index.js @@ -283,16 +283,12 @@ Page({ if (!item) { return; } - // 交易完成只允许发布者和接单开发者进入详情 + // 交易完成只允许发布者和接单开发者进入详情,其他人点击无反应 if (item.button && item.button.key === 'finished' && !item.isMy && !item.isMyWin) { - wx.showToast({ - title: '仅发布者和接单开发者可查看', - icon: 'none', - }); return; } - // 参与投标仅开发者可进入报价;未入驻先提示,确定后再去申请 - if (item.button && item.button.key === 'bid') { + // 参与投标仅开发者可进入报价;发布者不能给自己报名。未入驻先提示,确定后再去申请 + if (item.button && item.button.key === 'bid' && !item.isMy) { const role = (wx.getStorageSync('userInfo') || {}).role || ''; if (role !== 'dev') { wx.showModal({ @@ -314,7 +310,8 @@ Page({ } const { id } = item; const type = this.data.opType; - const opType = type == 'all' || type == 'myQuote' ? 'quote' : 'view'; + // 大厅和我投标的默认是开发者视角;发布者看自己的需求走客户视角,避免进入报名 + const opType = (type == 'all' || type == 'myQuote') && !item.isMy ? 'quote' : 'view'; //按后端返回的按钮动作标识判断(acceptPassed=验收), //命中时带标记,详情页据此弹出「先到沟通群体验后再验收」的提示 const isAccept = !!item.button && item.button.key === 'acceptPassed';