You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

967 lines
32 KiB

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=375, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>青核 Youthome - 关注 / 粉丝</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="../colors_and_type.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
:root {
/* Traework 设计令牌 - 圆角/间距/阴影/高度 */
--radius-xs: 4px;
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-xl: 20px;
--radius-full: 9999px;
--height-btn: 44px;
--height-input: 44px;
--height-nav: 64px;
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
--shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.06);
--shadow-btn: 0 2px 8px rgba(38, 194, 187, 0.25);
--shadow-btn-hover: 0 4px 16px rgba(38, 194, 187, 0.35);
--shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.12);
--shadow-float: 0 4px 24px rgba(0, 0, 0, 0.08);
--shadow-inset: inset 0 1px 3px rgba(0, 0, 0, 0.03);
--glass-bg: rgba(255, 255, 255, 0.72);
--glass-blur: blur(20px);
--glass-border: rgba(255, 255, 255, 0.3);
}
html, body {
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', Roboto, sans-serif;
background: var(--youth-bg-page);
color: var(--youth-text-primary);
min-height: 100vh;
overflow: hidden;
overflow-x: hidden;}
.app-container {
width: 375px;
height: 812px;
margin: 0 auto;
background: var(--youth-bg-page);
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* ===== 状态栏 ===== */
.status-bar {
height: 44px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
font-size: 15px;
font-weight: 600;
color: var(--youth-text-primary);
position: relative;
z-index: 10;
flex-shrink: 0;
background: var(--youth-bg-page);
}
.status-bar .right-icons {
display: flex;
align-items: center;
gap: 5px;
}
.status-bar svg {
width: 15px;
height: 15px;
}
/* ===== 顶部导航栏 ===== */
.top-nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 4px 16px 12px;
background: var(--youth-bg-page);
flex-shrink: 0;
position: relative;
z-index: 10;
}
.nav-btn {
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
color: var(--youth-text-primary);
border-radius: 8px;
}
.nav-btn:active {
transform: scale(0.92);
background: var(--youth-bg-hover);
}
.nav-btn svg {
width: 22px;
height: 22px;
stroke-width: 2px;
}
.nav-title {
font-size: 17px;
font-weight: 600;
color: var(--youth-text-primary);
line-height: 1;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
/* ===== 分段Tab ===== */
.segmented-tabs {
display: flex;
align-items: center;
justify-content: center;
padding: 0 16px 12px;
background: var(--youth-bg-page);
flex-shrink: 0;
gap: 32px;
position: relative;
z-index: 10;
}
.tab-item {
position: relative;
padding: 6px 4px 10px;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: baseline;
gap: 4px;
}
.tab-item .tab-text {
font-size: 15px;
font-weight: 500;
color: var(--youth-text-tertiary);
transition: all 0.2s ease;
}
.tab-item .tab-count {
font-size: 13px;
font-weight: 500;
color: var(--youth-text-tertiary);
transition: all 0.2s ease;
}
.tab-item.active .tab-text {
color: var(--youth-primary);
font-weight: 600;
font-size: 16px;
}
.tab-item.active .tab-count {
color: var(--youth-primary);
font-weight: 600;
}
.tab-item::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%) scaleX(0);
width: 20px;
height: 3px;
background: var(--youth-primary);
border-radius: 16px;
transition: all 0.25s ease;
}
.tab-item.active::after {
transform: translateX(-50%) scaleX(1);
}
/* ===== 搜索框 ===== */
.search-section {
padding: 0 16px 12px;
flex-shrink: 0;
background: var(--youth-bg-page);
position: relative;
z-index: 10;
}
.search-box {
display: flex;
align-items: center;
height: 36px;
background: var(--youth-bg-input);
border-radius: 8px;
padding: 0 12px;
gap: 8px;
transition: all 0.2s ease;
}
.search-box:focus-within {
background: var(--youth-bg-hover);
}
.search-box svg {
width: 16px;
height: 16px;
stroke-width: 2px;
color: var(--youth-text-tertiary);
flex-shrink: 0;
}
.search-box input {
flex: 1;
border: none;
outline: none;
background: transparent;
font-size: 14px;
color: var(--youth-text-primary);
height: 100%;
}
.search-box input::placeholder {
color: var(--youth-text-placeholder);
}
/* ===== 用户列表 ===== */
.user-list-container {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 0 16px 80px;
}
.user-list {
background: var(--youth-bg-card);
border-radius: 12px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.user-item {
display: flex;
align-items: center;
padding: 12px 14px;
gap: 12px;
cursor: pointer;
transition: background-color 0.15s ease;
position: relative;
}
.user-item:active {
background: var(--youth-bg-hover);
}
.user-item:not(:last-child)::after {
content: '';
position: absolute;
bottom: 0;
left: 66px;
right: 14px;
height: 1px;
background: var(--youth-border-light);
}
.user-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
font-weight: 600;
color: #fff;
position: relative;
overflow: hidden;
}
.user-avatar.gradient-1 { background: linear-gradient(135deg, #FF9F9F 0%, #FF6B9D 100%); }
.user-avatar.gradient-2 { background: linear-gradient(135deg, #93C5FD 0%, #60A5FA 100%); }
.user-avatar.gradient-3 { background: linear-gradient(135deg, #86EFAC 0%, #4ADE80 100%); }
.user-avatar.gradient-4 { background: linear-gradient(135deg, #FCD34D 0%, #FBBF24 100%); }
.user-avatar.gradient-5 { background: linear-gradient(135deg, #C4B5FD 0%, #A78BFA 100%); }
.user-avatar.gradient-6 { background: linear-gradient(135deg, #FDBA74 0%, #FB923C 100%); }
.user-info {
flex: 1;
min-width: 0;
}
.user-name {
font-size: 15px;
font-weight: 600;
color: var(--youth-text-primary);
line-height: 1.3;
margin-bottom: 3px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-meta {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--youth-text-tertiary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.verified-badge {
display: inline-flex;
align-items: center;
gap: 2px;
padding: 1px 6px;
border-radius: 10px;
background: var(--youth-primary-bg);
color: var(--youth-primary);
font-size: 10px;
font-weight: 500;
flex-shrink: 0;
}
.verified-badge svg {
width: 10px;
height: 10px;
}
/* ===== 关注按钮 ===== */
.follow-btn {
flex-shrink: 0;
height: 28px;
padding: 0 14px;
border-radius: 8px;
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
border: none;
display: flex;
align-items: center;
justify-content: center;
white-space: nowrap;
}
.follow-btn:active {
transform: scale(0.95);
}
.follow-btn.following {
background: var(--youth-bg-input);
color: var(--youth-text-secondary);
}
.follow-btn.follow {
background: var(--youth-primary);
color: #fff;
}
.follow-btn.mutual {
background: var(--youth-bg-input);
color: var(--youth-primary);
font-weight: 500;
}
.follow-btn.follow-back {
background: var(--youth-primary);
color: #fff;
}
/* ===== 底部Tab导航 ===== */
.bottom-nav {
height: 64px;
flex-shrink: 0;
background: var(--youth-bg-glass);
backdrop-filter: blur(20px) saturate(180%);
-webkit-backdrop-filter: blur(20px) saturate(180%);
border-top: 1px solid var(--youth-border-light);
display: flex;
align-items: flex-start;
justify-content: space-around;
padding: 8px 0 0;
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 20;
}
.bottom-tab {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding: 3px 10px;
cursor: pointer;
transition: all 0.2s ease;
color: var(--youth-text-tertiary);
user-select: none;
}
.bottom-tab:active {
transform: scale(0.92);
}
.bottom-tab.active {
color: var(--youth-primary);
}
.bottom-tab svg {
width: 22px;
height: 22px;
stroke-width: 2px;
}
.bottom-tab .tab-label {
font-size: 10px;
font-weight: 500;
}
.bottom-tab.active .tab-label {
font-weight: 600;
}
.list-content.active {
display: block;
animation: fadeSlideIn 0.25s ease;
}
@keyframes fadeSlideIn {
from {
opacity: 0;
transform: translateY(4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ===== 空状态提示 ===== */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60px 20px;
color: var(--youth-text-tertiary);
}
.empty-state svg {
width: 48px;
height: 48px;
margin-bottom: 12px;
opacity: 0.4;
}
.empty-state p {
font-size: 14px;
}
/* SVG 图标统一尺寸 */
.icon-svg {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1em;
height: 1em;
vertical-align: middle;
line-height: 1;
}
.icon-svg svg {
width: 100%;
height: 100%;
stroke: currentColor;
}
/* 侧栏图标 */
.sidebar-icon .icon-svg { width: 22px; height: 22px; font-size: 22px; }
/* 社团logo图标 */
.club-logo .icon-svg { width: 28px; height: 28px; font-size: 28px; color: #fff; }
/* 头图大图标 */
.hero-icon .icon-svg { width: 56px; height: 56px; font-size: 56px; opacity: 0.3; }
/* meta 小图标 */
.club-meta .icon-svg { width: 12px; height: 12px; font-size: 12px; }
/* 分类选择网格图标 */
.cat-option .icon-svg { width: 26px; height: 26px; font-size: 26px; }
/* logo预览图标 */
.logo-preview .icon-svg { width: 40px; height: 40px; font-size: 40px; color: #fff; }
/* 提示图标 */
.notice-icon .icon-svg { width: 18px; height: 18px; font-size: 18px; }
/* Hide scrollbar */
::-webkit-scrollbar { display: none; width: 0; height: 0; }
* { -ms-overflow-style: none; scrollbar-width: none; }
</style>
</head>
<body>
<div class="app-container">
<!-- ===== 状态栏 ===== -->
<div class="status-bar">
<span>9:41</span>
<div class="right-icons">
<!-- 信号 -->
<svg viewBox="0 0 24 24" fill="currentColor" stroke="none">
<rect x="2" y="14" width="3" height="8" rx="1"></rect>
<rect x="7" y="10" width="3" height="12" rx="1"></rect>
<rect x="12" y="6" width="3" height="16" rx="1"></rect>
<rect x="17" y="2" width="3" height="20" rx="1"></rect>
</svg>
<!-- WiFi -->
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12.55a11 11 0 0 1 14.08 0"></path>
<path d="M1.42 9a16 16 0 0 1 21.16 0"></path>
<path d="M8.53 16.11a6 6 0 0 1 6.95 0"></path>
<line x1="12" y1="20" x2="12.01" y2="20"></line>
</svg>
<!-- 电池 -->
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="7" width="18" height="10" rx="2"></rect>
<line x1="22" y1="11" x2="22" y2="13"></line>
<rect x="4" y="9" width="12" height="6" rx="1" fill="currentColor"></rect>
</svg>
</div>
</div>
<!-- ===== 顶部导航栏 ===== -->
<div class="top-nav">
<button class="nav-btn" data-dom-id="btn-back" onclick="goBack()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<polyline points="15 18 9 12 15 6"></polyline>
</svg>
</button>
<span class="nav-title">关注 / 粉丝</span>
</div>
<!-- ===== 分段Tab ===== -->
<div class="segmented-tabs">
<div class="tab-item active" data-dom-id="tab-following" onclick="switchTab('following')">
<span class="tab-text">关注</span>
<span class="tab-count">36</span>
</div>
<div class="tab-item" data-dom-id="tab-followers" onclick="switchTab('followers')">
<span class="tab-text">粉丝</span>
<span class="tab-count">128</span>
</div>
</div>
<!-- ===== 搜索框 ===== -->
<div class="search-section">
<div class="search-box">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input type="text" data-dom-id="search-input" id="search-input" placeholder="搜索" oninput="filterUsers()">
</div>
</div>
<!-- ===== 用户列表 ===== -->
<div class="user-list-container" id="user-list-container">
<!-- 关注列表 -->
<div class="list-content active" id="following-list">
<div class="user-list">
<div class="user-item" data-dom-id="user-item-1" data-name="林小雨" data-school="清华大学" onclick="goToProfile()">
<div class="user-avatar gradient-1">林</div>
<div class="user-info">
<div class="user-name">林小雨</div>
<div class="user-meta">
<span>清华大学</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn following" data-dom-id="btn-follow-1" onclick="event.stopPropagation(); toggleFollow(this, 'following')">已关注</button>
</div>
<div class="user-item" data-dom-id="user-item-2" data-name="陈明轩" data-school="北京大学" onclick="goToProfile()">
<div class="user-avatar gradient-2">陈</div>
<div class="user-info">
<div class="user-name">陈明轩</div>
<div class="user-meta">
<span>北京大学</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn following" data-dom-id="btn-follow-2" onclick="event.stopPropagation(); toggleFollow(this, 'following')">已关注</button>
</div>
<div class="user-item" data-dom-id="user-item-3" data-name="王思琪" data-school="复旦大学" onclick="goToProfile()">
<div class="user-avatar gradient-3">王</div>
<div class="user-info">
<div class="user-name">王思琪</div>
<div class="user-meta">
<span>复旦大学</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn following" data-dom-id="btn-follow-3" onclick="event.stopPropagation(); toggleFollow(this, 'following')">已关注</button>
</div>
<div class="user-item" data-dom-id="user-item-4" data-name="李雷" data-school="浙江大学" onclick="goToProfile()">
<div class="user-avatar gradient-4">李</div>
<div class="user-info">
<div class="user-name">李雷</div>
<div class="user-meta">
<span>浙江大学</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn following" data-dom-id="btn-follow-4" onclick="event.stopPropagation(); toggleFollow(this, 'following')">已关注</button>
</div>
<div class="user-item" data-dom-id="user-item-5" data-name="张小红" data-school="上海交大" onclick="goToProfile()">
<div class="user-avatar gradient-5">张</div>
<div class="user-info">
<div class="user-name">张小红</div>
<div class="user-meta">
<span>上海交大</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn mutual" data-dom-id="btn-follow-5" onclick="event.stopPropagation(); toggleFollow(this, 'following')">互相关注</button>
</div>
<div class="user-item" data-dom-id="user-item-6" data-name="刘阳" data-school="武汉大学" onclick="goToProfile()">
<div class="user-avatar gradient-6">刘</div>
<div class="user-info">
<div class="user-name">刘阳</div>
<div class="user-meta">
<span>武汉大学</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn following" data-dom-id="btn-follow-6" onclick="event.stopPropagation(); toggleFollow(this, 'following')">已关注</button>
</div>
</div>
</div>
<!-- 粉丝列表 -->
<div class="list-content" id="followers-list">
<div class="user-list">
<div class="user-item" data-name="赵晓晨" data-school="南京大学" onclick="goToProfile()">
<div class="user-avatar gradient-1">赵</div>
<div class="user-info">
<div class="user-name">赵晓晨</div>
<div class="user-meta">
<span>南京大学</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn follow-back" onclick="event.stopPropagation(); toggleFollow(this, 'followers')">回关</button>
</div>
<div class="user-item" data-name="孙浩然" data-school="中山大学" onclick="goToProfile()">
<div class="user-avatar gradient-2">孙</div>
<div class="user-info">
<div class="user-name">孙浩然</div>
<div class="user-meta">
<span>中山大学</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn mutual" onclick="event.stopPropagation(); toggleFollow(this, 'followers')">已互关</button>
</div>
<div class="user-item" data-name="周雅婷" data-school="四川大学" onclick="goToProfile()">
<div class="user-avatar gradient-3">周</div>
<div class="user-info">
<div class="user-name">周雅婷</div>
<div class="user-meta">
<span>四川大学</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn follow-back" onclick="event.stopPropagation(); toggleFollow(this, 'followers')">回关</button>
</div>
<div class="user-item" data-name="吴俊杰" data-school="华中科大" onclick="goToProfile()">
<div class="user-avatar gradient-4">吴</div>
<div class="user-info">
<div class="user-name">吴俊杰</div>
<div class="user-meta">
<span>华中科大</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn follow-back" onclick="event.stopPropagation(); toggleFollow(this, 'followers')">回关</button>
</div>
<div class="user-item" data-name="郑梦瑶" data-school="西安交大" onclick="goToProfile()">
<div class="user-avatar gradient-5">郑</div>
<div class="user-info">
<div class="user-name">郑梦瑶</div>
<div class="user-meta">
<span>西安交大</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn mutual" onclick="event.stopPropagation(); toggleFollow(this, 'followers')">已互关</button>
</div>
<div class="user-item" data-name="黄宇航" data-school="哈尔滨工大" onclick="goToProfile()">
<div class="user-avatar gradient-6">黄</div>
<div class="user-info">
<div class="user-name">黄宇航</div>
<div class="user-meta">
<span>哈尔滨工大</span>
<span class="verified-badge">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
已认证
</span>
</div>
</div>
<button class="follow-btn follow-back" onclick="event.stopPropagation(); toggleFollow(this, 'followers')">回关</button>
</div>
</div>
</div>
<!-- 搜索空状态 -->
<div class="empty-state" id="search-empty" style="display: none;">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<p>没有找到相关用户</p>
</div>
</div>
<!-- ===== 底部Tab导航 ===== -->
<!-- ===== 主题切换按钮 ===== -->
</div>
<script>// ===== 主题切换 =====
// 初始化主题
})();
// ===== 返回按钮 =====
function goBack() {
window.location.href = 'profile-home.html';
}
// ===== 搜索框聚焦 =====
function focusSearch() {
const input = document.getElementById('search-input');
input.focus();
}
// ===== Tab切换 =====
let currentTab = 'following';
function switchTab(tabName) {
currentTab = tabName;
// 更新Tab样式
const tabs = document.querySelectorAll('.tab-item');
tabs.forEach(tab => tab.classList.remove('active'));
document.querySelector(`[data-dom-id="tab-${tabName}"]`).classList.add('active');
// 切换列表内容
document.getElementById('following-list').classList.remove('active');
document.getElementById('followers-list').classList.remove('active');
document.getElementById(`${tabName}-list`).classList.add('active');
// 重置搜索
document.getElementById('search-input').value = '';
document.getElementById('search-empty').style.display = 'none';
// 重置列表项显示
const activeList = document.getElementById(`${tabName}-list`);
const items = activeList.querySelectorAll('.user-item');
items.forEach(item => {
item.style.display = '';
});
}
// ===== 搜索过滤 =====
function filterUsers() {
const query = document.getElementById('search-input').value.trim().toLowerCase();
const activeList = document.getElementById(`${currentTab}-list`);
const items = activeList.querySelectorAll('.user-item');
const emptyState = document.getElementById('search-empty');
let visibleCount = 0;
items.forEach(item => {
const name = item.getAttribute('data-name') || '';
const school = item.getAttribute('data-school') || '';
if (!query || name.toLowerCase().includes(query) || school.toLowerCase().includes(query)) {
item.style.display = '';
visibleCount++;
} else {
item.style.display = 'none';
}
});
// 显示/隐藏空状态
if (query && visibleCount === 0) {
emptyState.style.display = 'flex';
} else {
emptyState.style.display = 'none';
}
}
// ===== 关注按钮切换 =====
function toggleFollow(btn, tabType) {
const classes = btn.classList;
if (tabType === 'following') {
// 关注列表:已关注 <-> 关注(取消关注)
if (classes.contains('following')) {
classes.remove('following');
classes.add('follow');
btn.textContent = '关注';
} else if (classes.contains('mutual')) {
// 互相关注 -> 取消关注
classes.remove('mutual');
classes.add('follow');
btn.textContent = '关注';
} else if (classes.contains('follow')) {
classes.remove('follow');
classes.add('following');
btn.textContent = '已关注';
}
} else {
// 粉丝列表:回关 <-> 已互关
if (classes.contains('follow-back')) {
classes.remove('follow-back');
classes.add('mutual');
btn.textContent = '已互关';
} else if (classes.contains('mutual')) {
classes.remove('mutual');
classes.add('follow-back');
btn.textContent = '回关';
}
}
}
// ===== 跳转用户主页 =====
function goToProfile() {
window.location.href = 'user-profile.html';
}
// ===== 底部Tab切换 =====
function switchBottomTab(tabName) {
const tabs = document.querySelectorAll('.bottom-tab');
tabs.forEach(tab => tab.classList.remove('active'));
const activeTab = document.querySelector(`[data-dom-id="tab-${tabName}"]`);
if (activeTab) {
activeTab.classList.add('active');
}
// 页面跳转映射
const pageMap = {
'home': 'feed-home.html',
'activity': 'activity-list.html',
'message': 'message-list.html',
'discover': 'campus-radar.html',
'profile': 'profile-home.html'
};
if (tabName !== 'profile' && pageMap[tabName]) {
window.location.href = pageMap[tabName];
}
}</script>
</body>
</html>