feat: 使用 showToast 和 showSuccessToast 替换 toastController,简化提示逻辑

This commit is contained in:
2026-01-22 19:18:42 +07:00
parent cfa7b0e820
commit 5cb485f4d2
2 changed files with 6 additions and 19 deletions

View File

@@ -43,20 +43,12 @@ async function confirmSubscribe() {
}
if (!paymentPassword.value) {
toastController.create({
message: "请输入交易密码",
duration: 2000,
position: "top",
}).then(toast => toast.present());
showToast("请输入交易密码");
return;
}
if (!currentWallet.value || Number(currentWallet.value?.available) < Number(product.value.price)) {
toastController.create({
message: "所选钱包余额不足,请选择其他钱包或充值",
duration: 2000,
position: "top",
}).then(toast => toast.present());
showToast("所选钱包余额不足,请选择其他钱包或充值");
return;
}
@@ -65,17 +57,10 @@ async function confirmSubscribe() {
walletTypeId: selectedWallet.value,
tradePassword: paymentPassword.value,
}));
const toast = await toastController.create({
message: "产品申购成功!",
duration: 2000,
position: "bottom",
color: "success",
});
await toast.present();
showSuccessToast("产品申购成功!");
setTimeout(() => {
toast.dismiss();
emit("success");
}, 2000);
}, 1000);
}
</script>