소스 검색

邮件红点加数字提示

zhejiushizhuce 2 년 전
부모
커밋
b5124cc24e
2개의 변경된 파일과 22개의 추가작업 그리고 5개의 파일을 삭제
  1. 9 1
      src/layout/BottomNav/index.jsx
  2. 13 4
      src/layout/BottomNav/styles.module.scss

+ 9 - 1
src/layout/BottomNav/index.jsx

@@ -124,7 +124,15 @@ const BottomNav = () => {
             </NavLink>
             <NavLink className={styles.button} to={ROUTE_PATH.MESSAGE}>
                 {
-                    mailNew > 0 ? (<div className={styles["dont-badge"]}></div>) : (<></>)
+                    mailNew > 0 ? (
+                        <div className={styles["dont-badge"]}>
+                            <p>
+                                {
+                                    mailNew>=100?"...":mailNew
+                                }
+                            </p>
+                        </div>
+                    ) : (<></>)
                 }
                 {/*<svg className={"icon"}>*/}
                 {/*    <use xlinkHref={`${symbol_m}#icon_Account`} />*/}

+ 13 - 4
src/layout/BottomNav/styles.module.scss

@@ -148,11 +148,20 @@
     }
 }
 .dont-badge{
+    font-weight: 600;
+    display: flex;
+    align-items: center;
+    justify-content: center;
     position: absolute;
-    width: 0.75rem;
-    height: 0.75rem;
+    width: 0.85rem;
+    height: 0.85rem;
     border-radius: 50%;
-    right: 0.5rem;
-    top: 0.5rem;
+    right: 0.8rem;
+    top: 0.3rem;
     background-color: var(--primary-color);
+    color: #fff;
+    p{
+        font-size: calc(100% - 0.2rem);
+        font-weight: 700;
+    }
 }