Browse Source

perf: 底部nav栏选中状态字体调整,首页顶部新增 logo

qq12rrr 3 months ago
parent
commit
17d5fb5d5d

BIN
src/assets/home_logo_hrqb.png


+ 5 - 0
src/component/label/index.scss

@@ -6,6 +6,11 @@
     color: $primary-color;
   }
 
+  &.c-text-active {
+    color: $primary-color;
+  }
+
+
   &.c-text-danger {
     color: $danger-color;
   }

+ 28 - 19
src/component/label/index.tsx

@@ -1,26 +1,35 @@
-import './index.scss'
-import { Text as TaroText } from '@tarojs/components';
-import classNames from 'classnames';
-import { TextProps } from '@tarojs/components/types/Text';
+import "./index.scss";
+import { Text as TaroText } from "@tarojs/components";
+import classNames from "classnames";
+import { TextProps } from "@tarojs/components/types/Text";
 
-export type ILabelType = "primary" | "secondary" | "default" | "danger" | "white" | "success";
+export type ILabelType =
+  | "primary"
+  | "secondary"
+  | "default"
+  | "danger"
+  | "white"
+  | "success"
+  | "active";
 
 interface ILabelProps extends TextProps {
-    type?: ILabelType,
-    size?: "default" | "sm" | "lg";
-    bold?: boolean
+  type?: ILabelType;
+  size?: "default" | "sm" | "lg";
+  bold?: boolean;
 }
 
 const Label: React.FC<ILabelProps> = (props) => {
-    const { type = "default", size = "default", bold, ...textProps } = props;
-    const _classNames = classNames("c-text", {
-        ["c-text-" + type]: type !== "default",
-        ["c-text-" + size]: size !== "default",
-        ["c-text-bold"]: bold,
-    });
-    return (
-        <TaroText {...textProps} className={`${_classNames} ${props.className}`} >{props.children}</TaroText>
-    )
-}
+  const { type = "default", size = "default", bold, ...textProps } = props;
+  const _classNames = classNames("c-text", {
+    ["c-text-" + type]: type !== "default",
+    ["c-text-" + size]: size !== "default",
+    ["c-text-bold"]: bold,
+  });
+  return (
+    <TaroText {...textProps} className={`${_classNames} ${props.className}`}>
+      {props.children}
+    </TaroText>
+  );
+};
 
-export default Label;
+export default Label;

+ 1 - 1
src/component/layout/index.tsx

@@ -76,7 +76,7 @@ const BottomNavBar = () => {
               <Label
                 size="sm"
                 type={
-                  _index === bottomBarContext?.index ? "default" : "secondary"
+                  _index === bottomBarContext?.index ? "active" : "secondary"
                 }
               >
                 {p.name}

+ 3 - 3
src/pages/home/index.scss

@@ -15,9 +15,9 @@
   }
 
   .index-logo {
-    width: 332px;
-    height: 60px;
-    margin: 48px 32px 0;
+    width: 200rpx;
+    height: 48rpx;
+    margin: 30rpx 0 0 32rpx;
   }
 
   .index-panel {

+ 6 - 5
src/pages/home/index.tsx

@@ -166,11 +166,12 @@ const Home = () => {
     <Layout safe className="index" bottomBarIndex={0}>
       <ScrollView className="index-container">
         <SizeBox height={statusBarHeight} />
-        <SizeBox height={60} />
-        {/* <Image
-          className='index-logo'
-          src={require("../../assets/new-edition/index-logo.png")}
-        /> */}
+        <Image
+          className="index-logo"
+          src={require("../../assets/home_logo_hrqb.png")}
+        />
+        <SizeBox height={20} />
+
         <Padding padding={EdgeInsets.symmetric({ horizontal: 32 })}>
           <View
             style={{