diff --git a/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx b/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx index 6b8085f..ddff0bf 100644 --- a/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx +++ b/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx @@ -8,6 +8,7 @@ import { generateSignature } from "@/utils/crypto"; import webviewBaseRequest from "@/utils/webviewBaseRequest"; import { useRouter, useSearchParams } from "next/navigation"; +let selectedIndex = 0; export default function Pay({ params }) { const router = useRouter(); const searchParams = useSearchParams(); @@ -53,7 +54,6 @@ export default function Pay({ params }) { body: JSON.stringify(body), } ); - console.log("JSON.stringify(body)", JSON.stringify(body)); const temData = await response.json(); if (temData.ret === -1) { Toast.show({ @@ -95,10 +95,10 @@ export default function Pay({ params }) { (it) => it.enable ); if (superfanPriceList) { - if (typeof superChecked.selected === "number") { + if (selectedIndex) { setSuperChecked({ - index: superChecked.selected, - ...superfanPriceList[superChecked.selected], + index: selectedIndex, + ...superfanPriceList[selectedIndex], }); } else { setSuperChecked({ index: 0, ...superfanPriceList[0] }); @@ -121,7 +121,7 @@ export default function Pay({ params }) { }, 500); const intervalId = setInterval(() => { getData(); - getSuperfanshipData(); + getSuperfanshipData(superChecked); }, 2000); return () => { clearInterval(intervalId); @@ -207,6 +207,7 @@ export default function Pay({ params }) { }; const handleSelectSuper = (it) => { + selectedIndex = it.index; setSuperChecked({ ...it, selected: it.index }); };