From 4fa12ef615614f5bc144dbdc4900575b95e3a976 Mon Sep 17 00:00:00 2001 From: al Date: Thu, 16 Jan 2025 16:04:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=B6=E9=93=B6=E5=8F=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 }); };