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.
1131 lines
34 KiB
1131 lines
34 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">
|
|
<style>
|
|
* {
|
|
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 20px;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
flex-shrink: 0;
|
|
padding-top: 6px;
|
|
}
|
|
|
|
.status-bar .time {
|
|
font-weight: 700;
|
|
font-size: 15px;
|
|
letter-spacing: -0.01em;
|
|
}
|
|
|
|
.status-bar .right-icons {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
}
|
|
|
|
/* ========== 顶部导航栏 ========== */
|
|
.top-nav {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 12px;
|
|
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: all 0.2s ease;
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
background: rgba(255, 255, 255, 0.72);
|
|
backdrop-filter: blur(20px) saturate(180%);
|
|
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
.nav-btn:active {
|
|
transform: scale(0.93);
|
|
background: rgba(255, 255, 255, 0.9);
|
|
}
|
|
|
|
.nav-btn svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
stroke-width: 2px;
|
|
}
|
|
|
|
.nav-title {
|
|
font-size: 17px;
|
|
font-weight: 700;
|
|
color: var(--youth-text-primary);
|
|
letter-spacing: -0.01em;
|
|
}
|
|
|
|
/* ========== Tab切换栏 ========== */
|
|
.tab-bar {
|
|
display: flex;
|
|
padding: 0 16px;
|
|
border-bottom: 1px solid var(--youth-divider);
|
|
flex-shrink: 0;
|
|
background: var(--youth-bg-page);
|
|
gap: 32px;
|
|
}
|
|
|
|
.tab-item {
|
|
position: relative;
|
|
padding: 12px 0;
|
|
font-size: 15px;
|
|
font-weight: 500;
|
|
color: var(--youth-text-tertiary);
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.tab-item.active {
|
|
color: var(--youth-primary);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.tab-item::after {
|
|
content: '';
|
|
position: absolute;
|
|
bottom: -1px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
width: 0;
|
|
height: 3px;
|
|
background: linear-gradient(135deg, #54CAC5 0%, #26C2BB 50%, #1FA8A2 100%);
|
|
border-radius: 2px;
|
|
transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
|
|
.tab-item.active::after {
|
|
width: 28px;
|
|
}
|
|
|
|
/* ========== 搜索栏 ========== */
|
|
.search-section {
|
|
padding: 12px 16px;
|
|
flex-shrink: 0;
|
|
background: var(--youth-bg-page);
|
|
}
|
|
|
|
.search-input-wrap {
|
|
display: flex;
|
|
align-items: center;
|
|
height: 44px;
|
|
background: var(--youth-bg-input);
|
|
border: 1px solid var(--youth-border);
|
|
border-radius: 8px;
|
|
padding: 0 14px;
|
|
transition: all 0.2s ease;
|
|
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
}
|
|
|
|
.search-input-wrap:focus-within {
|
|
border-color: var(--youth-primary);
|
|
background: var(--youth-bg-card);
|
|
box-shadow: inset 0 1px 3px rgba(38, 194, 187, 0.06), 0 0 0 3px rgba(38, 194, 187, 0.1);
|
|
}
|
|
|
|
.search-icon {
|
|
color: var(--youth-text-tertiary);
|
|
margin-right: 8px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.search-icon svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
stroke-width: 2px;
|
|
}
|
|
|
|
.search-input {
|
|
flex: 1;
|
|
height: 44px;
|
|
border: none;
|
|
outline: none;
|
|
background: transparent;
|
|
font-size: 14px;
|
|
color: var(--youth-text-primary);
|
|
font-family: inherit;
|
|
}
|
|
|
|
.search-input::placeholder {
|
|
color: var(--youth-text-placeholder);
|
|
}
|
|
|
|
/* ========== 内容区 ========== */
|
|
.content-area {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
-webkit-overflow-scrolling: touch;
|
|
padding-bottom: 80px;
|
|
}
|
|
|
|
.content-area::-webkit-scrollbar {
|
|
display: none;
|
|
}
|
|
|
|
.tab-content {
|
|
display: none;
|
|
}
|
|
|
|
.tab-content.active {
|
|
display: block;
|
|
}
|
|
|
|
/* ========== 分组标题 ========== */
|
|
.group-section {
|
|
}
|
|
|
|
.group-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 16px 0 10px;
|
|
cursor: pointer;
|
|
transition: opacity 0.2s ease;
|
|
}
|
|
|
|
.group-header:active {
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.group-header-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.group-title {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
}
|
|
|
|
.group-count {
|
|
font-size: 12px;
|
|
color: var(--youth-text-tertiary);
|
|
font-weight: 400;
|
|
}
|
|
|
|
.group-arrow {
|
|
width: 16px;
|
|
height: 16px;
|
|
color: var(--youth-text-tertiary);
|
|
transition: transform 0.25s ease;
|
|
}
|
|
|
|
.group-arrow svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
stroke-width: 2px;
|
|
}
|
|
|
|
.group-header.collapsed .group-arrow {
|
|
transform: rotate(-90deg);
|
|
}
|
|
|
|
.group-body {
|
|
overflow: hidden;
|
|
transition: max-height 0.3s ease;
|
|
}
|
|
|
|
.group-body.collapsed {
|
|
max-height: 0 !important;
|
|
}
|
|
|
|
/* ========== 好友列表项 ========== */
|
|
.friend-list {
|
|
background: var(--youth-bg-card);
|
|
}
|
|
|
|
.friend-item {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 12px 16px;
|
|
cursor: pointer;
|
|
transition: all 0.15s ease;
|
|
position: relative;
|
|
}
|
|
|
|
.friend-item:active {
|
|
background: var(--youth-bg-hover);
|
|
transform: scale(0.99);
|
|
}
|
|
|
|
.friend-item + .friend-item::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 76px;
|
|
right: 0;
|
|
height: 1px;
|
|
background: var(--youth-divider);
|
|
}
|
|
|
|
.friend-avatar-wrap {
|
|
position: relative;
|
|
flex-shrink: 0;
|
|
margin-right: 12px;
|
|
}
|
|
|
|
.friend-avatar {
|
|
width: 48px;
|
|
height: 48px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 18px;
|
|
font-weight: 600;
|
|
color: #FFFFFF;
|
|
}
|
|
|
|
.online-dot {
|
|
position: absolute;
|
|
bottom: 1px;
|
|
right: 1px;
|
|
width: 12px;
|
|
height: 12px;
|
|
background: #52C41A;
|
|
border-radius: 50%;
|
|
border: 2px solid var(--youth-bg-card);
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.online-dot.offline {
|
|
background: #BFBFBF;
|
|
}
|
|
|
|
.friend-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.friend-name {
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
margin-bottom: 3px;
|
|
}
|
|
|
|
.friend-school {
|
|
font-size: 12px;
|
|
color: var(--youth-text-tertiary);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.friend-school .dot {
|
|
width: 2px;
|
|
height: 2px;
|
|
background: var(--youth-text-tertiary);
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* ========== 群聊列表项 ========== */
|
|
.group-list {
|
|
background: var(--youth-bg-card);
|
|
}
|
|
|
|
.group-item {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 12px 14px;
|
|
cursor: pointer;
|
|
transition: all 0.15s ease;
|
|
position: relative;
|
|
}
|
|
|
|
.group-item:active {
|
|
background: var(--youth-bg-hover);
|
|
transform: scale(0.99);
|
|
}
|
|
|
|
.group-item + .group-item::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 76px;
|
|
right: 0;
|
|
height: 1px;
|
|
background: var(--youth-divider);
|
|
}
|
|
|
|
.group-avatar-wrap {
|
|
position: relative;
|
|
flex-shrink: 0;
|
|
margin-right: 12px;
|
|
}
|
|
|
|
.group-avatar {
|
|
width: 48px;
|
|
height: 48px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.group-avatar-icon {
|
|
width: 24px;
|
|
height: 24px;
|
|
color: #FFFFFF;
|
|
opacity: 0.95;
|
|
}
|
|
|
|
.group-avatar-icon svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
stroke-width: 2px;
|
|
}
|
|
|
|
.group-avatar.multi {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
grid-template-rows: 1fr 1fr;
|
|
gap: 2px;
|
|
padding: 6px;
|
|
}
|
|
|
|
.group-avatar.multi .mini-avatar {
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: 4px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
color: #FFFFFF;
|
|
}
|
|
|
|
.group-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.group-name {
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
flex: 1;
|
|
}
|
|
|
|
.group-member-count {
|
|
font-size: 13px;
|
|
color: var(--youth-text-tertiary);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* 头像渐变配色 */
|
|
.avatar-gradient-1 { background: linear-gradient(135deg, #FFB0C7, #FF6B9D); }
|
|
.avatar-gradient-2 { background: linear-gradient(135deg, #7ED6E8, #26C2BB); }
|
|
.avatar-gradient-3 { background: linear-gradient(135deg, #A29BFE, #6C5CE7); }
|
|
.avatar-gradient-4 { background: linear-gradient(135deg, #FFD93D, #FF9F45); }
|
|
.avatar-gradient-5 { background: linear-gradient(135deg, #55EFC4, #00B894); }
|
|
.avatar-gradient-6 { background: linear-gradient(135deg, #FD79A8, #E84393); }
|
|
.avatar-gradient-7 { background: linear-gradient(135deg, #74B9FF, #0984E3); }
|
|
.avatar-gradient-8 { background: linear-gradient(135deg, #FFEAA7, #FDCB6E); }
|
|
|
|
.group-gradient-1 { background: linear-gradient(135deg, #7ED6E8, #26C2BB); }
|
|
.group-gradient-2 { background: linear-gradient(135deg, #FFB0C7, #FF6B9D); }
|
|
.group-gradient-3 { background: linear-gradient(135deg, #A29BFE, #6C5CE7); }
|
|
.group-gradient-4 { background: linear-gradient(135deg, #FFD93D, #FF9F45); }
|
|
.group-gradient-5 { background: linear-gradient(135deg, #55EFC4, #00B894); }
|
|
.group-gradient-6 { background: linear-gradient(135deg, #74B9FF, #0984E3); }
|
|
.group-gradient-7 { background: linear-gradient(135deg, #FD79A8, #E84393); }
|
|
|
|
/* ========== 底部导航栏 ========== */
|
|
.bottom-nav {
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 64px;
|
|
background: var(--youth-bg-card);
|
|
display: flex;
|
|
align-items: flex-start;
|
|
justify-content: space-around;
|
|
padding-top: 8px;
|
|
box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.04);
|
|
z-index: 50;
|
|
border-top: 1px solid var(--youth-border-light);
|
|
}
|
|
|
|
.bottom-nav-item {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 2px;
|
|
cursor: pointer;
|
|
position: relative;
|
|
padding-top: 2px;
|
|
color: var(--youth-text-tertiary);
|
|
transition: color 0.2s ease;
|
|
}
|
|
|
|
.bottom-nav-item.active {
|
|
color: var(--youth-primary);
|
|
}
|
|
|
|
.bottom-nav-item:active {
|
|
transform: scale(0.92);
|
|
}
|
|
|
|
.bottom-nav-item svg {
|
|
width: 22px;
|
|
height: 22px;
|
|
stroke-width: 1.8px;
|
|
}
|
|
|
|
.bottom-nav-item .nav-label {
|
|
font-size: 10px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.bottom-nav-item.active .nav-label {
|
|
font-weight: 600;
|
|
}
|
|
|
|
.bottom-nav-item.publish-btn .nav-icon-wrap {
|
|
width: 46px;
|
|
height: 46px;
|
|
background: linear-gradient(135deg, #54CAC5 0%, #26C2BB 50%, #1FA8A2 100%);
|
|
border-radius: 50%;
|
|
color: #FFFFFF;
|
|
margin-top: -16px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
box-shadow: 0 4px 14px rgba(38, 194, 187, 0.35);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.bottom-nav-item.publish-btn .nav-icon-wrap:active {
|
|
transform: scale(0.93);
|
|
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.3);
|
|
}
|
|
|
|
.bottom-nav-item.publish-btn .nav-icon-wrap svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
stroke-width: 2.5px;
|
|
color: #FFFFFF;
|
|
}
|
|
|
|
.bottom-nav-item.publish-btn .nav-label {
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.nav-dot {
|
|
position: absolute;
|
|
top: 2px;
|
|
right: 50%;
|
|
transform: translateX(14px);
|
|
width: 8px;
|
|
height: 8px;
|
|
background: var(--youth-danger-500);
|
|
border-radius: 50%;
|
|
border: 1.5px solid var(--youth-bg-card);
|
|
}
|
|
|
|
/* ========== 间距调整 ========== */
|
|
.group-section + .group-section {
|
|
margin-top: 4px;
|
|
}
|
|
|
|
/* ========== 字母索引 ========== */
|
|
.letter-section {
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.letter-header {
|
|
display: flex;
|
|
align-items: center;
|
|
height: 28px;
|
|
padding: 0 16px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-tertiary);
|
|
background: var(--youth-bg-page);
|
|
}
|
|
|
|
.letter-section .friend-list {
|
|
}
|
|
|
|
.letter-section .friend-item {
|
|
padding: 12px 16px;
|
|
}
|
|
|
|
.letter-section .friend-item:first-child {
|
|
padding-top: 0;
|
|
}
|
|
|
|
.letter-section .friend-item:last-child {
|
|
padding-bottom: 12px;
|
|
}
|
|
|
|
/* ========== 全部好友头部统计 ========== */
|
|
.all-friends-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 12px 16px 8px;
|
|
font-size: 13px;
|
|
color: var(--youth-text-tertiary);
|
|
}
|
|
|
|
.all-friends-header .count {
|
|
font-weight: 500;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="app-container">
|
|
<!-- 状态栏 -->
|
|
<div class="status-bar">
|
|
<span class="time">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>
|
|
<rect x="4.5" y="5" width="3" height="6" rx="0.5"></rect>
|
|
<rect x="9" y="2.5" width="3" height="8.5" rx="0.5"></rect>
|
|
<rect x="13.5" y="0" width="3" height="11" rx="0.5"></rect>
|
|
</svg>
|
|
<!-- WiFi -->
|
|
<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>
|
|
</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.4"></rect>
|
|
<rect x="2" y="2" width="18" height="8" rx="1.5" fill="currentColor"></rect>
|
|
<rect x="22.5" y="4" width="1.5" height="4" rx="0.5" fill="currentColor" opacity="0.4"></rect>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 顶部导航栏 -->
|
|
<div class="top-nav">
|
|
<div class="nav-left">
|
|
<button class="nav-btn" id="btn-back" onclick="goBack()" aria-label="返回">
|
|
<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>
|
|
</div>
|
|
<div class="nav-title">通讯录</div>
|
|
<div class="nav-right">
|
|
<button class="nav-btn" id="btn-add-friend" onclick="addFriend()" aria-label="添加好友">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" 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>
|
|
|
|
<!-- Tab切换栏 -->
|
|
<div class="tab-bar">
|
|
<div class="tab-item active" data-tab="friends" onclick="switchTab('friends')">好友</div>
|
|
<div class="tab-item" data-tab="groups" onclick="switchTab('groups')">群聊</div>
|
|
</div>
|
|
|
|
<!-- 搜索栏 -->
|
|
<div class="search-section">
|
|
<div class="search-input-wrap">
|
|
<div class="search-icon">
|
|
<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>
|
|
</div>
|
|
<input type="text" class="search-input" placeholder="搜索好友/群聊">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 内容区 -->
|
|
<div class="content-area">
|
|
<!-- 好友 Tab 内容 -->
|
|
<div class="tab-content active" id="friends-content">
|
|
<!-- 特别关心 -->
|
|
<div class="group-section">
|
|
<div class="group-header" onclick="toggleGroup(this)">
|
|
<div class="group-header-left">
|
|
<span class="group-title">特别关心</span>
|
|
<span class="group-count">2人</span>
|
|
</div>
|
|
<div class="group-arrow">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
|
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<div class="group-body">
|
|
<div class="friend-list">
|
|
<div class="friend-item" id="friend-item-1" onclick="openFriend('林小雨')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-1">林</div>
|
|
<div class="online-dot"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">林小雨</div>
|
|
<div class="friend-school">
|
|
<span>清华大学</span>
|
|
<span class="dot"></span>
|
|
<span>中文系</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="friend-item" onclick="openFriend('陈明轩')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-2">陈</div>
|
|
<div class="online-dot"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">陈明轩</div>
|
|
<div class="friend-school">
|
|
<span>清华大学</span>
|
|
<span class="dot"></span>
|
|
<span>计算机系</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 全部好友 - 按首字母排序 -->
|
|
<div class="all-friends-header">
|
|
<span>全部好友</span>
|
|
<span class="count">126人</span>
|
|
</div>
|
|
|
|
<!-- 字母 L -->
|
|
<div class="letter-section">
|
|
<div class="letter-header">L</div>
|
|
<div class="friend-list">
|
|
<div class="friend-item" onclick="openFriend('李子涵')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-5">李</div>
|
|
<div class="online-dot"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">李子涵</div>
|
|
<div class="friend-school">
|
|
<span>清华大学</span>
|
|
<span class="dot"></span>
|
|
<span>建筑学院</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="friend-item" onclick="openFriend('刘宇航')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-7">刘</div>
|
|
<div class="online-dot offline"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">刘宇航</div>
|
|
<div class="friend-school">
|
|
<span>清华大学</span>
|
|
<span class="dot"></span>
|
|
<span>自动化系</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 字母 S -->
|
|
<div class="letter-section">
|
|
<div class="letter-header">S</div>
|
|
<div class="friend-list">
|
|
<div class="friend-item" onclick="openFriend('孙浩然')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-8">孙</div>
|
|
<div class="online-dot offline"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">孙浩然</div>
|
|
<div class="friend-school">
|
|
<span>复旦大学</span>
|
|
<span class="dot"></span>
|
|
<span>物理系</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 字母 W -->
|
|
<div class="letter-section">
|
|
<div class="letter-header">W</div>
|
|
<div class="friend-list">
|
|
<div class="friend-item" onclick="openFriend('王思远')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-3">王</div>
|
|
<div class="online-dot"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">王思远</div>
|
|
<div class="friend-school">
|
|
<span>清华大学</span>
|
|
<span class="dot"></span>
|
|
<span>经管学院</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 字母 Z -->
|
|
<div class="letter-section">
|
|
<div class="letter-header">Z</div>
|
|
<div class="friend-list">
|
|
<div class="friend-item" onclick="openFriend('张梦瑶')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-6">张</div>
|
|
<div class="online-dot"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">张梦瑶</div>
|
|
<div class="friend-school">
|
|
<span>清华大学</span>
|
|
<span class="dot"></span>
|
|
<span>新闻学院</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="friend-item" onclick="openFriend('张晓桐')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-4">张</div>
|
|
<div class="online-dot"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">张晓桐</div>
|
|
<div class="friend-school">
|
|
<span>北京师范大学</span>
|
|
<span class="dot"></span>
|
|
<span>心理系</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="friend-item" onclick="openFriend('赵雨萱')">
|
|
<div class="friend-avatar-wrap">
|
|
<div class="friend-avatar avatar-gradient-6">赵</div>
|
|
<div class="online-dot offline"></div>
|
|
</div>
|
|
<div class="friend-info">
|
|
<div class="friend-name">赵雨萱</div>
|
|
<div class="friend-school">
|
|
<span>北京大学</span>
|
|
<span class="dot"></span>
|
|
<span>法学院</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 群聊 Tab 内容 -->
|
|
<div class="tab-content" id="groups-content">
|
|
<!-- 置顶群聊 -->
|
|
<div class="group-section">
|
|
<div class="group-header" onclick="toggleGroup(this)">
|
|
<div class="group-header-left">
|
|
<span class="group-title">置顶群聊</span>
|
|
<span class="group-count">2个</span>
|
|
</div>
|
|
<div class="group-arrow">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
|
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<div class="group-body">
|
|
<div class="group-list">
|
|
<div class="group-item" id="group-item-1" onclick="openGroup('摄影爱好者交流群')">
|
|
<div class="group-avatar-wrap">
|
|
<div class="group-avatar group-gradient-1 multi">
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.3);">林</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.25);">陈</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.2);">王</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.15);">李</div>
|
|
</div>
|
|
</div>
|
|
<div class="group-info">
|
|
<span class="group-name">摄影爱好者交流群</span>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="group-item" onclick="openGroup('篮球约战队')">
|
|
<div class="group-avatar-wrap">
|
|
<div class="group-avatar group-gradient-4">
|
|
<div class="group-avatar-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="9"></circle>
|
|
<path d="M12 3v18"></path>
|
|
<path d="M3 12h18"></path>
|
|
<path d="M5.5 5.5c3 3 10 3 13 0"></path>
|
|
<path d="M5.5 18.5c3-3 10-3 13 0"></path>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="group-info">
|
|
<span class="group-name">篮球约战队</span>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 全部群聊 -->
|
|
<div class="all-friends-header">
|
|
<span>全部群聊</span>
|
|
<span class="count">24个</span>
|
|
</div>
|
|
|
|
<div class="group-list">
|
|
<div class="group-item" onclick="openGroup('清华大学桌游社')" style="padding: 12px 16px; border-bottom: 1px solid var(--youth-border-light);">
|
|
<div class="group-avatar-wrap">
|
|
<div class="group-avatar group-gradient-3 multi">
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.3);">张</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.25);">刘</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.2);">赵</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.15);">王</div>
|
|
</div>
|
|
</div>
|
|
<div class="group-info"><span class="group-name">清华大学桌游社</span></div>
|
|
</div>
|
|
<div class="group-item" onclick="openGroup('考研互助群')" style="padding: 12px 16px; border-bottom: 1px solid var(--youth-border-light);">
|
|
<div class="group-avatar-wrap">
|
|
<div class="group-avatar group-gradient-5">
|
|
<div class="group-avatar-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
|
|
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="group-info"><span class="group-name">考研互助群</span></div>
|
|
</div>
|
|
<div class="group-item" onclick="openGroup('旅行搭子群')" style="padding: 12px 16px; border-bottom: 1px solid var(--youth-border-light);">
|
|
<div class="group-avatar-wrap">
|
|
<div class="group-avatar group-gradient-6">
|
|
<div class="group-avatar-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z"></path>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="group-info"><span class="group-name">旅行搭子群</span></div>
|
|
</div>
|
|
<div class="group-item" onclick="openGroup('计算机系2023级')" style="padding: 12px 16px; border-bottom: 1px solid var(--youth-border-light);">
|
|
<div class="group-avatar-wrap">
|
|
<div class="group-avatar group-gradient-7 multi">
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.3);">陈</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.25);">刘</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.2);">周</div>
|
|
<div class="mini-avatar" style="background: rgba(255,255,255,0.15);">吴</div>
|
|
</div>
|
|
</div>
|
|
<div class="group-info"><span class="group-name">计算机系2023级</span></div>
|
|
</div>
|
|
<div class="group-item" onclick="openGroup('食堂拼单群')" style="padding: 12px 16px;">
|
|
<div class="group-avatar-wrap">
|
|
<div class="group-avatar group-gradient-2">
|
|
<div class="group-avatar-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2"></path>
|
|
<path d="M7 2v20"></path>
|
|
<path d="M21 15V2v0a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3zm0 0v7"></path>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="group-info"><span class="group-name">食堂拼单群</span></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 底部导航栏 -->
|
|
|
|
</div>
|
|
|
|
<script>
|
|
// Tab切换
|
|
function switchTab(tabName) {
|
|
// 切换tab按钮状态
|
|
const tabItems = document.querySelectorAll('.tab-item');
|
|
tabItems.forEach(function(item) {
|
|
if (item.dataset.tab === tabName) {
|
|
item.classList.add('active');
|
|
} else {
|
|
item.classList.remove('active');
|
|
}
|
|
});
|
|
|
|
// 切换内容显示
|
|
const contents = document.querySelectorAll('.tab-content');
|
|
contents.forEach(function(content) {
|
|
content.classList.remove('active');
|
|
});
|
|
document.getElementById(tabName + '-content').classList.add('active');
|
|
}
|
|
|
|
// 分组展开/折叠
|
|
function toggleGroup(headerEl) {
|
|
const body = headerEl.nextElementSibling;
|
|
const isCollapsed = headerEl.classList.contains('collapsed');
|
|
|
|
if (isCollapsed) {
|
|
// 展开
|
|
headerEl.classList.remove('collapsed');
|
|
body.classList.remove('collapsed');
|
|
body.style.maxHeight = body.scrollHeight + 'px';
|
|
// 动画完成后清除maxHeight以便内容自适应
|
|
setTimeout(function() {
|
|
if (!body.classList.contains('collapsed')) {
|
|
body.style.maxHeight = 'none';
|
|
}
|
|
}, 300);
|
|
} else {
|
|
// 折叠
|
|
body.style.maxHeight = body.scrollHeight + 'px';
|
|
// 强制重排
|
|
body.offsetHeight;
|
|
headerEl.classList.add('collapsed');
|
|
body.classList.add('collapsed');
|
|
body.style.maxHeight = '0';
|
|
}
|
|
}
|
|
|
|
// 初始化分组高度
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const bodies = document.querySelectorAll('.group-body:not(.collapsed)');
|
|
bodies.forEach(function(body) {
|
|
body.style.maxHeight = 'none';
|
|
});
|
|
});
|
|
|
|
// 返回
|
|
function goBack() {
|
|
window.history.back();
|
|
}
|
|
|
|
// 添加好友
|
|
function addFriend() {
|
|
window.location.href = 'add-friend.html';
|
|
}
|
|
|
|
// 打开好友资料
|
|
function openFriend(name) {
|
|
console.log('打开好友资料:', name);
|
|
// window.location.href = 'user-profile.html?name=' + encodeURIComponent(name);
|
|
}
|
|
|
|
// 打开群聊
|
|
function openGroup(name) {
|
|
console.log('打开群聊:', name);
|
|
// window.location.href = 'group-chat.html?name=' + encodeURIComponent(name);
|
|
}
|
|
|
|
// 底部导航切换
|
|
function switchBottomNav(tab) {
|
|
const navItems = document.querySelectorAll('.bottom-nav-item');
|
|
navItems.forEach(function(item) {
|
|
item.classList.remove('active');
|
|
});
|
|
|
|
const target = document.querySelector('.bottom-nav-item[data-tab="' + tab + '"]');
|
|
if (target && !target.classList.contains('publish-btn')) {
|
|
target.classList.add('active');
|
|
}
|
|
|
|
// 实际跳转逻辑
|
|
// const pageMap = {
|
|
// 'home': 'home.html',
|
|
// 'discover': 'discover.html',
|
|
// 'publish': 'publish-select.html',
|
|
// 'message': 'message-list.html',
|
|
// 'profile': 'profile-home.html'
|
|
// };
|
|
// if (pageMap[tab]) {
|
|
// window.location.href = pageMap[tab];
|
|
// }
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|