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.
 
 

837 lines
26 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>
<link rel="stylesheet" href="../colors_and_type.css">
<script src="https://cdn.tailwindcss.com"></script>
<style>
:root {
--youth-primary: #26C2BB;
--youth-primary-light: #54CAC5;
--primary-bg: #E6F7F6;
--primary-border: #B3E8E4;
--bg-page: #F7F8FA;
--bg-card: #FFFFFF;
--text-title: #1F1F1F;
--text-body: #595959;
--text-muted: #8C8C8C;
--youth-border-light: #E8E8E8;
--youth-success: #52C41A;
--youth-warning: #FAAD14;
--danger: #F5222D;
--shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
--tag-bg: #F0F1F3;
--mint-light: #E8F8F5;
--orange-light: #FFF4E8;
--btn-gradient: linear-gradient(135deg, #54CAC5 0%, #26C2BB 50%, #1FA8A2 100%);
/* =====================================================
* 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-bottom: 64px;
/* 间距(4px 基础栅格) */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--space-page-x: 16px;
--space-card: 16px;
/* 柔和弥散阴影 */
--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.04);
--shadow-inset-focus: inset 0 1px 3px rgba(38, 194, 187, 0.08);
/* 毛玻璃 */
--glass-bg: rgba(255, 255, 255, 0.72);
--glass-blur: blur(20px);
--glass-border: rgba(255, 255, 255, 0.3);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'SF Pro Display', 'Helvetica Neue', sans-serif;
background: var(--youth-bg-page);
color: var(--youth-text-secondary);
min-height: 100vh;
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 16px;
font-size: 15px;
font-weight: 600;
color: var(--youth-text-primary);
flex-shrink: 0;
}
.status-bar .right-icons {
display: flex;
align-items: center;
gap: 6px;
}
/* 顶部导航 */
.top-nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8px;
height: 44px;
flex-shrink: 0;
}
.nav-left, .nav-right {
display: flex;
align-items: center;
}
.nav-btn {
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
color: var(--youth-text-primary);
cursor: pointer;
transition: background 0.2s ease;
border: none;
background: transparent;
}
.nav-btn:active {
background: var(--youth-border-light);
}
.nav-title {
font-size: 17px;
font-weight: 700;
color: var(--youth-text-primary);
}
/* 搜索区 */
.search-section {
padding: 16px;
flex-shrink: 0;
}
.search-input-group {
display: flex;
gap: 10px;
align-items: center;
}
.search-input-wrap {
flex: 1;
display: flex;
align-items: center;
height: 44px;
background: var(--youth-bg-card);
border: 1px solid var(--youth-border-light);
border-radius: 8px;
padding: 0 14px;
transition: all 0.2s ease;
}
.search-input-wrap:focus-within {
border-color: var(--youth-primary);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}
.search-icon {
color: var(--youth-text-tertiary);
margin-right: 10px;
flex-shrink: 0;
}
.search-input {
flex: 1;
height: 44px;
border: none;
outline: none;
background: transparent;
font-size: 15px;
color: var(--youth-text-primary);
}
.search-input::placeholder {
color: var(--youth-text-tertiary);
font-size: 14px;
}
.search-btn {
height: 44px;
padding: 0 20px;
border: none;
border-radius: 8px;
background: var(--youth-gradient-primary);
color: #FFFFFF;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
flex-shrink: 0;
position: relative;
overflow: hidden;
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.2);
}
.search-btn::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
pointer-events: none;
}
.search-btn:active {
transform: scale(0.96);
box-shadow: 0 1px 4px rgba(38, 194, 187, 0.15);
}
.search-hint {
margin-top: 10px;
font-size: 12px;
color: var(--youth-text-tertiary);
line-height: 1.5;
}
/* 快速添加 */
.quick-add {
padding: 0 16px 16px;
flex-shrink: 0;
}
.section-title {
font-size: 14px;
font-weight: 600;
color: var(--youth-text-primary);
margin-bottom: 10px;
}
.quick-add-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
}
.quick-add-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
cursor: pointer;
}
.quick-add-icon {
width: 48px;
height: 48px;
border-radius: 12px;
background: var(--youth-bg-card);
box-shadow: var(--youth-shadow-card);
display: flex;
align-items: center;
justify-content: center;
color: var(--youth-primary);
transition: all 0.2s ease;
}
.quick-add-item:active .quick-add-icon {
transform: scale(0.95);
}
.quick-add-item span {
font-size: 11px;
color: var(--youth-text-secondary);
}
/* 分割线 */
.divider-line {
height: 1px;
background: var(--youth-border-light);
margin: 0 16px;
flex-shrink: 0;
}
/* 结果区 */
.result-section {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
padding: 16px;
}
.result-section::-webkit-scrollbar {
display: none;
}
.result-title {
font-size: 14px;
font-weight: 600;
color: var(--youth-text-primary);
margin-bottom: 12px;
display: flex;
align-items: center;
justify-content: space-between;
}
.result-count {
font-size: 12px;
color: var(--youth-text-tertiary);
font-weight: 400;
}
/* 用户结果卡片 */
.user-result-card {
display: flex;
align-items: center;
padding: 14px 16px;
background: var(--youth-bg-card);
border-radius: 12px;
box-shadow: var(--youth-shadow-card);
margin-bottom: 10px;
cursor: pointer;
transition: all 0.2s ease;
}
.user-result-card:active {
transform: scale(0.99);
}
.user-avatar {
width: 48px;
height: 48px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
font-weight: 600;
color: #FFFFFF;
flex-shrink: 0;
margin-right: 12px;
}
.user-info {
flex: 1;
min-width: 0;
}
.user-name-row {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
}
.user-name {
font-size: 15px;
font-weight: 600;
color: var(--youth-text-primary);
}
.verified-badge {
display: flex;
align-items: center;
gap: 2px;
padding: 1px 6px;
background: var(--youth-teal-50);
color: var(--youth-primary);
border-radius: 10px;
font-size: 10px;
font-weight: 500;
flex-shrink: 0;
}
.user-id {
font-size: 12px;
color: var(--youth-text-tertiary);
margin-bottom: 3px;
}
.user-school {
font-size: 12px;
color: var(--youth-text-tertiary);
display: flex;
align-items: center;
gap: 4px;
}
.user-school .dot {
width: 2px;
height: 2px;
background: var(--youth-text-tertiary);
border-radius: 50%;
}
.add-friend-btn {
height: 32px;
padding: 0 14px;
border: none;
border-radius: 16px;
background: var(--youth-gradient-primary);
color: #FFFFFF;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
flex-shrink: 0;
display: flex;
align-items: center;
gap: 4px;
box-shadow: 0 2px 6px rgba(38, 194, 187, 0.2);
position: relative;
overflow: hidden;
}
.add-friend-btn::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
pointer-events: none;
}
.add-friend-btn:active {
transform: scale(0.96);
}
.add-friend-btn.added {
background: var(--youth-teal-50);
color: var(--youth-primary);
border: 1px solid var(--youth-primary-border);
box-shadow: none;
}
.add-friend-btn.added::before {
display: none;
}
/* 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60px 16px;
}
.empty-icon {
width: 88px;
height: 88px;
border-radius: 50%;
background: var(--youth-primary-bg);
display: flex;
align-items: center;
justify-content: center;
color: var(--youth-primary);
margin-bottom: 16px;
}
.empty-title {
font-size: 16px;
font-weight: 600;
color: var(--youth-text-primary);
margin-bottom: 6px;
}
.empty-desc {
font-size: 13px;
color: var(--youth-text-tertiary);
text-align: center;
line-height: 1.6;
}
/* 初始引导状态 */
.initial-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60px 16px;
}
.initial-icon {
width: 72px;
height: 72px;
border-radius: 50%;
background: var(--tag-bg);
display: flex;
align-items: center;
justify-content: center;
color: var(--youth-text-tertiary);
margin-bottom: 14px;
}
.initial-text {
font-size: 13px;
color: var(--youth-text-tertiary);
text-align: center;
line-height: 1.6;
}
/* 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; }
</style>
</head>
<body>
<div class="app-container" data-dom-id="app-container">
<!-- 状态栏 -->
<div class="status-bar">
<span>9:41</span>
<div class="right-icons">
<svg width="17" height="11" viewBox="0 0 17 11" fill="currentColor">
<rect x="0" y="7" width="3" height="4" rx="0.5"/>
<rect x="4.5" y="5" width="3" height="6" rx="0.5"/>
<rect x="9" y="2.5" width="3" height="8.5" rx="0.5"/>
<rect x="13.5" y="0" width="3" height="11" rx="0.5"/>
</svg>
<svg width="15" height="11" viewBox="0 0 15 11" fill="currentColor">
<path d="M7.5 1C5.3 1 3.2 1.7 1.5 3C-0.5 4.7 -0.5 7.5 1.5 9.2C1.9 9.6 2.5 9.6 2.9 9.2C3.3 8.8 3.3 8.2 2.9 7.8C1.6 6.5 1.6 4.4 2.9 3.1C4.2 1.8 6.3 1.4 8 2C10.1 2.7 11.7 4.4 12.2 6.5C12.5 7.3 12.4 8.1 11.8 8.7C11.4 9.1 11.4 9.7 11.8 10.1C12.2 10.5 12.8 10.5 13.2 10.1C14.2 9.1 14.5 7.7 14.2 6.3C13.6 4 12.1 2.3 10.2 1.3C9.3 1 8.4 0.9 7.5 1Z"/>
<path d="M7.5 4.5C6 4.5 4.5 5 3.4 6.2C2.3 7.4 2 9 2.4 10.4C2.5 10.8 2.8 11 3.2 11C3.5 11 3.8 10.8 3.9 10.5C4.2 9.5 4.8 8.6 5.7 8C6.6 7.4 7.6 7.1 8.6 7.2C9.8 7.3 10.9 7.8 11.6 8.7C12.3 9.6 12.6 10.7 12.4 11.8L12.4 12C12.3 12.4 12.6 12.7 13 12.8C13.4 12.9 13.7 12.6 13.8 12.2C14.1 10.5 13.5 8.8 12.4 7.5C11.3 6.2 9.6 5.3 7.8 4.9L7.5 4.5Z"/>
</svg>
<svg width="25" height="12" viewBox="0 0 25 12" fill="none">
<rect x="0.5" y="0.5" width="21" height="11" rx="2.5" stroke="currentColor" opacity="0.5"/>
<rect x="2" y="2" width="18" height="8" rx="1.5" fill="currentColor"/>
<rect x="22.5" y="4" width="1.5" height="4" rx="0.5" fill="currentColor" opacity="0.5"/>
</svg>
</div>
</div>
<!-- 顶部导航 -->
<div class="top-nav">
<div class="nav-left">
<button class="nav-btn" data-dom-id="btn-back" onclick="goBack()">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="15 18 9 12 15 6"></polyline>
</svg>
</button>
</div>
<div class="nav-title" data-dom-id="nav-title">添加好友</div>
<div class="nav-right" style="width: 36px;"></div>
</div>
<!-- 搜索区 -->
<div class="search-section">
<div class="search-input-group">
<div class="search-input-wrap">
<svg class="search-icon" width="18" height="18" 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>
<input
type="text"
class="search-input"
placeholder="输入用户ID / 青核号"
data-dom-id="search-input"
id="search-input"
>
</div>
<button class="search-btn" data-dom-id="btn-search" onclick="doSearch()">搜索</button>
</div>
<div class="search-hint">
输入对方的青核ID或手机号,精确查找已实名用户
</div>
</div>
<!-- 快速添加 -->
<div class="quick-add">
<div class="section-title">其他添加方式</div>
<div class="quick-add-grid">
<div class="quick-add-item" data-dom-id="quick-scan" onclick="goToScan()">
<div class="quick-add-icon">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 7V5a2 2 0 0 1 2-2h2"></path>
<path d="M17 3h2a2 2 0 0 1 2 2v2"></path>
<path d="M21 17v2a2 2 0 0 1-2 2h-2"></path>
<path d="M7 21H5a2 2 0 0 1-2-2v-2"></path>
<rect x="7" y="7" width="10" height="10" rx="1"></rect>
</svg>
</div>
<span>扫一扫</span>
</div>
<div class="quick-add-item" data-dom-id="quick-contacts">
<div class="quick-add-icon">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>
</svg>
</div>
<span>通讯录</span>
</div>
<div class="quick-add-item" data-dom-id="quick-nearby">
<div class="quick-add-icon">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"></path>
<circle cx="12" cy="10" r="3"></circle>
</svg>
</div>
<span>附近的人</span>
</div>
<div class="quick-add-item" data-dom-id="quick-qrcode">
<div class="quick-add-icon">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="7" height="7" rx="1"></rect>
<rect x="14" y="3" width="7" height="7" rx="1"></rect>
<rect x="3" y="14" width="7" height="7" rx="1"></rect>
<path d="M14 14h3v3h-3z"></path>
<path d="M20 14v7"></path>
<path d="M17 21h4"></path>
</svg>
</div>
<span>我的二维码</span>
</div>
</div>
</div>
<div class="divider-line"></div>
<!-- 结果区 -->
<div class="result-section" data-dom-id="result-section">
<!-- 初始状态 -->
<div id="state-initial" class="initial-state">
<div class="initial-icon">
<svg width="32" height="32" 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>
<line x1="8" y1="11" x2="14" y2="11"></line>
</svg>
</div>
<div class="initial-text">
输入用户ID或手机号<br/>快速添加同校好友
</div>
</div>
<!-- 有结果状态(默认隐藏) -->
<div id="state-result" style="display: none;">
<div class="result-title">
搜索结果
<span class="result-count">找到 1 位用户</span>
</div>
<div class="user-result-card" data-dom-id="user-card" onclick="goToProfile()">
<div class="user-avatar" style="background: linear-gradient(135deg, #FFD93D, #FF9F45);">陈</div>
<div class="user-info">
<div class="user-name-row">
<span class="user-name">陈明轩</span>
<span class="verified-badge">
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" 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 class="user-id">青核号:qh_chenmx2024</div>
<div class="user-school">
清华大学 <span class="dot"></span> 计算机系 <span class="dot"></span> 大三
</div>
</div>
<button class="add-friend-btn" data-dom-id="btn-add-friend" id="btn-add-friend" onclick="event.stopPropagation(); toggleAdd(this)">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
加好友
</button>
</div>
<div style="margin-top: 20px;">
<div class="result-title" style="margin-bottom: 10px;">
可能认识的人
</div>
<div class="user-result-card" onclick="goToProfile()">
<div class="user-avatar" style="background: linear-gradient(135deg, #7ED6E8, #26C2BB);">小</div>
<div class="user-info">
<div class="user-name-row">
<span class="user-name">小青同学</span>
<span class="verified-badge">
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" 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 class="user-id">青核号:qing_0415</div>
<div class="user-school">
清华大学 <span class="dot"></span> 中文系 <span class="dot"></span> 3位共同好友
</div>
</div>
<button class="add-friend-btn" onclick="event.stopPropagation(); toggleAdd(this)">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
加好友
</button>
</div>
</div>
</div>
<!-- 无结果状态(默认隐藏) -->
<div id="state-empty" class="empty-state" style="display: none;">
<div class="empty-icon">
<svg width="36" height="36" 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>
<line x1="8" y1="11" x2="14" y2="11"></line>
</svg>
</div>
<div class="empty-title">未找到该用户</div>
<div class="empty-desc">
请检查输入的ID是否正确<br/>或让对方分享二维码给你扫码添加
</div>
</div>
</div>
</div>
<script>// 主题切换
icon.innerHTML = '<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>';
}
}
// 搜索
let searchState = 'initial';
function doSearch() {
const input = document.getElementById('search-input');
const val = input.value.trim();
document.getElementById('state-initial').style.display = 'none';
document.getElementById('state-result').style.display = 'none';
document.getElementById('state-empty').style.display = 'none';
if (!val) {
document.getElementById('state-initial').style.display = 'flex';
searchState = 'initial';
return;
}
// 模拟:输入 123 显示无结果,其他显示有结果
if (val === '123' || val === '000000') {
document.getElementById('state-empty').style.display = 'flex';
searchState = 'empty';
} else {
document.getElementById('state-result').style.display = 'block';
searchState = 'result';
}
}
// 回车搜索
document.getElementById('search-input').addEventListener('keypress', function(e) {
if (e.key === 'Enter') doSearch();
});
// 加好友按钮
function toggleAdd(btn) {
const isAdded = btn.classList.contains('added');
if (isAdded) {
btn.classList.remove('added');
btn.innerHTML = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg> 加好友';
} else {
btn.classList.add('added');
btn.innerHTML = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已添加';
}
}
// 返回
function goBack() {
window.history.back();
}
// 跳转用户资料
function goToProfile() {
window.location.href = 'user-profile.html?id=1';
}
// 扫码
function goToScan() {
window.location.href = 'scan-qr.html';
}</script>
</body>
</html>