|
@@ -10,7 +10,7 @@ import { Popup, Toast } from "antd-mobile";
|
|
import clsx from "clsx";
|
|
import clsx from "clsx";
|
|
import { useTranslations } from "next-intl";
|
|
import { useTranslations } from "next-intl";
|
|
import Image from "next/image";
|
|
import Image from "next/image";
|
|
-import { useEffect, useRef, useState } from "react";
|
|
|
|
|
|
+import { useRef, useState } from "react";
|
|
import LotteryWheel from "./LotteryWheel";
|
|
import LotteryWheel from "./LotteryWheel";
|
|
import styles from "./style.module.scss";
|
|
import styles from "./style.module.scss";
|
|
const CashMainCom = () => {
|
|
const CashMainCom = () => {
|
|
@@ -61,211 +61,6 @@ const DrawMain1 = () => {
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
};
|
|
};
|
|
-const DrawMain2 = () => {
|
|
|
|
- const [blocks] = useState([
|
|
|
|
- {
|
|
|
|
- padding: "20",
|
|
|
|
- imgs: [
|
|
|
|
- {
|
|
|
|
- src: "/wheels/inner-circle.png",
|
|
|
|
- width: "100%",
|
|
|
|
- height: "100%",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ]);
|
|
|
|
- const [prizes] = useState([
|
|
|
|
- { background: "#fde187", fonts: [{ text: "0", top: "20%" }] },
|
|
|
|
- { background: "#faf3c3", fonts: [{ text: "1", top: "20%" }] },
|
|
|
|
- { background: "#fde187", fonts: [{ text: "2", top: "20%" }] },
|
|
|
|
- { background: "#faf3c3", fonts: [{ text: "3", top: "20%" }] },
|
|
|
|
- { background: "#fde187", fonts: [{ text: "4", top: "20%" }] },
|
|
|
|
- { background: "#faf3c3", fonts: [{ text: "5", top: "20%" }] },
|
|
|
|
- { background: "#fde187", fonts: [{ text: "6", top: "20%" }] },
|
|
|
|
- { background: "#faf3c3", fonts: [{ text: "7", top: "20%" }] },
|
|
|
|
- ]);
|
|
|
|
- const [buttons] = useState([
|
|
|
|
- {
|
|
|
|
- radius: "30%",
|
|
|
|
- imgs: [
|
|
|
|
- {
|
|
|
|
- src: "/wheels/pointer.png",
|
|
|
|
- width: "100%",
|
|
|
|
- top: "-130%",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ]);
|
|
|
|
- const myLucky = useRef<any>();
|
|
|
|
- const titleRef = useRef<any>(null);
|
|
|
|
-
|
|
|
|
- useEffect(() => {
|
|
|
|
- const ctx = titleRef.current;
|
|
|
|
- }, []);
|
|
|
|
- return (
|
|
|
|
- <div
|
|
|
|
- className={"relative mt-[260px] flex h-[3rem] items-center justify-center"}
|
|
|
|
- style={{ background: "/wheels/bg.png", backgroundSize: "100% 100%", zIndex: 2 }}
|
|
|
|
- >
|
|
|
|
- <img src={"/wheels/bg.png"} className={"absolute -top-[115%]"} />
|
|
|
|
- <img
|
|
|
|
- src="/wheels/header-bg.png"
|
|
|
|
- alt=""
|
|
|
|
- className={"absolute -top-[13%] z-10 h-[1.4rem]"}
|
|
|
|
- />
|
|
|
|
- {/*<canvas id={"titleCanvas"} ref={titleRef} />*/}
|
|
|
|
-
|
|
|
|
- {/*<svg width="100%" height="2.7778rem" className={"absolute -top-[15%] z-[11]"}>*/}
|
|
|
|
- {/* <path*/}
|
|
|
|
- {/* d="M 63 162 C 119 36, 341 0,470 120"*/}
|
|
|
|
- {/* stroke="blue"*/}
|
|
|
|
- {/* stroke-width="4"*/}
|
|
|
|
- {/* id="circle"*/}
|
|
|
|
- {/* fill="transparent"*/}
|
|
|
|
- {/* />*/}
|
|
|
|
-
|
|
|
|
- {/* <text*/}
|
|
|
|
- {/* style={{*/}
|
|
|
|
- {/* fill: "#ff3333",*/}
|
|
|
|
- {/* fontSize: "30px",*/}
|
|
|
|
- {/* fontWeight: "bold",*/}
|
|
|
|
- {/* textShadow: "0.1em 0.1em rgba(0,0,0,0.5)",*/}
|
|
|
|
- {/* }}*/}
|
|
|
|
- {/* >*/}
|
|
|
|
- {/* <textPath xlinkHref="#circle" textAnchor="middle" startOffset="50%" dy="0">*/}
|
|
|
|
- {/* <tspan>*/}
|
|
|
|
- {/* Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam, libero.*/}
|
|
|
|
- {/* </tspan>*/}
|
|
|
|
- {/* </textPath>*/}
|
|
|
|
- {/* </text>*/}
|
|
|
|
- {/*</svg>*/}
|
|
|
|
-
|
|
|
|
- <img src={"/wheels/outer-circle.png"} className={"absolute h-[100%]"} />
|
|
|
|
-
|
|
|
|
- {/*<img src={"/wheels/inner-circle.png"} className={"absolute h-[98%]"} />*/}
|
|
|
|
- <div className={"flex w-[100%] flex-1 justify-center"}>
|
|
|
|
- <LuckyWheel
|
|
|
|
- ref={myLucky}
|
|
|
|
- width="2.95rem"
|
|
|
|
- height="2.95rem"
|
|
|
|
- blocks={blocks}
|
|
|
|
- prizes={prizes}
|
|
|
|
- buttons={buttons}
|
|
|
|
- onStart={() => {
|
|
|
|
- // 点击抽奖按钮会触发star回调
|
|
|
|
- myLucky.current?.play();
|
|
|
|
- setTimeout(() => {
|
|
|
|
- const index = (Math.random() * 6) >> 0;
|
|
|
|
- myLucky.current?.stop(index);
|
|
|
|
- }, 2500);
|
|
|
|
- }}
|
|
|
|
- onEnd={(prize: any) => {
|
|
|
|
- // 抽奖结束会触发end回调
|
|
|
|
- alert("恭喜你抽到 " + prize.fonts[0].text + " 号奖品");
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- );
|
|
|
|
-};
|
|
|
|
-const DrawMain3 = () => {
|
|
|
|
- const myLucky = useRef<any>();
|
|
|
|
-
|
|
|
|
- const [blocks] = useState([
|
|
|
|
- {
|
|
|
|
- padding: "20",
|
|
|
|
- imgs: [
|
|
|
|
- {
|
|
|
|
- src: "/wheels/inner-circle.png",
|
|
|
|
- width: "100%",
|
|
|
|
- height: "100%",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ]);
|
|
|
|
- const [prizes] = useState([
|
|
|
|
- { fonts: [{ text: "0", top: "20%" }], background: "#e9e8fe" },
|
|
|
|
- { fonts: [{ text: "1", top: "20%" }], background: "#b8c5f2" },
|
|
|
|
- { fonts: [{ text: "2", top: "20%" }], background: "#e9e8fe" },
|
|
|
|
- { fonts: [{ text: "3", top: "10%" }], background: "#b8c5f2" },
|
|
|
|
- { fonts: [{ text: "4", top: "10%" }], background: "#e9e8fe" },
|
|
|
|
- { fonts: [{ text: "5", top: "10%" }], background: "#b8c5f2" },
|
|
|
|
- ]);
|
|
|
|
- const [buttons] = useState([
|
|
|
|
- {
|
|
|
|
- radius: "30%",
|
|
|
|
- imgs: [
|
|
|
|
- {
|
|
|
|
- src: "/wheels/pointer.png",
|
|
|
|
- width: "100%",
|
|
|
|
- top: "-130%",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ]);
|
|
|
|
- return (
|
|
|
|
- <div className={"relative flex h-[2.5rem] items-center justify-center border-4"}>
|
|
|
|
- <img src={"/wheels/bg.png"} className={"absolute"} />
|
|
|
|
- <div className={"mt-[40px] flex w-[100%] justify-center border-4"}>
|
|
|
|
- <img src={"/wheels/outer-circle.png"} className={"absolute h-[100%]"} />
|
|
|
|
- <img
|
|
|
|
- src="/wheels/header-bg.png"
|
|
|
|
- alt=""
|
|
|
|
- className={"absolute -bottom-[10px] z-10 h-[1.2rem]"}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- {/*<svg width="100%" height="2.7778rem" className={"absolute -top-[15%] z-[11]"}>*/}
|
|
|
|
- {/* <path*/}
|
|
|
|
- {/* d="M 63 162 C 119 36, 341 0,470 120"*/}
|
|
|
|
- {/* stroke="blue"*/}
|
|
|
|
- {/* stroke-width="4"*/}
|
|
|
|
- {/* id="circle"*/}
|
|
|
|
- {/* fill="transparent"*/}
|
|
|
|
- {/* />*/}
|
|
|
|
-
|
|
|
|
- {/* <text*/}
|
|
|
|
- {/* style={{*/}
|
|
|
|
- {/* fill: "#ff3333",*/}
|
|
|
|
- {/* fontSize: "30px",*/}
|
|
|
|
- {/* fontWeight: "bold",*/}
|
|
|
|
- {/* textShadow: "0.1em 0.1em rgba(0,0,0,0.5)",*/}
|
|
|
|
- {/* }}*/}
|
|
|
|
- {/* >*/}
|
|
|
|
- {/* <textPath xlinkHref="#circle" textAnchor="middle" startOffset="50%" dy="0">*/}
|
|
|
|
- {/* <tspan>*/}
|
|
|
|
- {/* Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam, libero.*/}
|
|
|
|
- {/* </tspan>*/}
|
|
|
|
- {/* </textPath>*/}
|
|
|
|
- {/* </text>*/}
|
|
|
|
- {/*</svg>*/}
|
|
|
|
-
|
|
|
|
- {/*<img src={"/wheels/inner-circle.png"} className={"absolute h-[98%]"} />*/}
|
|
|
|
- <div>
|
|
|
|
- <LuckyWheel
|
|
|
|
- ref={myLucky}
|
|
|
|
- width="2.95rem"
|
|
|
|
- height="2.95rem"
|
|
|
|
- blocks={blocks}
|
|
|
|
- prizes={prizes}
|
|
|
|
- buttons={buttons}
|
|
|
|
- onStart={() => {
|
|
|
|
- // 点击抽奖按钮会触发star回调
|
|
|
|
- myLucky.current?.play();
|
|
|
|
- setTimeout(() => {
|
|
|
|
- const index = (Math.random() * 6) >> 0;
|
|
|
|
- myLucky.current?.stop(index);
|
|
|
|
- }, 2500);
|
|
|
|
- }}
|
|
|
|
- onEnd={(prize: any) => {
|
|
|
|
- // 抽奖结束会触发end回调
|
|
|
|
- alert("恭喜你抽到 " + prize.fonts[0].text + " 号奖品");
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- );
|
|
|
|
-};
|
|
|
|
const DrawContent = () => {
|
|
const DrawContent = () => {
|
|
return (
|
|
return (
|
|
<div className={styles.drawContent}>
|
|
<div className={styles.drawContent}>
|
|
@@ -321,16 +116,20 @@ const Report = () => {
|
|
<div className={styles.vanTabsWrap}>
|
|
<div className={styles.vanTabsWrap}>
|
|
<div className={styles.vanTabsNav}>
|
|
<div className={styles.vanTabsNav}>
|
|
<div
|
|
<div
|
|
- className={`${styles.vanTabItem} ${activeTab === "left" ? styles.vanTabAcriveRight : ""}`}
|
|
|
|
|
|
+ className={`${styles.vanTabItem} ${activeTab === "right" ? styles.vanTabAcriveRight : ""} `}
|
|
onClick={() => handler("left")}
|
|
onClick={() => handler("left")}
|
|
>
|
|
>
|
|
- Relatório
|
|
|
|
|
|
+ <span className={activeTab === "left" ? styles.activeText : ""}>
|
|
|
|
+ Relatório
|
|
|
|
+ </span>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
- className={`${styles.vanTabItem} ${activeTab === "right" ? styles.vanTabAcriveLeft : ""}`}
|
|
|
|
|
|
+ className={`${styles.vanTabItem} ${activeTab === "left" ? styles.vanTabAcriveLeft : ""}`}
|
|
onClick={() => handler("right")}
|
|
onClick={() => handler("right")}
|
|
>
|
|
>
|
|
- Minha Referencia
|
|
|
|
|
|
+ <span className={activeTab === "right" ? styles.activeText : ""}>
|
|
|
|
+ Minha Referencia
|
|
|
|
+ </span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -405,7 +204,7 @@ const DrawMain = () => {
|
|
padding: "0",
|
|
padding: "0",
|
|
imgs: [
|
|
imgs: [
|
|
{
|
|
{
|
|
- src: "/wheels/center-light.png",
|
|
|
|
|
|
+ src: "/wheels/wheel.png",
|
|
width: "100%",
|
|
width: "100%",
|
|
height: "100%",
|
|
height: "100%",
|
|
},
|
|
},
|
|
@@ -413,14 +212,14 @@ const DrawMain = () => {
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
const [prizes] = useState([
|
|
const [prizes] = useState([
|
|
- { background: "#fde187", fonts: [{ text: "0", top: "20%" }] },
|
|
|
|
- { background: "#faf3c3", fonts: [{ text: "1", top: "20%" }] },
|
|
|
|
- { background: "#fde187", fonts: [{ text: "2", top: "20%" }] },
|
|
|
|
- { background: "#faf3c3", fonts: [{ text: "3", top: "20%" }] },
|
|
|
|
- { background: "#fde187", fonts: [{ text: "4", top: "20%" }] },
|
|
|
|
- { background: "#faf3c3", fonts: [{ text: "5", top: "20%" }] },
|
|
|
|
- { background: "#fde187", fonts: [{ text: "6", top: "20%" }] },
|
|
|
|
- { background: "#faf3c3", fonts: [{ text: "7", top: "20%" }] },
|
|
|
|
|
|
+ { fonts: [{ text: "0", top: "20%" }] },
|
|
|
|
+ { fonts: [{ text: "1", top: "20%" }] },
|
|
|
|
+ { fonts: [{ text: "2", top: "20%" }] },
|
|
|
|
+ { fonts: [{ text: "3", top: "20%" }] },
|
|
|
|
+ { fonts: [{ text: "4", top: "20%" }] },
|
|
|
|
+ { fonts: [{ text: "5", top: "20%" }] },
|
|
|
|
+ { fonts: [{ text: "6", top: "20%" }] },
|
|
|
|
+ { fonts: [{ text: "7", top: "20%" }] },
|
|
]);
|
|
]);
|
|
const [buttons] = useState([
|
|
const [buttons] = useState([
|
|
{
|
|
{
|
|
@@ -434,6 +233,10 @@ const DrawMain = () => {
|
|
],
|
|
],
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
|
|
+
|
|
|
|
+ const [defaultConfig] = useState({
|
|
|
|
+ offsetDegree: 20,
|
|
|
|
+ });
|
|
return (
|
|
return (
|
|
<div className={"relative"}>
|
|
<div className={"relative"}>
|
|
<WheelWallet />
|
|
<WheelWallet />
|
|
@@ -456,13 +259,10 @@ const DrawMain = () => {
|
|
|
|
|
|
<div
|
|
<div
|
|
className={
|
|
className={
|
|
- "mr-[0.07rem] flex h-[2.3rem] w-[2.3rem] " +
|
|
|
|
|
|
+ "mr-[0.07rem] flex h-[2.35rem] w-[2.35rem] " +
|
|
" absolute" +
|
|
" absolute" +
|
|
- " bottom-[0.2rem] z-50 rounded-[50%]"
|
|
|
|
|
|
+ " bottom-[0.17rem] z-50 rounded-[50%]"
|
|
}
|
|
}
|
|
- style={{
|
|
|
|
- boxShadow: "rgba(255, 255, 255, 1) 0px 0px 60px 12px inset",
|
|
|
|
- }}
|
|
|
|
>
|
|
>
|
|
{/*<div*/}
|
|
{/*<div*/}
|
|
{/* className={*/}
|
|
{/* className={*/}
|
|
@@ -478,9 +278,10 @@ const DrawMain = () => {
|
|
|
|
|
|
<LuckyWheel
|
|
<LuckyWheel
|
|
ref={myLucky}
|
|
ref={myLucky}
|
|
- width="2.3rem"
|
|
|
|
- height="2.3rem"
|
|
|
|
|
|
+ width="2.35rem"
|
|
|
|
+ height="2.35rem"
|
|
blocks={blocks}
|
|
blocks={blocks}
|
|
|
|
+ defaultConfig={defaultConfig}
|
|
prizes={prizes}
|
|
prizes={prizes}
|
|
buttons={buttons}
|
|
buttons={buttons}
|
|
onStart={() => {
|
|
onStart={() => {
|
|
@@ -519,9 +320,9 @@ const DrawMain = () => {
|
|
|
|
|
|
<div
|
|
<div
|
|
className={
|
|
className={
|
|
- "-mr-[0.08rem] flex h-[2.3rem] w-[2.3rem] " +
|
|
|
|
|
|
+ "-mr-[0.05rem] flex h-[2.3rem] w-[2.3rem] " +
|
|
" absolute" +
|
|
" absolute" +
|
|
- " bottom-[0.03rem]"
|
|
|
|
|
|
+ " bottom-[0.045rem]"
|
|
}
|
|
}
|
|
>
|
|
>
|
|
{/*<div*/}
|
|
{/*<div*/}
|
|
@@ -538,9 +339,10 @@ const DrawMain = () => {
|
|
|
|
|
|
<LuckyWheel
|
|
<LuckyWheel
|
|
ref={desktopWheelRef}
|
|
ref={desktopWheelRef}
|
|
- width="2.15rem"
|
|
|
|
- height="2.15rem"
|
|
|
|
|
|
+ width="2.2rem"
|
|
|
|
+ height="2.2rem"
|
|
blocks={blocks}
|
|
blocks={blocks}
|
|
|
|
+ defaultConfig={defaultConfig}
|
|
prizes={prizes}
|
|
prizes={prizes}
|
|
buttons={buttons}
|
|
buttons={buttons}
|
|
onStart={() => {
|
|
onStart={() => {
|