feat: add buy confirm

This commit is contained in:
Rogee
2025-05-13 14:59:54 +08:00
parent 282f4ef9b9
commit c3126a5aae

View File

@@ -88,6 +88,11 @@ const updateMediaSource = async () => {
}; };
const handleBuy = async () => { const handleBuy = async () => {
// confirm
if (!confirm("确认购买该曲谱?")) {
return;
}
if (buying.value) return; if (buying.value) return;
buying.value = true; buying.value = true;
try { try {
@@ -123,9 +128,12 @@ const handleBuy = async () => {
} }
} }
); );
} else { return
alert("余额支付成功");
} }
alert("余额支付成功");
fetchArticle();
await updateMediaSource();
} catch (error) { } catch (error) {
console.error("Failed to initiate payment:", error); console.error("Failed to initiate payment:", error);
alert("发起支付失败,请稍后重试"); alert("发起支付失败,请稍后重试");