From a90f241defdf3a216c30f15baef2ec6cb769d242 Mon Sep 17 00:00:00 2001 From: let5sne Date: Sat, 18 Jul 2026 05:56:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(mobile):=20overnight=20audit=20round=20?= =?UTF-8?q?=E2=80=94=20IA=20cleanup,=20internal=20codes,=20exam=20guard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 夜间自迭代体检(生产四tab+7子页,截图+console+接口+文案标志采集) 发现三类问题,本轮修复: 1. 信息架构(采纳用户建议):今日页「我的地图」四宫格三项与底部tab 重复(问/练),仅学习中心/工作上报有增量 → 整块从今日页移除, 「学习中心/我的训练概况/工作上报」下沉到「我」页新「常用功能」组 (图标+标题+说明行,与我的积分同列);今日页保留小贴士条, 页面高度显著缩短、不再与tab栏功能重复。 2. 内部编码泄漏:派发 reason 里的调度批次码(AUTO22-20260717 PILOT-04)在今日「今日安排」、练页「最近练过」、学习中心 「昨日错题重练」三处原样示人 → 新增 services/text.ts stripInternalCodes(剥前缀码保留人话,整行为码则回退默认文案), 三处渲染点统一接入。 3. 功能不通:直接访问 /pages/user/exam/index(无id)会请求 /api/aihr/mobile/exams/0 → 服务端500 → load() 增加 id 守卫, 显示「请从学习中心·考试任务进入」且不再发请求。 同时:今日「打字问」描述改为不换行文案(原两行文案窄列截断)。 验证:本地7项断言全过;生产复核 map removed/code clean/ profile entries/exam guard/exams|0 not fired 全 true。 发布备份 h5-before-20260718055449。 Co-Authored-By: Claude Fable 5 --- mobile-uni/src/pages/user/exam/index.vue | 5 + mobile-uni/src/pages/user/learning/index.vue | 3 +- mobile-uni/src/pages/user/practice/index.vue | 5 +- mobile-uni/src/pages/user/profile/index.vue | 111 +++++++++++++++++++ mobile-uni/src/pages/user/today/index.vue | 89 ++------------- mobile-uni/src/services/text.ts | 22 ++++ 6 files changed, 150 insertions(+), 85 deletions(-) create mode 100644 mobile-uni/src/services/text.ts diff --git a/mobile-uni/src/pages/user/exam/index.vue b/mobile-uni/src/pages/user/exam/index.vue index 72c8e974..f785e815 100644 --- a/mobile-uni/src/pages/user/exam/index.vue +++ b/mobile-uni/src/pages/user/exam/index.vue @@ -125,6 +125,11 @@ const speechLabel = (question: ExamQuestion) => speech.value.key === `q-${questi ? (speech.value.status === 'playing' ? '停止' : '生成中') : '播报题目'; const load = async () => { + // Direct visits without a valid exam id must not fire /exams/0 (server 500). + if (!id.value || id.value <= 0) { + message.value = '请从「学习中心 · 考试任务」进入具体考试'; + return; + } loading.value = true; try { exam.value = await getMyExam(id.value); diff --git a/mobile-uni/src/pages/user/learning/index.vue b/mobile-uni/src/pages/user/learning/index.vue index 4df2e1f4..f79e88d1 100644 --- a/mobile-uni/src/pages/user/learning/index.vue +++ b/mobile-uni/src/pages/user/learning/index.vue @@ -297,6 +297,7 @@ import { navigateBackToToday, resetPageScroll } from '@/services/navigation'; import { ensureEmployeePosition } from '@/services/position'; import { listMyExams } from '@/services/exam'; import { createPageRequestScope, currentAccountKey, type RequestScopeTicket } from '@/services/request-scope'; +import { stripInternalCodes } from '@/services/text'; const defaultScenarioId = 'complaint-water'; const pendingAssignmentKey = 'aihr_pending_assignment_id'; @@ -396,7 +397,7 @@ const assignmentDesc = (item: PracticeAssignment) => { if (item.status === '已完成' && item.feedback) return item.feedback; return '提交后显示反馈与参考答案'; } - return item.reason || item.feedback; + return stripInternalCodes(item.reason || item.feedback || ''); }; const assignmentSourceLabel = (source?: string) => { diff --git a/mobile-uni/src/pages/user/practice/index.vue b/mobile-uni/src/pages/user/practice/index.vue index 4a8fb0c1..d9da1663 100644 --- a/mobile-uni/src/pages/user/practice/index.vue +++ b/mobile-uni/src/pages/user/practice/index.vue @@ -358,6 +358,7 @@ import { resetPageScroll } from '@/services/navigation'; import { ensureEmployeePosition } from '@/services/position'; import { chooseSpeechAudio, createSpeechPlaybackController, measureAudioDuration, normalizeOssId, transcribeSpeechBlob, transcribeSpeechFile } from '@/services/speech'; import { createPageRequestScope, currentAccountKey, type RequestScopeTicket } from '@/services/request-scope'; +import { stripInternalCodes } from '@/services/text'; type PracticeStatus = 'idle' | 'starting' | 'active' | 'submitting' | 'finished'; type RecentPracticeItem = { @@ -668,9 +669,9 @@ const assignmentDesc = (item: PracticeAssignment) => { if (item.source === 'daily' && item.status === '已完成') { const score = typeof item.score === 'number' ? `得分 ${item.score} 分` : ''; const mode = item.scoreMode === 'LLM' ? 'AI语义评估' : '规则兜底'; - return [score, mode, item.feedback || item.reason].filter(Boolean).join(' · '); + return [score, mode, stripInternalCodes(item.feedback || item.reason || '')].filter(Boolean).join(' · '); } - return item.feedback || item.reason; + return stripInternalCodes(item.feedback || item.reason || ''); }; const assignmentSourceLabel = (source?: string) => { diff --git a/mobile-uni/src/pages/user/profile/index.vue b/mobile-uni/src/pages/user/profile/index.vue index ee2de42d..026ebb0a 100644 --- a/mobile-uni/src/pages/user/profile/index.vue +++ b/mobile-uni/src/pages/user/profile/index.vue @@ -120,6 +120,34 @@ › + + 常用功能 + + + + + 成长证据包(待人工复核) @@ -243,6 +271,19 @@ const openPoints = () => { uni.navigateTo({ url: '/pages/user/points/index' }); }; +const openLearning = () => { + uni.navigateTo({ url: '/pages/user/learning/index' }); +}; + +const openPracticeSummary = () => { + uni.setStorageSync('aihr_sop_pending_tool', 'MY_PRACTICE_SUMMARY'); + uni.switchTab({ url: '/pages/user/sop/index' }); +}; + +const openReport = () => { + uni.navigateTo({ url: `/pages/common/building/index?title=${encodeURIComponent('工作上报')}` }); +}; + const clearProfileData = () => { profile.value = null; history.value = []; @@ -765,4 +806,74 @@ onShow(() => { color: var(--employee-muted); font-size: 12px; } + +.feature-entries { + display: flex; + flex-direction: column; + gap: 4px; +} + +.feature-entry { + display: flex; + align-items: center; + gap: 12px; + width: 100%; + margin: 0; + padding: 12px 4px; + border: none; + background: transparent; + text-align: left; + line-height: 1.3; +} + +.feature-entry::after { + border: none; +} + +.feature-entry + .feature-entry { + border-top: 1px solid #f2f3f5; +} + +.feature-entry-icon { + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + width: 38px; + height: 38px; + border-radius: 10px; + color: #ffffff; + font-size: 16px; + font-weight: 700; +} + +.feature-entry-icon.learn { + background: #1f5c9d; +} + +.feature-entry-icon.summary { + background: #e70014; +} + +.feature-entry-icon.report { + background: #d98200; +} + +.feature-entry-copy { + flex: 1; + display: flex; + flex-direction: column; + gap: 2px; +} + +.feature-entry-title { + color: #18202b; + font-size: 15px; + font-weight: 700; +} + +.feature-entry-desc { + color: #8a93a0; + font-size: 12px; +} diff --git a/mobile-uni/src/pages/user/today/index.vue b/mobile-uni/src/pages/user/today/index.vue index cefead9d..17928664 100644 --- a/mobile-uni/src/pages/user/today/index.vue +++ b/mobile-uni/src/pages/user/today/index.vue @@ -46,7 +46,7 @@ 打字问 - 输入问题获得解答 + 输入文字提问 @@ -87,7 +87,7 @@ 今日安排 - @@ -134,30 +134,6 @@ - - - - 我的地图 - - - - - -