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-08 09:44:59 +08:00
1 parent fc9633f371
commit 6f8252472f
114 files changed
+2758 -1798

No files matched your search

+16 -8
View File
@@ -6,20 +6,24 @@ import { StepNavigation } from '@/components/Guide'
import { Video, QuestionQuiz, type Question } from '@/components'
import { getPublicPath, getStaticImage, IMAGE_PATHS } from '@/utils'
import { GuideSteps } from '@/components/Guide'
// 光初识 - 暂时用光的基础认知代替
import video1 from '/video/new/xinshou_guangdejichurenzhi.mp4'
import video2 from '/video/new/xinshou_guangdesidashuxing.mp4'
import video3 from '/video/new/xsdh_psdhjsj_batch.mp4'
import GuideStepsItem from '@/components/Guide/GuideStepsItem.vue'
import { useBasicElementsStore } from '@/stores/modules/basic-elements'
const router = useRouter()
const basicElementsStore = useBasicElementsStore()
const introGuideKey = 'basic-light-intro'
const showIntroGuide = ref(!basicElementsStore.guideShown[introGuideKey])
if (showIntroGuide.value) {
basicElementsStore.markGuideShown(introGuideKey)
}
// 受控播放开关(用于切换到下一个视频时自动播放)
const playing = ref(false)
const status = ref(false)
const showQuiz = ref(false) // 控制是否显示答题窗口
const isGuide = ref(true)
const isGuide = showIntroGuide
const currentGuideStep = ref(0)
const showGoldenHourGuide = ref(false)
const goldenHourGuideShown = ref(false)
@@ -48,18 +52,21 @@ const navigationSteps = ref([
id: 'step2',
label: '视觉素养',
content: '光的基础认知',
videoUrl: getPublicPath('video/new/light/xinshou_guangdejichurenzhi.mp4'),
type: 'planning' as const
},
{
id: 'step3',
label: '视觉素养',
content: '光的四大属性',
videoUrl: getPublicPath('video/new/light/xinshou_guangdesidashuxing.mp4'),
type: 'planning' as const
},
{
id: 'step4',
label: '视觉素养',
content: '拍摄的黄金时间',
videoUrl: getPublicPath('video/new/light/xsdh_psdhjsj_batch.mp4'),
type: 'planning' as const
}
])
@@ -69,9 +76,11 @@ const showStepNavigation = ref(false)
const currentNavigationStep = ref(0) // 对应视频索引,从0开始
// 视频列表
const videoList = [video1, video2, video3]
const currentVideoIndex = ref(0)
//按顺序播放
const currentVideo = computed(() => navigationSteps.value[currentVideoIndex.value].videoUrl)
// 题目数据:拍摄的黄金时间(index 2)
const questions = ref<Question[]>([])
@@ -107,9 +116,8 @@ const getQuestionsForVideo = (index: number): Question[] => {
}
//按顺序播放
const currentVideo = computed(() => videoList[currentVideoIndex.value])
const handleVideoChange = () => {
if (currentVideoIndex.value < videoList.length - 1) {
if (currentVideoIndex.value < navigationSteps.value.length - 1) {
currentVideoIndex.value++
currentNavigationStep.value = currentVideoIndex.value
} else {