Commit 73d56f33 by liimin

style(theme): 统一使用CSS变量管理背景颜色并优化代码结构

- 将多个组件中的硬编码背景色替换为统一的CSS变量
- 添加全局背景色变量定义,包括页面、卡片、头部、图标等状态
- 优化Equity Detail页面的类型安全和代码结构
- 使用工具函数替代直接的类型转换操作
- 重构组件方法调用方式,提高代码可维护性
1 parent 0342a36e
...@@ -152,7 +152,7 @@ function getIconUrl(icon: string): string { ...@@ -152,7 +152,7 @@ function getIconUrl(icon: string): string {
width: var(--entrance-icon-size); width: var(--entrance-icon-size);
height: var(--entrance-icon-size); height: var(--entrance-icon-size);
border-radius: var(--l-radius-md); border-radius: var(--l-radius-md);
background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf5 100%); background-color: var(--bg-icon);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
......
...@@ -171,7 +171,7 @@ function onSlideTapFromEvent(idx: any): void { ...@@ -171,7 +171,7 @@ function onSlideTapFromEvent(idx: any): void {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid rgba(226, 236, 248, 0.8); border-bottom: 1px solid rgba(226, 236, 248, 0.8);
background: linear-gradient(135deg, rgba(248, 251, 255, 0.95) 0%, rgba(240, 246, 255, 0.95) 100%); background-color: var(--bg-header);
} }
.intro-hero-title-wrap { .intro-hero-title-wrap {
...@@ -253,7 +253,7 @@ function onSlideTapFromEvent(idx: any): void { ...@@ -253,7 +253,7 @@ function onSlideTapFromEvent(idx: any): void {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
background-image: linear-gradient(to top, rgba(30, 58, 138, 0.56) 0%, rgba(30, 58, 138, 0.0) 26%); background-color: rgba(30, 58, 138, 0.3);
border-radius: 10px; border-radius: 10px;
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf5 50%, #e4e9f2 100%); background-color: var(--bg-page);
} }
/* 嵌入 index tab 槽(SceneShell 右侧):在 flex 列/行里占满剩余空间,避免仅依赖 height:100% 横竖屏一侧失效 */ /* 嵌入 index tab 槽(SceneShell 右侧):在 flex 列/行里占满剩余空间,避免仅依赖 height:100% 横竖屏一侧失效 */
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
align-items: center; align-items: center;
padding-left: var(--l-spacing-lg); padding-left: var(--l-spacing-lg);
border-bottom: 1px solid rgba(0, 0, 0, 0.06); border-bottom: 1px solid rgba(0, 0, 0, 0.06);
background: linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent); background-color: rgba(255, 255, 255, 0.5);
} }
.title-text { .title-text {
...@@ -426,11 +426,11 @@ ...@@ -426,11 +426,11 @@
} }
.addr-line-left { .addr-line-left {
background: linear-gradient(to left, #eeeeee, rgba(216, 216, 216, 0)); background-color: #eeeeee;
} }
.addr-line-right { .addr-line-right {
background: linear-gradient(to right, #eeeeee, rgba(216, 216, 216, 0)); background-color: #eeeeee;
} }
// ===== HomeFrame Tabbar( .hf-landscape-column, // ===== HomeFrame Tabbar( .hf-landscape-column,
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
.search-input { .search-input {
width: 100%; width: 100%;
height: var(--account-search-height); height: var(--account-search-height);
background-color: #ffffff; background-color: var(--bg-card);
border-radius: 20px; border-radius: 20px;
box-sizing: border-box; box-sizing: border-box;
padding: 0 16px; padding: 0 16px;
......
...@@ -380,7 +380,7 @@ onMounted(() => { ...@@ -380,7 +380,7 @@ onMounted(() => {
.items { .items {
min-height: 92px; min-height: 92px;
background-color: #ffffff; background-color: var(--bg-card);
border-radius: 16px; border-radius: 16px;
padding: 18px; padding: 18px;
display: flex; display: flex;
...@@ -425,7 +425,7 @@ onMounted(() => { ...@@ -425,7 +425,7 @@ onMounted(() => {
0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.08),
0 2px 6px rgba(15, 23, 42, 0.1); 0 2px 6px rgba(15, 23, 42, 0.1);
border-color: rgba(22, 119, 255, 0.4); border-color: rgba(22, 119, 255, 0.4);
background-color: #f0f4ff; background-color: var(--bg-pressed);
} }
.left { .left {
...@@ -508,7 +508,7 @@ onMounted(() => { ...@@ -508,7 +508,7 @@ onMounted(() => {
} }
.active { .active {
background-color: rgba(22, 119, 255, 0.04); background-color: var(--bg-active);
border-color: rgba(22, 119, 255, 0.3); border-color: rgba(22, 119, 255, 0.3);
box-shadow: box-shadow:
0 4px 16px rgba(22, 119, 255, 0.12), 0 4px 16px rgba(22, 119, 255, 0.12),
......
...@@ -306,7 +306,7 @@ defineExpose({ ...@@ -306,7 +306,7 @@ defineExpose({
.items { .items {
min-height: 72px; min-height: 72px;
background-color: #ffffff; background-color: var(--bg-card);
border-radius: 14px; border-radius: 14px;
padding: 12px 14px; padding: 12px 14px;
display: flex; display: flex;
...@@ -338,7 +338,7 @@ defineExpose({ ...@@ -338,7 +338,7 @@ defineExpose({
0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.08),
0 2px 6px rgba(15, 23, 42, 0.1); 0 2px 6px rgba(15, 23, 42, 0.1);
border-color: rgba(22, 119, 255, 0.4); border-color: rgba(22, 119, 255, 0.4);
background-color: #f0f4ff; background-color: var(--bg-pressed);
} }
} }
...@@ -357,7 +357,7 @@ defineExpose({ ...@@ -357,7 +357,7 @@ defineExpose({
width: 36px; width: 36px;
height: 36px; height: 36px;
border-radius: 10px; border-radius: 10px;
background-color: rgba(22, 119, 255, 0.06); background-color: var(--bg-icon);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
...@@ -397,7 +397,7 @@ defineExpose({ ...@@ -397,7 +397,7 @@ defineExpose({
} }
.items.active { .items.active {
background-color: rgba(22, 119, 255, 0.04); background-color: var(--bg-active);
border-color: rgba(22, 119, 255, 0.25); border-color: rgba(22, 119, 255, 0.25);
box-shadow: box-shadow:
0 3px 12px rgba(22, 119, 255, 0.1), 0 3px 12px rgba(22, 119, 255, 0.1),
......
...@@ -223,7 +223,7 @@ defineExpose({ ...@@ -223,7 +223,7 @@ defineExpose({
.items { .items {
min-height: 92px; min-height: 92px;
background-color: #ffffff; background-color: var(--bg-card);
border-radius: 16px; border-radius: 16px;
padding: 18px; padding: 18px;
display: flex; display: flex;
...@@ -251,7 +251,7 @@ defineExpose({ ...@@ -251,7 +251,7 @@ defineExpose({
0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.08),
0 2px 6px rgba(15, 23, 42, 0.1); 0 2px 6px rgba(15, 23, 42, 0.1);
border-color: rgba(22, 119, 255, 0.4); border-color: rgba(22, 119, 255, 0.4);
background-color: #f0f4ff; background-color: var(--bg-pressed);
} }
.left { .left {
...@@ -324,7 +324,7 @@ defineExpose({ ...@@ -324,7 +324,7 @@ defineExpose({
} }
.active { .active {
background-color: rgba(22, 119, 255, 0.04); background-color: var(--bg-active);
border-color: rgba(22, 119, 255, 0.3); border-color: rgba(22, 119, 255, 0.3);
box-shadow: box-shadow:
0 4px 16px rgba(22, 119, 255, 0.12), 0 4px 16px rgba(22, 119, 255, 0.12),
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
// 淡雅蓝灰背景 - 企业级设计规范(iOS/Android 兼容) // 淡雅蓝灰背景 - 企业级设计规范(iOS/Android 兼容)
background-color: #e8ecf1; background-color: var(--bg-page);
overflow: hidden; overflow: hidden;
// 添加装饰性渐变光晕效果 // 添加装饰性渐变光晕效果
......
...@@ -6,6 +6,13 @@ export const globalScreenVars = { ...@@ -6,6 +6,13 @@ export const globalScreenVars = {
'--radius': '8px', '--radius': '8px',
'--opacity': 1, '--opacity': 1,
'--padding': '12px', '--padding': '12px',
// 全局背景色 - 淡雅蓝灰(企业级设计规范)
'--bg-page': '#f5f7fa',
'--bg-card': '#ffffff',
'--bg-header': '#f8fbff',
'--bg-icon': '#f5f7fa',
'--bg-active': 'rgba(22, 119, 255, 0.04)',
'--bg-pressed': '#f0f4ff',
}, },
// 竖屏全局 // 竖屏全局
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!