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.
1318 lines
50 KiB
1318 lines
50 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>
|
|
* {
|
|
-webkit-tap-highlight-color: transparent;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
: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);
|
|
|
|
}
|
|
|
|
|
|
body {
|
|
font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
background: var(--youth-bg-page);
|
|
color: var(--youth-text-primary);
|
|
margin: 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
overflow-x: hidden;}
|
|
|
|
/* 页面容器 - 固定812px高度 */
|
|
.app-container {
|
|
width: 375px;
|
|
height: 812px;
|
|
margin: 0 auto;
|
|
position: relative;
|
|
overflow: hidden;
|
|
background: var(--youth-bg-page);
|
|
}
|
|
|
|
/* 主页面布局flex */
|
|
.page-layout {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
}
|
|
|
|
/* 状态栏 */
|
|
.status-bar {
|
|
height: 44px;
|
|
display: flex;
|
|
align-items: flex-end;
|
|
justify-content: space-between;
|
|
padding: 0 24px 8px;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
flex-shrink: 0;
|
|
z-index: 50;
|
|
position: relative;
|
|
padding-bottom: 6px;
|
|
}
|
|
|
|
.status-bar .right-icons {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
/* 顶部导航栏 - 毛玻璃 */
|
|
.top-nav {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 8px 12px;
|
|
background: var(--youth-bg-glass);
|
|
backdrop-filter: blur(20px) saturate(180%);
|
|
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
|
border-bottom: 1px solid var(--youth-glass-border);
|
|
position: relative;
|
|
z-index: 40;
|
|
}
|
|
|
|
.nav-btn {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--youth-gradient-matte-light);
|
|
box-shadow:
|
|
0 2px 6px rgba(0, 0, 0, 0.06),
|
|
inset 0 1px 2px rgba(255, 255, 255, 0.8);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.nav-btn:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.nav-btn-icon {
|
|
width: 18px;
|
|
height: 18px;
|
|
color: var(--youth-text-primary);
|
|
}
|
|
|
|
.nav-center {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 2px;
|
|
position: absolute;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
top: 50%;
|
|
margin-top: -18px;
|
|
}
|
|
|
|
.nav-group-name {
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.nav-group-meta {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 11px;
|
|
color: var(--youth-text-tertiary);
|
|
}
|
|
|
|
.nav-group-meta .online-dot {
|
|
width: 5px;
|
|
height: 5px;
|
|
border-radius: 50%;
|
|
background: var(--youth-primary);
|
|
box-shadow: 0 0 3px rgba(38, 194, 187, 0.6);
|
|
}
|
|
|
|
.nav-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
/* 群设置按钮 - 多人图标立体浮雕 */
|
|
.group-settings-btn {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--youth-gradient-primary);
|
|
box-shadow:
|
|
0 2px 8px rgba(38, 194, 187, 0.35),
|
|
inset 0 1px 2px rgba(255, 255, 255, 0.4);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.group-settings-btn:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.group-settings-btn svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
color: white;
|
|
}
|
|
|
|
/* 群公告横幅 */
|
|
.group-notice {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 12px;
|
|
background: linear-gradient(135deg, var(--youth-teal-50) 0%, var(--youth-teal-100) 100%);
|
|
border-bottom: 1px solid var(--youth-teal-200);
|
|
position: relative;
|
|
z-index: 35;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.group-notice:active {
|
|
opacity: 0.85;
|
|
}
|
|
|
|
.group-notice.collapsed {
|
|
display: none;
|
|
}
|
|
|
|
.notice-icon {
|
|
width: 28px;
|
|
height: 28px;
|
|
border-radius: 50%;
|
|
background: var(--youth-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
box-shadow: 0 2px 6px rgba(38, 194, 187, 0.3);
|
|
}
|
|
|
|
.notice-icon svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
color: white;
|
|
}
|
|
|
|
.notice-text {
|
|
flex: 1;
|
|
font-size: 12px;
|
|
color: var(--youth-teal-800);
|
|
line-height: 1.4;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.notice-link {
|
|
font-size: 12px;
|
|
color: var(--youth-primary);
|
|
font-weight: 500;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.notice-close {
|
|
width: 20px;
|
|
height: 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--youth-teal-600);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* 聊天消息区 */
|
|
.chat-area {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
padding: 12px 12px 16px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
|
|
.chat-area::-webkit-scrollbar {
|
|
width: 0;
|
|
display: none;
|
|
}
|
|
|
|
/* 系统消息 */
|
|
.system-msg {
|
|
align-self: center;
|
|
padding: 4px 12px;
|
|
background: var(--youth-gray-200);
|
|
border-radius: 12px;
|
|
font-size: 11px;
|
|
color: var(--youth-text-tertiary);
|
|
max-width: 80%;
|
|
text-align: center;
|
|
}
|
|
|
|
/* 时间分隔 */
|
|
.time-divider {
|
|
align-self: center;
|
|
padding: 4px 12px;
|
|
background: var(--youth-gray-200);
|
|
border-radius: 12px;
|
|
font-size: 11px;
|
|
color: var(--youth-text-tertiary);
|
|
margin: 2px 0;
|
|
}
|
|
|
|
/* 消息气泡 - 对方(左)群聊模式 */
|
|
.msg-received {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 8px;
|
|
max-width: 78%;
|
|
align-self: flex-start;
|
|
}
|
|
|
|
.msg-avatar {
|
|
width: 34px;
|
|
height: 34px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: white;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
flex-shrink: 0;
|
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.msg-avatar.avatar-teal {
|
|
background: linear-gradient(135deg, #3FCFCA 0%, #26C2BB 100%);
|
|
}
|
|
|
|
.msg-avatar.avatar-orange {
|
|
background: linear-gradient(135deg, #FFB96B 0%, #FF9F45 100%);
|
|
}
|
|
|
|
.msg-avatar.avatar-purple {
|
|
background: linear-gradient(135deg, #9B8DFF 0%, #7B61FF 100%);
|
|
}
|
|
|
|
.msg-avatar.avatar-pink {
|
|
background: linear-gradient(135deg, #FF8AAE 0%, #FF6B9D 100%);
|
|
}
|
|
|
|
.msg-avatar.avatar-green {
|
|
background: linear-gradient(135deg, #67E188 0%, #34C759 100%);
|
|
}
|
|
|
|
.msg-avatar-self {
|
|
background: linear-gradient(135deg, #FFB96B 0%, #FF9F45 100%);
|
|
box-shadow: 0 2px 6px rgba(255, 159, 69, 0.3);
|
|
}
|
|
|
|
.msg-content-wrap {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.msg-sender-name {
|
|
font-size: 11px;
|
|
color: var(--youth-text-tertiary);
|
|
margin-left: 2px;
|
|
}
|
|
|
|
.msg-bubble-received {
|
|
background: var(--youth-bg-card);
|
|
border-radius: 16px;
|
|
border-bottom-left-radius: 4px;
|
|
padding: 10px 14px;
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
color: var(--youth-text-primary);
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
|
position: relative;
|
|
word-break: break-word;
|
|
}
|
|
|
|
/* 消息气泡 - 我方(右) */
|
|
.msg-sent {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 8px;
|
|
max-width: 78%;
|
|
align-self: flex-end;
|
|
flex-direction: row-reverse;
|
|
}
|
|
|
|
.msg-bubble-sent {
|
|
background: var(--youth-gradient-primary);
|
|
border-radius: 16px;
|
|
border-bottom-right-radius: 4px;
|
|
padding: 10px 14px;
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
color: white;
|
|
box-shadow: 0 2px 10px rgba(38, 194, 187, 0.3);
|
|
position: relative;
|
|
word-break: break-word;
|
|
}
|
|
|
|
/* 消息图片 */
|
|
.msg-image {
|
|
width: 140px;
|
|
height: 100px;
|
|
border-radius: 10px;
|
|
object-fit: cover;
|
|
display: block;
|
|
}
|
|
|
|
.msg-bubble-received .msg-image {
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.msg-bubble-received.img-bubble {
|
|
padding: 6px 6px 8px;
|
|
}
|
|
|
|
.msg-bubble-received.img-bubble .msg-text {
|
|
padding: 0 6px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
/* 活动卡片消息 */
|
|
.activity-card {
|
|
align-self: center;
|
|
width: 88%;
|
|
background: var(--youth-bg-card);
|
|
border-radius: 12px;
|
|
padding: 12px;
|
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
|
|
border: 1px solid var(--youth-border-light);
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.activity-card:active {
|
|
transform: scale(0.98);
|
|
}
|
|
|
|
.activity-card-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.activity-card-icon {
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 12px;
|
|
background: linear-gradient(135deg, #FFB96B 0%, #FF9F45 100%);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.activity-card-icon svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
color: white;
|
|
}
|
|
|
|
.activity-card-label {
|
|
font-size: 11px;
|
|
color: var(--youth-text-tertiary);
|
|
}
|
|
|
|
.activity-card-title {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
margin-bottom: 6px;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.activity-card-info {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.activity-info-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 12px;
|
|
color: var(--youth-text-secondary);
|
|
}
|
|
|
|
.activity-info-row svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
color: var(--youth-text-tertiary);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.activity-card-btn {
|
|
width: 100%;
|
|
height: 32px;
|
|
border-radius: 12px;
|
|
background: var(--youth-gradient-primary);
|
|
color: white;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 4px;
|
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
.activity-card-btn svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
/* 底部输入栏 - 毛玻璃 */
|
|
.input-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 10px 12px;
|
|
background: var(--youth-bg-glass);
|
|
backdrop-filter: blur(20px) saturate(180%);
|
|
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
|
border-top: 1px solid var(--youth-glass-border);
|
|
position: relative;
|
|
z-index: 30;
|
|
}
|
|
|
|
.input-btn {
|
|
width: 36px;
|
|
height: 44px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--youth-gradient-matte-light);
|
|
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
flex-shrink: 0;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.input-btn:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.input-btn-icon {
|
|
width: 18px;
|
|
height: 18px;
|
|
color: var(--youth-text-secondary);
|
|
}
|
|
|
|
.input-field-wrap {
|
|
flex: 1;
|
|
position: relative;
|
|
}
|
|
|
|
.input-field {
|
|
width: 100%;
|
|
height: 44px;
|
|
border: none;
|
|
outline: none;
|
|
border-radius: 8px;
|
|
padding: 0 14px;
|
|
font-size: 14px;
|
|
background: var(--youth-bg-input);
|
|
color: var(--youth-text-primary);
|
|
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.input-field:focus {
|
|
box-shadow: inset 0 1px 3px rgba(38, 194, 187, 0.06), 0 0 0 3px rgba(38, 194, 187, 0.1);
|
|
}
|
|
|
|
.input-field::placeholder {
|
|
color: var(--youth-text-placeholder);
|
|
}
|
|
|
|
.send-btn {
|
|
width: 36px;
|
|
height: 44px;
|
|
border-radius: 50%;
|
|
background: var(--youth-gradient-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.35);
|
|
flex-shrink: 0;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.send-btn:active {
|
|
transform: scale(0.95);
|
|
box-shadow: 0 1px 4px rgba(38, 194, 187, 0.3);
|
|
}
|
|
|
|
.send-btn.hidden {
|
|
display: none;
|
|
}
|
|
|
|
.send-btn-icon {
|
|
width: 16px;
|
|
height: 16px;
|
|
color: white;
|
|
}
|
|
|
|
/* 更多功能面板 - 2行4列 */
|
|
.more-panel {
|
|
position: absolute;
|
|
bottom: -280px;
|
|
left: 0;
|
|
right: 0;
|
|
background: var(--youth-bg-glass-strong);
|
|
backdrop-filter: blur(40px) saturate(180%);
|
|
-webkit-backdrop-filter: blur(40px) saturate(180%);
|
|
border-top-left-radius: 20px;
|
|
border-top-right-radius: 20px;
|
|
border-top: 1px solid var(--youth-glass-border);
|
|
padding: 16px 12px 28px;
|
|
z-index: 35;
|
|
transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.more-panel.open {
|
|
bottom: 0;
|
|
}
|
|
|
|
.more-panel-handle {
|
|
width: 36px;
|
|
height: 4px;
|
|
background: var(--youth-gray-300);
|
|
border-radius: 2px;
|
|
margin: 0 auto 14px;
|
|
}
|
|
|
|
.more-panel-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, 1fr);
|
|
gap: 14px 10px;
|
|
}
|
|
|
|
.more-panel-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 6px;
|
|
cursor: pointer;
|
|
transition: transform 0.2s ease;
|
|
}
|
|
|
|
.more-panel-item:active {
|
|
transform: scale(0.92);
|
|
}
|
|
|
|
.more-panel-icon {
|
|
width: 50px;
|
|
height: 50px;
|
|
border-radius: 14px;
|
|
background: var(--youth-gradient-matte-light);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
box-shadow:
|
|
0 4px 12px rgba(0, 0, 0, 0.06),
|
|
inset 0 1px 2px rgba(255, 255, 255, 0.8),
|
|
inset 0 -1px 2px rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
.more-panel-icon svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
}
|
|
|
|
.more-panel-label {
|
|
font-size: 11px;
|
|
color: var(--youth-text-secondary);
|
|
}
|
|
|
|
/* 表情面板 */
|
|
.emoji-panel {
|
|
position: absolute;
|
|
bottom: -260px;
|
|
left: 0;
|
|
right: 0;
|
|
background: var(--youth-bg-glass-strong);
|
|
backdrop-filter: blur(40px) saturate(180%);
|
|
-webkit-backdrop-filter: blur(40px) saturate(180%);
|
|
border-top-left-radius: 20px;
|
|
border-top-right-radius: 20px;
|
|
border-top: 1px solid var(--youth-glass-border);
|
|
padding: 12px 12px 28px;
|
|
z-index: 35;
|
|
transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.emoji-panel.open {
|
|
bottom: 0;
|
|
}
|
|
|
|
.emoji-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(8, 1fr);
|
|
gap: 4px;
|
|
}
|
|
|
|
.emoji-item {
|
|
width: 100%;
|
|
aspect-ratio: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 24px;
|
|
cursor: pointer;
|
|
border-radius: 8px;
|
|
transition: background 0.15s ease, transform 0.1s ease;
|
|
}
|
|
|
|
.emoji-item:active {
|
|
background: rgba(38, 194, 187, 0.12);
|
|
transform: scale(0.92);
|
|
}
|
|
|
|
|
|
/* 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">
|
|
<div class="page-layout">
|
|
<!-- 状态栏 -->
|
|
<div class="status-bar">
|
|
<span>9:41</span>
|
|
<div class="right-icons">
|
|
<svg width="16" height="11" viewBox="0 0 16 11" fill="currentColor">
|
|
<path d="M1 7.5a1 1 0 0 1 1.414-.008l.094.094L4 9.086V6a1 1 0 0 1 .883-.993L5 5h2a1 1 0 0 1 .993.883L8 6v3.086l1.49-1.49a1 1 0 0 1 1.32-.083l.094.083a1 1 0 0 1 .083 1.32l-.083.094-3.182 3.182a1 1 0 0 1-1.414 0L1.008 8.914A1 1 0 0 1 1 7.5Z"/>
|
|
<path d="M12 3a1 1 0 0 1 1.414-.008l.094.094L16 5.586a1 1 0 0 1-1.32 1.497l-.094-.083L14 5.414V11a1 1 0 0 1-1.993.117L12 11V3Z"/>
|
|
</svg>
|
|
<svg width="15" height="11" viewBox="0 0 15 11" fill="currentColor">
|
|
<path d="M7.5 1.5c2.3 0 4.4.85 6 2.28a.5.5 0 0 1 .1.7l-.1.1-1.3 1.3a.5.5 0 0 1-.67.06l-.08-.06a5 5 0 0 0-7.9 0l-.08.06a.5.5 0 0 1-.67 0l-.1-.1L1.4 4.58a.5.5 0 0 1 0-.7C2.6 2.35 4.7 1.5 7.5 1.5Zm0 3.5c1 0 1.9.37 2.6 1a.5.5 0 0 1 .08.7l-.08.08-1.1 1.1a.5.5 0 0 1-.66.06l-.07-.06-.53-.53a.5.5 0 0 0-.64 0l-.53.53a.5.5 0 0 1-.66 0l-.07-.06-1.1-1.1a.5.5 0 0 1 0-.7C5.6 5.37 6.5 5 7.5 5Zm0 2.5c.5 0 .9.2 1.2.5l-.05.06-.7.7a.5.5 0 0 1-.7 0l-.7-.7.05-.06c.3-.3.7-.5 1.2-.5Z"/>
|
|
</svg>
|
|
<svg width="26" height="12" viewBox="0 0 26 12" fill="currentColor">
|
|
<rect x="0.5" y="0.5" width="22" height="11" rx="2.5" stroke="currentColor" fill="none" opacity="0.4"/>
|
|
<rect x="2" y="2" width="18" height="8" rx="1.5"/>
|
|
<rect x="23.5" y="3.5" width="2" height="5" rx="1" fill="currentColor" opacity="0.4"/>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 顶部导航栏 -->
|
|
<div class="top-nav">
|
|
<button class="nav-btn" data-dom-id="btn-back" onclick="goBack()">
|
|
<svg class="nav-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<polyline points="15 18 9 12 15 6"></polyline>
|
|
</svg>
|
|
</button>
|
|
|
|
<div class="nav-center">
|
|
<div class="nav-group-name">
|
|
羽毛球约球群🏸
|
|
</div>
|
|
<div class="nav-group-meta">
|
|
<span>8人</span>
|
|
<span class="online-dot"></span>
|
|
<span>在线3人</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="nav-right">
|
|
<button class="group-settings-btn" data-dom-id="btn-group-settings" onclick="goToChatSettings()">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
<circle cx="9" cy="7" r="4"></circle>
|
|
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
|
|
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 群公告横幅 -->
|
|
<div class="group-notice" data-dom-id="group-notice" id="groupNotice" onclick="viewNotice()">
|
|
<div class="notice-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M3 11l18-5v12L3 14v-3z"></path>
|
|
<path d="M11.6 16.8a3 3 0 1 1-5.8-1.6"></path>
|
|
</svg>
|
|
</div>
|
|
<span class="notice-text">【公告】本周六下午羽毛球活动,报名截止周五晚</span>
|
|
<span class="notice-link">查看</span>
|
|
<button class="notice-close" onclick="event.stopPropagation(); closeNotice()">
|
|
<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="18" y1="6" x2="6" y2="18"></line>
|
|
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 聊天消息区 -->
|
|
<div class="chat-area" id="chatArea">
|
|
<!-- 时间分隔 -->
|
|
<div class="time-divider">今天 14:30</div>
|
|
|
|
<!-- 系统消息:加入群聊 -->
|
|
<div class="system-msg" data-dom-id="msg-system-join">
|
|
陈明轩 加入了群聊
|
|
</div>
|
|
|
|
<!-- 对方消息1 - 林小雨 -->
|
|
<div class="msg-received" data-dom-id="msg-other-1">
|
|
<div class="msg-avatar avatar-teal" onclick="goToUserProfile('林小雨')">林</div>
|
|
<div class="msg-content-wrap">
|
|
<span class="msg-sender-name">林小雨</span>
|
|
<div class="msg-bubble-received">
|
|
周六有人一起打球吗?
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 对方消息2 - 陈明轩 -->
|
|
<div class="msg-received" data-dom-id="msg-other-2">
|
|
<div class="msg-avatar avatar-orange" onclick="goToUserProfile('陈明轩')">陈</div>
|
|
<div class="msg-content-wrap">
|
|
<span class="msg-sender-name">陈明轩</span>
|
|
<div class="msg-bubble-received">
|
|
我报名!几点呀?
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 我方消息 -->
|
|
<div class="msg-sent" data-dom-id="msg-sent-1">
|
|
<div class="msg-avatar msg-avatar-self">我</div>
|
|
<div class="msg-bubble-sent">
|
|
我也来!下午两点怎么样?
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 对方消息3 - 李雷(带图) -->
|
|
<div class="msg-received" data-dom-id="msg-other-3">
|
|
<div class="msg-avatar avatar-purple" onclick="goToUserProfile('李雷')">李</div>
|
|
<div class="msg-content-wrap">
|
|
<span class="msg-sender-name">李雷</span>
|
|
<div class="msg-bubble-received img-bubble">
|
|
<img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDE0MCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxNDAiIGhlaWdodD0iMTAwIiBmaWxsPSIjRTZGOUY4Ii8+CjxjaXJjbGUgY3g9IjEwMCIgY3k9IjI1IiByPSIxNSIgZmlsbD0iI0ZGREk2QyIvPgo8cGF0aCBkPSJNMCA3NUwyNSA0NUw0NSA2MEw3MCAzMEwxNDAgNzVWMTAwSDBWNzVaIiBmaWxsPSIjMzRDNzU5Ii8+CjxwYXRoIGQ9Ik0wIDg1TDIwIDY1TDQwIDc1TDYwIDU1TDgwIDcwTDEwMCA1MEwxNDAgODVWMTAwSDBWODVaIiBmaWxsPSIjMjZDMkJCIi8+CjwhLS0g55m95q+P56CI5a2QgLSDor63plJ/nq5siLS0+CjxlbGxpcHNlIGN4PSI4MCIgY3k9IjgwIiByeD0iMTIiIHJ5PSI1IiBmaWxsPSIjRkZGRkZGIiBvcGFjaXR5PSIwLjgiLz4KPHBhdGggZD0iTTgwIDc1Vjg1IiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4K" alt="羽毛球" class="msg-image">
|
|
<div class="msg-text">我带新球过来~</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 对方消息4 - 王思琪 -->
|
|
<div class="msg-received" data-dom-id="msg-other-4">
|
|
<div class="msg-avatar avatar-pink" onclick="goToUserProfile('王思琪')">王</div>
|
|
<div class="msg-content-wrap">
|
|
<span class="msg-sender-name">王思琪</span>
|
|
<div class="msg-bubble-received">
|
|
报名+1,我带水!
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 活动卡片 -->
|
|
<div class="activity-card" data-dom-id="msg-activity-card" onclick="openActivityDetail()">
|
|
<div class="activity-card-header">
|
|
<div class="activity-card-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<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="activity-card-label">群主发起了一个活动</span>
|
|
</div>
|
|
<div class="activity-card-title">周六羽毛球约球活动</div>
|
|
<div class="activity-card-info">
|
|
<div class="activity-info-row">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
<polyline points="12 6 12 12 16 14"></polyline>
|
|
</svg>
|
|
<span>8月17日(周六)14:00-16:00</span>
|
|
</div>
|
|
<div class="activity-info-row">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path>
|
|
<circle cx="12" cy="10" r="3"></circle>
|
|
</svg>
|
|
<span>学校体育馆羽毛球馆</span>
|
|
</div>
|
|
</div>
|
|
<button class="activity-card-btn">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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>
|
|
报名 / 查看详情
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 底部输入栏 -->
|
|
<div class="input-bar">
|
|
<button class="input-btn" data-dom-id="btn-voice" onclick="toggleVoice()">
|
|
<svg class="input-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path>
|
|
<path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>
|
|
<line x1="12" y1="19" x2="12" y2="23"></line>
|
|
<line x1="8" y1="23" x2="16" y2="23"></line>
|
|
</svg>
|
|
</button>
|
|
|
|
<div class="input-field-wrap">
|
|
<input
|
|
type="text"
|
|
class="input-field"
|
|
data-dom-id="input-message"
|
|
placeholder="说点什么..."
|
|
id="messageInput"
|
|
oninput="handleInput()"
|
|
onfocus="handleInputFocus()"
|
|
onkeydown="handleKeyDown(event)"
|
|
>
|
|
</div>
|
|
|
|
<button class="input-btn" data-dom-id="btn-emoji" onclick="toggleEmojiPanel()">
|
|
<svg class="input-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
<path d="M8 14s1.5 2 4 2 4-2 4-2"></path>
|
|
<line x1="9" y1="9" x2="9.01" y2="9"></line>
|
|
<line x1="15" y1="9" x2="15.01" y2="9"></line>
|
|
</svg>
|
|
</button>
|
|
|
|
<button class="input-btn" data-dom-id="btn-plus" onclick="toggleMorePanel()">
|
|
<svg class="input-btn-icon" 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>
|
|
|
|
<button class="send-btn hidden" data-dom-id="btn-send" onclick="sendMessage()">
|
|
<svg class="send-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<line x1="22" y1="2" x2="11" y2="13"></line>
|
|
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 表情面板 -->
|
|
<div class="emoji-panel" id="emojiPanel">
|
|
<div class="more-panel-handle"></div>
|
|
<div class="emoji-grid" id="emojiGrid">
|
|
<span class="emoji-item" data-emoji="😊">😊</span>
|
|
<span class="emoji-item" data-emoji="😃">😃</span>
|
|
<span class="emoji-item" data-emoji="🥰">🥰</span>
|
|
<span class="emoji-item" data-emoji="😎">😎</span>
|
|
<span class="emoji-item" data-emoji="🤔">🤔</span>
|
|
<span class="emoji-item" data-emoji="😅">😅</span>
|
|
<span class="emoji-item" data-emoji="😭">😭</span>
|
|
<span class="emoji-item" data-emoji="👍">👍</span>
|
|
<span class="emoji-item" data-emoji="❤️">❤️</span>
|
|
<span class="emoji-item" data-emoji="🎉">🎉</span>
|
|
<span class="emoji-item" data-emoji="🔥">🔥</span>
|
|
<span class="emoji-item" data-emoji="✨">✨</span>
|
|
<span class="emoji-item" data-emoji="📷">📷</span>
|
|
<span class="emoji-item" data-emoji="🎨">🎨</span>
|
|
<span class="emoji-item" data-emoji="☕">☕</span>
|
|
<span class="emoji-item" data-emoji="🌸">🌸</span>
|
|
<span class="emoji-item" data-emoji="🍀">🍀</span>
|
|
<span class="emoji-item" data-emoji="🌙">🌙</span>
|
|
<span class="emoji-item" data-emoji="⭐">⭐</span>
|
|
<span class="emoji-item" data-emoji="💪">💪</span>
|
|
<span class="emoji-item" data-emoji="🙏">🙏</span>
|
|
<span class="emoji-item" data-emoji="👋">👋</span>
|
|
<span class="emoji-item" data-emoji="🎯">🎯</span>
|
|
<span class="emoji-item" data-emoji="🚀">🚀</span>
|
|
<span class="emoji-item" data-emoji="😘">😘</span>
|
|
<span class="emoji-item" data-emoji="🤣">🤣</span>
|
|
<span class="emoji-item" data-emoji="😴">😴</span>
|
|
<span class="emoji-item" data-emoji="🤗">🤗</span>
|
|
<span class="emoji-item" data-emoji="😏">😏</span>
|
|
<span class="emoji-item" data-emoji="🙈">🙈</span>
|
|
<span class="emoji-item" data-emoji="💔">💔</span>
|
|
<span class="emoji-item" data-emoji="🎂">🎂</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 更多功能面板 - 2行4列 -->
|
|
<div class="more-panel" data-dom-id="more-panel" id="morePanel">
|
|
<div class="more-panel-handle"></div>
|
|
<div class="more-panel-grid">
|
|
<div class="more-panel-item" data-dom-id="btn-album" onclick="openAlbum()">
|
|
<div class="more-panel-icon" style="color: #FF9F45;">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<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>
|
|
<span class="more-panel-label">相册</span>
|
|
</div>
|
|
<div class="more-panel-item" data-dom-id="btn-camera" onclick="openCamera()">
|
|
<div class="more-panel-icon" style="color: #7B61FF;">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path>
|
|
<circle cx="12" cy="13" r="4"></circle>
|
|
</svg>
|
|
</div>
|
|
<span class="more-panel-label">相机</span>
|
|
</div>
|
|
<div class="more-panel-item" data-dom-id="btn-location" onclick="shareLocation()">
|
|
<div class="more-panel-icon" style="color: #34C759;">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path>
|
|
<circle cx="12" cy="10" r="3"></circle>
|
|
</svg>
|
|
</div>
|
|
<span class="more-panel-label">位置</span>
|
|
</div>
|
|
<div class="more-panel-item" onclick="sendFile()">
|
|
<div class="more-panel-icon" style="color: #26C2BB;">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path>
|
|
<polyline points="13 2 13 9 20 9"></polyline>
|
|
</svg>
|
|
</div>
|
|
<span class="more-panel-label">文件</span>
|
|
</div>
|
|
<div class="more-panel-item" data-dom-id="btn-group-activity" onclick="openGroupActivity()">
|
|
<div class="more-panel-icon" style="color: #FF9F45;">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<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="more-panel-label">群活动</span>
|
|
</div>
|
|
<div class="more-panel-item" data-dom-id="btn-group-vote" onclick="openGroupVote()">
|
|
<div class="more-panel-icon" style="color: #7B61FF;">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<polyline points="9 11 12 14 22 4"></polyline>
|
|
<path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path>
|
|
</svg>
|
|
</div>
|
|
<span class="more-panel-label">群投票</span>
|
|
</div>
|
|
<div class="more-panel-item" onclick="sendRedPacket()">
|
|
<div class="more-panel-icon" style="color: #FF3B30;">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M20 12V8H6a2 2 0 0 1-2-2c0-1.1.9-2 2-2h12v4"></path>
|
|
<path d="M4 6v12c0 1.1.9 2 2 2h14v-4"></path>
|
|
<path d="M18 12a2 2 0 0 0 0 4h4v-4z"></path>
|
|
</svg>
|
|
</div>
|
|
<span class="more-panel-label">红包</span>
|
|
</div>
|
|
<div class="more-panel-item" onclick="startVoiceCall()">
|
|
<div class="more-panel-icon" style="color: #FF6B9D;">
|
|
<svg 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 class="more-panel-label">语音通话</span>
|
|
</div>
|
|
</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>`;
|
|
}
|
|
}
|
|
|
|
// 初始化主题
|
|
}
|
|
} catch (e) {}
|
|
})();
|
|
|
|
// 返回按钮
|
|
function goBack() {
|
|
window.location.href = 'message-list.html';
|
|
}
|
|
|
|
// 跳转群设置
|
|
function goToChatSettings() {
|
|
window.location.href = 'chat-settings.html';
|
|
}
|
|
|
|
// 跳转用户资料
|
|
function goToUserProfile(name) {
|
|
window.location.href = 'user-profile.html';
|
|
}
|
|
|
|
// 查看群公告
|
|
function viewNotice() {
|
|
console.log('查看群公告详情');
|
|
}
|
|
|
|
// 关闭群公告
|
|
function closeNotice() {
|
|
const notice = document.getElementById('groupNotice');
|
|
notice.classList.add('collapsed');
|
|
}
|
|
|
|
// 语音按钮切换
|
|
function toggleVoice() {
|
|
console.log('切换语音输入');
|
|
}
|
|
|
|
// 切换更多功能面板
|
|
function toggleMorePanel() {
|
|
const panel = document.getElementById('morePanel');
|
|
const emojiPanel = document.getElementById('emojiPanel');
|
|
|
|
if (panel.classList.contains('open')) {
|
|
panel.classList.remove('open');
|
|
} else {
|
|
emojiPanel.classList.remove('open');
|
|
panel.classList.add('open');
|
|
}
|
|
}
|
|
|
|
// 切换表情面板
|
|
function toggleEmojiPanel() {
|
|
const panel = document.getElementById('emojiPanel');
|
|
const morePanel = document.getElementById('morePanel');
|
|
|
|
if (panel.classList.contains('open')) {
|
|
panel.classList.remove('open');
|
|
} else {
|
|
morePanel.classList.remove('open');
|
|
panel.classList.add('open');
|
|
}
|
|
}
|
|
|
|
// 插入表情
|
|
function insertEmoji(emoji) {
|
|
const input = document.getElementById('messageInput');
|
|
input.value += emoji;
|
|
handleInput();
|
|
input.focus();
|
|
}
|
|
|
|
// 表情面板事件委托
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
var emojiGrid = document.getElementById('emojiGrid');
|
|
if (emojiGrid) {
|
|
emojiGrid.addEventListener('click', function(e) {
|
|
var item = e.target.closest('.emoji-item');
|
|
if (item && item.dataset.emoji) {
|
|
insertEmoji(item.dataset.emoji);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
// 输入框处理
|
|
function handleInput() {
|
|
const input = document.getElementById('messageInput');
|
|
const sendBtn = document.querySelector('[data-dom-id="btn-send"]');
|
|
const plusBtn = document.querySelector('[data-dom-id="btn-plus"]');
|
|
|
|
if (input.value.trim().length > 0) {
|
|
sendBtn.classList.remove('hidden');
|
|
plusBtn.style.display = 'none';
|
|
} else {
|
|
sendBtn.classList.add('hidden');
|
|
plusBtn.style.display = 'flex';
|
|
}
|
|
}
|
|
|
|
// 输入框聚焦
|
|
function handleInputFocus() {
|
|
const morePanel = document.getElementById('morePanel');
|
|
const emojiPanel = document.getElementById('emojiPanel');
|
|
morePanel.classList.remove('open');
|
|
emojiPanel.classList.remove('open');
|
|
|
|
setTimeout(() => {
|
|
const chatArea = document.getElementById('chatArea');
|
|
chatArea.scrollTop = chatArea.scrollHeight;
|
|
}, 100);
|
|
}
|
|
|
|
// 键盘事件
|
|
function handleKeyDown(event) {
|
|
if (event.key === 'Enter') {
|
|
sendMessage();
|
|
}
|
|
}
|
|
|
|
// 发送消息
|
|
function sendMessage() {
|
|
const input = document.getElementById('messageInput');
|
|
const text = input.value.trim();
|
|
|
|
if (!text) return;
|
|
|
|
const chatArea = document.getElementById('chatArea');
|
|
|
|
const msgDiv = document.createElement('div');
|
|
msgDiv.className = 'msg-sent';
|
|
msgDiv.innerHTML = `
|
|
<div class="msg-avatar msg-avatar-self">我</div>
|
|
<div class="msg-bubble-sent">
|
|
${escapeHtml(text)}
|
|
</div>
|
|
`;
|
|
|
|
chatArea.appendChild(msgDiv);
|
|
|
|
input.value = '';
|
|
handleInput();
|
|
|
|
chatArea.scrollTop = chatArea.scrollHeight;
|
|
}
|
|
|
|
// HTML转义
|
|
function escapeHtml(text) {
|
|
const div = document.createElement('div');
|
|
div.appendChild(document.createTextNode(text));
|
|
return div.innerHTML;
|
|
}
|
|
|
|
// 更多功能面板按钮
|
|
function openAlbum() {
|
|
console.log('打开相册');
|
|
}
|
|
|
|
function openCamera() {
|
|
console.log('打开相机');
|
|
}
|
|
|
|
function shareLocation() {
|
|
console.log('分享位置');
|
|
}
|
|
|
|
function sendFile() {
|
|
console.log('发送文件');
|
|
}
|
|
|
|
function openGroupActivity() {
|
|
console.log('群活动');
|
|
window.location.href = 'activity-list.html';
|
|
}
|
|
|
|
function openGroupVote() {
|
|
console.log('群投票');
|
|
}
|
|
|
|
function sendRedPacket() {
|
|
console.log('发红包');
|
|
}
|
|
|
|
function startVoiceCall() {
|
|
console.log('开始语音通话');
|
|
}
|
|
|
|
// 活动卡片点击
|
|
function openActivityDetail() {
|
|
console.log('打开活动详情');
|
|
window.location.href = 'activity-list.html';
|
|
}
|
|
|
|
// 点击聊天区域关闭面板
|
|
document.getElementById('chatArea').addEventListener('click', function() {
|
|
document.getElementById('morePanel').classList.remove('open');
|
|
document.getElementById('emojiPanel').classList.remove('open');
|
|
});
|
|
|
|
// 初始化滚动到底部
|
|
window.addEventListener('load', function() {
|
|
const chatArea = document.getElementById('chatArea');
|
|
chatArea.scrollTop = chatArea.scrollHeight;
|
|
});</script>
|
|
</body>
|
|
</html>
|
|
|