修复bug

This commit is contained in:
2026-04-22 09:01:50 +08:00
parent 02243a0b88
commit 51d016655c
5 changed files with 22 additions and 8 deletions
+14 -2
View File
@@ -188,6 +188,7 @@ const callPhoneFn = (phone: string) => {
const payMethodOptions = ref({
orderId: '',
cardId: '',
cardNumber: '',
payMethod: 1, // 支付方式 1信用卡 2余额
payPassword: '',
})
@@ -216,9 +217,20 @@ function goPay() {
// 如果是余额支付,弹出支付密码弹窗
if(payMethodOptions.value.payMethod === 2) {
passwordInputRef.value?.showPasswordInput()
} else {
appMerchantOrderPayOrder()
return
}
// 信用卡支付:必须已绑定卡(与 appMerchantOrderPayOrder 入参一致,避免 cardId/cardNumber 为空仍请求)
if (payMethodOptions.value.payMethod === 1) {
const cardId = String(payMethodOptions.value.cardId || '').trim()
if (!cardId) {
uni.showToast({
title: t('pages-store.order.pleaseBindCreditCard'),
icon: 'none',
})
return
}
}
appMerchantOrderPayOrder()
}
function payPawSuccess(password: string) {
payMethodOptions.value.payPassword = password