|
@@ -1,86 +1,764 @@
|
|
|
"use client";
|
|
|
+import { claimActivityReward, get8GSignInfo, Sign8gItem, SignInfo8g } from "@/api/activity";
|
|
|
import CustomButton from "@/components/CustomButton";
|
|
|
+import MultGift from "@/components/MultGift";
|
|
|
import VipProgress from "@/components/VipProgress";
|
|
|
+import feedback from "@/feedback";
|
|
|
+import { formatAmount } from "@/utils";
|
|
|
+import { Toast } from "antd-mobile";
|
|
|
import clsx from "clsx";
|
|
|
+import { useTranslations } from "next-intl";
|
|
|
+import React from "react";
|
|
|
import styles from "./page.module.scss";
|
|
|
|
|
|
const Page = () => {
|
|
|
+ const t = useTranslations();
|
|
|
+ const [data, setData] = React.useState<SignInfo8g>();
|
|
|
+ const [vipLevel, setVipLevel] = React.useState(0);
|
|
|
+ const [claimData, setClaimData] = React.useState<Sign8gItem>();
|
|
|
+ const claimDataRef = React.useRef<Sign8gItem>();
|
|
|
+
|
|
|
+ React.useEffect(() => {
|
|
|
+ getData();
|
|
|
+ }, []);
|
|
|
+
|
|
|
+ const curSignIn = React.useMemo(() => {
|
|
|
+ const signObj = data?.list?.sign_in || {};
|
|
|
+ return signObj[vipLevel] || {};
|
|
|
+ }, [data, vipLevel]);
|
|
|
+ const curContinueSignIn = React.useMemo(() => {
|
|
|
+ const continueObj = data?.list?.continuous_sign_in || {};
|
|
|
+ return continueObj[vipLevel] || {};
|
|
|
+ }, [data, vipLevel]);
|
|
|
+
|
|
|
+ const getData = async () => {
|
|
|
+ const res = await get8GSignInfo({ activity_id: 61 });
|
|
|
+ setData({
|
|
|
+ id: 61,
|
|
|
+ associated_activity_id: 62,
|
|
|
+ name: "8G签到活动",
|
|
|
+ type: 17,
|
|
|
+ act_time_type: 1,
|
|
|
+ start_at: 1745031600,
|
|
|
+ end_at: 1811818799,
|
|
|
+ display_start_time: 1744992000,
|
|
|
+ display_end_time: 1811865599,
|
|
|
+ list: {
|
|
|
+ sign_in: {
|
|
|
+ "0": [
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 3,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 1,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 20,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 4,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 5,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 6,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 7,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 1,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 2,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ "1": [
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 1,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 2,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 3,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 4,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 5,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 6,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 7,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ "2": [
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 3,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 4,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 5,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 6,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 7,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 1,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 2,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 61,
|
|
|
+ id: 2,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ continuous_sign_in: {
|
|
|
+ "0": [
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 1,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 2,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 3,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 4,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 5,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 6,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 7,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ "1": [
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 1,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 2,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 3,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 4,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 5,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 6,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 7,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: false,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ "2": [
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 6,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: true,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 7,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: true,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 1,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: true,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 2,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: true,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 3,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 1,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: true,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 4,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: true,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ activity_id: 62,
|
|
|
+ id: 5,
|
|
|
+ coin_type: 1,
|
|
|
+ num: 0.5,
|
|
|
+ status: 0,
|
|
|
+ is_double: false,
|
|
|
+ is_double_notify: true,
|
|
|
+ cur_pay: 0,
|
|
|
+ double_pay: 20,
|
|
|
+ multiple: 0,
|
|
|
+ img: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ act_page: 0,
|
|
|
+ background_type: 1,
|
|
|
+ Background: "",
|
|
|
+ act_promotion_url: "",
|
|
|
+ pay_amount: 0,
|
|
|
+ total_bet: 0,
|
|
|
+ reward: 0,
|
|
|
+ cur_num: 1,
|
|
|
+ tally_time: 1744992000,
|
|
|
+ is_op: false,
|
|
|
+ remark: "",
|
|
|
+ });
|
|
|
+ };
|
|
|
+ const vipChange = (value: any) => {
|
|
|
+ setVipLevel(value);
|
|
|
+ };
|
|
|
+
|
|
|
+ const doClaim = async (item: Sign8gItem) => {
|
|
|
+ if (item.double_pay <= 0) {
|
|
|
+ await doRealClaim();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const res = await feedback.showModal({
|
|
|
+ content: (modalProps: any) => {
|
|
|
+ return (
|
|
|
+ <MultGift
|
|
|
+ needDoublePay={item?.double_pay}
|
|
|
+ curPay={item.cur_pay}
|
|
|
+ multiple={item?.multiple}
|
|
|
+ baseGift={item.num}
|
|
|
+ multipleGift={item.num * item.multiple}
|
|
|
+ doClose={modalProps.doClose}
|
|
|
+ ></MultGift>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ width: "80%",
|
|
|
+ useDefaultFooter: false,
|
|
|
+ });
|
|
|
+
|
|
|
+ setClaimData(item);
|
|
|
+ claimDataRef.current = item;
|
|
|
+ };
|
|
|
+
|
|
|
+ const doRealClaim = async () => {
|
|
|
+ if (!claimDataRef.current) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Toast.show({ icon: "loading" });
|
|
|
+ try {
|
|
|
+ const res = await claimActivityReward({
|
|
|
+ activity_id: claimDataRef.current.activity_id,
|
|
|
+ id: claimDataRef.current.id,
|
|
|
+ });
|
|
|
+ if (res.code === 200 && res?.data?.code === 0) {
|
|
|
+ Toast.show({ icon: "success" });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ throw new Error(res.code.toString());
|
|
|
+ } catch (err: any) {
|
|
|
+ Toast.show({ icon: "fail", content: t(`code.${err?.message || 400}`) });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.pageContainer}>
|
|
|
- <VipProgress></VipProgress>
|
|
|
+ <VipProgress onChange={vipChange}></VipProgress>
|
|
|
<div className={styles.boxContainer}>
|
|
|
<div className="text mt-[5px] w-full text-center text-[12px]">
|
|
|
Ao alcançar a meta de check-ins consecutivos, você recebe uma recompensa extra
|
|
|
</div>
|
|
|
<div className={clsx("flex items-stretch justify-between", styles.boxWrap)}>
|
|
|
- <div className={clsx(styles.boxItem, "text-[12px]")}>
|
|
|
- <div className={clsx("flex flex-col items-center", styles.geted)}>
|
|
|
- <div className="rounded-[4px]">Dia</div>
|
|
|
- <div className="font-black">0</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div className={clsx(styles.boxItem, "text-[12px]")}>
|
|
|
- <div className={clsx("flex flex-col items-center")}>
|
|
|
- <div className="rounded-[4px]">10 Dia</div>
|
|
|
- <img src="/check_in/week1.webp" alt="" />
|
|
|
- <div>0</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div className={clsx(styles.boxItem, "text-[12px]")}>
|
|
|
- <div className={clsx("flex flex-col items-center")}>
|
|
|
- <div className="rounded-[4px]">15 Dia</div>
|
|
|
- <img src="/check_in/week1.webp" alt="" />
|
|
|
- <div>0</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div className={clsx(styles.boxItem, "text-[12px]")}>
|
|
|
- <div className={clsx("flex flex-col items-center")}>
|
|
|
- <div className="rounded-[4px]">20 Dia</div>
|
|
|
- <img src="/check_in/week1.webp" alt="" />
|
|
|
- <div>0</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div className={clsx(styles.boxItem, "text-[12px]")}>
|
|
|
- <div className={clsx("flex flex-col items-center")}>
|
|
|
- <div className="rounded-[4px]">30 Dia</div>
|
|
|
- <img src="/check_in/week1.webp" alt="" />
|
|
|
- <div>0</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ {!!curContinueSignIn?.length &&
|
|
|
+ curContinueSignIn.map((item) => {
|
|
|
+ return (
|
|
|
+ <div key={item.id} className={clsx(styles.boxItem, "text-[12px]")}>
|
|
|
+ <div
|
|
|
+ className={clsx("flex flex-col items-center", {
|
|
|
+ [styles.geted]: item.status === 2,
|
|
|
+ })}
|
|
|
+ >
|
|
|
+ {item.status !== 2 && (
|
|
|
+ <>
|
|
|
+ <div className="rounded-[4px]">{item.id} Dia</div>
|
|
|
+ <img
|
|
|
+ src={item.img}
|
|
|
+ className="h-[.49rem] w-[.49rem]"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <div>{item.num}</div>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ {item.status === 2 && (
|
|
|
+ <>
|
|
|
+ <div className="rounded-[4px]">{item.id} Dia</div>
|
|
|
+ <div className="font-black">{item.num}</div>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ })}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className={styles.cardBox}>
|
|
|
- {[1, 2, 3, 4, 5, 6, 7].map((item, idx) => {
|
|
|
- return (
|
|
|
- <div
|
|
|
- key={item}
|
|
|
- className={clsx(styles.cardItem, {
|
|
|
- [styles.last]: idx === 6 && idx % 2 === 0,
|
|
|
- })}
|
|
|
- >
|
|
|
- <div className={styles.tag}>{item} Dia</div>
|
|
|
- <div>Pode receber</div>
|
|
|
- <div className="status-price text-[16px] font-black">
|
|
|
- R$0,60 / R$6,00
|
|
|
- </div>
|
|
|
- <div className={styles.btnBox}>
|
|
|
- {item == 1 && (
|
|
|
- <CustomButton className={styles.button} type="primary">
|
|
|
- <>Check In</>
|
|
|
- </CustomButton>
|
|
|
- )}
|
|
|
- {item != 1 && (
|
|
|
- <CustomButton className={styles.button} type="disable2">
|
|
|
- <>
|
|
|
- <i className="iconfont icon-suoding mr-[.1rem] text-[.12rem]"></i>
|
|
|
- Não iniciado
|
|
|
- </>
|
|
|
- </CustomButton>
|
|
|
- )}
|
|
|
+ {!!curSignIn?.length &&
|
|
|
+ curSignIn.map((item, idx) => {
|
|
|
+ return (
|
|
|
+ <div
|
|
|
+ key={item.id}
|
|
|
+ className={clsx(styles.cardItem, {
|
|
|
+ [styles.last]: idx === 6 && idx % 2 === 0,
|
|
|
+ })}
|
|
|
+ >
|
|
|
+ <div className={styles.tag}>{item.id} Dia</div>
|
|
|
+ <div>Pode receber</div>
|
|
|
+ <div className="status-price text-[16px] font-black">
|
|
|
+ R${formatAmount(item.num)}{" "}
|
|
|
+ {item.double_pay > 0 && (
|
|
|
+ <>/ R${formatAmount(item.num * item.multiple)}</>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ <div className={styles.btnBox}>
|
|
|
+ {item.status == 1 && (
|
|
|
+ <CustomButton
|
|
|
+ className={styles.button}
|
|
|
+ type="primary"
|
|
|
+ onClick={() => doClaim(item)}
|
|
|
+ >
|
|
|
+ <>Check In</>
|
|
|
+ </CustomButton>
|
|
|
+ )}
|
|
|
+ {item.status === 0 && (
|
|
|
+ <CustomButton className={styles.button} type="disable2">
|
|
|
+ <>
|
|
|
+ <i className="iconfont icon-suoding mr-[.1rem] text-[.12rem]"></i>
|
|
|
+ Não iniciado
|
|
|
+ </>
|
|
|
+ </CustomButton>
|
|
|
+ )}
|
|
|
+ {item.status === 2 && (
|
|
|
+ <div className="flex w-full items-center justify-start">
|
|
|
+ <img
|
|
|
+ className="w-[1rem]"
|
|
|
+ src="/happy_wheel/vip_claimed_icon.webp"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- );
|
|
|
- })}
|
|
|
+ );
|
|
|
+ })}
|
|
|
</div>
|
|
|
</div>
|
|
|
);
|