This commit is contained in:
张成
2025-09-17 22:55:20 +08:00
parent 46fc702dfd
commit 721d0c10e4
11 changed files with 1078 additions and 3 deletions

View File

@@ -115,6 +115,31 @@ export const UserInfoCard: React.FC<UserInfoCardProps> = ({
setEditingField("");
};
// 处理统计项点击
const handle_stats_click = (type: 'following' | 'friends' | 'hosted' | 'participated') => {
// 只有当前用户才能查看关注相关页面
if (!is_current_user) {
Taro.showToast({
title: '暂不支持查看他人关注信息',
icon: 'none'
});
return;
}
if (type === 'following') {
// 跳转到关注列表页面
Taro.navigateTo({
url: '/user_pages/follow/index?tab=following'
});
} else if (type === 'friends') {
// 跳转到球友(粉丝)页面,显示粉丝标签
Taro.navigateTo({
url: '/user_pages/follow/index?tab=follower'
});
}
// 主办和参加暂时不处理,可以后续扩展
};
return (
<View className="user_info_card">
{/* 头像和基本信息 */}
@@ -139,11 +164,11 @@ export const UserInfoCard: React.FC<UserInfoCardProps> = ({
{/* 统计数据 */}
<View className="stats_section">
<View className="stats_container">
<View className="stat_item">
<View className="stat_item clickable" onClick={() => handle_stats_click('following')}>
<Text className="stat_number">{user_info.stats.following}</Text>
<Text className="stat_label"></Text>
</View>
<View className="stat_item">
<View className="stat_item clickable" onClick={() => handle_stats_click('friends')}>
<Text className="stat_number">{user_info.stats.friends}</Text>
<Text className="stat_label"></Text>
</View>