|
@@ -333,7 +333,7 @@ const remark = ref('') //备注
|
|
const radiovalue1 = ref('苹果')
|
|
const radiovalue1 = ref('苹果')
|
|
const selectedAddress = ref(null)
|
|
const selectedAddress = ref(null)
|
|
const addressFlag = ref(false)
|
|
const addressFlag = ref(false)
|
|
-const paymentMethod = ref(1) // Add payment method ref with default value 1 (wallet)
|
|
|
|
|
|
+const paymentMethod = ref(null) // Add payment method ref with default value 1 (wallet)
|
|
|
|
|
|
const addressInfo = ref(null)
|
|
const addressInfo = ref(null)
|
|
// Radio 单选框数据
|
|
// Radio 单选框数据
|
|
@@ -584,8 +584,14 @@ const handlConfiRmpurchase = () => {
|
|
duration: 2000,
|
|
duration: 2000,
|
|
})
|
|
})
|
|
return // 阻止购买
|
|
return // 阻止购买
|
|
|
|
+ } else if (!paymentMethod.value) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请选择支付方式',
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000,
|
|
|
|
+ })
|
|
|
|
+ return // 阻止购买
|
|
}
|
|
}
|
|
-
|
|
|
|
// 如果有地址,执行购买逻辑
|
|
// 如果有地址,执行购买逻辑
|
|
proceedToPayment()
|
|
proceedToPayment()
|
|
}
|
|
}
|
|
@@ -703,7 +709,7 @@ const proceedToPayment = async () => {
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('支付失败:', error)
|
|
console.error('支付失败:', error)
|
|
uni.showToast({
|
|
uni.showToast({
|
|
- title: '支付失败余额不足',
|
|
|
|
|
|
+ title: '余额不足',
|
|
icon: 'error',
|
|
icon: 'error',
|
|
duration: 1500,
|
|
duration: 1500,
|
|
mask: true,
|
|
mask: true,
|