Просмотр исходного кода

fix: 主题切换硬编码颜色修复 + 修复PricingController测试断言

- commission/index.vue: 卡片背景硬编码移除,字体/状态徽章改用 CSS 变量
- withdraw/index.vue: 卡片背景硬编码移除,链接/错误字体改用 CSS 变量
- ControllerIntegrationTest: isSeedPrice 断言修正为 true
- test-coverage-report.md: 更新测试结果为 196/0/5,新增主题修复记录
liaoxg 3 месяцев назад
Родитель
Сommit
9b25c1d442

+ 9 - 9
client/pages/commission/index.vue

@@ -382,7 +382,7 @@ function formatDate(dateStr) {
 
 /* Section */
 .section {
-  background: #fff;
+  background: var(--color-bg-card);
   border-radius: 14px;
   padding: 16px;
   margin-bottom: 16px;
@@ -400,7 +400,7 @@ function formatDate(dateStr) {
 }
 .section-sub {
   font-size: 12px;
-  color: #3B82F6;
+  color: var(--color-info);
   font-weight: 500;
 }
 
@@ -606,14 +606,14 @@ function formatDate(dateStr) {
   font-size: 12px;
   font-weight: 600;
   color: var(--color-gold);
-  background: #FEF3C7;
+  background: var(--color-gold-bg);
   padding: 2px 10px;
   border-radius: 4px;
   letter-spacing: 1px;
 }
 .tool-arrow {
   font-size: 18px;
-  color: #CBD5E0;
+  color: var(--color-text-secondary);
 }
 
 /* ===== Commission List ===== */
@@ -629,7 +629,7 @@ function formatDate(dateStr) {
 .comm-amount {
   font-size: 15px;
   font-weight: 600;
-  color: #2D8B67;
+  color: var(--color-success);
   display: block;
 }
 .comm-level {
@@ -640,7 +640,7 @@ function formatDate(dateStr) {
 }
 .comm-remark {
   font-size: 11px;
-  color: #8B9DAB;
+  color: var(--color-text-tertiary);
   margin-top: 1px;
   display: block;
 }
@@ -652,10 +652,10 @@ function formatDate(dateStr) {
   display: inline-block;
   margin-bottom: 2px;
 }
-.comm-status.status-settled { background: #ECFDF5; color: #2D8B67; }
-.comm-status.status-pending { background: #FEF3C7; color: #D4A017; }
+.comm-status.status-settled { background: var(--color-success-bg); color: var(--color-success); }
+.comm-status.status-pending { background: var(--color-warning-bg); color: var(--color-warning); }
 .comm-status.status-withdrawn { background: var(--color-bg-input); color: var(--color-text-secondary); }
-.comm-status.status-available { background: #EFF6FF; color: #3B82F6; }
+.comm-status.status-available { background: var(--color-info-bg); color: var(--color-info); }
 .comm-date {
   font-size: 11px;
   color: var(--color-text-secondary);

+ 4 - 4
client/pages/withdraw/index.vue

@@ -128,7 +128,7 @@ function formatMoney(cents) {
 }
 
 .input-section {
-  background: #fff;
+  background: var(--color-bg-card);
   border-radius: 14px;
   padding: 20px;
   margin-bottom: 16px;
@@ -172,18 +172,18 @@ function formatMoney(cents) {
 }
 .hint-link {
   font-size: 12px;
-  color: #3B82F6;
+  color: var(--color-info);
   font-weight: 500;
 }
 .error-text {
   display: block;
   font-size: 12px;
-  color: #EF4444;
+  color: var(--color-danger);
   margin-top: 8px;
 }
 
 .rules-card {
-  background: #fff;
+  background: var(--color-bg-card);
   border-radius: 14px;
   padding: 16px 20px;
   margin-bottom: 24px;

+ 17 - 3
docs/test-coverage-report.md

@@ -1,13 +1,14 @@
 # 测试覆盖率报告
 
-**生成日期:** 2026-06-05
-**分支:** master
+**生成日期:** 2026-06-08
+**分支:** master (rebased on origin/master)
+**备注:** 本次从远程拉取更新后 rebase,解决冲突后全量运行 196 测试全通过;同时修复了主题切换时字体颜色和卡片背景不跟随的 CSS 问题(改用 CSS 变量)。
 
 ## 总览
 
 | 套件 | 运行 | 通过 | 失败 | 错误 | 跳过 |
 |------|------|------|------|------|------|
-| 后端单元测试 | 183 | 183 | 0 | 0 | 5 |
+| 后端单元测试 | 196 | 196 | 0 | 0 | 5 |
 | Playwright E2E (admin) | 3 | 3 | 0 | 0 | 0 |
 
 ## 后端测试详情
@@ -71,6 +72,19 @@
 | `admin/settings` | 管理页面新增 | Dify AI 配置卡片、关系类型配置卡片 |
 | `client/relations/analysis-*.vue`(3页) | 新增前端页面 | 选择成员→AI对话→历史记录 |
 
+## 主题切换修复(v20260608)
+
+| 页面 | 修复项 | 说明 |
+|------|--------|------|
+| `client/pages/commission/index.vue` | `.section` 背景 `#fff` → `--color-bg-card` | 卡片不跟主题切换 |
+| | `.section-sub`, `.comm-amount`, `.comm-remark`, `.tool-arrow` | 硬编码字体颜色 → CSS 变量 |
+| | 状态徽章 `.status-settled/pending/available` | 背景和文字颜色 → 语义变量 |
+| `client/pages/withdraw/index.vue` | `.input-section`, `.rules-card` 背景 `#fff` → `--color-bg-card` | 卡片不跟主题切换 |
+| | `.hint-link` `#3B82F6` → `--color-info` | 链接颜色 |
+| | `.error-text` `#EF4444` → `--color-danger` | 错误提示颜色 |
+| **剩余已知问题** | `client/pages/profile/` 仍有 `#FEF3C7`, `#E5E7EB`, `#F9FAFB` 等硬编码 | 需后续处理 |
+| | `client/pages/relations/*.vue` 21处 `color: #FFFFFF` | 部分在深色背景上可保留,需逐一确认 |
+
 ## 已知缺口
 
 | 区域 | 问题 | 优先级 |

+ 1 - 1
num-server/src/test/java/com/etotem/num/controller/ControllerIntegrationTest.java

@@ -834,7 +834,7 @@ class ControllerIntegrationTest {
                 .andExpect(jsonPath("$.data.seedPrice").value(131400))
                 .andExpect(jsonPath("$.data.standardPrice").value(198600))
                 .andExpect(jsonPath("$.data.annualFee").value(13100))
-                .andExpect(jsonPath("$.data.isSeedPrice").value(false))
+                .andExpect(jsonPath("$.data.isSeedPrice").value(true))
                 .andExpect(jsonPath("$.data.remainingSeats").value(300))
                 .andExpect(jsonPath("$.data.seedLimit").value(300));
     }