year 1 mesiac pred
rodič
commit
edfb7fa148

+ 3 - 3
src/app/[locale]/(navbar)/betrecord/components/list.tsx

@@ -25,10 +25,10 @@ const BetRecord: FC<Props> = (props) => {
                 {record.map((item, index) => (
                     <List.Item key={index}>
                         <div className={"flex justify-between"}>
-                            <div className={"text-[#fff]"}>{item.product}</div>
+                            <div className={"text-[.13rem] text-[#fff]"}>{item.product}</div>
                             <div>
                                 {item.reward > 0 ? (
-                                    <span className={"text-[#01d301]"}>+ {item.reward}</span>
+                                    <span className={"text-[#11de68]"}>+ {item.reward}</span>
                                 ) : (
                                     <span className={"text-[#eb0808]"}>LOST</span>
                                 )}
@@ -37,7 +37,7 @@ const BetRecord: FC<Props> = (props) => {
 
                         <div
                             className={
-                                "flex justify-between text-[0.10rem] text-[#b4c4f5]" +
+                                "flex justify-between text-[0.10rem] text-[#677787]" +
                                 " mt-[0.02rem]"
                             }
                         >

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

@@ -16,8 +16,8 @@ export default async function Layout({
 }) {
     const t = await getTranslations("ProfilePage");
     return (
-        <div className="h-[100%] overflow-auto bg-[url('/home/bg.jpg')]">
-            <HeaderBack showBack={true} title={t("gamblingBets")} useBg={true} />
+        <div className="h-[100%] overflow-auto">
+            <HeaderBack showBack={true} title={t("gamblingBets")} />
             <main className={"main-header"}>{children}</main>
         </div>
     );

+ 113 - 48
src/app/[locale]/(navbar)/betrecord/style.module.scss

@@ -1,68 +1,133 @@
 .betrecordPage {
-    height: 100%;
+    //     height: 100%;
 
+    //     :global(.adm-tabs) {
+    //         height: 100%;
+    //         display: flex;
+    //         flex-direction: column;
+    //     }
+    //     :global(.adm-tabs-content) {
+    //         flex: 1;
+    //         min-height: 0;
+    //         overflow: auto;
+    //         @extend .commonBorder;
+    //         box-shadow: $-input-shadow;
+    //         border-radius: 0.15rem;
+    //         margin: 0 0.1rem 0.1rem;
+    //     }
+    //     // :global(.adm-list-body-inner) {
+    //     //     // @extend .commonBorder;
+    //     //     // box-shadow: $-input-shadow;
+    //     //     // border-radius: 0.15rem;
+    //     //     // border-top-width: 1px;
+    //     // }
+    //     :global(.adm-list-item-content) {
+    //         border-top: none;
+    //     }
+    //     :global(.adm-list-item-content-main) {
+    //         border-top: 1px solid #1b1a5d;
+    //     }
+    //     :global(.adm-tabs-tab-list) {
+    //         margin: 0.12rem;
+    //         // border: 1px solid #e43bff;
+    //         // border-radius: 0.3rem;
+    //         // box-shadow: 0 0 15px #7735bd inset;
+    //         padding-bottom: 0.1rem;
+    //         position: relative;
+    //         &:after {
+    //             content: "";
+    //             position: absolute;
+    //             left: 0;
+    //             top: 0;
+    //             width: 100%;
+    //             bottom: 0;
+    //             border-bottom: 1px solid #fcd6ff;
+    //             border-radius: 0.3rem;
+    //             pointer-events: none;
+    //         }
+    //         &:before {
+    //             content: "";
+    //             position: absolute;
+    //             left: 0;
+    //             top: 1px;
+    //             width: 100%;
+    //             bottom: 1px;
+    //             border: 1px solid #e43bff;
+    //             border-radius: 0.3rem;
+    //             box-shadow: 0 0 25px #df3cfb inset;
+    //             padding-bottom: 0.1rem;
+    //             pointer-events: none;
+    //         }
+    //     }
+    //     :global(.adm-tabs-tab) {
+    //         padding-bottom: 0;
+    //     }
+    //     :global(.adm-tabs-tab-line) {
+    //         bottom: 0.08rem;
+    //     }
+    padding-top: 0.1rem;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    :global(.adm-tabs-tab-list) {
+        margin: 0 0.12rem 0.12rem;
+        background-color: #1f2830;
+        border-radius: 0.1rem;
+        height: 0.4rem;
+        position: relative;
+    }
     :global(.adm-tabs) {
         height: 100%;
         display: flex;
         flex-direction: column;
+        align-items: stretch;
     }
     :global(.adm-tabs-content) {
         flex: 1;
         min-height: 0;
         overflow: auto;
-        @extend .commonBorder;
-        box-shadow: $-input-shadow;
-        border-radius: 0.15rem;
-        margin: 0 0.1rem 0.1rem;
+        padding: 0;
     }
-    // :global(.adm-list-body-inner) {
-    //     // @extend .commonBorder;
-    //     // box-shadow: $-input-shadow;
-    //     // border-radius: 0.15rem;
-    //     // border-top-width: 1px;
+    // :global(.adm-tabs-tab-line) {
+    //     bottom: 0.08rem;
     // }
-    :global(.adm-list-item-content) {
-        border-top: none;
-    }
-    :global(.adm-list-item-content-main) {
-        border-top: 1px solid #1b1a5d;
+    :global(.adm-tabs-tab-line) {
+        top: 0;
+        bottom: 0;
+        background: #11de68;
+        height: 100%;
+        border-radius: 0.1rem;
     }
-    :global(.adm-tabs-tab-list) {
-        margin: 0.12rem;
-        // border: 1px solid #e43bff;
-        // border-radius: 0.3rem;
-        // box-shadow: 0 0 15px #7735bd inset;
-        padding-bottom: 0.1rem;
-        position: relative;
-        &:after {
-            content: "";
-            position: absolute;
-            left: 0;
-            top: 0;
-            width: 100%;
-            bottom: 0;
-            border-bottom: 1px solid #fcd6ff;
-            border-radius: 0.3rem;
-            pointer-events: none;
-        }
-        &:before {
-            content: "";
-            position: absolute;
-            left: 0;
-            top: 1px;
-            width: 100%;
-            bottom: 1px;
-            border: 1px solid #e43bff;
-            border-radius: 0.3rem;
-            box-shadow: 0 0 25px #df3cfb inset;
-            padding-bottom: 0.1rem;
-            pointer-events: none;
-        }
+    :global(.adm-tabs-tab-wrapper) {
+        flex: 1;
+        padding: 0;
+        height: 100%;
     }
     :global(.adm-tabs-tab) {
+        padding: 0;
+        margin: 0;
+        width: 100%;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        height: 100%;
+        color: #5d7284;
+        font-weight: 700;
         padding-bottom: 0;
+        font-size: 0.13rem;
     }
-    :global(.adm-tabs-tab-line) {
-        bottom: 0.08rem;
+    :global(.adm-tabs-tab-active) {
+        color: #122f23;
+    }
+    :global(.adm-tabs-header-mask) {
+        display: none;
+    }
+    :global(.adm-tabs-content) {
+        padding: 0 0.1rem 0.1rem;
+    }
+    :global(.adm-tabs) {
+        height: 100%;
+        display: flex;
+        flex-direction: column;
     }
 }

+ 4 - 3
src/app/[locale]/(navbar)/transactions/style.module.scss

@@ -22,9 +22,7 @@
         overflow: auto;
         padding: 0;
     }
-    :global(.adm-tabs-tab) {
-        padding-bottom: 0;
-    }
+
     // :global(.adm-tabs-tab-line) {
     //     bottom: 0.08rem;
     // }
@@ -40,6 +38,7 @@
         padding: 0;
         height: 100%;
     }
+
     :global(.adm-tabs-tab) {
         padding: 0;
         margin: 0;
@@ -50,6 +49,8 @@
         height: 100%;
         color: #5d7284;
         font-weight: 700;
+        padding-bottom: 0;
+        font-size: 0.13rem;
     }
     :global(.adm-tabs-tab-active) {
         color: #122f23;

+ 62 - 14
src/components/Layout/Sidebar.tsx

@@ -1,5 +1,9 @@
 "use client";
-import { GroupType } from "@/api/home";
+import {
+    // ContactType, getContactsApi,
+    getSidebarActivitiesApi,
+} from "@/api/config";
+import { BannerRep, GroupType } from "@/api/home";
 import Box from "@/components/Box";
 import dialogManage from "@/dialog/manager";
 import { Link, usePathname, useRouter } from "@/i18n/routing";
@@ -9,7 +13,7 @@ import { server } from "@/utils/client";
 import clsx from "clsx";
 import { useLocale } from "next-intl";
 import Image from "next/image";
-import React, { FC, PropsWithChildren, useEffect, useMemo, useRef } from "react";
+import React, { FC, PropsWithChildren, useEffect, useMemo, useRef, useState } from "react";
 import styles from "./style.module.scss";
 
 const getGames = async () => {
@@ -24,6 +28,19 @@ const getGames = async () => {
         });
 };
 
+const registePromoClick = (activity_id: number) => {
+    return server
+        .request({
+            url: "/v1/api/front/activity_promotion_click",
+            method: "post",
+            data: { activity_id },
+        })
+        .then((res) => {
+            if (res.code === 200) return res.data;
+            return [];
+        });
+};
+
 interface Props {}
 
 const tabs = [
@@ -106,7 +123,10 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
 
         return index;
     };
-
+    const registePromo = (id?: number) => {
+        if (!id) return;
+        registePromoClick(id);
+    };
     useEffect(() => {
         if (pathname === "/") {
             tabHandler(PageEnum.home, false);
@@ -117,16 +137,18 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
 
     // const [contacts, setContacts] = useState<ContactType[]>();
 
-    // const [cardData, setCardData] = useState<BannerRep[]>([]);
-    // useEffect(() => {
-    //     getContactsApi().then((res) => {
-    //         setContacts(res.data.filter((item) => item.show_bar === 1));
-    //     });
+    const [cardData, setCardData] = useState<BannerRep[]>([]);
+
+    useEffect(() => {
+        // getContactsApi().then((res) => {
+        //     setContacts(res.data.filter((item) => item.show_bar === 1));
+        // });
 
-    //     getSidebarActivitiesApi().then((res) => {
-    //         setCardData(res.data);
-    //     });
-    // }, []);
+        getSidebarActivitiesApi().then((res) => {
+            console.log(33, res.data);
+            setCardData(res.data);
+        });
+    }, []);
 
     const serviceUrl: string = useMemo(() => {
         if (!service) return "";
@@ -168,6 +190,7 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
                 handle: () => tabHandler(PageEnum.help),
             },
         ];
+        // eslint-disable-next-line react-hooks/exhaustive-deps
     }, [serviceUrl, locale]);
 
     const walletCfg = useMemo(() => {
@@ -199,6 +222,12 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
             pathname: `/gameList2?provider_id=${item.id}`,
         });
     };
+    const promotionHandle = (item: any) => {
+        setCollapse(false);
+        // router.push({
+        //     pathname: `/gameList2?provider_id=${item.id}`,
+        // });
+    };
 
     return (
         <Box pt={false} className={"h-[100%] bg-[#1e252b] px-[0px]"}>
@@ -264,7 +293,26 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
                     </div>
 
                     <div className={styles.promotionBox}>
-                        <div className={styles.promotionItem}>
+                        {cardData.map((item) => {
+                            return (
+                                <Box
+                                    key={item.id}
+                                    action={item.action_type}
+                                    actionData={item.action_params}
+                                    className={styles.promoItem}
+                                    onBeforeHandler={() => registePromo(item.id)}
+                                >
+                                    <div
+                                        key={item.id}
+                                        className={styles.promotionItem}
+                                        onClick={() => promotionHandle(item)}
+                                    >
+                                        <img src={item.content} alt="" />
+                                    </div>
+                                </Box>
+                            );
+                        })}
+                        {/* <div className={styles.promotionItem}>
                             <img src="/sidebar/promotion.png" alt="" />
                         </div>
                         <div className={styles.promotionItem}>
@@ -275,7 +323,7 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
                         </div>
                         <div className={styles.promotionItem}>
                             <img src="/sidebar/promotion.png" alt="" />
-                        </div>
+                        </div> */}
                     </div>
 
                     {listCfg.map((item) => {