feat: 完善视频学习进度缓存

完善新手导航和三大创作模块的视频完成缓存、未完成提示与学习进度计算,确保进度按实际学习资源完成情况更新。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
zhongyidianandClaude Opus 4.7 committed 2026-05-11 09:05:29 +08:00
1 parent 1f8723aabd
commit 6f289959be
63 files changed
+3139 -1126

No files matched your search

+34 -4
View File
@@ -6,9 +6,11 @@ import PracticeRatingModal, {
type PracticeRatingItem,
} from '@/components/PracticeRatingModal'
import { IMAGE_PATHS, getPublicPath } from '@/utils'
import { ref } from 'vue'
import { useInterviewStore } from '@/stores/modules/interview'
import { computed, ref } from 'vue'
const router = useRouter()
const store = useInterviewStore()
const props = defineProps({
path: {
@@ -17,8 +19,24 @@ const props = defineProps({
},
})
type PracticeRatingScores = Record<string, number>
const workKey = computed<string>(() => decodeURIComponent(props.path))
const applyScores = (
items: PracticeRatingItem[],
scores: PracticeRatingScores,
): PracticeRatingItem[] =>
items.map((item) => ({
...item,
score: scores[item.title] ?? item.score,
}))
const toScores = (items: PracticeRatingItem[]): PracticeRatingScores =>
Object.fromEntries(items.map((item) => [item.title, item.score]))
/** 评估项目列表 */
const evaluationItems = ref<PracticeRatingItem[]>([
const defaultEvaluationItems: PracticeRatingItem[] = [
{
title: '人物表达',
description: '能清晰介绍人物身份、特点或故事,让观众认识人物',
@@ -49,7 +67,18 @@ const evaluationItems = ref<PracticeRatingItem[]>([
description: '作品完整,有真实感与感染力,具备观看吸引力',
score: 5,
},
])
]
const evaluationItems = ref<PracticeRatingItem[]>(
applyScores(
defaultEvaluationItems,
store.getPracticeWorkRating(workKey.value),
),
)
const handleSaveEvaluation = (items: PracticeRatingItem[]): void => {
store.setPracticeWorkRating(workKey.value, toScores(items))
}
/** 保存弹窗 */
const showModal = ref<boolean>(false)
@@ -82,10 +111,11 @@ const handleBack = (): void => {
<PracticeRatingModal
:visible="showModal"
:items="evaluationItems"
v-model:items="evaluationItems"
background-image="interview/practice/人物访谈短片创作-作品评分表"
top-tip="评分时要关注6个维度哦~分别是人物表达、素材拍摄、镜头语言、剪辑结构、音画关系、综合观感每个维度满分5分,能打1-5分,记得对照作品表现来打分呀~"
bottom-tip="己评价的实战作品,从封面入口就能直接看到具体评分!打了多少分一目了然,不用再点进详情页翻找啦~"
@save="handleSaveEvaluation"
@close="showModal = false"
/>
</div>