fix(aihr): align task labels and training duration

This commit is contained in:
2026-07-14 14:15:02 +08:00
parent 23328f66ff
commit 8bb43a2394
6 changed files with 92 additions and 7 deletions
@@ -62,6 +62,9 @@
<view v-for="item in recentPracticeItems" :key="item.id" class="assignment-row recent-row" :class="{ highlighted: item.assignment && highlightedAssignmentId === item.assignment.id }" @click="openRecentItem(item)">
<view class="recent-icon" aria-hidden="true">{{ item.icon }}</view>
<view class="assignment-copy">
<text v-if="item.sourceLabel" class="assignment-badge" :class="item.assignment?.source || 'manual'">
{{ item.sourceLabel }}
</text>
<text class="assignment-title">{{ item.title }}</text>
<text class="assignment-desc">{{ item.desc }}</text>
</view>
@@ -271,6 +274,7 @@ type RecentPracticeItem = {
id: string;
title: string;
desc: string;
sourceLabel?: string;
status: string;
icon: string;
assignment?: PracticeAssignment;
@@ -334,6 +338,7 @@ const recentPracticeItems = computed<RecentPracticeItem[]>(() => {
id: `assignment-${item.id}`,
title: item.question || item.scenarioName || '专项训练',
desc: item.status === '已完成' ? '已完成' : '待复盘',
sourceLabel: assignmentSourceLabel(item.source),
status: item.status,
icon: item.scenarioName?.includes('催费') ? '⌕' : item.scenarioName?.includes('报修') ? '⌁' : '◉',
assignment: item
@@ -370,6 +375,12 @@ const assignmentDesc = (item: PracticeAssignment) => {
return item.feedback || item.reason;
};
const assignmentSourceLabel = (source?: string) => {
if (source === 'retry') return '错题再练';
if (source === 'camp') return '训练营';
return '专项训练';
};
const goLogin = () => {
rememberLoginRedirect('/pages/user/practice/index');
uni.navigateTo({ url: '/pages/auth/login/index' });