feat(ui): 记录页月份联动与多项 UI 美化/修复
- records: 底部列表与月份选择器联动,新增 [本月|最近] 分段控件;标题/空态随模式切换 - leaderboard: 领奖台布局(冠军居中+皇冠)、次数标注于底座且三档水平对齐;头像 cloud:// 批量预解析提速(云函数需重新部署) - index/timer: 主色底图标改白色变体修复隐形;目标数字按微信字体缩放补偿真机遮挡 - settings: 配色方案横滑渐变色卡;头像上传前压缩至 200px - theme: 新增 teal 主题;暗黑背景统一对齐 - 圆形头像双保险(image 自身 border-radius)修复月/年榜方图 注: cloudfunctions/leaderboard 改动须在开发者工具重新部署才生效。
This commit is contained in:
+15
-4
@@ -38,6 +38,14 @@ const THEMES = [
|
||||
primaryLight: '#F06A9A',
|
||||
primaryBg: '#FDEEF3',
|
||||
primaryRgb: '236,64,122'
|
||||
},
|
||||
{
|
||||
id: 'teal',
|
||||
name: '湖青',
|
||||
primary: '#00BCD4',
|
||||
primaryLight: '#4DD0E1',
|
||||
primaryBg: '#E0F7FA',
|
||||
primaryRgb: '0,188,212'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -95,9 +103,12 @@ const setTheme = (id) => {
|
||||
|
||||
const getThemeStyle = (theme, isDark = false) => {
|
||||
const t = theme || getCurrentTheme()
|
||||
// Dark palette is unified with theme.json (#131316 family) so the chrome
|
||||
// background and the page background stop disagreeing. Card is brightened
|
||||
// to keep elevation readable on the darker backdrop.
|
||||
const baseVars = isDark
|
||||
? '--text:#E5E5E7;--text-secondary:#98989F;--bg:#2C2C2E;--bg-gradient-start:#2C2C2E;--bg-gradient-end:#38383A;--card-bg:#3A3A3C;--bg-soft:#48484A;--border:#48484A;--success:#30D158;--success-rgb:48,209,88;--danger:#FF6B6B;--danger-rgb:255,107,107;'
|
||||
: BASE_VARS
|
||||
? '--text:#E5E5E7;--text-secondary:#98989F;--bg:#131316;--bg-gradient-start:#131316;--bg-gradient-end:#1C1C20;--card-bg:#26262B;--bg-soft:#343439;--border:#343439;--success:#30D158;--success-rgb:48,209,88;--danger:#FF6B6B;--danger-rgb:255,107,107;'
|
||||
: `--text:#333333;--text-secondary:#999999;--bg:${t.primaryBg};--bg-gradient-start:${t.primaryBg};--bg-gradient-end:#FAFAFA;--card-bg:#FFFFFF;--bg-soft:#F0F0F0;--border:#EEEEEE;--success:#4CAF50;--success-rgb:76,175,80;--danger:#E53935;--danger-rgb:229,57,53;`
|
||||
return `${baseVars}--primary:${t.primary};--primary-light:${t.primaryLight};--primary-bg:${t.primaryBg};--primary-rgb:${t.primaryRgb};`
|
||||
}
|
||||
|
||||
@@ -116,7 +127,7 @@ const applyThemeToPage = (self) => {
|
||||
// theme.json 的 dark section 只响应系统暗黑模式。用户手动选择暗黑
|
||||
// 但系统是明亮时,窗口背景仍为浅色,切 tab 会闪白。这里用 API 强制设置
|
||||
// 窗口背景,让 tab 切换时的瞬间底色与当前模式一致。
|
||||
const bg = isDark ? '#0F0F12' : '#F5F5F5'
|
||||
const bg = isDark ? '#131316' : theme.primaryBg
|
||||
try { wx.setBackgroundColor({ backgroundColor: bg, backgroundColorTop: bg, backgroundColorBottom: bg }) } catch (e) {}
|
||||
}
|
||||
|
||||
@@ -125,7 +136,7 @@ const applyWindowBg = () => {
|
||||
try {
|
||||
const darkMod = require('./darkMode')
|
||||
const isDark = darkMod.getInitialDarkMode()
|
||||
const bg = isDark ? '#0F0F12' : '#F5F5F5'
|
||||
const bg = isDark ? '#131316' : getCurrentTheme().primaryBg
|
||||
wx.setBackgroundColor({ backgroundColor: bg, backgroundColorTop: bg, backgroundColorBottom: bg })
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user