|
@@ -1,5 +1,6 @@
|
|
"use client";
|
|
"use client";
|
|
import { claimActivityReward, getJackpotInfo, GetJackpotResponse } from "@/api/activity";
|
|
import { claimActivityReward, getJackpotInfo, GetJackpotResponse } from "@/api/activity";
|
|
|
|
+import GlobalNotify from "@/components/ModalPopup/GlobalNotifyModal";
|
|
import { formatAmount } from "@/utils";
|
|
import { formatAmount } from "@/utils";
|
|
import { Toast } from "antd-mobile";
|
|
import { Toast } from "antd-mobile";
|
|
import clsx from "clsx";
|
|
import clsx from "clsx";
|
|
@@ -45,6 +46,9 @@ const Jackpot: React.FC = () => {
|
|
const [actKey, setActKey] = React.useState<number | string>(2);
|
|
const [actKey, setActKey] = React.useState<number | string>(2);
|
|
const [infoData, setInfoData] = React.useState<GetJackpotResponse>();
|
|
const [infoData, setInfoData] = React.useState<GetJackpotResponse>();
|
|
const activeId = searchParams.get("activity_id");
|
|
const activeId = searchParams.get("activity_id");
|
|
|
|
+ const [amount, setAmount] = React.useState<string>("12.30");
|
|
|
|
+ const [visible, setVisible] = React.useState<boolean>(false);
|
|
|
|
+
|
|
const images = React.useMemo(() => {
|
|
const images = React.useMemo(() => {
|
|
return [
|
|
return [
|
|
"/jackpot/2.png",
|
|
"/jackpot/2.png",
|
|
@@ -85,6 +89,7 @@ const Jackpot: React.FC = () => {
|
|
if (!activeId) return;
|
|
if (!activeId) return;
|
|
try {
|
|
try {
|
|
const res = await getJackpotInfo({ activity_id: Number(activeId) });
|
|
const res = await getJackpotInfo({ activity_id: Number(activeId) });
|
|
|
|
+ setVisible(true);
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
if (res.data.list) {
|
|
if (res.data.list) {
|
|
const keys = Object.keys(res.data.list);
|
|
const keys = Object.keys(res.data.list);
|
|
@@ -137,11 +142,9 @@ const Jackpot: React.FC = () => {
|
|
id: curTabData.id,
|
|
id: curTabData.id,
|
|
});
|
|
});
|
|
if (res.code === 200 && res?.data?.code === 1) {
|
|
if (res.code === 200 && res?.data?.code === 1) {
|
|
- await getInfoData();
|
|
|
|
- Toast.show({
|
|
|
|
- content: "Reclamação bem-sucedida",
|
|
|
|
- maskClickable: false,
|
|
|
|
- });
|
|
|
|
|
|
+ setAmount(formatAmount(res?.data?.data?.amount));
|
|
|
|
+ setVisible(true);
|
|
|
|
+ getInfoData();
|
|
} else {
|
|
} else {
|
|
throw new Error(t(`code.400`));
|
|
throw new Error(t(`code.400`));
|
|
}
|
|
}
|
|
@@ -268,6 +271,12 @@ const Jackpot: React.FC = () => {
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <GlobalNotify
|
|
|
|
+ amount={amount}
|
|
|
|
+ visible={visible}
|
|
|
|
+ onChange={() => setVisible(false)}
|
|
|
|
+ deraction={5000}
|
|
|
|
+ ></GlobalNotify>
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
};
|
|
};
|