修复收银台问题

This commit is contained in:
al 2025-01-16 16:04:13 +08:00
parent 5f00fd1717
commit 4fa12ef615
1 changed files with 6 additions and 5 deletions

View File

@ -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 });
};