Explorar el Código

fix: 更新红包雨详情

Before hace 8 meses
padre
commit
b1144f8bf3

+ 5 - 2
messages/br.json

@@ -55,7 +55,8 @@
     "login": "Login",
     "register": "Cadastre-se",
     "locale": "Preferência de Localização",
-    "deposit": "Depósito"
+    "deposit": "Depósito",
+    "cashWheel": "CashWheel"
   },
   "Game": {
     "demo":"Demo",
@@ -149,7 +150,8 @@
     "Oferecer": "Oferecer",
     "DepositarAgora": "Depositar Agora",
     "RechargeSuc": "充值成功",
-    "depositTips": "We give 2% of each charge to help the power stations"
+    "depositTips": "We give 2% of each charge to help the power stations",
+    "customButtonText": "Custom top-ups"
   },
   "WithdrawPage": {
     "Certifique": "Certifique-se de que o CPF está em seu nome para evitar atrasos.",
@@ -341,6 +343,7 @@
     "1016": "Mismatched identity information",
     "1017": "The invitation code is incorrect",
     "1018": "The withdrawal channel is closed",
+    "1019": "The amount of coding done is too small",
     "1200":"Insufficient inventory",
     "1201": "",
     "1202":"",

+ 5 - 2
messages/en.json

@@ -56,7 +56,8 @@
     "login": "Login",
     "register": "Cadastre-se",
     "locale": "Preferência de Localização",
-    "deposit": "Depósito"
+    "deposit": "Depósito",
+    "cashWheel": "CashWheel"
   },
   "Game": {
     "demo":"Demo",
@@ -150,7 +151,8 @@
     "Oferecer": "Oferecer",
     "DepositarAgora": "Depositar Agora",
     "RechargeSuc": "充值成功",
-    "depositTips": "We give 2% of each charge to help the power stations"
+    "depositTips": "We give 2% of each charge to help the power stations",
+    "customButtonText": "Custom top-ups"
   },
   "WithdrawPage": {
     "Certifique": "Certifique-se de que o CPF está em seu nome para evitar atrasos.",
@@ -342,6 +344,7 @@
     "1016": "Mismatched identity information",
     "1017": "The invitation code is incorrect",
     "1018": "The withdrawal channel is closed",
+    "1019": "The amount of coding done is too small",
     "1200":"Insufficient inventory",
     "1201": "",
     "1202":"",

+ 1 - 5
package.json

@@ -4,24 +4,20 @@
   "private": true,
   "scripts": {
     "dev": "node scripts/swEnv.js .env.development .env.local && next dev ",
-
     "dev:prod": "node scripts/swEnv.js .env.production .env.local  && next dev",
     "build:prod": "node scripts/swEnv.js .env.production .env.local  && next build",
-
     "dev:test": "node scripts/swEnv.js .env.test .env.local && next dev",
     "build:test": "node scripts/swEnv.js .env.test .env.local && next build",
-
     "dev:uat": "node scripts/swEnv.js .env.uat .env.local  && next dev",
     "build:uat": "node scripts/swEnv.js .env.uat .env.local  && next build",
-
     "dev:third": "node scripts/swEnv.js .env.third .env.local  && next dev",
     "build:third": "node scripts/swEnv.js .env.third .env.local  && next build",
     "start": "next start",
-
     "lint": "next lint",
     "preinstall": "npx only-allow pnpm"
   },
   "dependencies": {
+    "@lucky-canvas/react": "^0.1.13",
     "ahooks": "^3.8.0",
     "antd-mobile": "^5.37.1",
     "axios": "^1.7.2",

+ 15 - 0
pnpm-lock.yaml

@@ -8,6 +8,9 @@ importers:
 
   .:
     dependencies:
+      '@lucky-canvas/react':
+        specifier: ^0.1.13
+        version: 0.1.13
       ahooks:
         specifier: ^3.8.0
         version: 3.8.0(react@18.3.1)
@@ -418,6 +421,9 @@ packages:
   '@jridgewell/trace-mapping@0.3.25':
     resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
 
+  '@lucky-canvas/react@0.1.13':
+    resolution: {integrity: sha512-4M2bHOn5lEBubqDXXHKONnAERr3O4YIbQ8Q8QynmbD0DeSk/VQewBAzx4RopHr3Fe0dcN98YmvwaxqNl39OR7w==}
+
   '@next/env@14.2.4':
     resolution: {integrity: sha512-3EtkY5VDkuV2+lNmKlbkibIJxcO4oIHEhBWne6PaAp+76J9KoSsGvNikp6ivzAT8dhhBMYrm6op2pS1ApG0Hzg==}
 
@@ -1518,6 +1524,9 @@ packages:
   lru-cache@10.4.3:
     resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}
 
+  lucky-canvas@1.7.27:
+    resolution: {integrity: sha512-Ftz6qD+863bI7xijBmZg3dw3cNEc7odPr70EZQcGA14y3TgTAzH65HPosOCd6kKUlMwhntBaHMx3onoj9MtJRQ==}
+
   merge2@1.4.1:
     resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
     engines: {node: '>= 8'}
@@ -2701,6 +2710,10 @@ snapshots:
       '@jridgewell/resolve-uri': 3.1.2
       '@jridgewell/sourcemap-codec': 1.5.0
 
+  '@lucky-canvas/react@0.1.13':
+    dependencies:
+      lucky-canvas: 1.7.27
+
   '@next/env@14.2.4': {}
 
   '@next/eslint-plugin-next@14.2.4':
@@ -4012,6 +4025,8 @@ snapshots:
 
   lru-cache@10.4.3: {}
 
+  lucky-canvas@1.7.27: {}
+
   merge2@1.4.1: {}
 
   micromatch@4.0.7:

BIN
public/hby/red-bg2.png


BIN
public/hby/red-icon.gif


BIN
public/wheels/bg.png


BIN
public/wheels/header-bg.png


BIN
public/wheels/inner-circle.png


BIN
public/wheels/outer-circle.png


BIN
public/wheels/pointer.png


+ 2 - 2
src/app/[locale]/(TabBar)/[[...share]]/@actionWidget/Service.tsx

@@ -48,7 +48,7 @@ const ServiceWidget: FC<Props> = (props) => {
 
             // 是否有已开始但是没领过的红包
             return actList.filter((aItem: any) => {
-                return aItem.is_start && !aItem.is_receive;
+                return aItem.can_receive && aItem.is_start && !aItem.is_receive;
             });
         } catch (error) {
             console.log("redPacketInfo===>error:", error);
@@ -72,7 +72,7 @@ const ServiceWidget: FC<Props> = (props) => {
                         <div key={index} className={`mb-[0.0694rem] cursor-pointer`}>
                             <img
                                 className={"h-[0.3889rem] w-[0.3889rem]"}
-                                src="/hby/red-icon.png"
+                                src="/hby/red-icon.gif"
                                 onClick={() => {
                                     RedPacketModalRef.current?.onOpen(packets, index);
                                 }}

+ 1 - 1
src/app/[locale]/(TabBar)/promo/PopupHby.tsx

@@ -412,7 +412,7 @@ const Popup = (props: any) => {
             }
             // 是否有已开始但是没领过的红包
             let isHasStartAct = actList.filter((aItem: any) => {
-                return !!aItem.is_start && !aItem.is_receive;
+                return aItem.can_receive && aItem.is_start && !aItem.is_receive;
             });
 
             let isShowRed = isHasStartAct.length > 0;

+ 256 - 105
src/app/[locale]/(navbar)/cashWheel/CashWheelClient.tsx

@@ -1,124 +1,275 @@
 "use client";
 
-import { Mask } from "antd-mobile";
-import clsx from "clsx";
-import Image from "next/image";
-import { Fragment, useEffect, useRef, useState } from "react";
+import { useRef, useState } from "react";
+import LotteryWheel from "./LotteryWheel";
 import styles from "./style.module.scss";
-import LotteryWheel from './LotteryWheel';
-
-
-const CashMainCom = ()=>{
-  return (
-    <div className={`${styles.cashMain} ${styles.cashMain} ${styles.type1}`}>
-      <div className={styles.haveCash}>
-        <img  src="/wheel/cash.png" alt="" className={styles.cashImg} />
-        <div > R$ <span  className={styles.cash}>94.15</span></div>
-        <span  className={styles.withdraw}><img  src="/wheel/pix.png" alt=""/> SACAR </span>
-      </div>
-      <div  className={styles.progress}>
-        <div  className={styles.num}> 94.15%</div>
-        <div  className={styles.bar}>
-          <span  style={{width: "calc(97.15% - 0.07rem)"}}></span>
+const CashMainCom = () => {
+    return (
+        <div className={`${styles.cashMain} ${styles.cashMain} ${styles.type1}`}>
+            <div className={styles.haveCash}>
+                <img src="/wheel/cash.png" alt="" className={styles.cashImg} />
+                <div>
+                    {" "}
+                    R$ <span className={styles.cash}>94.15</span>
+                </div>
+                <span className={styles.withdraw}>
+                    <img src="/wheel/pix.png" alt="" /> SACAR{" "}
+                </span>
+            </div>
+            <div className={styles.progress}>
+                <div className={styles.num}> 94.15%</div>
+                <div className={styles.bar}>
+                    <span style={{ width: "calc(97.15% - 0.07rem)" }}></span>
+                </div>
+            </div>
+            <div className={styles.needCash}>
+                {" "}
+                Ainda e necessário <span className={styles.needCashNum}>5.85</span> para realizar do
+                saque{" "}
+            </div>
         </div>
-      </div>
-      <div  className={styles.needCash}> Ainda e necessário  <span  className={styles.needCashNum}>5.85</span> para realizar do saque </div>
-    </div>
-  )
-}
+    );
+};
+const DrawMain1 = () => {
+    return (
+        <div className={styles.drawMain}>
+            <div className={styles.draw}>
+                {/*<img src="/wheel/d.png" className={styles.lamp} />*/}
+                {/*<img src="/wheel/light1.png" className={styles.light1} />*/}
+                {/*<img src="/wheel/light2.png" className={styles.light2} />*/}
+                {/*<div className={styles.pointer}>*/}
+                {/*    <img src="/wheel/pointer.png" />*/}
+                {/*</div>*/}
+                {/*<img src="/wheel/bg_light.png" className={styles.drawBgImg} />*/}
+                {/*<div className={`${styles.drawLen} ${styles.position} `}></div>*/}
 
-const DrawMain=()=>{
-  return (
-    <div className={styles.drawMain}>
-      <div className={styles.draw}>
-        <img src="/wheel/d.png" className={styles.lamp}/>
-        <img src="/wheel/light1.png" className={styles.light1}/>
-        <img src="/wheel/light2.png" className={styles.light2}/>
-        <div className={styles.pointer}>
-          <img src="/wheel/pointer.png" />
-        </div>
-        <img src="/wheel/bg_light.png" className={styles.drawBgImg}/>
-        <div className={`${styles.drawLen} ${styles.position} `}></div>
-        {/* <div className={styles.drawContents}>
+                {/* <div className={styles.drawContents}>
           <canvas id={styles.draw} width={306} height={306} />
         </div> */}
-        <LotteryWheel />
-      </div>
-    </div>
-  )
-}
+                <LotteryWheel />
+            </div>
+        </div>
+    );
+};
+const DrawMain = () => {
+    const [blocks] = useState([
+        {
+            padding: "20",
+            imgs: [
+                {
+                    src: "/wheels/inner-circle.png",
+                    width: "100%",
+                    height: "100%",
+                },
+            ],
+        },
+    ]);
+    const [prizes] = useState([
+        { background: "#fde187", fonts: [{ text: "0" }] },
+        { background: "#faf3c3", fonts: [{ text: "1" }] },
+        { background: "#fde187", fonts: [{ text: "2" }] },
+        { background: "#faf3c3", fonts: [{ text: "3" }] },
+        { background: "#fde187", fonts: [{ text: "4" }] },
+        { background: "#faf3c3", fonts: [{ text: "5" }] },
+        { background: "#fde187", fonts: [{ text: "6" }] },
+        { background: "#faf3c3", fonts: [{ text: "7" }] },
+    ]);
+    const [buttons] = useState([
+        {
+            radius: "30%",
+            imgs: [
+                {
+                    src: "/wheels/pointer.png",
+                    width: "100%",
+                    top: "-130%",
+                },
+            ],
+        },
+    ]);
+    const myLucky = useRef<any>();
+    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-[15%] z-10 h-[1.4889rem]"}
+            />
+
+            <svg width="100%" height="2.7778rem" className={"absolute -top-[15%] z-[11]"}>
+                <path
+                    d="M 63 162 C 119 36, 341 0,566 168"
+                    stroke="blue"
+                    stroke-width="4"
+                    id="circle"
+                    fill="transparent"
+                />
+                <text
+                    style={{
+                        fill: "#ff3333",
+                        fontSize: "20px",
+                        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.</tspan>
+                    </textPath>
+                </text>
+            </svg>
+            {/*<svg viewBox="0 -15 200 50" style={{ width: "100%", height: "100%" }}>*/}
+            {/*    /!*<path d="M0 30 C 50 5, 150 5 200 30" fill="transparent" id="circle" />*!/*/}
+
+            {/*    <path*/}
+            {/*        d="M0 100 C 100 0, 100 0, 200 100"*/}
+            {/*        fill="transparent"*/}
+            {/*        stroke="blue"*/}
+            {/*        stroke-width="2"*/}
+            {/*        id="circle"*/}
+            {/*    />*/}
 
-const DrawContent = ()=>{
-  return (
-    <div  className={styles.drawContent}>
-      <div  className={styles.text}>
-        <span ><span  style={{color: "rgb(135, 149, 177)"}}>Expira em</span> 2d 19:18:13</span>
-      </div>
-      <div  className={styles.cashButton}>
-        <div> Convide amigos para ajudar com saques </div>
-        <div className={`${styles.iconfont} ${styles.iconShare}`}></div>
-      </div>
-    </div>
-  )
-}
+            {/*    <text*/}
+            {/*        style={{*/}
+            {/*            fill: "#ff3333",*/}
+            {/*            fontSize: "20px",*/}
+            {/*            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.</tspan>*/}
+            {/*        </textPath>*/}
+            {/*    </text>*/}
+            {/*</svg>*/}
+            <img src={"/wheels/outer-circle.png"} className={"absolute h-[100%]"} />
 
-const Report=()=>{
-  const winListData = Array(500).fill('1')
-  return (
-    <div className={styles.report}>
-      <div className={`${styles.vanTabs} ${styles.vanTabsLine}`}>
-        <div className={styles.vanTabsWrap}>
-          <div className={styles.vanTabsNav}>
-            <div className={`${styles.vanTabItem} ${styles.vanTabAcrive}`}>Relatório</div>
-            <div className={`${styles.vanTabItem}`}>Minha Referencia</div>
-          </div>
+            {/*<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>
-        <div className={styles.vanTabsContent}>
-          <div className={styles.vantabpane}>
-            <div className={styles.tabContent}>
-              <div className={`${styles.winList} ${styles.swipernoswiping} ${styles.type2}`}>
-                {winListData.length>0  && winListData.map((item,index)=>{
-                  return (
-                    <div className={styles.item} key={index}>
-                      <span  className={`${styles.name} ${styles.omitWrap}`}>5533******412</span>
-                      <span  className={styles.tipText}> Acabou de saca </span>
-                      <div  className={styles.value}>
-                        <span  className={styles.addCash}>+100</span>
-                        <span  className={styles.unit}> R$</span>
-                      </div>
-                    </div>
-                  )
-                })}
-              </div>
+    );
+};
+
+const DrawContent = () => {
+    return (
+        <div className={styles.drawContent}>
+            <div className={styles.text}>
+                <span>
+                    <span style={{ color: "rgb(135, 149, 177)" }}>Expira em</span> 2d 19:18:13
+                </span>
+            </div>
+            <div className={styles.cashButton}>
+                <div> Convide amigos para ajudar com saques</div>
+                <div className={`${styles.iconfont} ${styles.iconShare}`}></div>
             </div>
-          </div>
         </div>
-      </div>
-      <div className={styles.rules}>
-        <h2>Regras</h2>
-        <ul className={styles.tipsContent}>
-          <li>1.Você pode iniciar um saque quando o valor acumulado atingir 100 BRL.  </li>
-          <li>2.Convidar amigos para se registrarem no 9f.com irá ajudá- lo a sacar dinheiro rapidamente.</li>
-          <li>3. Cada usuário receberá uma única rodada grátis por dia. </li>
-          <li>4.Cada usuário tem um período de validade de 3 dias para cada atividade e pode participar da atividade várias vezes.</li>
-          <li>5.Se você receber um bônus de dinheiro extra, pode jogar jogos de graça e ganhar ainda mais dinheiro real.</li>
-          <li>6.Se voce nao retirar o dinheiro dentro de 3 dias,ele ser perdido.</li>
-        </ul>
-      </div>
-    </div>
-  )
-}
+    );
+};
 
+const Report = () => {
+    const winListData = Array(500).fill("1");
+    return (
+        <div className={styles.report}>
+            <div className={`${styles.vanTabs} ${styles.vanTabsLine}`}>
+                <div className={styles.vanTabsWrap}>
+                    <div className={styles.vanTabsNav}>
+                        <div className={`${styles.vanTabItem} ${styles.vanTabAcrive}`}>
+                            Relatório
+                        </div>
+                        <div className={`${styles.vanTabItem}`}>Minha Referencia</div>
+                    </div>
+                </div>
+                <div className={styles.vanTabsContent}>
+                    <div className={styles.vantabpane}>
+                        <div className={styles.tabContent}>
+                            <div
+                                className={`${styles.winList} ${styles.swipernoswiping} ${styles.type2}`}
+                            >
+                                {winListData.length > 0 &&
+                                    winListData.map((item, index) => {
+                                        return (
+                                            <div className={styles.item} key={index}>
+                                                <span
+                                                    className={`${styles.name} ${styles.omitWrap}`}
+                                                >
+                                                    5533******412
+                                                </span>
+                                                <span className={styles.tipText}>
+                                                    {" "}
+                                                    Acabou de saca{" "}
+                                                </span>
+                                                <div className={styles.value}>
+                                                    <span className={styles.addCash}>+100</span>
+                                                    <span className={styles.unit}> R$</span>
+                                                </div>
+                                            </div>
+                                        );
+                                    })}
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div className={styles.rules}>
+                <h2>Regras</h2>
+                <ul className={styles.tipsContent}>
+                    <li>1.Você pode iniciar um saque quando o valor acumulado atingir 100 BRL. </li>
+                    <li>
+                        2.Convidar amigos para se registrarem no 9f.com irá ajudá- lo a sacar
+                        dinheiro rapidamente.
+                    </li>
+                    <li>3. Cada usuário receberá uma única rodada grátis por dia. </li>
+                    <li>
+                        4.Cada usuário tem um período de validade de 3 dias para cada atividade e
+                        pode participar da atividade várias vezes.
+                    </li>
+                    <li>
+                        5.Se você receber um bônus de dinheiro extra, pode jogar jogos de graça e
+                        ganhar ainda mais dinheiro real.
+                    </li>
+                    <li>6.Se voce nao retirar o dinheiro dentro de 3 dias,ele ser perdido.</li>
+                </ul>
+            </div>
+        </div>
+    );
+};
 
 const CashWheelClient = () => {
     return (
-       <div className={styles.cashWheelClient}>
-        <CashMainCom />
-        <DrawMain/>
-        <DrawContent />
-        <Report />
-        {/* <LotteryWheel/> */}
-       </div>
+        <>
+            <div className={"mb-[40px] border-4"}>123</div>
+            <DrawMain />
+            {/*<div className={styles.cashWheelClient}>*/}
+            {/*    <CashMainCom />*/}
+            {/*    <DrawMain />*/}
+            {/*    <DrawContent />*/}
+            {/*    <Report />*/}
+            {/*    /!* <LotteryWheel/> *!/*/}
+            {/*</div>*/}
+        </>
     );
 };
 

+ 79 - 68
src/app/[locale]/(navbar)/cashWheel/LotteryWheel.tsx

@@ -1,83 +1,94 @@
 "use client";
-import { useRef, useEffect, useState } from 'react';
+import { useEffect, useRef, useState } from "react";
 import styles from "./style.module.scss";
 
-
-
 const Lottery = () => {
-  const canvasRef = useRef<any>(null);
-  const [isSpinning, setIsSpinning] = useState(false);
-  const [prize, setPrize] = useState('');
-  const segments = ['一等奖', '二等奖', '三等奖', '四等奖', '五等奖', '六等奖', '七等奖', '八等奖'];
-  // 4:1940,8:2120
-  const segmentAngle = (2 * Math.PI) / segments.length;
-
-  const drawWheel = () => {
-    const canvas = canvasRef.current;
-    const ctx = canvas.getContext('2d');
-    const radius = canvas.width / 2;
-
-    // 绘制背景图
-    const backgroundImage = new Image();
-    backgroundImage.src = '/wheel/spinBg.png'; // 替换为你的背景图路径
-    backgroundImage.onload = () => {
-      ctx.clearRect(0, 0, canvas.width, canvas.height);
-      ctx.drawImage(backgroundImage, 0, 0, canvas.width, canvas.height); // 绘制背景图
-
-      ctx.save();
-      ctx.translate(radius, radius);
-
-
-      // 绘制奖项文本
-      segments.forEach((segment, index) => {
-        ctx.save();
-        ctx.rotate(index * segmentAngle);
-        ctx.fillStyle = '#fff'; // 文字颜色
-        ctx.font = '16px Arial';
-        ctx.fillText(segment, radius / 2, 8); // 适当调整位置
-        ctx.restore();
-      });
-
-      ctx.restore();
+    const canvasRef = useRef<any>(null);
+    const [isSpinning, setIsSpinning] = useState(false);
+    const [prize, setPrize] = useState("");
+    const segments = [
+        "一等奖",
+        "二等奖",
+        "三等奖",
+        "四等奖",
+        "五等奖",
+        "六等奖",
+        "七等奖",
+        "八等奖",
+    ];
+    // 4:1940,8:2120
+    const segmentAngle = (2 * Math.PI) / segments.length;
+
+    const drawWheel = () => {
+        const canvas = canvasRef.current;
+        const ctx = canvas.getContext("2d");
+        const radius = canvas.width / 2;
+
+        // 绘制背景图
+        const backgroundImage = new Image();
+        backgroundImage.src = "/wheel/spinBg.png"; // 替换为你的背景图路径
+        backgroundImage.onload = () => {
+            ctx.clearRect(0, 0, canvas.width, canvas.height);
+            ctx.drawImage(backgroundImage, 0, 0, canvas.width, canvas.height); // 绘制背景图
+
+            ctx.save();
+            ctx.translate(radius, radius);
+
+            // 绘制奖项文本
+            segments.forEach((segment, index) => {
+                ctx.save();
+                ctx.rotate(index * segmentAngle);
+                ctx.fillStyle = "#fff"; // 文字颜色
+                ctx.font = "16px Arial";
+                ctx.fillText(segment, radius / 2, 8); // 适当调整位置
+                ctx.restore();
+            });
+
+            ctx.restore();
+        };
     };
-  };
 
-  const spinWheel = () => {
-    if (isSpinning) return;
+    const spinWheel = () => {
+        if (isSpinning) return;
+
+        setIsSpinning(true);
+        let rotation = 0;
+        const spinDuration = 5000; // 旋转持续时间
+        const stopAngle =
+            Math.floor(Math.random() * segments.length) * (360 / segments.length) + 360 * 5; // 随机停下的角度
 
-    setIsSpinning(true);
-    let rotation = 0;
-    const spinDuration = 5000; // 旋转持续时间
-    const stopAngle = Math.floor(Math.random() * segments.length) * (360 / segments.length) + 360 * 5; // 随机停下的角度
+        const spinAnimation = (timestamp: any) => {
+            rotation += 10; // 每次增加的角度
+            canvasRef.current.style.transform = `rotate(${rotation}deg)`;
 
-    const spinAnimation = (timestamp:any) => {
-      rotation += 10; // 每次增加的角度
-      canvasRef.current.style.transform = `rotate(${rotation}deg)`;
+            if (rotation < stopAngle) {
+                requestAnimationFrame(spinAnimation);
+            } else {
+                setIsSpinning(false);
+                const winningSegment = Math.floor((stopAngle % 360) / (360 / segments.length));
+                setPrize(segments[winningSegment]);
+            }
+        };
 
-      if (rotation < stopAngle) {
         requestAnimationFrame(spinAnimation);
-      } else {
-        setIsSpinning(false);
-        const winningSegment = Math.floor(((stopAngle % 360) / (360 / segments.length)));
-        setPrize(segments[winningSegment]);
-      }
     };
 
-    requestAnimationFrame(spinAnimation);
-  };
-
-  useEffect(() => {
-    drawWheel();
-  }, []);
-
-  return (
-    <>
-      <img src="/wheel/draw.png" className={`${styles.drawImg} ${styles.position}`} onClick={spinWheel}/>
-      <div className={styles.drawContents}>
-        <canvas ref={canvasRef} id={styles.draw} width={306} height={306} />
-      </div>
-    </>
-  );
+    useEffect(() => {
+        drawWheel();
+    }, []);
+
+    return (
+        <>
+            <img
+                src="/wheel/draw.png"
+                className={`${styles.drawImg} ${styles.position}`}
+                onClick={spinWheel}
+            />
+            <div className={styles.drawContents}>
+                <canvas ref={canvasRef} id={styles.draw} width={306} height={306} />
+            </div>
+        </>
+    );
 };
 
 export default Lottery;

+ 2 - 2
src/app/[locale]/(navbar)/cashWheel/layout.tsx

@@ -9,10 +9,10 @@ export default async function Layout({
     children: ReactNode;
     params: { locale: string };
 }) {
-    const t = await getTranslations("Sidebar");
+    const t = await getTranslations("Header");
     return (
         <>
-            <HeaderBack showBack={true} title={t("receba")} />
+            <HeaderBack showBack={true} title={t("cashWheel")} />
             <main className={"main-header bg-[#24262b]"}>{children}</main>
         </>
     );

+ 157 - 84
src/app/[locale]/(navbar)/doings/discount/DepositData.tsx

@@ -2,7 +2,6 @@
 import { DepositsTypes } from "@/api/depositsApi";
 import { getUserRechargeApi } from "@/api/user";
 import Box from "@/components/Box";
-import ButtonOwn from "@/components/ButtonOwn";
 import { useUserInfoStore } from "@/stores/useUserInfoStore";
 import { neReg } from "@/utils";
 import { Form, Input, Toast } from "antd-mobile";
@@ -10,7 +9,10 @@ import { FormInstance } from "antd-mobile/es/components/form";
 import { useTranslations } from "next-intl";
 import { FC, Fragment, useRef, useState } from "react";
 
+import ButtonOwn from "@/components/ButtonOwn";
 import "@/styles/deposit.scss";
+import { Autoplay, Pagination } from "swiper/modules";
+import { Swiper, SwiperSlide } from "swiper/react";
 interface Props {
     deposits: DepositsTypes[];
 }
@@ -18,7 +20,10 @@ const DepositData: FC<Props> = (props) => {
     const { deposits } = props;
     const t = useTranslations();
     const userInfo = useUserInfoStore((state) => state.userInfo);
+    // 选中类型
     const [activeType, setActiveType] = useState<DepositsTypes>(deposits[0]);
+    // 是否自定义充值
+    const [isCustomInput, setIsCustomInput] = useState(false);
 
     const formInstanceRef = useRef<FormInstance>(null);
     let [amount, setAmount] = useState<number | undefined>(undefined);
@@ -66,101 +71,169 @@ const DepositData: FC<Props> = (props) => {
             );
         return Promise.resolve();
     };
+    const banners = [
+        {
+            id: 61,
+            sort: 0,
+            show_platform: 1,
+            action_type: 1,
+            action_params: "",
+            content: "http://192.168.0.237:9000/bcwin/86fa3351-2aef-4ede-ba70-cae365f03812.jpg",
+        },
+        {
+            id: 62,
+            sort: 0,
+            show_platform: 1,
+            action_type: 1,
+            action_params: "",
+            content: "http://192.168.0.237:9000/bcwin/9809de49-966e-4dea-81c9-baa71347dc6c.jpg",
+        },
+    ];
+
     return (
-        <div className="deposit-box">
-            <div className={"flex flex-wrap"}>
-                {deposits.map((item, index) => {
-                    return (
-                        <Fragment key={item.id}>
-                            <p
-                                className="btn-box truncate"
-                                style={{
-                                    borderColor: activeType.id === item.id ? "#ff9323" : "#333",
-                                }}
-                                onClick={() => titleChangeHandler(item, index)}
+        <>
+            <div style={{ height: "1.86rem" }} className={"home-banner"}>
+                <Swiper
+                    autoplay={{ delay: 2500 }}
+                    pagination={{ clickable: true }}
+                    spaceBetween={10}
+                    scrollbar={{ draggable: true }}
+                    slidesPerView={1}
+                    loop
+                    modules={[Pagination, Autoplay]}
+                >
+                    {banners.map((banner, index) => (
+                        <SwiperSlide key={index}>
+                            <Box
+                                none
+                                action={banner.action_type as 1}
+                                actionData={banner.action_params}
                             >
-                                {item.name}
-                            </p>
-                        </Fragment>
-                    );
-                })}
+                                <img
+                                    src={banner.content}
+                                    style={{ height: "1.86rem", width: "100%" }}
+                                    alt={"banner"}
+                                />
+                            </Box>
+                        </SwiperSlide>
+                    ))}
+                </Swiper>
             </div>
+            <div className="deposit-box">
+                <p>title</p>
+                <p className={"text-[0.12rem] text-[#e8e8e8]"}>
+                    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab accusamus amet
+                    animi beatae blanditiis cumque dicta dolor eius est ex, facilis illo libero
+                    magnam placeat quibusdam similique ullam, vel veniam?
+                </p>
+                <div className={"flex flex-wrap"}>
+                    {deposits.map((item, index) => {
+                        return (
+                            <Fragment key={item.id}>
+                                <p
+                                    className="btn-box truncate"
+                                    style={{
+                                        borderColor: activeType.id === item.id ? "#ff9323" : "#333",
+                                    }}
+                                    onClick={() => titleChangeHandler(item, index)}
+                                >
+                                    {item.name}
+                                </p>
+                            </Fragment>
+                        );
+                    })}
+                </div>
 
-            <Box className={"custom-form"} style={{ padding: 0 }}>
-                <Form
-                    style={{
-                        "--border-bottom": "none",
-                        "--border-top": "none",
-                        "--border-inner": "none",
-                    }}
-                    ref={formInstanceRef}
-                    footer={
-                        <>
-                            <ButtonOwn active>{t("DepositPage.DepositarAgora")}</ButtonOwn>
-                        </>
-                    }
-                    initialValues={userInfo}
-                    onFinish={onFinish}
-                    onValuesChange={onValuesChange}
-                >
-                    {isStrictMode ? (
-                        <>
-                            <Form.Item
-                                name="user_name"
-                                label=""
-                                rules={[{ required: true, message: t("form.usernameReg") }]}
-                            >
-                                <Input placeholder={t("form.username")} />
-                            </Form.Item>
+                <Box className={"custom-form"} style={{ padding: 0 }}>
+                    <Form
+                        style={{
+                            "--border-bottom": "none",
+                            "--border-top": "none",
+                            "--border-inner": "none",
+                        }}
+                        ref={formInstanceRef}
+                        initialValues={userInfo}
+                        onFinish={onFinish}
+                        onValuesChange={onValuesChange}
+                    >
+                        {isStrictMode ? (
+                            <>
+                                <Form.Item
+                                    name="user_name"
+                                    label=""
+                                    rules={[{ required: true, message: t("form.usernameReg") }]}
+                                >
+                                    <Input placeholder={t("form.username")} />
+                                </Form.Item>
+                                <Form.Item
+                                    name="passport"
+                                    label=""
+                                    rules={[
+                                        {
+                                            required: true,
+                                            message: t("form.cardReg"),
+                                            pattern: neReg,
+                                        },
+                                    ]}
+                                >
+                                    <Input
+                                        placeholder={t("form.card")}
+                                        maxLength={11}
+                                        type={"text"}
+                                    />
+                                </Form.Item>
+                            </>
+                        ) : null}
+                        {isCustomInput && (
                             <Form.Item
-                                name="passport"
+                                name="amount"
                                 label=""
                                 rules={[
-                                    { required: true, message: t("form.cardReg"), pattern: neReg },
+                                    { required: true, type: "number", validator: amountValidator },
                                 ]}
                             >
-                                <Input placeholder={t("form.card")} maxLength={11} type={"text"} />
+                                <Input
+                                    placeholder={`${t("DepositPage.Montante")}(BRL): Mín. ${activeType.min_amount}`}
+                                    type={"number"}
+                                    maxLength={activeType.max_amount}
+                                />
                             </Form.Item>
-                        </>
-                    ) : null}
-                    <Form.Item
-                        name="amount"
-                        label=""
-                        rules={[{ required: true, type: "number", validator: amountValidator }]}
-                    >
-                        <Input
-                            placeholder={`${t("DepositPage.Montante")}(BRL): Mín. ${activeType.min_amount}`}
-                            type={"number"}
-                            maxLength={activeType.max_amount}
-                        />
-                    </Form.Item>
+                        )}
 
-                    <div className={"flex flex-col"}>
-                        <div className={"flex-1"}>
-                            <ul className="ul-box">
-                                {activeType.products.map((item, index) => (
-                                    <li
-                                        className={amount == item.amount ? "active" : ""}
-                                        key={index}
-                                        onClick={() => amountChange(item.amount)}
-                                    >
-                                        {!!item.badge && <span className="hot"></span>}
-                                        <div className="amountContent">
-                                            {/* <span className="iconfont icon-unit-brl"></span> */}
-                                            <span className="iconfont">R$</span>
-                                            <span> {item.amount}</span>
-                                        </div>
-                                        <span className="amountTips">
-                                            {t("DepositPage.Oferecer")} 100%
-                                        </span>
-                                    </li>
-                                ))}
-                            </ul>
+                        <div className={"flex flex-col"}>
+                            <div className={"flex-1"}>
+                                <ul className="ul-box">
+                                    {activeType.products.map((item, index) => (
+                                        <li
+                                            className={amount == item.amount ? "active" : ""}
+                                            key={index}
+                                            onClick={() => amountChange(item.amount)}
+                                        >
+                                            {!!item.badge && <span className="hot"></span>}
+                                            <div className="amountContent">
+                                                {/* <span className="iconfont icon-unit-brl"></span> */}
+                                                <span className="iconfont">R$</span>
+                                                <span> {item.amount}</span>
+                                            </div>
+                                            <span className="amountTips">
+                                                {t("DepositPage.Oferecer")} 100%
+                                            </span>
+                                        </li>
+                                    ))}
+                                </ul>
+                            </div>
                         </div>
-                    </div>
-                </Form>
-            </Box>
-        </div>
+                    </Form>
+                </Box>
+                <ButtonOwn
+                    style={{ marginTop: "0.1389rem" }}
+                    active
+                    callbackFun={() => setIsCustomInput(true)}
+                >
+                    {t("DepositPage.customButtonText")}
+                </ButtonOwn>
+            </div>
+        </>
     );
 };
 

+ 2 - 1
src/components/Box/RedPacketModal.tsx

@@ -427,7 +427,7 @@ const RedPacketModal = forwardRef<RedPacketModalProps, Props>(function RedPacket
             // 是否有已开始但是没领过的红包
             let packetsFilter = actList
                 .filter((aItem: any) => {
-                    return aItem.is_start && !aItem.is_receive;
+                    return aItem.can_receive && aItem.is_start && !aItem.is_receive;
                 })
                 .sort((pre: any, next: any) => pre.end_time - next.end_time);
 
@@ -478,6 +478,7 @@ const RedPacketModal = forwardRef<RedPacketModalProps, Props>(function RedPacket
     return (
         <Mask visible={visible} destroyOnClose={true}>
             <FallAnimation onClose={() => setVisible(false)} />
+
             {status === Status.is_start ? (
                 <HbyInfo
                     onCloseHby={() => setVisible(false)}

+ 6 - 5
src/components/Box/redpacked.module.scss

@@ -265,20 +265,21 @@
   }
   .title{
     color: #925c00;
-    font-size: .16rem;
+    font-size: .14rem;
     text-align: center;
+    font-weight: bold;
     font-family: 'Arial-BoldMT,Arial';
     width: 1.595rem;
-    margin-top: 0.2rem
+    margin: 0.6rem 0 0.1rem 0;
   }
   .cash{
-    color: #8c0c04;
+    color: #c2302e;
     font-family: "Arial-BoldMT,Arial";
     font-weight: 700;
     font-size: .55rem;
     flex: 1;
-    display: flex;
-    align-items: center;
+    //display: flex;
+    //align-items: center;
   }
   .tips{
     width: 1.545rem;

+ 7 - 2
src/components/ButtonOwn/index.tsx

@@ -1,6 +1,6 @@
 "use client";
 import clsx from "clsx";
-import { FC, PropsWithChildren } from "react";
+import { CSSProperties, FC, PropsWithChildren } from "react";
 import styles from "./style.module.scss";
 
 /**
@@ -13,6 +13,8 @@ export interface ButtonOwnProps {
     children?: any;
     active?: boolean;
     callbackFun?: () => void;
+    className?: string;
+    style?: CSSProperties;
     [props: string]: any;
 }
 
@@ -20,14 +22,17 @@ const ButtonOwn: FC<PropsWithChildren<ButtonOwnProps>> = ({
     children = "",
     active = false,
     callbackFun,
+    className,
+    style,
     ...other
 }) => {
     const divClassName = clsx({
         [styles.button]: true,
         [styles.active]: active,
+        className,
     });
     return (
-        <button className={divClassName} {...other} onClick={callbackFun}>
+        <button style={style} className={divClassName} {...other} onClick={callbackFun}>
             {children}
         </button>
     );

+ 1 - 1
src/styles/deposit.scss

@@ -1,6 +1,6 @@
 .deposit-box {
   width: 100%;
-  height: 100%;
+  //height: 100%;
   overflow-y: auto;
   padding: 0.1rem .18rem;
   //background-color: #1f1f1f;

+ 14 - 0
src/types/lucky-canvas.d.ts

@@ -0,0 +1,14 @@
+declare module "@lucky-canvas/react" {
+    import { FC } from "react";
+    interface LuckyCanvasProps<B = any, P = any, A = any> {
+        ref: any;
+        width: string;
+        height: string;
+        blocks: B[];
+        prizes: P[];
+        buttons: A[];
+        onStart: () => void;
+        onEnd: (p: P) => void;
+    }
+    export const LuckyWheel: FC<LuckyCanvasProps>;
+}