|
@@ -7,19 +7,20 @@ import { Link } from "@/i18n/routing";
|
|
|
import { useUserInfoStore } from "@/stores/useUserInfoStore";
|
|
|
import { copyText, timeFormat } from "@/utils/methods";
|
|
|
import { useCountDown } from "ahooks";
|
|
|
-import { Mask, Popup, Toast } from "antd-mobile";
|
|
|
+import { Popup, Toast } from "antd-mobile";
|
|
|
import clsx from "clsx";
|
|
|
import { useTranslations } from "next-intl";
|
|
|
import Image from "next/image";
|
|
|
-import { createContext, FC, useContext, useEffect, useState } from "react";
|
|
|
+import { createContext, FC, Fragment, useContext, useEffect, useState } from "react";
|
|
|
import LotteryWheel from "./LotteryWheel";
|
|
|
import styles from "./style.module.scss";
|
|
|
interface Props {
|
|
|
// wheel: WheelsType;
|
|
|
allHistory: any[];
|
|
|
+ selfHistory: any[];
|
|
|
+ phones: any[];
|
|
|
}
|
|
|
-interface ContextType extends WheelsType {
|
|
|
- allHistory: any[];
|
|
|
+interface ContextType extends WheelsType, Props {
|
|
|
handler: () => void;
|
|
|
}
|
|
|
const WheelContext = createContext<Partial<ContextType>>({});
|
|
@@ -115,6 +116,57 @@ const LeftListClient = () => {
|
|
|
</>
|
|
|
);
|
|
|
};
|
|
|
+
|
|
|
+const RightListClient = () => {
|
|
|
+ const wheel = useContext(WheelContext);
|
|
|
+ return (
|
|
|
+ <div className={"h-[100%] overflow-scroll p-[10px]"}>
|
|
|
+ <div
|
|
|
+ className={
|
|
|
+ "grid grid-cols-[1.3889rem_1fr_0.6944rem] gap-y-[0.1389rem] text-[0.0972rem]" +
|
|
|
+ " text-[#8795b1]"
|
|
|
+ }
|
|
|
+ >
|
|
|
+ {wheel.selfHistory &&
|
|
|
+ wheel.selfHistory.map((n, index) => {
|
|
|
+ return (
|
|
|
+ <Fragment key={index}>
|
|
|
+ <div className={"flex"}>
|
|
|
+ <span
|
|
|
+ className={"mr-[0.0694rem] text-[0.12rem] text-[#6ddf39]"}
|
|
|
+ >
|
|
|
+ +100.00
|
|
|
+ </span>
|
|
|
+ <div
|
|
|
+ className={
|
|
|
+ "h-[0.16rem] w-[0.16rem] rounded-[50%] bg-[#6ddf39] text-center" +
|
|
|
+ " text-[0.07rem] leading-[0.16rem] text-[#fff]"
|
|
|
+ }
|
|
|
+ >
|
|
|
+ R$
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className={"flex flex-1"}>
|
|
|
+ {" "}
|
|
|
+ {timeFormat(Date.now(), "br", undefined, true)}
|
|
|
+ </div>
|
|
|
+ <div className={"flex justify-end text-[#f0ae18]"}>
|
|
|
+ <Image
|
|
|
+ className={"mr-[0.0694rem] object-contain"}
|
|
|
+ src={"/wheels/group.png"}
|
|
|
+ alt={"group"}
|
|
|
+ width={20}
|
|
|
+ height={8}
|
|
|
+ />
|
|
|
+ <span>+12</span>
|
|
|
+ </div>
|
|
|
+ </Fragment>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+};
|
|
|
const Report = () => {
|
|
|
const [activeTab, setActiveTab] = useState<Dtltype>("left");
|
|
|
|
|
@@ -152,7 +204,7 @@ const Report = () => {
|
|
|
<div className={styles.vanTabsContent}>
|
|
|
<div className={styles.vantabpane}>
|
|
|
<div className={styles.tabContent}>
|
|
|
- {activeTab === "left" ? <LeftListClient /> : null}
|
|
|
+ {activeTab === "left" ? <LeftListClient /> : <RightListClient />}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -311,7 +363,9 @@ const DrawMain = () => {
|
|
|
<div className={"relative"}>
|
|
|
<WheelWallet />
|
|
|
|
|
|
- <WheelClient isRotate={true} wheel={wheel} onRotateEnd={wheel.handler!} />
|
|
|
+ <div className={"pt-[0.1389rem]"}>
|
|
|
+ <WheelClient isRotate={true} wheel={wheel} onRotateEnd={wheel.handler!} />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
);
|
|
|
};
|
|
@@ -351,11 +405,21 @@ const CountdownClient = () => {
|
|
|
</div>
|
|
|
);
|
|
|
};
|
|
|
+const phones = Array(9)
|
|
|
+ .fill(0)
|
|
|
+ .map((_, i) => {
|
|
|
+ const num = `557894567${Math.floor(Math.random() * 1000)
|
|
|
+ .toString()
|
|
|
+ .padStart(4, "0")}`;
|
|
|
+ return num;
|
|
|
+ });
|
|
|
const ShareClient = () => {
|
|
|
const [visible, setVisible] = useState(false);
|
|
|
const wheel = useContext(WheelContext);
|
|
|
const user = useUserInfoStore((state) => state.userInfo);
|
|
|
|
|
|
+ const [currentPhoneIndex, setCurrentPhoneIndex] = useState(0);
|
|
|
+
|
|
|
const shareUrl = `${process.env.NEXT_PUBLIC_SHARE_URL}/br/sharecwbr?turntable=${wheel.activities && wheel.activities[0].id}&user=${user.id}&time=${wheel.activate?.end_time}`;
|
|
|
const url = encodeURIComponent(`${shareUrl}`);
|
|
|
const text = encodeURIComponent(`Receba 100 BRL de graça,Pix SAQUE RÁPIDO`);
|
|
@@ -392,6 +456,11 @@ const ShareClient = () => {
|
|
|
copyText(text);
|
|
|
Toast.show({ icon: "success", content: t("SummaryPage.copySuc"), maskClickable: false });
|
|
|
};
|
|
|
+ const handler = () => {
|
|
|
+ const current = phones[currentPhoneIndex];
|
|
|
+ window.open(`https://wa.me/${current}`);
|
|
|
+ setCurrentPhoneIndex((value) => (value += 1));
|
|
|
+ };
|
|
|
|
|
|
return (
|
|
|
<>
|
|
@@ -431,7 +500,7 @@ const ShareClient = () => {
|
|
|
setVisible(false);
|
|
|
}}
|
|
|
showCloseButton
|
|
|
- bodyStyle={{ height: "2.9rem", background: "#fff" }}
|
|
|
+ bodyStyle={{ background: "#fff" }}
|
|
|
>
|
|
|
<div className={"p-[0.1389rem] text-[#555555]"}>
|
|
|
<h1>1.Convide amlgos para ajudar com saques</h1>
|
|
@@ -479,48 +548,64 @@ const ShareClient = () => {
|
|
|
<div className={"mt-[0.0694rem]"}>
|
|
|
<h1>2.Enviar convite para jogador aleatório ajudar</h1>
|
|
|
|
|
|
- <div
|
|
|
- className={
|
|
|
- "grid grid-cols-2 gap-[0.1389rem] text-[0.12rem] text-[#fff]" +
|
|
|
- " mt-[0.0694rem]"
|
|
|
- }
|
|
|
- >
|
|
|
- <Link
|
|
|
- href={"#"}
|
|
|
- className={
|
|
|
- "flex items-center rounded-[0.0694rem] bg-[#10cb8c]" +
|
|
|
- " p-[0.0694rem] text-[#fff]"
|
|
|
- }
|
|
|
- >
|
|
|
- <div className={"flex-1"}>
|
|
|
- <p>Enviar Mensagem </p>
|
|
|
- <p>no WhatsAPP</p>
|
|
|
- </div>
|
|
|
- <Image
|
|
|
- src={"/summary/WhatsApp-nobg.png"}
|
|
|
- alt={"whatsApp"}
|
|
|
- width={40}
|
|
|
- height={40}
|
|
|
- />
|
|
|
- </Link>
|
|
|
- <Link
|
|
|
- href={"sms:10086?body=message_body"}
|
|
|
+ <div className={"mt-[0.0694rem] bg-[#000] p-[10px]"}>
|
|
|
+ <div className={"grid grid-cols-3 gap-[5px] text-[0.0833rem]"}>
|
|
|
+ {phones.map((phone, index) => {
|
|
|
+ return (
|
|
|
+ <span
|
|
|
+ style={{
|
|
|
+ color: index < currentPhoneIndex ? "#fff" : "#ccc",
|
|
|
+ }}
|
|
|
+ key={index}
|
|
|
+ >
|
|
|
+ {phone}
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
className={
|
|
|
- "flex items-center rounded-[10px] bg-[#35b2fe]" +
|
|
|
- " p-[0.0694rem] text-[#fff]"
|
|
|
+ "grid grid-cols-2 gap-[0.1389rem] text-[0.12rem] text-[#fff]"
|
|
|
}
|
|
|
>
|
|
|
- <div className={"flex-1"}>
|
|
|
- <p>Enviar Mensagem </p>
|
|
|
- <p>SMS</p>
|
|
|
+ <div
|
|
|
+ onClick={handler}
|
|
|
+ className={
|
|
|
+ "flex items-center rounded-[0.0694rem] bg-[#10cb8c]" +
|
|
|
+ " p-[0.0694rem] text-[#fff]"
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <div className={"flex-1"}>
|
|
|
+ <p>Enviar Mensagem </p>
|
|
|
+ <p>no WhatsAPP</p>
|
|
|
+ </div>
|
|
|
+ <Image
|
|
|
+ src={"/summary/WhatsApp-nobg.png"}
|
|
|
+ alt={"whatsApp"}
|
|
|
+ width={40}
|
|
|
+ height={40}
|
|
|
+ />
|
|
|
</div>
|
|
|
- <Image
|
|
|
- src={"/summary/SMS.png"}
|
|
|
- alt={"whatsApp"}
|
|
|
- width={40}
|
|
|
- height={40}
|
|
|
- />
|
|
|
- </Link>
|
|
|
+ <Link
|
|
|
+ href={`sms:${phones.join(";")}?body=message_body`}
|
|
|
+ className={
|
|
|
+ "flex items-center rounded-[10px] bg-[#35b2fe]" +
|
|
|
+ " p-[0.0694rem] text-[#fff]"
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <div className={"flex-1"}>
|
|
|
+ <p>Enviar Mensagem </p>
|
|
|
+ <p>SMS</p>
|
|
|
+ </div>
|
|
|
+ <Image
|
|
|
+ src={"/summary/SMS.png"}
|
|
|
+ alt={"whatsApp"}
|
|
|
+ width={40}
|
|
|
+ height={40}
|
|
|
+ />
|
|
|
+ </Link>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -529,20 +614,6 @@ const ShareClient = () => {
|
|
|
);
|
|
|
};
|
|
|
|
|
|
-const ReceiveClient = () => {
|
|
|
- const wheel = useContext(WheelContext);
|
|
|
- console.log(`🚀🚀🚀🚀🚀-> in CashWheelClient.tsx on 664`, wheel);
|
|
|
- const receiveHandler = () => {
|
|
|
- console.log(`🚀🚀🚀🚀🚀-> in CashWheelClient.tsx on 666`);
|
|
|
- };
|
|
|
- return (
|
|
|
- <Mask visible={false}>
|
|
|
- <div className={"absolute top-1/2 flex w-[100%] items-center justify-center"}>
|
|
|
- <Image src={"/wheels/receive-button.png"} alt={"receive"} height={0} width={160} />
|
|
|
- </div>
|
|
|
- </Mask>
|
|
|
- );
|
|
|
-};
|
|
|
const CashWheelClient: FC<Props> = (props) => {
|
|
|
const getWheelData = async () => {
|
|
|
return getWheelApi().then((res) => {
|
|
@@ -558,6 +629,8 @@ const CashWheelClient: FC<Props> = (props) => {
|
|
|
const [values, setValues] = useState<Partial<ContextType>>({
|
|
|
num: 100,
|
|
|
allHistory: props.allHistory || [],
|
|
|
+ selfHistory: props.selfHistory || [],
|
|
|
+ phones: props.phones || [],
|
|
|
handler: getWheelData,
|
|
|
});
|
|
|
useEffect(() => {
|
|
@@ -571,7 +644,7 @@ const CashWheelClient: FC<Props> = (props) => {
|
|
|
{/*倒计时*/}
|
|
|
<CountdownClient />
|
|
|
{/*分享*/}
|
|
|
- <ShareClient />
|
|
|
+ {values.activate && values.activate?.end_time > 0 ? <ShareClient /> : null}
|
|
|
<div className={styles.cashWheelClient}>
|
|
|
{/*<CashMainCom />*/}
|
|
|
{/*<DrawContent />*/}
|