This commit is contained in:
2025-11-22 15:46:23 +08:00
parent b2b665dfb6
commit cba231ab3d
11 changed files with 197 additions and 127 deletions

View File

@@ -7,6 +7,7 @@ import { FollowService, FollowUser } from '@/services/followService';
import { withAuth } from '@/components';
import './index.scss';
import CommonDialog from '@/components/CommonDialog'
import { useUserActions } from "@/store/userStore";
// 标签页类型
type TabType = 'mutual_follow' | 'following' | 'follower' | 'recommend';
@@ -20,6 +21,7 @@ const TAB_CONFIG = [
];
const FollowPage: React.FC = () => {
const { fetchUserInfo } = useUserActions();
// 获取页面参数,支持指定默认标签页
const instance = Taro.getCurrentInstance();
const default_tab = (instance.router?.params?.tab as TabType) || 'mutual_follow';
@@ -145,6 +147,7 @@ const FollowPage: React.FC = () => {
if (is_following) {
await FollowService.follow_user(user_id);
updateFollowStatus(user_id, is_following);
fetchUserInfo()
// Taro.showToast({
// title: '关注成功',
// icon: 'success'
@@ -219,6 +222,7 @@ const FollowPage: React.FC = () => {
await FollowService.unfollow_user(deleteConfirm.userId!);
closeDeleteConfirm();
updateFollowStatus(deleteConfirm.userId!, false);
fetchUserInfo()
// Taro.showToast({
// title: '取消关注成功',
// icon: 'success'
@@ -235,7 +239,7 @@ const FollowPage: React.FC = () => {
return (
<View className="follow_page">
{/* 自定义导航栏 */}
<GeneralNavbar
<GeneralNavbar
title="粉丝"
titlePosition="left"
showBack={true}