取消关注添加确认弹窗、个人页添加往期球局

This commit is contained in:
2025-09-22 21:33:43 +08:00
parent c4d387473c
commit 186d5b8a3a
8 changed files with 206 additions and 58 deletions

View File

@@ -4,12 +4,17 @@ import Taro from '@tarojs/taro';
import { FollowUser } from '@/services/followService';
import './index.scss';
// 标签页类型
type TabType = 'mutual_follow' | 'following' | 'follower' | 'recommend';
interface FollowUserCardProps {
user: FollowUser;
tabKey: TabType;
onFollowChange?: (userId: number, isFollowing: boolean) => void;
}
const FollowUserCard: React.FC<FollowUserCardProps> = ({ user, onFollowChange }) => {
const FollowUserCard: React.FC<FollowUserCardProps> = ({ user, tabKey, onFollowChange }) => {
const [isProcessing, setIsProcessing] = useState(false);
// 防御性检查
@@ -23,7 +28,7 @@ const FollowUserCard: React.FC<FollowUserCardProps> = ({ user, onFollowChange })
try {
setIsProcessing(true);
// 根据当前状态决定操作
let new_status = false;
if (user.follow_status === 'follower' || user.follow_status === 'recommend') {
@@ -53,7 +58,7 @@ const FollowUserCard: React.FC<FollowUserCardProps> = ({ user, onFollowChange })
try {
setIsProcessing(true);
// TODO: 加入黑名单逻辑
Taro.showToast({
Taro.showToast({
title: '不会再为您推荐该用户',
icon: 'none'
});
@@ -107,8 +112,8 @@ const FollowUserCard: React.FC<FollowUserCardProps> = ({ user, onFollowChange })
return (
<View className="follow_user_card">
<View className="user_info" onClick={handle_user_click}>
<Image
className="avatar"
<Image
className="avatar"
src={user.avatar_url || require('@/static/userInfo/default_avatar.svg')}
/>
<View className="user_details">
@@ -118,8 +123,8 @@ const FollowUserCard: React.FC<FollowUserCardProps> = ({ user, onFollowChange })
</Text>
</View>
</View>
<View
<View
className={`action_button ${button_config.className} ${isProcessing ? 'processing' : ''}`}
onClick={handle_follow_action}
>
@@ -128,7 +133,7 @@ const FollowUserCard: React.FC<FollowUserCardProps> = ({ user, onFollowChange })
</Text>
</View>
{
user.follow_status === 'recommend' && (
tabKey === 'recommend' && (
<View className='delete_button' onClick={add_to_blacklist}></View>
)
}