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.
 
 
 
 

1111 lines
35 KiB

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>消息通知 - 青核 Youthome</title>
<link rel="stylesheet" href="../css/design-system.css">
<style>
/* ===== App容器 ===== */
.app {
width: 1920px
max-width: 100%;;
height: 1080px;
margin: 0 auto;
display: flex;
position: relative;
overflow: hidden;
background: var(--bg-page);
}
/* ===== 左侧固定侧边栏 ===== */
.sidebar {
width: var(--sidebar-width);
height: 100%;
background: var(--bg-sidebar);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
flex-shrink: 0;
position: relative;
z-index: 20;
}
.sidebar-logo {
padding: 24px 20px 20px;
display: flex;
align-items: center;
gap: 10px;
border-bottom: 1px solid var(--border-light);
cursor: pointer;
flex-shrink: 0;
}
.sidebar-logo-icon {
width: 36px;
height: 36px;
border-radius: 10px;
background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 16px;
font-weight: 700;
flex-shrink: 0;
box-shadow: 0 4px 12px rgba(23, 176, 207, 0.25);
}
.sidebar-logo-text { display: flex; flex-direction: column; gap: 1px; }
.sidebar-logo-text .main { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.sidebar-logo-text .sub { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.sidebar-nav {
flex: 1;
padding: 16px 12px 24px 12px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.nav-section-title {
font-size: 11px;
font-weight: 600;
color: var(--text-tertiary);
padding: 12px 12px 8px;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.nav-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
color: var(--text-secondary);
cursor: pointer;
transition: all var(--transition-fast);
user-select: none;
}
.nav-item:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.nav-item.active {
background: var(--primary-bg);
color: var(--primary);
font-weight: 600;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer {
padding: 16px;
border-top: 1px solid var(--border-light);
flex-shrink: 0;
}
.sidebar-user {
display: flex;
align-items: center;
gap: 10px;
padding: 10px;
border-radius: 10px;
cursor: pointer;
transition: background var(--transition-fast);
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
flex-shrink: 0;
overflow: hidden;
}
.sidebar-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
font-size: 13px;
font-weight: 600;
color: var(--text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sidebar-user-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
/* ===== 右侧主区域 ===== */
.main-area {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
position: relative;
}
/* ===== 顶部操作栏 ===== */
.top-bar {
height: var(--topbar-height);
background: var(--bg-card);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32px;
flex-shrink: 0;
position: relative;
z-index: 15;
}
.top-bar-left {
display: flex;
align-items: center;
}
.page-title-bar {
font-size: 18px;
font-weight: 700;
color: var(--text-primary);
}
.top-bar-right {
display: flex;
align-items: center;
gap: 16px;
}
.search-wrapper { width: 320px; position: relative; }
.search-input {
width: 100%;
height: 40px;
padding: 0 16px 0 42px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-size: 14px;
color: var(--text-primary);
background: var(--bg-page);
transition: all var(--transition-fast);
outline: none;
font-family: inherit;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}
.search-input:focus {
border-color: var(--primary);
background: var(--bg-card);
box-shadow: 0 0 0 3px rgba(23, 176, 207, 0.12);
}
.search-input::placeholder { color: var(--text-placeholder); }
.search-icon {
position: absolute;
left: 14px;
top: 50%;
transform: translateY(-50%);
width: 18px;
height: 18px;
color: var(--text-tertiary);
pointer-events: none;
}
.mark-all-read-btn {
height: 40px;
padding: 0 18px;
border-radius: var(--radius-sm);
background: var(--bg-card);
border: 1px solid var(--border);
font-size: 14px;
font-weight: 500;
color: var(--text-secondary);
cursor: pointer;
transition: all var(--transition-fast);
display: inline-flex;
align-items: center;
gap: 6px;
}
.mark-all-read-btn:hover {
border-color: var(--primary);
color: var(--primary);
}
.mark-all-read-btn svg { width: 16px; height: 16px; }
/* ===== 主内容区 ===== */
.content-area {
flex: 1;
overflow: hidden;
padding: 24px 32px 32px;
position: relative;
display: flex;
gap: 24px;
}
/* ===== 左栏:分类列表 ===== */
.category-panel {
width: 260px;
flex-shrink: 0;
background: var(--bg-card);
border-radius: var(--radius-md);
border: 1px solid var(--border-light);
box-shadow: var(--shadow-card);
overflow: hidden;
display: flex;
flex-direction: column;
}
.category-header {
padding: 18px 20px 14px;
border-bottom: 1px solid var(--border-light);
}
.category-header-title {
font-size: 15px;
font-weight: 600;
color: var(--text-primary);
}
.category-list {
flex: 1;
overflow-y: auto;
padding: 8px 0;
}
.category-list::-webkit-scrollbar { width: 4px; }
.category-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.category-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 20px;
cursor: pointer;
transition: all var(--transition-fast);
position: relative;
border-left: 3px solid transparent;
}
.category-item:hover {
background: var(--bg-hover);
}
.category-item.active {
background: var(--primary-bg);
border-left-color: var(--primary);
}
.category-item.active .category-name {
color: var(--primary);
font-weight: 600;
}
.category-icon {
width: 36px;
height: 36px;
border-radius: 8px;
background: var(--bg-hover);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
color: var(--text-secondary);
transition: all var(--transition-fast);
}
.category-item.active .category-icon {
background: var(--bg-card);
color: var(--primary);
}
.category-icon svg { width: 18px; height: 18px; }
.category-name {
flex: 1;
font-size: 14px;
font-weight: 500;
color: var(--text-secondary);
}
.category-badge {
min-width: 20px;
height: 20px;
padding: 0 6px;
background: var(--error);
color: #fff;
font-size: 11px;
font-weight: 600;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.category-badge.zero {
background: transparent;
color: var(--text-tertiary);
}
/* ===== 右栏:消息列表 ===== */
.message-panel {
flex: 1;
min-width: 0;
background: var(--bg-card);
border-radius: var(--radius-md);
border: 1px solid var(--border-light);
box-shadow: var(--shadow-card);
overflow: hidden;
display: flex;
flex-direction: column;
}
.message-list {
flex: 1;
overflow-y: auto;
}
.message-list::-webkit-scrollbar { width: 6px; }
.message-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.message-list::-webkit-scrollbar-track { background: transparent; }
.message-item {
display: flex;
align-items: flex-start;
gap: 14px;
padding: 18px 24px;
border-bottom: 1px solid var(--border-light);
cursor: pointer;
transition: background var(--transition-fast);
position: relative;
background: var(--bg-card);
}
.message-item:hover {
background: var(--bg-hover);
}
.message-item.unread {
background: #F7FDFC;
}
.message-item.unread:hover {
background: #EFFAF9;
}
.message-dot {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--primary);
flex-shrink: 0;
}
.message-avatar-wrap {
position: relative;
flex-shrink: 0;
}
.message-avatar {
width: 48px;
height: 48px;
border-radius: 50%;
overflow: hidden;
background: linear-gradient(135deg, var(--primary-light), var(--primary));
}
.message-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.message-avatar.system {
display: flex;
align-items: center;
justify-content: center;
color: #fff;
}
.message-avatar.system svg {
width: 24px;
height: 24px;
}
.message-content {
flex: 1;
min-width: 0;
}
.message-top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
}
.message-user {
display: flex;
align-items: center;
gap: 6px;
}
.message-username {
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
}
.message-extra {
font-size: 13px;
color: var(--text-secondary);
}
.message-time {
font-size: 12px;
color: var(--text-tertiary);
flex-shrink: 0;
}
.message-text {
font-size: 13px;
color: var(--text-secondary);
line-height: 1.55;
}
.message-text .highlight {
color: var(--primary);
font-weight: 500;
}
/* 加载更多 */
.load-more {
padding: 16px 24px;
text-align: center;
border-top: 1px solid var(--border-light);
}
.load-more-btn {
font-size: 13px;
color: var(--text-tertiary);
cursor: pointer;
transition: color var(--transition-fast);
display: inline-flex;
align-items: center;
gap: 6px;
}
.load-more-btn:hover {
color: var(--primary);
}
.load-more-btn svg { width: 16px; height: 16px; }
/* SVG stroke统一 */
svg { stroke-linecap: round; stroke-linejoin: round; }
/* ===== 发布按钮 ===== */
.sidebar-publish {
padding: 12px 12px 8px;
flex-shrink: 0;
}
.publish-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
height: 44px;
background: var(--primary);
color: #fff;
border-radius: 12px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: all .2s ease;
box-shadow: 0 4px 12px rgba(23, 176, 207, 0.25);
}
.publish-btn:hover {
opacity: 0.92;
transform: translateY(-1px);
box-shadow: 0 6px 16px rgba(23, 176, 207, 0.35);
}
.publish-btn svg { width: 20px; height: 20px; }
.publish-btn .publish-arrow { width: 16px; height: 16px; opacity: 0.8; transition: transform .2s; }
.publish-btn:hover .publish-arrow { transform: translateY(1px); }
.publish-dropdown {
display: none;
margin-top: 6px;
background: var(--bg-card, #fff);
border: 1px solid var(--border-light, #eee);
border-radius: 12px;
padding: 6px;
box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.sidebar-publish:hover .publish-dropdown { display: block; }
.publish-option {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
border-radius: 8px;
cursor: pointer;
transition: background .15s;
}
.publish-option:hover { background: var(--bg-hover, #f5f5f5); }
.publish-option svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.publish-option-title { font-size: 14px; font-weight: 600; color: var(--text-primary, #1a1a1a); }
.publish-option-desc { font-size: 11px; color: var(--text-tertiary, #999); margin-top: 2px; }
/* ===== 导航项角标 ===== */
.nav-item-label {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
}
.nav-badge {
min-width: 18px;
height: 18px;
padding: 0 5px;
background: #FF4D4F;
color: #fff;
font-size: 11px;
font-weight: 600;
border-radius: 9px;
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
}
/* ===== 底部用户卡片箭头 ===== */
.sidebar-user-arrow {
width: 16px;
height: 16px;
color: var(--text-tertiary, #999);
flex-shrink: 0;
margin-left: auto;
}
</style>
<link rel="stylesheet" href="../css/web-refresh.css?v=20261020-brand-color">
</head>
<body>
<div class="app">
<!-- ===== 左侧固定侧边栏 ===== -->
<aside class="sidebar">
<div class="sidebar-logo" onclick="location.href='feed.html'">
<div class="sidebar-logo-icon">青</div>
<div class="sidebar-logo-text">
<span class="main">青核 Youthome</span>
<span class="sub">校园实名社交</span>
</div>
</div>
<!-- 发布按钮 -->
<div class="sidebar-publish">
<div class="publish-btn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
<span>发布</span>
<svg class="publish-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</div>
<div class="publish-dropdown">
<div class="publish-option" onclick="location.href='publish-post.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
<circle cx="8.5" cy="8.5" r="1.5"></circle>
<polyline points="21 15 16 10 5 21"></polyline>
</svg>
<div class="publish-option-text">
<div class="publish-option-title">发布动态</div>
<div class="publish-option-desc">分享图文、心情</div>
</div>
</div>
<div class="publish-option" onclick="location.href='publish-video.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="23 7 16 12 23 17 23 7"></polygon>
<rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect>
</svg>
<div class="publish-option-text">
<div class="publish-option-title">发布视频</div>
<div class="publish-option-desc">上传短视频</div>
</div>
</div>
<div class="publish-option" onclick="location.href='activity-create.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
<line x1="12" y1="14" x2="12" y2="18"></line>
<line x1="10" y1="16" x2="14" y2="16"></line>
</svg>
<div class="publish-option-text">
<div class="publish-option-title">发起活动</div>
<div class="publish-option-desc">组织线下聚会</div>
</div>
</div>
</div>
</div>
<nav class="sidebar-nav">
<div class="nav-section-title">探索</div>
<div class="nav-item" onclick="location.href='feed.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M19 20H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1m2 13a2 2 0 0 1-2-2V7m2 13a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"></path>
</svg>
动态广场
</div>
<div class="nav-item" onclick="location.href='video.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="23 7 16 12 23 17 23 7"></polygon>
<rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect>
</svg>
视频广场
</div>
<div class="nav-item" onclick="location.href='activities.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
活动组局
</div>
<div class="nav-section-title">我的</div>
<div class="nav-item" onclick="location.href='me.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
个人中心
</div>
<div class="nav-item active" onclick="location.href='notification.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
<path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
</svg>
<div class="nav-item-label">
消息通知
<span class="nav-badge">3</span>
</div>
</div>
<div class="nav-item" onclick="location.href='settings.html'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
设置
</div>
</nav>
<div class="sidebar-footer">
<div class="sidebar-user" onclick="location.href='me.html'">
<div class="sidebar-avatar">
<img src="../assets/avatar-01-female-short-light.jpg" alt="林小夏">
</div>
<div class="sidebar-user-info">
<div class="sidebar-user-name">林小夏</div>
<div class="sidebar-user-desc">复旦大学</div>
</div>
<svg class="sidebar-user-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</aside>
<!-- ===== 右侧主区域 ===== -->
<div class="main-area">
<!-- ===== 顶部操作栏 ===== -->
<header class="top-bar">
<div class="top-bar-left">
<div class="page-title-bar">消息通知</div>
</div>
<div class="top-bar-right">
<div class="search-wrapper">
<svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<path d="m21 21-4.3-4.3"></path>
</svg>
<input type="text" class="search-input" placeholder="搜索消息">
</div>
<button class="mark-all-read-btn" onclick="markAllRead()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>
全部标为已读
</button>
</div>
</header>
<!-- ===== 主内容区 ===== -->
<main class="content-area">
<!-- 左栏:分类列表 -->
<aside class="category-panel">
<div class="category-header">
<div class="category-header-title">消息分类</div>
</div>
<div class="category-list">
<div class="category-item active" onclick="selectCategory(this)">
<div class="category-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
<line x1="3" y1="9" x2="21" y2="9"></line>
<line x1="9" y1="21" x2="9" y2="9"></line>
</svg>
</div>
<span class="category-name">全部</span>
<span class="category-badge">12</span>
</div>
<div class="category-item" onclick="selectCategory(this)">
<div class="category-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
</svg>
</div>
<span class="category-name">点赞</span>
<span class="category-badge">8</span>
</div>
<div class="category-item" onclick="selectCategory(this)">
<div class="category-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
</svg>
</div>
<span class="category-name">评论回复</span>
<span class="category-badge">3</span>
</div>
<div class="category-item" onclick="selectCategory(this)">
<div class="category-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="4"></circle>
<path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"></path>
</svg>
</div>
<span class="category-name">@我的</span>
<span class="category-badge">1</span>
</div>
<div class="category-item" onclick="selectCategory(this)">
<div class="category-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
<line x1="20" y1="8" x2="20" y2="14"></line>
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
</div>
<span class="category-name">新增关注</span>
<span class="category-badge zero">0</span>
</div>
<div class="category-item" onclick="selectCategory(this)">
<div class="category-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
</div>
<span class="category-name">活动提醒</span>
<span class="category-badge zero">0</span>
</div>
<div class="category-item" onclick="selectCategory(this)">
<div class="category-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
</svg>
</div>
<span class="category-name">系统公告</span>
<span class="category-badge zero">0</span>
</div>
</div>
</aside>
<!-- 右栏:消息列表 -->
<section class="message-panel">
<div class="message-list">
<!-- 消息1:点赞类 - 未读 -->
<a class="message-item unread" data-notification-id="like-canteen" data-category="点赞" href="post-detail.html?post=canteen&amp;notice=like-canteen">
<div class="message-dot"></div>
<div class="message-avatar-wrap">
<div class="message-avatar">
<img src="../assets/avatar-02-male-short-medium.jpg" alt="张子轩">
</div>
</div>
<div class="message-content">
<div class="message-top">
<div class="message-user">
<span class="message-username">张子轩</span>
<span class="message-extra">等3人赞了你的动态</span>
</div>
<span class="message-time">2分钟前</span>
</div>
<div class="message-text">
<span class="highlight">「今天食堂的新菜也太好吃了吧!」</span>
</div>
</div>
</a>
<!-- 消息2:评论回复 - 未读 -->
<a class="message-item unread" data-notification-id="comment-canteen" data-category="评论回复" href="post-detail.html?post=canteen&amp;notice=comment-canteen&amp;comment=li-mengqi#comments">
<div class="message-dot"></div>
<div class="message-avatar-wrap">
<div class="message-avatar">
<img src="../assets/avatar-03-female-long-dark.jpg" alt="李梦琪">
</div>
</div>
<div class="message-content">
<div class="message-top">
<div class="message-user">
<span class="message-username">李梦琪</span>
<span class="message-extra">评论了你</span>
</div>
<span class="message-time">15分钟前</span>
</div>
<div class="message-text">“好棒!我也想去~” <span class="highlight">回复于「今天食堂的新菜也太好吃了吧!」</span></div>
</div>
</a>
<!-- 消息3:@我的 - 未读 -->
<a class="message-item unread" data-notification-id="mention-milk-tea" data-category="@我的" href="post-detail.html?post=milk-tea&amp;notice=mention-milk-tea&amp;comment=wang-haoran#comments">
<div class="message-dot"></div>
<div class="message-avatar-wrap">
<div class="message-avatar">
<img src="../assets/avatar-04-male-curly-light.jpg" alt="王浩然">
</div>
</div>
<div class="message-content">
<div class="message-top">
<div class="message-user">
<span class="message-username">王浩然</span>
<span class="message-extra">在评论中@了你</span>
</div>
<span class="message-time">1小时前</span>
</div>
<div class="message-text">
<span class="highlight">@林小夏</span> 你说的那家奶茶店在哪呀?我也想去尝尝
</div>
</div>
</a>
<!-- 消息4:新增关注 - 已读 -->
<a class="message-item" data-notification-id="follow-chen-shiyu" data-category="新增关注" href="user.html?name=%E9%99%88%E8%AF%97%E9%9B%A8&amp;notice=follow-chen-shiyu">
<div class="message-avatar-wrap">
<div class="message-avatar">
<img src="../assets/avatar-05-female-ponytail-medium.jpg" alt="陈诗雨">
</div>
</div>
<div class="message-content">
<div class="message-top">
<div class="message-user">
<span class="message-username">陈诗雨</span>
<span class="message-extra">关注了你</span>
</div>
<span class="message-time">2小时前</span>
</div>
<div class="message-text">
查看陈诗雨的个人主页
</div>
</div>
</a>
<!-- 消息5:活动提醒 - 已读 -->
<a class="message-item" data-notification-id="activity-singer" data-category="活动提醒" href="activity-detail.html">
<div class="message-avatar-wrap">
<div class="message-avatar system">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
</div>
</div>
<div class="message-content">
<div class="message-top">
<div class="message-user">
<span class="message-username">系统通知</span>
<span class="message-extra">活动提醒</span>
</div>
<span class="message-time">昨天</span>
</div>
<div class="message-text">
你关注的 <span class="highlight">「校园十佳歌手大赛」</span> 已开放报名,查看活动时间和地点。
</div>
</div>
</a>
<!-- 消息6:系统公告 - 已读 -->
<a class="message-item" data-notification-id="privacy-settings" data-category="系统公告" href="settings.html?section=privacy">
<div class="message-avatar-wrap">
<div class="message-avatar system" style="background: linear-gradient(135deg, #B5D8FF, #4A90FF);">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
</svg>
</div>
</div>
<div class="message-content">
<div class="message-top">
<div class="message-user">
<span class="message-username">系统通知</span>
<span class="message-extra">系统公告</span>
</div>
<span class="message-time">3天前</span>
</div>
<div class="message-text">
隐私设置已更新:现在可以管理动态可见范围、陌生人私信和在线状态。
</div>
</div>
</a>
</div>
<!-- 加载更多 -->
<div class="load-more">
<div class="load-more-btn" aria-disabled="true">
已显示全部消息
</div>
</div>
</section>
<section class="web-chat-view" hidden>
<div class="web-chat-convs">
<div class="web-chat-convs-head">好友消息</div>
<div class="web-chat-conv-items"></div>
</div>
<div class="web-chat-pane">
<div class="web-chat-pane-head"><span class="web-chat-pane-title">选择一个会话开始聊天</span></div>
<div class="web-chat-msgs"></div>
<div class="web-chat-inputbar">
<textarea class="web-chat-textarea" placeholder="输入消息…"></textarea>
<button class="web-chat-send" type="button">发送</button>
</div>
</div>
</section>
</main>
</div>
</div>
<script>
// 通用函数
function goHome() { location.href = 'feed.html'; }
// 分类切换
function selectCategory(el) {
document.querySelectorAll('.category-item').forEach(item => {
item.classList.remove('active');
});
el.classList.add('active');
}
// 全部标为已读
function markAllRead() {
document.querySelectorAll('.message-item.unread').forEach(item => {
item.classList.remove('unread');
const dot = item.querySelector('.message-dot');
if (dot) dot.remove();
});
// 更新分类未读数字
document.querySelectorAll('.category-badge').forEach(badge => {
if (!badge.classList.contains('zero')) {
badge.textContent = '0';
badge.classList.add('zero');
}
});
showToast('success', '已全部标为已读');
}
// 加载更多
function loadMore() {
showToast('info', '加载更多消息...');
}
// Toast
function showToast(type, message) {
const toast = document.createElement('div');
toast.style.cssText = `
position: fixed;
top: 80px;
right: 32px;
display: flex;
align-items: center;
gap: 10px;
padding: 12px 18px;
background: #fff;
border-radius: 10px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
border: 1px solid #F0F0F0;
border-left: 3px solid ${type === 'success' ? '#52C41A' : type === 'error' ? '#F5222D' : type === 'warning' ? '#FAAD14' : '#17B0CF'};
font-size: 14px;
color: #1F1F1F;
z-index: 9999;
animation: toastIn 0.3s ease;
`;
toast.innerHTML = `<span>${message}</span>`;
document.body.appendChild(toast);
setTimeout(() => {
toast.style.opacity = '0';
toast.style.transform = 'translateX(20px)';
toast.style.transition = 'all 0.3s ease';
setTimeout(() => toast.remove(), 300);
}, 2000);
}
// 添加toast动画样式
const style = document.createElement('style');
style.textContent = `
@keyframes toastIn {
from { opacity: 0; transform: translateX(20px); }
to { opacity: 1; transform: translateX(0); }
}
`;
document.head.appendChild(style);
</script>
<script src="../js/web-local-data.js?v=20261016-local" defer></script>
<script src="../js/web-api.js?v=20261020-api" defer></script>
<script src="../js/web-shell.js?v=20261013-message-links-3" defer></script>
</body>
</html>