refactor: 项目架构重构 - 目录标准化 + 清理冗余
- 目录重命名: backend/wdkj-server/ → server/, frontend/ai-dimension/ → client/ - 删除 20+ 冗余文件(WDKJ 旧脚本、Windows 脚本、过时文档、设计稿) - 更新 package.json 元数据(移除 wdkj 命名) - 完善三级 .gitignore(根 + server + client) - 重写 README.md 和 CHANGELOG.md - 工具脚本移至 scripts/
This commit is contained in:
@@ -0,0 +1,249 @@
|
||||
<template>
|
||||
<view class="page-settings">
|
||||
<view class="status-bar-placeholder"></view>
|
||||
<text class="page-title">设置</text>
|
||||
|
||||
<!-- 偏好设置 -->
|
||||
<view class="section-title">偏好设置</view>
|
||||
<view class="card">
|
||||
<view class="setting-item" @click="togglePush">
|
||||
<view class="s-icon" style="background:rgba(255,213,79,0.1);color:#ffd54f">🔔</view>
|
||||
<view class="s-text">
|
||||
<text class="s-label">推送通知</text>
|
||||
<text class="s-desc">接收每日 AI 趋势推送</text>
|
||||
</view>
|
||||
<view class="s-switch" :class="{ active: pushOn }">
|
||||
<view class="s-switch-knob" :class="{ on: pushOn }"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="setting-item" @click="toggleDarkMode">
|
||||
<view class="s-icon" style="background:rgba(77,208,225,0.1);color:#4dd0e1">🌙</view>
|
||||
<view class="s-text">
|
||||
<text class="s-label">暗色模式</text>
|
||||
<text class="s-desc">{{ darkMode ? '已开启暗色风格' : '当前为亮色风格' }}</text>
|
||||
</view>
|
||||
<view class="s-switch" :class="{ active: darkMode }">
|
||||
<view class="s-switch-knob" :class="{ on: darkMode }"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 其他 -->
|
||||
<view class="section-title">其他</view>
|
||||
<view class="card">
|
||||
<view class="setting-item" @click="showAbout">
|
||||
<view class="s-icon" style="background:rgba(179,136,255,0.1);color:#b388ff">ℹ️</view>
|
||||
<view class="s-text">
|
||||
<text class="s-label">关于「宇之然AI维度」</text>
|
||||
</view>
|
||||
<text class="s-arrow">→</text>
|
||||
</view>
|
||||
<view class="setting-item" @click="showContact">
|
||||
<view class="s-icon" style="background:rgba(102,187,106,0.1);color:#66bb6a">📧</view>
|
||||
<view class="s-text">
|
||||
<text class="s-label">联系方式</text>
|
||||
<text class="s-desc">客服邮箱:support@yuzhiran.com</text>
|
||||
</view>
|
||||
<text class="s-arrow">→</text>
|
||||
</view>
|
||||
<view class="setting-item" @click="showAgreement">
|
||||
<view class="s-icon" style="background:rgba(239,83,80,0.1);color:#ef5350">📄</view>
|
||||
<view class="s-text">
|
||||
<text class="s-label">用户协议 / 隐私政策</text>
|
||||
</view>
|
||||
<text class="s-arrow">→</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<text class="version">宇之然 AI 维度 v1.0.0</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
|
||||
const pushOn = ref(true)
|
||||
const darkMode = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
// 读取当前主题
|
||||
darkMode.value = uni.getStorageSync('theme') === 'dark'
|
||||
})
|
||||
|
||||
function togglePush() {
|
||||
pushOn.value = !pushOn.value
|
||||
uni.showToast({
|
||||
title: pushOn.value ? '推送已开启' : '推送已关闭',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
function toggleDarkMode() {
|
||||
darkMode.value = !darkMode.value
|
||||
const theme = darkMode.value ? 'dark' : 'light'
|
||||
uni.setStorageSync('theme', theme)
|
||||
applyTheme(theme)
|
||||
uni.showToast({
|
||||
title: darkMode.value ? '已切换为暗色模式' : '已切换为亮色模式',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
function applyTheme(theme) {
|
||||
try {
|
||||
const root = document.documentElement
|
||||
if (theme === 'dark') {
|
||||
root.classList.add('theme-dark')
|
||||
root.classList.remove('theme-light')
|
||||
} else {
|
||||
root.classList.remove('theme-dark')
|
||||
root.classList.add('theme-light')
|
||||
}
|
||||
} catch (e) {}
|
||||
// tabBar 同步
|
||||
applyTabBarTheme(theme)
|
||||
}
|
||||
|
||||
function applyTabBarTheme(theme) {
|
||||
try {
|
||||
if (theme === 'dark') {
|
||||
uni.setTabBarStyle({ color: 'rgba(255,255,255,0.25)', selectedColor: '#b388ff', backgroundColor: '#08080f', borderStyle: 'black' })
|
||||
} else {
|
||||
uni.setTabBarStyle({ color: 'rgba(0,0,0,0.35)', selectedColor: '#7c4dff', backgroundColor: '#ffffff', borderStyle: 'white' })
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function showAbout() {
|
||||
uni.showModal({
|
||||
title: '关于「宇之然AI维度」',
|
||||
content: '宇之然 AI 维度 v1.0.0\n从 5 个维度系统理解人工智能\n© 2026 宇之然',
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
|
||||
function showContact() {
|
||||
uni.showModal({
|
||||
title: '联系方式',
|
||||
content: '客服邮箱:support@yuzhiran.com\n工作时间:周一至周五 9:00-18:00',
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
|
||||
function showAgreement() {
|
||||
uni.showModal({
|
||||
title: '用户协议 / 隐私政策',
|
||||
content: '暂无内容',
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-settings {
|
||||
min-height: 100vh;
|
||||
padding: 0 20px 40px;
|
||||
background: var(--bg-primary);
|
||||
}
|
||||
|
||||
.status-bar-placeholder { height: 44px; }
|
||||
|
||||
.page-title {
|
||||
font-size: 22px;
|
||||
color: var(--text-primary);
|
||||
font-weight: 600;
|
||||
display: block;
|
||||
margin: 6px 0 22px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
margin: 18px 0 10px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
border-radius: 14px;
|
||||
padding: 4px 16px;
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
padding: 14px 0;
|
||||
border-bottom: 1px solid var(--glass-border);
|
||||
}
|
||||
.setting-item:last-child { border-bottom: none; }
|
||||
|
||||
.s-icon {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.s-text {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.s-label {
|
||||
font-size: 14px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.s-desc {
|
||||
font-size: 11px;
|
||||
color: var(--text-tertiary);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.s-arrow {
|
||||
font-size: 14px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
// 开关
|
||||
.s-switch {
|
||||
width: 44px;
|
||||
height: 24px;
|
||||
border-radius: 12px;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
transition: background 0.3s;
|
||||
}
|
||||
.s-switch.active {
|
||||
background: rgba(124, 77, 255, 0.4);
|
||||
}
|
||||
.s-switch-knob {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: white;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
transition: left 0.3s;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
||||
}
|
||||
.s-switch-knob.on { left: 22px; }
|
||||
|
||||
.version {
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
margin-top: 30px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user