From a199ab7d087a9c01a400ad0161a1d584e9b88ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Tue, 2 Jun 2026 16:54:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- page_shanghu/guanli/agent_order.vue | 71 ++- .../components/BluetoothProcessPanel.vue | 504 +++++++++++++++++ page_shanghu/guanli/device_detail.vue | 5 +- .../mixins/merchantDeviceUnlockMixin.js | 518 ++++++++++++++++++ 4 files changed, 1083 insertions(+), 15 deletions(-) create mode 100644 page_shanghu/guanli/components/BluetoothProcessPanel.vue create mode 100644 page_shanghu/guanli/mixins/merchantDeviceUnlockMixin.js diff --git a/page_shanghu/guanli/agent_order.vue b/page_shanghu/guanli/agent_order.vue index f098147..bb984f6 100644 --- a/page_shanghu/guanli/agent_order.vue +++ b/page_shanghu/guanli/agent_order.vue @@ -95,6 +95,17 @@ :display-deposit="displayDeposit" @update:visible="priceDetailShow = $event" /> + + @@ -109,8 +120,11 @@ import DeviceSelectorPopup from './components/DeviceSelectorPopup.vue'; import InsuranceSelector from './components/InsuranceSelector.vue'; import PayChannelSelector from './components/PayChannelSelector.vue'; import PriceDetailPopup from './components/PriceDetailPopup.vue'; +import BluetoothProcessPanel from './components/BluetoothProcessPanel.vue'; +import merchantDeviceUnlockMixin from './mixins/merchantDeviceUnlockMixin.js'; export default { + mixins: [merchantDeviceUnlockMixin], components: { PackageSelector, VehicleCard, @@ -120,7 +134,8 @@ import PriceDetailPopup from './components/PriceDetailPopup.vue'; DeviceSelectorPopup, InsuranceSelector, PayChannelSelector, - PriceDetailPopup + PriceDetailPopup, + BluetoothProcessPanel }, data() { return { @@ -226,9 +241,7 @@ import PriceDetailPopup from './components/PriceDetailPopup.vue'; this.pollPayResult(payNo) return } - this.submitting = false - uni.showToast({ title: '下单成功', icon: 'success', duration: 1500 }) - setTimeout(() => { uni.navigateBack() }, 1500) + this.handlePaymentSuccess() return } this.submitting = false @@ -549,9 +562,7 @@ import PriceDetailPopup from './components/PriceDetailPopup.vue'; const status = res && res.data ? res.data.status : '' if (status === 'PAYED') { uni.hideLoading() - this.submitting = false - uni.showToast({ title: '收款成功', icon: 'success', duration: 1500 }) - setTimeout(() => { uni.navigateBack() }, 1500) + this.handlePaymentSuccess() return } if (status === 'CANCELED' || status === 'REFUNDED') { @@ -657,21 +668,29 @@ import PriceDetailPopup from './components/PriceDetailPopup.vue'; } this.$u.post('/bst/order/agentCreate', data).then(res => { if (res.code === 200) { + const createResult = res.data || {} + if (createResult.needPay === false) { + uni.hideLoading() + this.handlePaymentSuccess() + return + } if (isOfflinePay) { uni.hideLoading() this.submitting = false - this.handleOfflinePay(res.data || {}) + this.handleOfflinePay(createResult) return } - const payNo = res.data && res.data.pay ? res.data.pay.no : '' + const payNo = createResult.pay ? createResult.pay.no : '' if (payNo) { uni.showLoading({ title: '等待支付结果...', mask: true }) this.pollPayResult(payNo) - } else { + } else if (createResult.needPay === true) { uni.hideLoading() this.submitting = false - uni.showToast({ title: '下单成功', icon: 'success', duration: 1500 }) - setTimeout(() => { uni.navigateBack() }, 1500) + uni.showToast({ title: '支付单信息异常,请稍后在订单中查看', icon: 'none', duration: 2500 }) + } else { + uni.hideLoading() + this.handlePaymentSuccess() } } else { uni.hideLoading() @@ -684,6 +703,34 @@ import PriceDetailPopup from './components/PriceDetailPopup.vue'; uni.showToast({ title: '网络异常,请重试', icon: 'none', duration: 2000 }) }) }, + handlePaymentSuccess() { + this.submitting = true + uni.showToast({ title: '收款成功', icon: 'success', duration: 1500 }) + this.startAdminUnlockAfterPay({ + deviceInfo: this.deviceInfo, + adminFinalStatus: '3', + onComplete: (success) => { + this.submitting = false + this.finishAgentOrderFlow(success) + } + }) + }, + finishAgentOrderFlow(unlockSuccess) { + if (unlockSuccess === false) { + uni.showModal({ + title: '开锁未完成', + content: '支付已成功,但车辆开锁失败。请前往车辆详情页手动开锁。', + showCancel: false, + success: () => { + uni.navigateBack() + } + }) + return + } + setTimeout(() => { + uni.navigateBack() + }, 1500) + }, handleOfflinePay(data) { const applyNo = data.payParams && data.payParams.no ? String(data.payParams.no) : '' const payNo = data.pay && data.pay.no ? String(data.pay.no) : '' diff --git a/page_shanghu/guanli/components/BluetoothProcessPanel.vue b/page_shanghu/guanli/components/BluetoothProcessPanel.vue new file mode 100644 index 0000000..e1d53f9 --- /dev/null +++ b/page_shanghu/guanli/components/BluetoothProcessPanel.vue @@ -0,0 +1,504 @@ + + + + + diff --git a/page_shanghu/guanli/device_detail.vue b/page_shanghu/guanli/device_detail.vue index f9357d8..29efcce 100644 --- a/page_shanghu/guanli/device_detail.vue +++ b/page_shanghu/guanli/device_detail.vue @@ -241,7 +241,7 @@ - + 代客下单 @@ -459,8 +459,7 @@