feat(M08-A): 接入顾客端订单开门

This commit is contained in:
Codex
2026-06-24 22:39:15 +08:00
parent d2c73a2c28
commit eaa86547c2
7 changed files with 161 additions and 2 deletions
+13
View File
@@ -66,6 +66,19 @@ Page({
})
},
async openDoor() {
if (!this.data.orderId) return
await this.withOrderRequest(async () => {
const response = await request(`/orders/${encodeURIComponent(this.data.orderId)}/open-door`, {
method: 'POST',
data: { delayTime: 4 },
})
this.setData({
successMessage: `开门指令已发送:${response.data.status || 'PUBLISHED'}`,
})
})
},
async withOrderRequest(work) {
this.setData({ loading: true, errorMessage: '', successMessage: '' })
try {
+1
View File
@@ -21,6 +21,7 @@
<view class="action-grid">
<button loading="{{loading}}" bindtap="loadOrder">刷新</button>
<button loading="{{loading}}" bindtap="openDoor">开门</button>
<button loading="{{loading}}" bindtap="loadCancellationQuote">取消测算</button>
<button loading="{{loading}}" bindtap="cancelOrder">取消订单</button>
</view>