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,281 @@
|
||||
<template>
|
||||
<view class="app-root">
|
||||
<slot />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||
|
||||
onLaunch(() => {
|
||||
console.log('[AI维度] App launched')
|
||||
initTheme()
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
console.log('[AI维度] App shown')
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
console.log('[AI维度] App hidden')
|
||||
})
|
||||
|
||||
function initTheme() {
|
||||
const theme = uni.getStorageSync('theme') || 'light'
|
||||
applyTheme(theme)
|
||||
}
|
||||
|
||||
function applyTheme(theme) {
|
||||
try {
|
||||
// H5 环境:操作 document class
|
||||
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) {
|
||||
// 小程序环境:document 不存在
|
||||
}
|
||||
// 小程序 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) {
|
||||
// H5 环境 setTabBarStyle 可能不支持
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* ============================================
|
||||
宇之然AI维度 — 全局主题
|
||||
默认:亮色模式 | .theme-dark:暗色模式
|
||||
============================================ */
|
||||
|
||||
/* ---- 亮色模式(默认) ---- */
|
||||
page, .theme-light {
|
||||
/* 基础色 — 清爽浅灰 */
|
||||
--bg-primary: #f5f5f7;
|
||||
--bg-secondary: #ffffff;
|
||||
--bg-tertiary: #e8e8ed;
|
||||
|
||||
/* 玻璃拟态 */
|
||||
--glass-bg: rgba(255, 255, 255, 0.7);
|
||||
--glass-border: rgba(0, 0, 0, 0.06);
|
||||
--glass-hover: rgba(255, 255, 255, 0.85);
|
||||
--glass-hover-border: rgba(0, 0, 0, 0.1);
|
||||
--glass-strong: rgba(255, 255, 255, 0.9);
|
||||
--glass-dim-bg: rgba(139, 92, 246, 0.05);
|
||||
|
||||
/* 文字 */
|
||||
--text-primary: rgba(0, 0, 0, 0.88);
|
||||
--text-secondary: rgba(0, 0, 0, 0.55);
|
||||
--text-tertiary: rgba(0, 0, 0, 0.4);
|
||||
--text-muted: rgba(0, 0, 0, 0.25);
|
||||
--text-disabled: rgba(0, 0, 0, 0.2);
|
||||
|
||||
/* 品牌色 */
|
||||
--color-brand: #7c4dff;
|
||||
--color-brand-light: #b388ff;
|
||||
--color-brand-dark: #651fff;
|
||||
--color-brand-bg: rgba(124, 77, 255, 0.08);
|
||||
--color-brand-glow: rgba(124, 77, 255, 0.12);
|
||||
|
||||
/* 维度色 */
|
||||
--dim1-color: #7c4dff;
|
||||
--dim1-bg: rgba(124, 77, 255, 0.08);
|
||||
--dim1-icon-bg: rgba(124, 77, 255, 0.15);
|
||||
--dim1-border: rgba(124, 77, 255, 0.15);
|
||||
--dim1-glow: rgba(124, 77, 255, 0.06);
|
||||
|
||||
--dim2-color: #0ea5e9;
|
||||
--dim2-bg: rgba(14, 165, 233, 0.08);
|
||||
--dim2-icon-bg: rgba(14, 165, 233, 0.15);
|
||||
--dim2-border: rgba(14, 165, 233, 0.15);
|
||||
--dim2-glow: rgba(14, 165, 233, 0.06);
|
||||
|
||||
--dim3-color: #10b981;
|
||||
--dim3-bg: rgba(16, 185, 129, 0.08);
|
||||
--dim3-icon-bg: rgba(16, 185, 129, 0.15);
|
||||
--dim3-border: rgba(16, 185, 129, 0.15);
|
||||
--dim3-glow: rgba(16, 185, 129, 0.06);
|
||||
|
||||
--dim4-color: #f59e0b;
|
||||
--dim4-bg: rgba(245, 158, 11, 0.08);
|
||||
--dim4-icon-bg: rgba(245, 158, 11, 0.15);
|
||||
--dim4-border: rgba(245, 158, 11, 0.15);
|
||||
--dim4-glow: rgba(245, 158, 11, 0.06);
|
||||
|
||||
--dim5-color: #ef4444;
|
||||
--dim5-bg: rgba(239, 68, 68, 0.08);
|
||||
--dim5-icon-bg: rgba(239, 68, 68, 0.15);
|
||||
--dim5-border: rgba(239, 68, 68, 0.15);
|
||||
--dim5-glow: rgba(239, 68, 68, 0.06);
|
||||
|
||||
/* 功能色 */
|
||||
--color-free: #10b981;
|
||||
--color-free-bg: rgba(16, 185, 129, 0.1);
|
||||
--color-pro: #f59e0b;
|
||||
--color-pro-bg: rgba(245, 158, 11, 0.1);
|
||||
--color-vip: #ef4444;
|
||||
--color-vip-bg: rgba(239, 68, 68, 0.1);
|
||||
--color-hot: #ef4444;
|
||||
--color-hot-bg: rgba(239, 68, 68, 0.12);
|
||||
--color-new: #0ea5e9;
|
||||
--color-new-bg: rgba(14, 165, 233, 0.12);
|
||||
--color-pick: #7c4dff;
|
||||
--color-pick-bg: rgba(124, 77, 255, 0.12);
|
||||
|
||||
/* 圆角/间距/过渡 */
|
||||
--radius-sm: 8px;
|
||||
--radius-md: 12px;
|
||||
--radius-lg: 16px;
|
||||
--radius-xl: 20px;
|
||||
--radius-full: 9999px;
|
||||
--spacing-xs: 4px;
|
||||
--spacing-sm: 8px;
|
||||
--spacing-md: 12px;
|
||||
--spacing-lg: 16px;
|
||||
--spacing-xl: 20px;
|
||||
--spacing-2xl: 24px;
|
||||
--blur-bg: 20px;
|
||||
--transition-fast: 0.2s ease;
|
||||
--transition-normal: 0.3s ease;
|
||||
--glow-brand: 0 0 20px rgba(124, 77, 255, 0.08);
|
||||
--glow-brand-strong: 0 0 30px rgba(124, 77, 255, 0.12);
|
||||
}
|
||||
|
||||
/* ---- 暗色模式 ---- */
|
||||
.theme-dark {
|
||||
/* 基础色 */
|
||||
--bg-primary: #14141e;
|
||||
--bg-secondary: #181828;
|
||||
--bg-tertiary: #1c1a34;
|
||||
|
||||
--glass-bg: rgba(255, 255, 255, 0.06);
|
||||
--glass-border: rgba(255, 255, 255, 0.08);
|
||||
--glass-hover: rgba(255, 255, 255, 0.1);
|
||||
--glass-hover-border: rgba(255, 255, 255, 0.15);
|
||||
--glass-strong: rgba(255, 255, 255, 0.12);
|
||||
--glass-dim-bg: rgba(124, 77, 255, 0.06);
|
||||
|
||||
--text-primary: rgba(255, 255, 255, 0.95);
|
||||
--text-secondary: rgba(255, 255, 255, 0.7);
|
||||
--text-tertiary: rgba(255, 255, 255, 0.5);
|
||||
--text-muted: rgba(255, 255, 255, 0.3);
|
||||
--text-disabled: rgba(255, 255, 255, 0.15);
|
||||
|
||||
--color-brand: #8b5cf6;
|
||||
--color-brand-light: #a78bfa;
|
||||
--color-brand-dark: #7c3aed;
|
||||
--color-brand-bg: rgba(139, 92, 246, 0.12);
|
||||
--color-brand-glow: rgba(139, 92, 246, 0.15);
|
||||
|
||||
--dim1-color: #a78bfa;
|
||||
--dim1-bg: rgba(139, 92, 246, 0.12);
|
||||
--dim1-icon-bg: rgba(139, 92, 246, 0.2);
|
||||
--dim1-border: rgba(139, 92, 246, 0.18);
|
||||
--dim1-glow: rgba(139, 92, 246, 0.08);
|
||||
|
||||
--dim2-color: #60a5fa;
|
||||
--dim2-bg: rgba(96, 165, 250, 0.12);
|
||||
--dim2-icon-bg: rgba(96, 165, 250, 0.2);
|
||||
--dim2-border: rgba(96, 165, 250, 0.18);
|
||||
--dim2-glow: rgba(96, 165, 250, 0.08);
|
||||
|
||||
--dim3-color: #34d399;
|
||||
--dim3-bg: rgba(52, 211, 153, 0.12);
|
||||
--dim3-icon-bg: rgba(52, 211, 153, 0.2);
|
||||
--dim3-border: rgba(52, 211, 153, 0.18);
|
||||
--dim3-glow: rgba(52, 211, 153, 0.08);
|
||||
|
||||
--dim4-color: #fbbf24;
|
||||
--dim4-bg: rgba(251, 191, 36, 0.12);
|
||||
--dim4-icon-bg: rgba(251, 191, 36, 0.2);
|
||||
--dim4-border: rgba(251, 191, 36, 0.18);
|
||||
--dim4-glow: rgba(251, 191, 36, 0.08);
|
||||
|
||||
--dim5-color: #fb7185;
|
||||
--dim5-bg: rgba(251, 113, 133, 0.12);
|
||||
--dim5-icon-bg: rgba(251, 113, 133, 0.2);
|
||||
--dim5-border: rgba(251, 113, 133, 0.18);
|
||||
--dim5-glow: rgba(251, 113, 133, 0.08);
|
||||
|
||||
--color-free: #34d399;
|
||||
--color-free-bg: rgba(52, 211, 153, 0.12);
|
||||
--color-pro: #fbbf24;
|
||||
--color-pro-bg: rgba(251, 191, 36, 0.12);
|
||||
--color-vip: #fb7185;
|
||||
--color-vip-bg: rgba(251, 113, 133, 0.12);
|
||||
--color-hot: #fb7185;
|
||||
--color-hot-bg: rgba(251, 113, 133, 0.15);
|
||||
--color-new: #60a5fa;
|
||||
--color-new-bg: rgba(96, 165, 250, 0.15);
|
||||
--color-pick: #a78bfa;
|
||||
--color-pick-bg: rgba(139, 92, 246, 0.15);
|
||||
|
||||
--glow-brand: 0 0 20px rgba(139, 92, 246, 0.1);
|
||||
--glow-brand-strong: 0 0 30px rgba(139, 92, 246, 0.15);
|
||||
}
|
||||
|
||||
/* 全局排版 */
|
||||
page {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
background-color: var(--bg-primary);
|
||||
color: var(--text-secondary);
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
|
||||
}
|
||||
|
||||
view {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* 卡片通用 */
|
||||
.card {
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
border-radius: var(--radius-lg);
|
||||
backdrop-filter: blur(var(--blur-bg));
|
||||
-webkit-backdrop-filter: blur(var(--blur-bg));
|
||||
transition: all var(--transition-normal);
|
||||
}
|
||||
|
||||
.gradient-brand {
|
||||
background: linear-gradient(135deg, var(--color-brand), var(--color-brand-light));
|
||||
}
|
||||
|
||||
.gradient-text {
|
||||
background: linear-gradient(135deg, var(--color-brand-light), var(--color-brand));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user