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.
 
 

1343 lines
46 KiB

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=375, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>青核 Youthome - 隐私设置</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="../colors_and_type.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
:root {
/* Traework 设计令牌 - 圆角/间距/阴影/高度 */
--radius-xs: 4px;
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-xl: 20px;
--radius-full: 9999px;
--height-btn: 44px;
--height-input: 44px;
--height-nav: 64px;
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
--shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.06);
--shadow-btn: 0 2px 8px rgba(38, 194, 187, 0.25);
--shadow-btn-hover: 0 4px 16px rgba(38, 194, 187, 0.35);
--shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.12);
--shadow-float: 0 4px 24px rgba(0, 0, 0, 0.08);
--shadow-inset: inset 0 1px 3px rgba(0, 0, 0, 0.03);
--glass-bg: rgba(255, 255, 255, 0.72);
--glass-blur: blur(20px);
--glass-border: rgba(255, 255, 255, 0.3);
}
html, body {
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', Roboto, sans-serif;
background: var(--youth-bg-page);
color: var(--youth-text-primary);
min-height: 100vh;
overflow-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: 36px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
font-size: 14px;
font-weight: 600;
color: var(--youth-text-primary);
position: relative;
z-index: 10;
flex-shrink: 0;
}
.status-bar .right-icons {
display: flex;
align-items: center;
gap: 6px;
}
.status-bar svg {
width: 16px;
height: 16px;
}
/* ===== 导航栏 ===== */
.nav-bar {
height: 64px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 16px;
position: relative;
flex-shrink: 0;
}
.nav-btn {
width: 34px;
height: 34px;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--youth-radius-lg);
background: var(--youth-gradient-matte-card);
border: 1px solid var(--youth-border-light);
box-shadow:
0 2px 8px rgba(0, 0, 0, 0.06),
inset 0 1px 0 rgba(255, 255, 255, 0.8);
cursor: pointer;
transition: all 0.2s ease;
color: var(--youth-text-primary);
position: absolute;
left: 16px;
top: 50%;
transform: translateY(-50%);
}
.nav-btn:active {
transform: translateY(-50%) scale(0.95);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}
.nav-title {
font-size: 17px;
font-weight: 600;
color: var(--youth-text-primary);
letter-spacing: -0.01em;
}
/* ===== 内容滚动区 ===== */
.content-scroll {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding-bottom: 12px;
}
.content-scroll::-webkit-scrollbar {
width: 0;
}
/* ===== 隐私安全提示卡片 ===== */
.privacy-hero-card {
margin: 12px 16px 4px;
padding: 16px;
border-radius: 16px;
background: linear-gradient(135deg, #E6FAF9 0%, #D0F5F3 100%);
display: flex;
align-items: center;
gap: 12px;
position: relative;
overflow: hidden;
box-shadow:
0 4px 16px rgba(38, 194, 187, 0.15),
inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.privacy-hero-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
pointer-events: none;
}
.privacy-shield-icon {
width: 48px;
height: 48px;
flex-shrink: 0;
position: relative;
z-index: 1;
filter: drop-shadow(0 4px 8px rgba(38, 194, 187, 0.4));
}
.privacy-hero-text {
flex: 1;
position: relative;
z-index: 1;
}
.privacy-hero-title {
font-size: 15px;
font-weight: 700;
color: #0D6B67;
margin-bottom: 3px;
letter-spacing: -0.01em;
}
.privacy-hero-desc {
font-size: 11px;
color: #1A8A85;
line-height: 1.5;
}
/* ===== 设置分组标题 ===== */
.group-title {
font-size: 12px;
font-weight: 500;
color: var(--youth-text-tertiary);
padding: 14px 20px 6px;
letter-spacing: 0.02em;
}
/* ===== 设置分组卡片 ===== */
.settings-group {
margin: 0 16px;
background: var(--youth-bg-card);
border-radius: 16px;
overflow: hidden;
box-shadow:
0 2px 12px rgba(0, 0, 0, 0.04),
inset 0 1px 0 rgba(255, 255, 255, 0.6);
border: 1px solid var(--youth-border-light);
position: relative;
}
.settings-group::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
pointer-events: none;
}
.settings-item {
display: flex;
align-items: center;
padding: 13px 16px;
cursor: pointer;
transition: background-color 0.15s ease;
position: relative;
}
.settings-item:active {
background-color: var(--youth-bg-hover);
}
.settings-item:not(:last-child)::after {
content: '';
position: absolute;
bottom: 0;
left: 52px;
right: 16px;
height: 1px;
background: var(--youth-border-light);
}
.settings-icon {
width: 30px;
height: 30px;
border-radius: var(--youth-radius-md);
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
flex-shrink: 0;
box-shadow:
0 2px 6px rgba(0, 0, 0, 0.08),
inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.settings-icon svg {
width: 16px;
height: 16px;
}
.settings-label {
flex: 1;
font-size: 14px;
font-weight: 500;
color: var(--youth-text-primary);
}
.settings-right {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
.settings-value {
font-size: 13px;
color: var(--youth-text-tertiary);
}
.settings-value.danger {
color: #E57878;
font-weight: 500;
}
.settings-arrow {
color: var(--youth-text-quaternary);
}
.settings-arrow svg {
width: 16px;
height: 16px;
}
/* ===== 立体开关 ===== */
.toggle-switch {
width: 46px;
height: 26px;
border-radius: 13px;
background: var(--youth-gray-300);
position: relative;
cursor: pointer;
transition: background-color 0.3s ease;
box-shadow:
inset 0 2px 4px rgba(0, 0, 0, 0.12),
inset 0 1px 2px rgba(0, 0, 0, 0.08);
flex-shrink: 0;
}
.toggle-switch.active {
background: linear-gradient(135deg, #54CAC5 0%, #26C2BB 100%);
box-shadow:
inset 0 2px 4px rgba(0, 0, 0, 0.1),
0 2px 8px rgba(38, 194, 187, 0.35);
}
.toggle-thumb {
position: absolute;
top: 2px;
left: 2px;
width: 22px;
height: 22px;
border-radius: 50%;
background: linear-gradient(135deg, #FFFFFF 0%, #F0F0F0 100%);
box-shadow:
0 2px 6px rgba(0, 0, 0, 0.15),
0 1px 2px rgba(0, 0, 0, 0.1),
inset 0 1px 0 rgba(255, 255, 255, 0.9);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-switch.active .toggle-thumb {
transform: translateX(20px);
background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 100%);
box-shadow:
0 2px 8px rgba(0, 0, 0, 0.2),
0 1px 3px rgba(0, 0, 0, 0.12),
inset 0 1px 0 rgba(255, 255, 255, 1);
}
/* ===== 底部安全区域 ===== */
.safe-area-bottom {
height: 20px;
flex-shrink: 0;
background: var(--youth-bg-page);
}
/* ===== 弹窗蒙层 ===== */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.45);
z-index: 998;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.modal-overlay.show {
opacity: 1;
visibility: visible;
}
.modal-dialog {
width: 280px;
background: var(--youth-bg-card);
border-radius: 20px;
padding: 20px 20px 16px;
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
transform: scale(0.9);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 999;
}
.modal-overlay.show .modal-dialog {
transform: scale(1);
}
.modal-title {
font-size: 17px;
font-weight: 700;
color: var(--youth-text-primary);
text-align: center;
margin-bottom: 6px;
}
.modal-message {
font-size: 13px;
color: var(--youth-text-secondary);
text-align: center;
margin-bottom: 18px;
line-height: 1.5;
}
.modal-actions {
display: flex;
gap: 10px;
}
.modal-btn {
flex: 1;
height: 42px;
border-radius: var(--youth-radius-xl);
font-size: 14px;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: all 0.2s ease;
position: relative;
overflow: hidden;
}
.modal-btn:active {
transform: scale(0.97);
}
.modal-btn.danger {
background: linear-gradient(135deg, #FF8A8A 0%, #FF6B6B 100%);
color: white;
box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}
.modal-btn.danger::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
pointer-events: none;
}
.modal-btn.cancel {
background: var(--youth-bg-input);
color: var(--youth-text-secondary);
border: 1px solid var(--youth-border-light);
}
.modal-btn.primary {
background: linear-gradient(135deg, #54CAC5 0%, #26C2BB 100%);
color: white;
box-shadow: 0 4px 12px rgba(38, 194, 187, 0.3);
}
.modal-btn.primary::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
pointer-events: none;
}
/* ===== 底部选择器弹窗 ===== */
.picker-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.45);
display: flex;
align-items: flex-end;
justify-content: center;
z-index: 100;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.picker-overlay.show {
opacity: 1;
visibility: visible;
}
.picker-sheet {
width: 375px;
background: var(--youth-bg-card);
border-radius: 20px 20px 0 0;
padding: 8px 0 20px;
transform: translateY(100%);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}
.picker-overlay.show .picker-sheet {
transform: translateY(0);
}
.picker-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 20px 10px;
border-bottom: 1px solid var(--youth-border-light);
}
.picker-header .picker-title {
font-size: 16px;
font-weight: 600;
color: var(--youth-text-primary);
}
.picker-header .picker-close {
font-size: 14px;
color: var(--youth-text-tertiary);
cursor: pointer;
}
.picker-options {
padding: 8px 0;
}
.picker-option {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 20px;
cursor: pointer;
transition: background-color 0.15s ease;
}
.picker-option:active {
background-color: var(--youth-bg-hover);
}
.picker-option .option-label {
font-size: 15px;
color: var(--youth-text-primary);
font-weight: 500;
}
.picker-option .option-check {
color: var(--youth-primary);
display: none;
}
.picker-option.selected .option-check {
display: block;
}
.picker-option .option-check svg {
width: 18px;
height: 18px;
}
/* ===== Toast ===== */
.toast {
position: fixed;
top: 100px;
left: 50%;
transform: translateX(-50%) translateY(-20px);
padding: 10px 20px;
background: rgba(26, 26, 26, 0.9);
color: white;
border-radius: var(--youth-radius-full);
font-size: 14px;
font-weight: 500;
z-index: 200;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
}
.toast.show {
opacity: 1;
visibility: visible;
transform: translateX(-50%) translateY(0);
}
/* ===== 设置图标背景色 ===== */
.icon-bg-eye {
background: linear-gradient(135deg, #E5FFF8 0%, #CCFFF0 100%);
color: #34C7A0;
}
.icon-bg-activity {
background: linear-gradient(135deg, #FFF5E5 0%, #FFE9CC 100%);
color: #E5A253;
}
.icon-bg-profile {
background: linear-gradient(135deg, #E5F0FF 0%, #CCE0FF 100%);
color: #5385E5;
}
.icon-bg-school {
background: linear-gradient(135deg, #E5F7F6 0%, #CCEFEA 100%);
color: #26C2BB;
}
.icon-bg-chat {
background: linear-gradient(135deg, #FFE5F0 0%, #FFCCE0 100%);
color: #E55395;
}
.icon-bg-user-add {
background: linear-gradient(135deg, #F0EEFF 0%, #DED9FF 100%);
color: #7B61FF;
}
.icon-bg-comment {
background: linear-gradient(135deg, #E5F7FF 0%, #CCEFF9 100%);
color: #5A9FD4;
}
.icon-bg-mention {
background: linear-gradient(135deg, #FFFBE5 0%, #FFF6CC 100%);
color: #E5C553;
}
.icon-bg-ban {
background: linear-gradient(135deg, #FFE5E5 0%, #FFCCCC 100%);
color: #E57878;
}
.icon-bg-eye-off {
background: linear-gradient(135deg, #F0FFF5 0%, #DAFFE6 100%);
color: #53B972;
}
.icon-bg-location {
background: linear-gradient(135deg, #FFE5E5 0%, #FFCCCC 100%);
color: #E57853;
}
.icon-bg-photo {
background: linear-gradient(135deg, #E8E5FF 0%, #D4CCFF 100%);
color: #8B77FF;
}
.icon-bg-download {
background: linear-gradient(135deg, #E5FFF0 0%, #CCFFDE 100%);
color: #34C759;
}
.icon-bg-delete {
background: linear-gradient(135deg, #FFE5E5 0%, #FFD4CC 100%);
color: #E55353;
}
/* 响应式 */
@media (max-width: 375px) {
.app-container { width: 100%; height: 100vh; }
}
/* SVG 图标统一尺寸 */
.icon-svg {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1em;
height: 1em;
vertical-align: middle;
line-height: 1;
}
.icon-svg svg {
width: 100%;
height: 100%;
stroke: currentColor;
}
/* 侧栏图标 */
.sidebar-icon .icon-svg { width: 22px; height: 22px; font-size: 22px; }
/* 社团logo图标 */
.club-logo .icon-svg { width: 28px; height: 28px; font-size: 28px; color: #fff; }
/* 头图大图标 */
.hero-icon .icon-svg { width: 56px; height: 56px; font-size: 56px; opacity: 0.3; }
/* meta 小图标 */
.club-meta .icon-svg { width: 12px; height: 12px; font-size: 12px; }
/* 分类选择网格图标 */
.cat-option .icon-svg { width: 26px; height: 26px; font-size: 26px; }
/* logo预览图标 */
.logo-preview .icon-svg { width: 40px; height: 40px; font-size: 40px; color: #fff; }
/* 提示图标 */
.notice-icon .icon-svg { width: 18px; height: 18px; font-size: 18px; }
/* Hide scrollbar */
::-webkit-scrollbar { display: none; width: 0; height: 0; }
* { -ms-overflow-style: none; scrollbar-width: none; }
</style>
</head>
<body>
<div class="app-container">
<!-- 状态栏 -->
<div class="status-bar">
<span>9:41</span>
<div class="right-icons">
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z"></path>
</svg>
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4z"></path>
</svg>
</div>
</div>
<!-- 导航栏 -->
<div class="nav-bar">
<button class="nav-btn" data-dom-id="btn-back" onclick="goBack()">
<svg width="20" height="20" 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>
<span class="nav-title">隐私设置</span>
</div>
<!-- 内容滚动区 -->
<div class="content-scroll">
<!-- 隐私安全提示卡片 -->
<div class="privacy-hero-card">
<div class="privacy-shield-icon">
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="shieldGrad" x1="24" y1="4" x2="24" y2="44" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#54CAC5"/>
<stop offset="50%" stop-color="#26C2BB"/>
<stop offset="100%" stop-color="#1A8A85"/>
</linearGradient>
<linearGradient id="shieldHighlight" x1="24" y1="4" x2="24" y2="24" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.5"/>
<stop offset="100%" stop-color="#ffffff" stop-opacity="0"/>
</linearGradient>
</defs>
<path d="M24 4L6 10V22C6 30 14 38 24 44C34 38 42 30 42 22V10L24 4Z" fill="url(#shieldGrad)"/>
<path d="M24 4L6 10V16L24 10L42 16V10L24 4Z" fill="url(#shieldHighlight)"/>
<path d="M18 24L22 28L31 19" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="privacy-hero-text">
<div class="privacy-hero-title">你的隐私安全由我们守护</div>
<div class="privacy-hero-desc">青核严格保护你的个人信息,学信网认证数据加密存储</div>
</div>
</div>
<!-- 第一组:谁可以看我 -->
<div class="group-title">谁可以看我</div>
<div class="settings-group">
<div class="settings-item" data-dom-id="item-post-visibility" onclick="openVisibilityPicker('post')">
<div class="settings-icon icon-bg-eye">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
<circle cx="12" cy="12" r="3"></circle>
</svg>
</div>
<span class="settings-label">动态可见范围</span>
<div class="settings-right">
<span class="settings-value" id="post-visibility-value">全校可见</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
<div class="settings-item" data-dom-id="item-activity-visibility" onclick="openVisibilityPicker('activity')">
<div class="settings-icon icon-bg-activity">
<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="settings-label">组局可见范围</span>
<div class="settings-right">
<span class="settings-value" id="activity-visibility-value">本校可见</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
<div class="settings-item" data-dom-id="item-profile-visibility" onclick="openVisibilityPicker('profile')">
<div class="settings-icon icon-bg-profile">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<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>
<span class="settings-label">资料页可见范围</span>
<div class="settings-right">
<span class="settings-value" id="profile-visibility-value">认证用户可见</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
<div class="settings-item" onclick="toggleSwitch('switch-find-by-school')">
<div class="settings-icon icon-bg-school">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 10v6M2 10l10-5 10 5-10 5z"></path>
<path d="M6 12v5c3 3 9 3 12 0v-5"></path>
</svg>
</div>
<span class="settings-label">允许通过学校找到我</span>
<div class="settings-right">
<div class="toggle-switch active" data-dom-id="switch-find-by-school" onclick="event.stopPropagation(); toggleSwitch('switch-find-by-school')">
<div class="toggle-thumb"></div>
</div>
</div>
</div>
</div>
<!-- 第二组:互动权限 -->
<div class="group-title">互动权限</div>
<div class="settings-group">
<div class="settings-item" onclick="toggleSwitch('switch-stranger-greet')">
<div class="settings-icon icon-bg-chat">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<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="settings-label">允许陌生人打招呼</span>
<div class="settings-right">
<div class="toggle-switch active" data-dom-id="switch-stranger-greet" onclick="event.stopPropagation(); toggleSwitch('switch-stranger-greet')">
<div class="toggle-thumb"></div>
</div>
</div>
</div>
<div class="settings-item" onclick="toggleSwitch('switch-friend-verify')">
<div class="settings-icon icon-bg-user-add">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<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="settings-label">加我为好友需要验证</span>
<div class="settings-right">
<div class="toggle-switch active" data-dom-id="switch-friend-verify" onclick="event.stopPropagation(); toggleSwitch('switch-friend-verify')">
<div class="toggle-thumb"></div>
</div>
</div>
</div>
<div class="settings-item" data-dom-id="item-comment-perm" onclick="openPermPicker('comment')">
<div class="settings-icon icon-bg-comment">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path>
</svg>
</div>
<span class="settings-label">允许评论我的动态</span>
<div class="settings-right">
<span class="settings-value" id="comment-perm-value">所有人</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
<div class="settings-item" data-dom-id="item-mention-perm" onclick="openPermPicker('mention')">
<div class="settings-icon icon-bg-mention">
<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="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="settings-label">允许@我</span>
<div class="settings-right">
<span class="settings-value" id="mention-perm-value">好友和群聊</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
</div>
<!-- 第三组:数据与权限 -->
<div class="group-title">数据与权限</div>
<div class="settings-group">
<div class="settings-item" data-dom-id="item-blacklist" onclick="navigateTo('item-blacklist')">
<div class="settings-icon icon-bg-ban">
<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>
<line x1="4.93" y1="4.93" x2="19.07" y2="19.07"></line>
</svg>
</div>
<span class="settings-label">黑名单管理</span>
<div class="settings-right">
<span class="settings-value">3人</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
<div class="settings-item" data-dom-id="item-block-posts" onclick="navigateTo('item-block-posts')">
<div class="settings-icon icon-bg-eye-off">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
<line x1="1" y1="1" x2="23" y2="23"></line>
</svg>
</div>
<span class="settings-label">不看他的动态</span>
<div class="settings-right">
<span class="settings-value">5人</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
<div class="settings-item" data-dom-id="item-location-perm" onclick="openPermInfo('location')">
<div class="settings-icon icon-bg-location">
<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="settings-label">位置信息权限</span>
<div class="settings-right">
<span class="settings-value">使用时允许</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
<div class="settings-item" data-dom-id="item-photo-perm" onclick="openPermInfo('photo')">
<div class="settings-icon icon-bg-photo">
<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="settings-label">相册权限</span>
<div class="settings-right">
<span class="settings-value">已允许</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
</div>
<!-- 第四组:账号与数据 -->
<div class="group-title">账号与数据</div>
<div class="settings-group">
<div class="settings-item" data-dom-id="item-data-download" onclick="openDataDownloadModal()">
<div class="settings-icon icon-bg-download">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
<polyline points="7 10 12 15 17 10"></polyline>
<line x1="12" y1="15" x2="12" y2="3"></line>
</svg>
</div>
<span class="settings-label">个人数据下载</span>
<div class="settings-right">
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
<div class="settings-item" data-dom-id="item-delete-account" onclick="openDeleteAccountModal()">
<div class="settings-icon icon-bg-delete">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
</svg>
</div>
<span class="settings-label">注销账号</span>
<div class="settings-right">
<span class="settings-value danger">注销</span>
<div class="settings-arrow">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
</div>
</div>
</div>
<!-- 底部留白 -->
<div style="height: 4px;"></div>
</div>
<!-- 底部安全区域 -->
<div class="safe-area-bottom"></div>
</div>
<!-- 可见范围选择器 -->
<div class="picker-overlay" id="visibility-picker" onclick="closePickerOutside(event, 'visibility-picker')">
<div class="picker-sheet">
<div class="picker-header">
<span class="picker-title" id="visibility-picker-title">选择可见范围</span>
<span class="picker-close" onclick="closeVisibilityPicker()">取消</span>
</div>
<div class="picker-options" id="visibility-options">
<!-- 动态生成 -->
</div>
</div>
</div>
<!-- 权限选择器 -->
<div class="picker-overlay" id="perm-picker" onclick="closePickerOutside(event, 'perm-picker')">
<div class="picker-sheet">
<div class="picker-header">
<span class="picker-title" id="perm-picker-title">选择权限</span>
<span class="picker-close" onclick="closePermPicker()">取消</span>
</div>
<div class="picker-options" id="perm-options">
<!-- 动态生成 -->
</div>
</div>
</div>
<!-- 权限说明弹窗 -->
<div class="modal-overlay" id="perm-info-modal" onclick="closeModalOutside(event, 'perm-info-modal')">
<div class="modal-dialog">
<div class="modal-title" id="perm-info-title">权限说明</div>
<div class="modal-message" id="perm-info-message">权限说明内容</div>
<div class="modal-actions">
<button class="modal-btn primary" onclick="closePermInfoModal()">我知道了</button>
</div>
</div>
</div>
<!-- 个人数据下载确认弹窗 -->
<div class="modal-overlay" id="data-download-modal" onclick="closeModalOutside(event, 'data-download-modal')">
<div class="modal-dialog">
<div class="modal-title">个人数据下载</div>
<div class="modal-message">我们将为你生成一份包含你的个人资料、动态、聊天记录等数据的文件。<br>确认开始下载吗?</div>
<div class="modal-actions">
<button class="modal-btn cancel" onclick="closeDataDownloadModal()">取消</button>
<button class="modal-btn primary" onclick="confirmDataDownload()">确认下载</button>
</div>
</div>
</div>
<!-- 注销账号严重警告弹窗 -->
<div class="modal-overlay" id="delete-account-modal" onclick="closeModalOutside(event, 'delete-account-modal')">
<div class="modal-dialog">
<div class="modal-title" style="color: #FF3B30;">注销账号</div>
<div class="modal-message">
<strong>警告:注销后将无法恢复!</strong><br><br>
你的所有数据包括:<br>
· 个人资料与认证信息<br>
· 发布的动态和组局<br>
· 好友关系和聊天记录<br>
· 积分与虚拟资产<br><br>
确定要注销账号吗?
</div>
<div class="modal-actions">
<button class="modal-btn cancel" onclick="closeDeleteAccountModal()">再想想</button>
<button class="modal-btn danger" onclick="confirmDeleteAccount()">确认注销</button>
</div>
</div>
</div>
<!-- Toast 提示 -->
<div class="toast" id="toast"></div>
<script>// ===== 数据配置 =====
const visibilityOptions = {
post: [
{ value: 'public', label: '全校可见' },
{ value: 'school', label: '本校可见' },
{ value: 'verified', label: '认证用户可见' },
{ value: 'friends', label: '仅好友可见' },
{ value: 'private', label: '仅自己可见' }
],
activity: [
{ value: 'public', label: '全校可见' },
{ value: 'school', label: '本校可见' },
{ value: 'verified', label: '认证用户可见' },
{ value: 'friends', label: '仅好友可见' }
],
profile: [
{ value: 'public', label: '所有人可见' },
{ value: 'school', label: '本校可见' },
{ value: 'verified', label: '认证用户可见' },
{ value: 'friends', label: '仅好友可见' }
]
};
const visibilityTitles = {
post: '动态可见范围',
activity: '组局可见范围',
profile: '资料页可见范围'
};
const currentVisibility = {
post: 'public',
activity: 'school',
profile: 'verified'
};
const permOptions = {
comment: [
{ value: 'all', label: '所有人' },
{ value: 'verified', label: '认证用户' },
{ value: 'friends', label: '仅好友' },
{ value: 'none', label: '不允许' }
],
mention: [
{ value: 'all', label: '所有人' },
{ value: 'friends_group', label: '好友和群聊' },
{ value: 'friends', label: '仅好友' },
{ value: 'none', label: '不允许' }
]
};
const permTitles = {
comment: '允许评论我的动态',
mention: '允许@我'
};
const currentPerm = {
comment: 'all',
mention: 'friends_group'
};
const permInfo = {
location: {
title: '位置信息权限',
message: '青核使用位置信息为你推荐附近的同学、组局和校园活动。<br><br>当前状态:使用时允许<br>你可以在系统设置中修改此权限。'
},
photo: {
title: '相册权限',
message: '青核需要访问相册以让你上传头像、发布动态照片和分享图片。<br><br>当前状态:已允许<br>你可以在系统设置中修改此权限。'
}
};
// 初始化主题
}
})();
// ===== 返回按钮 =====
function goBack() {
window.location.href = 'settings.html';
}
// ===== 开关切换 =====
function toggleSwitch(domId) {
const toggleEl = document.querySelector(`[data-dom-id="${domId}"]`);
if (toggleEl) {
toggleEl.classList.toggle('active');
}
}
// ===== 可见范围选择器 =====
let currentPickerType = '';
let currentPickerCategory = '';
function openVisibilityPicker(type) {
currentPickerType = 'visibility';
currentPickerCategory = type;
const title = document.getElementById('visibility-picker-title');
const options = document.getElementById('visibility-options');
title.textContent = visibilityTitles[type];
options.innerHTML = '';
visibilityOptions[type].forEach(opt => {
const isSelected = currentVisibility[type] === opt.value;
const div = document.createElement('div');
div.className = 'picker-option' + (isSelected ? ' selected' : '');
div.innerHTML = `
<span class="option-label">${opt.label}</span>
<span class="option-check">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</span>
`;
div.onclick = () => selectVisibility(type, opt.value, opt.label);
options.appendChild(div);
});
document.getElementById('visibility-picker').classList.add('show');
}
function selectVisibility(type, value, label) {
currentVisibility[type] = value;
document.getElementById(`${type}-visibility-value`).textContent = label;
closeVisibilityPicker();
showToast(`已设置为${label}`);
}
function closeVisibilityPicker() {
document.getElementById('visibility-picker').classList.remove('show');
}
// ===== 权限选择器 =====
function openPermPicker(type) {
currentPickerType = 'perm';
currentPickerCategory = type;
const title = document.getElementById('perm-picker-title');
const options = document.getElementById('perm-options');
title.textContent = permTitles[type];
options.innerHTML = '';
permOptions[type].forEach(opt => {
const isSelected = currentPerm[type] === opt.value;
const div = document.createElement('div');
div.className = 'picker-option' + (isSelected ? ' selected' : '');
div.innerHTML = `
<span class="option-label">${opt.label}</span>
<span class="option-check">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</span>
`;
div.onclick = () => selectPerm(type, opt.value, opt.label);
options.appendChild(div);
});
document.getElementById('perm-picker').classList.add('show');
}
function selectPerm(type, value, label) {
currentPerm[type] = value;
document.getElementById(`${type}-perm-value`).textContent = label;
closePermPicker();
showToast(`已设置为${label}`);
}
function closePermPicker() {
document.getElementById('perm-picker').classList.remove('show');
}
// ===== 点击遮罩关闭选择器 =====
function closePickerOutside(event, pickerId) {
if (event.target.classList.contains('picker-overlay')) {
document.getElementById(pickerId).classList.remove('show');
}
}
// ===== 权限说明弹窗 =====
function openPermInfo(type) {
const info = permInfo[type];
document.getElementById('perm-info-title').textContent = info.title;
document.getElementById('perm-info-message').innerHTML = info.message;
document.getElementById('perm-info-modal').classList.add('show');
}
function closePermInfoModal() {
document.getElementById('perm-info-modal').classList.remove('show');
}
// ===== 个人数据下载弹窗 =====
function openDataDownloadModal() {
document.getElementById('data-download-modal').classList.add('show');
}
function closeDataDownloadModal() {
document.getElementById('data-download-modal').classList.remove('show');
}
function confirmDataDownload() {
closeDataDownloadModal();
showToast('数据下载请求已提交');
}
// ===== 注销账号弹窗 =====
function openDeleteAccountModal() {
document.getElementById('delete-account-modal').classList.add('show');
}
function closeDeleteAccountModal() {
document.getElementById('delete-account-modal').classList.remove('show');
}
function confirmDeleteAccount() {
closeDeleteAccountModal();
showToast('账号注销申请已提交');
}
// ===== 点击遮罩关闭弹窗 =====
function closeModalOutside(event, modalId) {
if (event.target.classList.contains('modal-overlay')) {
document.getElementById(modalId).classList.remove('show');
}
}
// ===== 导航跳转 =====
function navigateTo(itemId) {
switch (itemId) {
case 'item-blacklist':
showToast('前往黑名单管理');
break;
case 'item-block-posts':
showToast('前往不看他的动态');
break;
default:
showToast('功能开发中');
}
}
// ===== Toast =====
let toastTimer = null;
function showToast(message) {
const toast = document.getElementById('toast');
toast.textContent = message;
toast.classList.add('show');
if (toastTimer) clearTimeout(toastTimer);
toastTimer = setTimeout(() => {
toast.classList.remove('show');
}, 2000);
}</script>
</body>
</html>