Explorar el Código

Merge branch 'feature-year0506' of bcwin/site_front into v1.4

year hace 2 meses
padre
commit
5fab959465

+ 2 - 1
package.json

@@ -19,7 +19,8 @@
     "build:br": "node scripts/swEnv.js .env.br .env.local  && next build",
     "start": "next start",
     "lint": "next lint",
-    "build": "next build"
+    "build": "next build",
+    "statics":"python statics.py"
   },
   "dependencies": {
     "@lucky-canvas/react": "^0.1.13",

+ 3 - 3
src/components/HeaderBack/index.tsx

@@ -6,7 +6,7 @@ import { useTranslations } from "next-intl";
 import { FC, PropsWithChildren, ReactNode, useEffect, useState } from "react";
 import styles from "./style.module.scss";
 
-import { getToken } from "@/utils/Cookies";
+// import { getToken } from "@/utils/Cookies";
 import clearCache from "./actions";
 
 /**
@@ -84,13 +84,13 @@ const HeaderBack: FC<PropsWithChildren<HeaderBackProps>> = ({
                 {(title || selfTitle) && <span>{title || selfTitle}</span>}
             </div>
             <div className={styles.content}>{children}</div>
-            {getToken() && (
+            {/* {getToken() && (
                 <div>
                     {!wallet.is_open_no_bonus && (
                         <img src="/img/no_bouns.png" alt="" className="h-[20px]" />
                     )}
                 </div>
-            )}
+            )} */}
 
             {!Right && (
                 <span className={styles.right} onClick={() => goPage("home")}>

+ 3 - 3
src/components/ModalPopup/WalletDescribeModal/index.tsx

@@ -1,6 +1,6 @@
 import { Wallet, cleanBounsApi, toggleUserBounsApi } from "@/api/user";
 import { percentage } from "@/utils/methods";
-import { Dialog, ProgressBar, Switch, Toast } from "antd-mobile";
+import { Dialog, ProgressBar, Toast } from "antd-mobile";
 import { useTranslations } from "next-intl";
 import React from "react";
 import "./style.scss";
@@ -134,7 +134,7 @@ export const BonusContent = (props: { wallet: Wallet; handleAcquire?: any }) =>
                 <li className="mt-[.06rem]">{t("bonusDesc2")}</li>
                 <li className="mt-[.06rem]">{t("bonusDesc3")}</li>
             </ul>
-            <div className="mt-[.15rem] rounded-[8px] border-[1px] border-[#e540ff] bg-[#2f4cc8] shadow-[0_-10px_25px_#e641ff_inset]">
+            {/* <div className="mt-[.15rem] rounded-[8px] border-[1px] border-[#e540ff] bg-[#2f4cc8] shadow-[0_-10px_25px_#e641ff_inset]">
                 <div className="flex flex-row items-center justify-between border-b-[1px] border-[#e540ff] p-[8px]">
                     <span className="text-[#fff]">{t("bounsTitle1")}</span>
                     <Switch
@@ -165,7 +165,7 @@ export const BonusContent = (props: { wallet: Wallet; handleAcquire?: any }) =>
                         {t("boundsBtn")}
                     </a>
                 </div>
-            </div>
+            </div> */}
             {handleAcquire && (
                 <a
                     className={`carteira-box ${wallet.is_point_transfer ? "active" : ""}`}

+ 27 - 7
statics.py

@@ -5,6 +5,19 @@ import os
 import sys
 from collections import defaultdict
 
+def get_current_branch():
+    try:
+        result = subprocess.run(
+            ["git", "branch", "--show-current"],
+            capture_output=True,
+            text=True,
+            check=True
+        )
+        return result.stdout.strip()
+    except subprocess.CalledProcessError:
+        return None  # 非Git仓库或命令失败
+
+
 def get_git_root(path="."):
     """获取当前目录所在的Git仓库根目录"""
     try:
@@ -49,14 +62,17 @@ def count_changes_in_commit(repo_path, commit_hash):
         
         insertions = 0
         deletions = 0
+        totals=0
         for line in result.stdout.strip().split('\n'):
             parts = line.split('\t')
+            
             if len(parts) == 3:
-                ins, dels, _ = parts
+                ins, dels, total = parts
                 insertions += int(ins) if ins != '-' else 0
                 deletions += int(dels) if dels != '-' else 0
+                totals += 1
         
-        return insertions, deletions
+        return insertions, deletions,totals
     except subprocess.CalledProcessError:
         return 0, 0
 
@@ -93,6 +109,7 @@ def main():
     # 获取Git仓库根目录
     repo_path = get_git_root()
     repo_name = os.path.basename(repo_path)
+    branch_name = get_current_branch()
     
     # 获取今日提交
     commits = get_today_commits(repo_path)
@@ -103,13 +120,15 @@ def main():
     # 统计总变动
     total_insertions = 0
     total_deletions = 0
+    total_files = 0
     filetype_stats = defaultdict(lambda: {"insertions": 0, "deletions": 0})
     
     for commit in commits:
         # 统计总变动
-        ins, dels = count_changes_in_commit(repo_path, commit)
+        ins, dels, totals= count_changes_in_commit(repo_path, commit)
         total_insertions += ins
         total_deletions += dels
+        total_files += totals
         
         # 按文件类型统计
         commit_filetype_stats = count_changes_by_filetype(repo_path, commit)
@@ -118,12 +137,13 @@ def main():
             filetype_stats[ext]["deletions"] += stats["deletions"]
     
     # 打印结果
-    print(f"Git仓库代码变动统计 - {repo_name}")
+    print(f"Git仓库代码变动统计-{repo_name}-{branch_name}")
     print(f"日期: {datetime.date.today()}")
     print(f"提交数: {len(commits)}")
-    print(f"总插入行数: {total_insertions}")
-    print(f"总删除行数: {total_deletions}")
-    print(f"净变动行数: {total_insertions - total_deletions}")
+    print(f"总行数: {total_insertions}")
+    print(f"总文件数: {total_files}")
+    # print(f"总删除行数: {total_deletions}")
+    # print(f"净变动行数: {total_insertions - total_deletions}")
     print("\n按文件类型统计:")
     print("{:<10} {:>12} {:>12} {:>12}".format("类型", "插入", "删除", "净变动"))
     print("-" * 48)