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;

View File

@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { View, Text, ScrollView } from '@tarojs/components';
import Taro from '@tarojs/taro';
import CustomNavbar from '@/components/CustomNavbar';
import { GeneralNavbar } from '@/components';
import FollowUserCard from '@/components/FollowUserCard';
import { FollowService, FollowUser } from '@/services/followService';
import { withAuth } from '@/components';
@@ -235,17 +235,12 @@ const FollowPage: React.FC = () => {
return (
<View className="follow_page">
{/* 自定义导航栏 */}
<CustomNavbar backgroundColor="#FAFAFA">
<View className="navbar_content">
<View className="navbar_back" onClick={() => Taro.navigateBack()}>
<View className="back_icon" />
</View>
<Text className="navbar_title"></Text>
<View className="navbar_action">
<View className="action_icon" />
</View>
</View>
</CustomNavbar>
<GeneralNavbar
title="粉丝"
titlePosition="left"
backgroundColor="#FAFAFA"
showBack={true}
/>
{/* 标签页导航 */}
<View className="tab_navigation">

View File

@@ -14,7 +14,6 @@ import {
} from "@/components/UserInfo";
import { UserService, UserInfoType } from "@/services/userService";
import * as LoginService from "@/services/loginService";
import CustomNavbar from "@/components/CustomNavbar";
import { useGlobalState } from "@/store/global";
import { GeneralNavbar } from "@/components";