This commit is contained in:
张成
2025-11-14 23:38:24 +08:00
parent 3c4897508a
commit 0cf5acde1e
4 changed files with 7 additions and 50 deletions

View File

@@ -1,10 +0,0 @@
.customerNavbar {
position: fixed;
top: 0;
left: 0;
overflow: hidden;
z-index: 99;
width: 100%;
// 背景颜色通过 style 动态设置,默认 #FAFAFA
box-shadow: none;
}

View File

@@ -1,27 +0,0 @@
import { View } from "@tarojs/components";
import styles from "./index.module.scss";
import { useGlobalState } from "@/store/global";
interface IProps {
children: any;
backgroundColor?: string; // 背景颜色,不设置则透明
}
const CustomNavbar = (props: IProps) => {
const { children, backgroundColor } = props;
const { statusNavbarHeightInfo } = useGlobalState();
const { statusBarHeight, navBarHeight } = statusNavbarHeightInfo;
return (
<View
className={styles.customerNavbar}
style={{
height: `${statusBarHeight + navBarHeight}px`,
backgroundColor: backgroundColor || 'transparent'
}}
>
{children}
</View>
);
};
export default CustomNavbar;