支持微信支付宝独立支付渠道

This commit is contained in:
yml
2026-06-14 23:38:03 +08:00
parent 2dc5a8121e
commit 3ff8c1de88
27 changed files with 550 additions and 97 deletions
@@ -19,6 +19,7 @@ import {
} from '@/features/orders'
import { handoffStatusLabel, orderStatusLabel } from '@/shared/utils/statusLabels'
import { formatDateTime } from '@/shared/utils/time'
import type { PaymentPayWay } from '@/features/orders/api/orders'
// 移动端支付收银台(基于通用 useOrderPaymentCashier 的薄封装:注入 vant toast + App 浏览器跳转)。
const cashier = useMobilePaymentCashier()
@@ -101,6 +102,7 @@ const {
}
},
actionsNeedingConfirm: CONFIRMABLE_ACTIONS,
selectPayWay,
ordersPath: '/m/orders',
chatPathPrefix: '/m/chats/',
startCashier: (payment, onPaid) => cashier.openMobilePaymentCashier(payment, onPaid),
@@ -115,6 +117,23 @@ const showDisputePopup = ref(false)
const showCounterPopup = ref(false)
const showRejectPopup = ref(false)
// selectPayWay 在创建支付单前让移动端用户选择支付宝或微信。
async function selectPayWay(): Promise<PaymentPayWay | null> {
try {
await showDialog({
title: '选择支付方式',
message: '选择后将生成对应渠道的支付二维码。',
showCancelButton: true,
confirmButtonText: '支付宝支付',
cancelButtonText: '微信支付',
closeOnClickOverlay: false,
})
return 'ZFBZF'
} catch (action) {
return action === 'cancel' ? 'WXZF' : null
}
}
// 账号快照展示(PC 不用,保留在本视图)。
function readSnapshot() {
return readOrderSnapshot(order.value) as Record<string, any> | null