Przeglądaj źródła

Merge branch 'dev' into feature-XianCH

XianCH 1 rok temu
rodzic
commit
5bf2249320

BIN
public/img/iconTab/afiliado.png


BIN
public/img/iconTab/hot.png


BIN
public/img/iconTab/rs.png


BIN
public/img/pixImg.png


+ 1 - 1
src/app/[locale]/(ordinary)/deposit/page.scss

@@ -10,7 +10,7 @@
       width: .8rem;
       height: .27rem;
       margin: .12rem 0;
-      background: url('/imgs/pixImg.png') no-repeat center;
+      background: url('/img/pixImg.png') no-repeat center;
       background-size: 100% 100%;
     }
     .btn-box {

+ 55 - 39
src/components/Footer/index.tsx

@@ -1,58 +1,74 @@
 "use client";
-import { useRouter } from "@/i18n";
-import { FC, PropsWithChildren, ReactNode } from "react";
+import { usePathname, useRouter} from "@/i18n";
+import { FC, PropsWithChildren, ReactNode, useEffect } from "react";
 import clsx from "clsx";
 import "./style.scss";
 
 /**
  * @description 底部Tab组件
- * @param footerPlaceholder 底部占位元素
- * @param footerRender 底部渲染元素
+ * @param children 插槽内容
  *
  */
 export interface FooterProps {
-    footerPlaceholder?: boolean;
-    footerRender?: () => ReactNode;
+    children?: () => ReactNode;
 }
 
-const Footer: FC<PropsWithChildren<FooterProps>> = (props) => {
+const Footer: FC<PropsWithChildren<FooterProps>> = () => {
+    const tabList = [
+        {
+            iconSpanName: 'icon-home',
+            label: 'Início',
+            path: '/'
+        },
+        {
+            iconSpanName: 'icon-qianbao1',
+            label: 'Depósito',
+            path: '/deposit'
+        },
+        {
+            iconSpanName: 'icon-afiliado',
+            label: 'Afiliado',
+            path: '/affiliate/summary'
+        },
+        {
+            iconSpanName: 'icon-tiyu',
+            label: 'Esportes',
+            path: '/'
+        },
+        {
+            iconSpanName: 'icon-yonghu',
+            label: 'Perfil',
+            path: '/profile'
+        },
+    ]
+
+    const pathname = usePathname()
+
     const router = useRouter();
+    const goPage = (path = '/') => {
+        router.push(path)
+    }
 
     return (
         <div className="footer-box">
             <ul>
-                <li>
-                    <div className="icon-box">
-                        <span className="iconfont icon-home"></span>
-                    </div>
-                    <label>Início</label>
-                </li>
-                <li className="active">
-                    <div className="icon-box">
-                        <span className="iconfont icon-qianbao1"></span>
-                    </div>
-                    <label>Depósito</label>
-                </li>
-                <li>
-                    <div className="icon-box">
-                        <i className="icon-afiliado"></i>
-                        <i className="icon-rs"></i>
-                    </div>
-                    <label>Afiliado</label>
-                </li>
-                <li>
-                    <div className="icon-box">
-                        <span className="iconfont icon-tiyu"></span>
-                        <i className="icon-hot"></i>
-                    </div>
-                    <label>Esportes</label>
-                </li>
-                <li>
-                    <div className="icon-box">
-                        <span className="iconfont icon-yonghu"></span>
-                    </div>
-                    <label>Perfil</label>
-                </li>
+                {
+                    tabList.map((item, index) => {
+                        return (
+                            <li className={clsx(item.path == pathname && 'active')} onClick={() => goPage(item.path)} key={index}>
+                                <div className="icon-box">
+                                    {
+                                        index == 2 ? (
+                                            <><i className="icon-afiliado"></i><i className="icon-rs"></i></>
+                                        ) : <span className={clsx('iconfont',item.iconSpanName)}></span>
+                                    }
+                                    { index == 3 && <b className="icon-hot"></b> }
+                                </div>
+                                <label>{item.label}</label>
+                            </li>
+                        )
+                    })
+                }
             </ul>
         </div>
     );

+ 4 - 3
src/components/Footer/style.scss

@@ -54,7 +54,7 @@
         .icon-afiliado {
           width: .55rem;
           height: .55rem;
-          background: url('/imgs/iconTab/afiliado.png') no-repeat;
+          background: url('/img/iconTab/afiliado.png') no-repeat;
           background-size: 100%;
           margin-bottom: .05rem;
         }
@@ -66,7 +66,7 @@
           font-size: .12rem;
           width: .25rem;
           height: .3rem;
-          background: url('/imgs/iconTab/rs.png') no-repeat;
+          background: url('/img/iconTab/rs.png') no-repeat;
           background-size: 100%;
         }
 
@@ -77,8 +77,9 @@
           font-size: .12rem;
           width: .25rem;
           height: .25rem;
-          background: url('/imgs/iconTab/hot.png') no-repeat;
+          background: url('/img/iconTab/hot.png') no-repeat;
           background-size: 100%;
+          font-weight: normal;
         }
       }