Sfoglia il codice sorgente

feat: 修改代码

year 3 mesi fa
parent
commit
b7fa2427e3

BIN
public/deliver/bg.png


BIN
public/deliver/r1.png


BIN
public/deliver/r2.png


BIN
public/deliver/title.png


BIN
public/deliver/top.png


+ 20 - 0
src/app/[locale]/(doings)/deliver/layout.tsx

@@ -0,0 +1,20 @@
+import HeaderBack from "@/components/HeaderBack";
+import { getTranslations } from "next-intl/server";
+import { ReactNode } from "react";
+import styles from "./style.module.scss";
+
+export default async function Layout({
+    children,
+    params: { locale },
+}: {
+    children: ReactNode;
+    params: { locale: string };
+}) {
+    const t = await getTranslations("Header");
+    return (
+        <div className={styles.page}>
+            <HeaderBack showBack={true} title={"Bónus Misterioso"} useBg={true} />
+            <main className={"main-header"}>{children}</main>
+        </div>
+    );
+}

+ 149 - 0
src/app/[locale]/(doings)/deliver/page.tsx

@@ -0,0 +1,149 @@
+"use client";
+import { useRouter } from "@/i18n/routing";
+import clsx from "clsx";
+import React from "react";
+import styles from "./style.module.scss";
+
+const Deliver: React.FC = () => {
+    const [coords, setCoords] = React.useState<string>("");
+    const imgRef = React.useRef<HTMLImageElement>(null);
+    const router = useRouter();
+
+    const list = React.useMemo(() => {
+        return [
+            {
+                deposit: "depósito",
+                code: "Codificação",
+                money: "prêmio",
+            },
+            {
+                deposit: "depósito",
+                code: "Codificação",
+                money: "prêmio22",
+            },
+        ];
+    }, []);
+    React.useEffect(() => {
+        getCoords();
+        // eslint-disable-next-line react-hooks/exhaustive-deps
+    }, []);
+    //计算按钮坐标
+    const getCoords = () => {
+        if (!imgRef.current) {
+            setTimeout(() => {
+                getCoords();
+            }, 1000);
+        }
+        const img = imgRef.current;
+        const width = img?.naturalWidth || 0;
+        const cw = img?.clientWidth || 0;
+        const scaleNum = cw / width;
+        const x = 500 * scaleNum;
+        const y = 280 * scaleNum;
+        const ex = cw;
+        const ey = 390 * scaleNum;
+        setCoords(`${x},${y},${ex},${ey}`);
+    };
+    const goDeposite = () => {
+        router.push("/deposit");
+    };
+
+    return (
+        <div className={styles.deliverPage}>
+            <div className={clsx(styles.deliverPageContainer, "pb-[.2rem]")}>
+                <img
+                    useMap="#planetmap"
+                    src="/deliver/top.png"
+                    ref={imgRef}
+                    style={{ width: "100%" }}
+                    alt=""
+                />
+                <map name="planetmap">
+                    <area shape="rect" coords={coords} alt="Sun" onClick={goDeposite}></area>
+                </map>
+                <div className={styles.deliverPageMoney}>
+                    <div className={styles.progress}>
+                        <div className={styles.progressInner}></div>
+                    </div>
+                    <div className={styles.vip}>
+                        <span>vip1</span>
+                        <span>vip1</span>
+                    </div>
+
+                    <div className={styles.info}>
+                        <div>
+                            <span>Depósito de hoje:</span>
+                            <span className={"text-[#ffd800]"}>R$ 100</span>
+                        </div>
+                        <div>
+                            <span>Cota de codificação: </span>
+                            <span className={"text-[#ffd800]"}>R$ 100</span>
+                        </div>
+                    </div>
+                    <div className={styles.text}>Valor a ser arrecadado hoje</div>
+                    <div className={clsx("text-center", styles.moneyContainer)}>
+                        <span className={clsx(styles.moneyText, "text-[.2rem]")}>R$ </span>
+                        <span className={clsx(styles.moneyText, "text-[.6rem]")}>50.00</span>
+                    </div>
+                    <div className="mt-[.2rem] flex flex-row items-center justify-center">
+                        <span className={styles.btn}>Recebido</span>
+                    </div>
+                </div>
+                <div className={clsx(styles.box, "p-[.2rem] pt-[.34rem]")}>
+                    <div className={styles.boxTitle}>Detalhes do evento</div>
+                    <div className="text-[.14rem]">
+                        A partir de agora, todos os jogadores que depositarem mais de 500 reais no
+                        mesmo dia e completarem os requisitos do código correspondente poderão
+                        receber até 88.888 reais mais bônus no dia seguinte. Por exemplo: O Membro A
+                        deposita mais de 300.000 reais no mesmo dia e completa os requisitos do
+                        código. No dia seguinte, ele pode receber 3.888 yuans mais bônus. O bônus
+                        pode ser reivindicado após 0:05 do dia seguinte, válido durante o dia, e a
+                        recompensa será perdida após o limite de tempo!
+                    </div>
+                </div>
+                <div className={clsx(styles.box, "pt-[.4rem]")}>
+                    <div className={styles.boxTitle}>Recompensas de Atividade</div>
+                    <div className={styles.list}>
+                        {list.map((item, idx) => {
+                            return (
+                                <div
+                                    key={JSON.stringify(item)}
+                                    className={clsx(styles.listItem, {
+                                        [styles.odd]: idx % 2 === 0,
+                                    })}
+                                >
+                                    <div>depósito</div>
+                                    <div>Codificação</div>
+                                    <div>prêmio</div>
+                                </div>
+                            );
+                        })}
+                    </div>
+                </div>
+                <div className={clsx(styles.box, "pt-[.4rem]")}>
+                    <div className={styles.boxTitle}>Regras de Atividade</div>
+                    <div className="p-[.1rem] text-[.14rem]">
+                        <div>1.Jogadores que se registraram com sucesso podem participar. </div>
+                        <div>
+                            2.Os membros que atenderem aos requisitos da atividade só poderão
+                            receber a recompensa no mesmo dia. O não recebimento da recompensa após
+                            o prazo será considerado como renúncia automática dos direitos da
+                            atividade.
+                        </div>
+                        <div>
+                            3.O horário para reivindicar as recompensas da atividade é 5 minutos
+                            após o dia seguinte.
+                        </div>
+                        <div>
+                            4.A empresa reserva-se o direito de interpretar esta atividade e
+                            reserva-se o direito de congelar e cancelar todos os direitos dos
+                            membros.
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    );
+};
+
+export default Deliver;

