|
@@ -5,7 +5,6 @@ import {
|
|
|
ContinuousListItem,
|
|
|
ContinuousResult,
|
|
|
ContinuousRewardItem,
|
|
|
- ContinuousStageItem,
|
|
|
getContinuousRechargeInfo,
|
|
|
} from "@/api/activity";
|
|
|
import CutDown from "@/components/CutDown";
|
|
@@ -20,16 +19,6 @@ import { useSearchParams } from "next/navigation";
|
|
|
import React from "react";
|
|
|
import styles from "./page.module.scss";
|
|
|
|
|
|
-interface Cfg1Item {
|
|
|
- text: string;
|
|
|
- text2: string;
|
|
|
- key: number;
|
|
|
- footer: string;
|
|
|
- footer2?: string;
|
|
|
-}
|
|
|
-
|
|
|
-interface StageItem extends ContinuousStageItem, Cfg1Item {}
|
|
|
-
|
|
|
interface ListItem {
|
|
|
dayId: number;
|
|
|
data: ContinuousListItem;
|
|
@@ -118,7 +107,7 @@ const Page = () => {
|
|
|
React.useEffect(() => {
|
|
|
getData();
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
- }, []);
|
|
|
+ }, [query.activity_id]);
|
|
|
const getData = async () => {
|
|
|
const res = await getContinuousRechargeInfo({ activity_id: Number(query.activity_id) });
|
|
|
if (res.code === 200) {
|
|
@@ -208,8 +197,10 @@ const Page = () => {
|
|
|
);
|
|
|
});
|
|
|
}
|
|
|
- setAmount(amountObj);
|
|
|
- setVisible(true);
|
|
|
+ if (Object.keys(amountObj).length > 0) {
|
|
|
+ setVisible(true);
|
|
|
+ setAmount(amountObj);
|
|
|
+ }
|
|
|
getData();
|
|
|
} else {
|
|
|
throw new Error(t(`code.400`));
|
|
@@ -221,10 +212,17 @@ const Page = () => {
|
|
|
maskClickable: false,
|
|
|
});
|
|
|
}
|
|
|
- getData();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const doGoLinkActivity = (type: 11 | 13) => {
|
|
|
+ if (type === data.type || !data.associated_activity_id) return;
|
|
|
+ router.replace({
|
|
|
+ pathname: "/rechargeproxy",
|
|
|
+ query: { activity_id: data.associated_activity_id },
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<div className={clsx(styles.continuePage)}>
|
|
|
<div className={styles.container}>
|
|
@@ -240,6 +238,7 @@ const Page = () => {
|
|
|
className={clsx(styles.text, {
|
|
|
[styles.active]: act === 0,
|
|
|
})}
|
|
|
+ onClick={() => doGoLinkActivity(11)}
|
|
|
>
|
|
|
Meu login
|
|
|
</div>
|
|
@@ -247,6 +246,7 @@ const Page = () => {
|
|
|
className={clsx(styles.text, {
|
|
|
[styles.active]: act === 1,
|
|
|
})}
|
|
|
+ onClick={() => doGoLinkActivity(13)}
|
|
|
>
|
|
|
Login de amigo
|
|
|
</div>
|