diff --git a/backend/application/api/controller/Demand.php b/backend/application/api/controller/Demand.php
index dc329d3..0e1274b 100644
--- a/backend/application/api/controller/Demand.php
+++ b/backend/application/api/controller/Demand.php
@@ -175,7 +175,12 @@ class Demand extends Api
} elseif ($item->status == 4 && $item->accept_status == 1) {
$button = ['name' => '前去验收', 'theme' => 'danger'];
} elseif ($item->status == 5 && $item->accept_status == 2) {
- $button = ['name' => '确认收货', 'theme' => 'danger'];
+ //开发者发货后客户才能确认收货
+ if ($item->hasDelivery) {
+ $button = ['name' => '确认收货', 'theme' => 'danger'];
+ } else {
+ $button = ['name' => '待发货', 'theme' => 'light'];
+ }
}
}
return $button;
diff --git a/frontend/miniapp/pages/demand/detail/index.wxml b/frontend/miniapp/pages/demand/detail/index.wxml
index 94ccbbb..8ea14ef 100644
--- a/frontend/miniapp/pages/demand/detail/index.wxml
+++ b/frontend/miniapp/pages/demand/detail/index.wxml
@@ -112,5 +112,6 @@
合同签约
验收
确认收货
+ 待发货(等待开发者交付)
\ No newline at end of file
diff --git a/frontend/miniapp/pages/demand/detail/index.wxs b/frontend/miniapp/pages/demand/detail/index.wxs
index 2d6ef53..c3ccdbd 100644
--- a/frontend/miniapp/pages/demand/detail/index.wxs
+++ b/frontend/miniapp/pages/demand/detail/index.wxs
@@ -58,10 +58,20 @@ var canAcceptPassed = function (demandInfo) {
demandInfo.accept_status == 1;
}
+// 客户确认收货:待收货且开发者已发货
var canConfirmReceipt = function (demandInfo) {
if (!demandInfo) return false;
return demandInfo.status == 5 &&
- demandInfo.accept_status == 2;
+ demandInfo.accept_status == 2 &&
+ !!getDelivery(demandInfo);
+}
+
+// 开发者尚未发货,客户等待交付中
+var isWaitingDeliver = function (demandInfo) {
+ if (!demandInfo) return false;
+ return demandInfo.status == 5 &&
+ demandInfo.accept_status == 2 &&
+ !getDelivery(demandInfo);
}
// 获取交付内容(订单发货表,后端 detail 接口挂载的 delivery 字段,未发货返回 null)
@@ -111,6 +121,7 @@ module.exports = {
canCompleteWork: canCompleteWork,
canAcceptPassed: canAcceptPassed,
canConfirmReceipt: canConfirmReceipt,
+ isWaitingDeliver: isWaitingDeliver,
getDelivery: getDelivery,
canDeliverGoods: canDeliverGoods,
isDelivered: isDelivered,