+ 163 - 0
src/app/[locale]/(doings)/deliver/style.module.scss

@@ -0,0 +1,163 @@
+.page {
+    height: 100%;
+}
+.deliverPage {
+    height: 100%;
+    overflow: auto;
+    &Container {
+        background-image: url("/deliver/bg.png");
+        background-size: 100% 100%;
+        background-repeat: no-repeat;
+        min-height: 100%;
+    }
+    &Money {
+        margin: 0 0.11rem;
+        box-sizing: border-box;
+        border-radius: 0 0 0.1rem 0.1rem;
+        border-style: solid;
+        border-color: #8deaf2;
+        border-width: 4px;
+        border-top-width: 0;
+        position: relative;
+        padding: 0.1rem;
+        background: linear-gradient(to bottom, #4a4abb, #4767d5);
+        .vip {
+            display: flex;
+            justify-content: space-between;
+            span:nth-child(1) {
+                color: #ffce63;
+                font-size: 0.12rem;
+            }
+            span:last-child {
+                color: #ffffff;
+                font-size: 0.12rem;
+            }
+        }
+        .info {
+            border-radius: 0.1rem;
+            border: 1px solid #8aeaf2;
+            box-shadow: 0 0 0.15rem #9895d6 inset;
+            padding: 0.06rem;
+            margin-top: 0.1rem;
+            display: flex;
+            justify-content: space-between;
+            font-size: 0.1rem;
+        }
+        .text {
+            margin-top: 0.1rem;
+            text-align: center;
+            font-size: 0.2rem;
+            font-weight: bold;
+            background: linear-gradient(to bottom, #ffc914, #ff663f); // 添加水平渐变背景
+            -webkit-background-clip: text; // 将背景裁剪到文字
+            background-clip: text;
+            -webkit-text-fill-color: transparent;
+            filter: drop-shadow(-1px -1px 0 #fff) drop-shadow(1px -1px 0 #fff)
+                drop-shadow(-1px 1px 0 #fff) drop-shadow(1px 1px 0 #fff);
+        }
+        .moneyText {
+            font-weight: bold;
+            background: linear-gradient(to bottom, #fffab6, #ec8d19); // 添加水平渐变背景
+            -webkit-background-clip: text; // 将背景裁剪到文字
+            background-clip: text;
+            -webkit-text-fill-color: transparent;
+            filter: drop-shadow(-1px -1px 0 #fff) drop-shadow(1px -1px 0 #fff)
+                drop-shadow(-1px 1px 0 #fff) drop-shadow(1px 1px 0 #fff);
+        }
+    }
+    .moneyContainer {
+        border-bottom: 6px solid #99eef4;
+        border-radius: 4px;
+        position: relative;
+        perspective: 1000px;
+        span {
+            position: relative;
+            z-index: 1;
+        }
+        &:after {
+            content: "";
+            position: absolute;
+            bottom: 1px;
+            left: 0;
+            right: 0;
+            background-color: #606ce3;
+            height: 0.6rem;
+            transform: rotateX(70deg);
+            transform-origin: 0 100%;
+        }
+    }
+    .btn {
+        background: url("/deliver/r2.png") no-repeat;
+        background-size: 100% 100%;
+        display: block;
+        width: 2.2rem;
+        height: 0.52rem;
+        text-align: center;
+        line-height: 0.5rem;
+        font-size: 0.18rem;
+        &.disabled {
+            background: url("/deliver/r1.png") no-repeat;
+            color: rgba(255, 255, 255, 0.5);
+        }
+    }
+    .progress {
+        position: absolute;
+        left: -4px;
+        top: 0;
+        right: -4px;
+        height: 0.09rem;
+        background: linear-gradient(to bottom, #ccc, #969595);
+        border-radius: 0 0 0.04rem 0.04rem;
+        overflow: hidden;
+        &Inner {
+            width: 20%;
+            height: 100%;
+            background: linear-gradient(to bottom, #dcd87e, #f0a434);
+            border-radius: 0.04rem 0.04rem;
+        }
+    }
+}
+.box {
+    position: relative;
+    background-color: #273a9a;
+    margin: 0.2rem 0.1rem 0 0.1rem;
+    border-radius: 0.1rem;
+    position: relative;
+    &::before {
+        content: "";
+        position: absolute;
+        left: 0;
+        top: 0;
+        right: 0;
+        bottom: 0;
+        box-shadow: 0 1px 8px rgba(255, 255, 255, 0.6) inset;
+        border-radius: 0.1rem;
+    }
+    .boxTitle {
+        position: absolute;
+        left: 0.32rem;
+        right: 0.32rem;
+        top: -0.06rem;
+        height: 0.34rem;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        background: url("/deliver/title.png") no-repeat;
+        background-size: 100% 100%;
+        font-size: 0.16rem;
+        font-weight: 700;
+    }
+}
+.list {
+    .listItem {
+        display: flex;
+        &.odd {
+            background-color: #20297f;
+        }
+        div {
+            flex: 1;
+            padding: 0.1rem 0;
+            text-align: center;
+        }
+    }
+}