forked from zhongyidian/super_video
feat: 完善模块引导与学习进度体验
统一引导提示的持久化控制,补充学习进度入口与模块资源,避免用户返回页面时重复触发提示。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fc9633f371
commit
6f8252472f
114 files changed
+2758
-1798
No files matched your search
@@ -5,21 +5,16 @@ import ImgButton from '@/components/Button/ImgButton.vue'
|
||||
import { StepNavigation, GuideSteps, GuideStepsItem } from '@/components/Guide'
|
||||
import { Video, QuestionQuiz, type Question } from '@/components'
|
||||
import { getPublicPath, getStaticImage, IMAGE_PATHS } from '@/utils'
|
||||
// 视频导入
|
||||
// 手机摄像头介绍
|
||||
import video1 from '/video/new/xinshou_shoujishexiangtoujieshao.mp4'
|
||||
// 景别概念介绍 - 暂时用其他视频代替
|
||||
import video2 from '/video/new/xsdh_jbgnjs_batch.mp4'
|
||||
// 手机慢动作 - 暂时用其他视频代替
|
||||
import video3 from '/video/new/xsdh_sjmdz_batch.mp4'
|
||||
// 延时摄影 - 暂时用其他视频代替
|
||||
import video4 from '/video/new/xsdh_yssy_batch.mp4'
|
||||
// 神奇的微距摄影
|
||||
import video5 from '/video/new/xsdh_sqdwjsy_batch.mp4'
|
||||
// 夜景摄影 - 暂时用其他视频代替
|
||||
import video6 from '/video/new/xsdh_djmldyjsy_batch.mp4'
|
||||
import { useBasicElementsStore } from '@/stores/modules/basic-elements'
|
||||
|
||||
const router = useRouter()
|
||||
const basicElementsStore = useBasicElementsStore()
|
||||
const introGuideKey = 'basic-shooting-skills-intro'
|
||||
const showIntroGuide = ref(!basicElementsStore.guideShown[introGuideKey])
|
||||
|
||||
if (showIntroGuide.value) {
|
||||
basicElementsStore.markGuideShown(introGuideKey)
|
||||
}
|
||||
|
||||
// 受控播放开关(用于切换到下一个视频时自动播放)
|
||||
const playing = ref(false)
|
||||
@@ -32,36 +27,42 @@ const rawSteps = [
|
||||
id: 'step2',
|
||||
label: '摄影基础',
|
||||
content: '手机摄像头介绍',
|
||||
videoUrl: getPublicPath('video/new/shooting-skills/xinshou_shoujishexiangtoujieshao.mp4'),
|
||||
type: 'post' as const
|
||||
},
|
||||
{
|
||||
id: 'step3',
|
||||
label: '摄影基础',
|
||||
content: '景别概念介绍',
|
||||
videoUrl: getPublicPath('video/new/shooting-skills/xsdh_jbgnjs_batch.mp4'),
|
||||
type: 'post' as const
|
||||
},
|
||||
{
|
||||
id: 'step4',
|
||||
label: '摄影基础',
|
||||
content: '手机慢动作',
|
||||
videoUrl: getPublicPath('video/new/shooting-skills/xsdh_sjmdz_batch.mp4'),
|
||||
type: 'post' as const
|
||||
},
|
||||
{
|
||||
id: 'step5',
|
||||
label: '摄影基础',
|
||||
content: '延时摄影',
|
||||
videoUrl: getPublicPath('video/new/shooting-skills/xsdh_yssy_batch.mp4'),
|
||||
type: 'post' as const
|
||||
},
|
||||
{
|
||||
id: 'step6',
|
||||
label: '摄影基础',
|
||||
content: '神奇的微距摄影',
|
||||
videoUrl: getPublicPath('video/new/shooting-skills/xsdh_sqdwjsy_batch.mp4'),
|
||||
type: 'post' as const
|
||||
},
|
||||
{
|
||||
id: 'step7',
|
||||
label: '摄影基础',
|
||||
content: '独具魅力的夜景摄影',
|
||||
videoUrl: getPublicPath('video/new/shooting-skills/xsdh_djmldyjsy_batch.mp4'),
|
||||
type: 'post' as const
|
||||
}
|
||||
]
|
||||
@@ -73,9 +74,11 @@ const showStepNavigation = ref(false)
|
||||
const currentNavigationStep = ref(0) // 对应视频索引,从0开始
|
||||
|
||||
// 视频列表
|
||||
const videoList = [video1, video2, video3, video4, video5, video6]
|
||||
const currentVideoIndex = ref(0)
|
||||
|
||||
//按顺序播放
|
||||
const currentVideo = computed(() => navigationSteps.value[currentVideoIndex.value].videoUrl)
|
||||
|
||||
// 题目数据:景别概念介绍(index 1)、手机慢动作(index 2)、独具魅力的夜景摄影(index 5)
|
||||
const questions = ref<Question[]>([])
|
||||
|
||||
@@ -172,9 +175,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 {
|
||||
@@ -297,7 +299,11 @@ const handleQuestionsComplete = () => {
|
||||
@close="handleStepNavigationClose"
|
||||
/>
|
||||
|
||||
<GuideSteps :visible="true" position-offset-y="85%" @complete="handleIntroGuideComplete">
|
||||
<GuideSteps
|
||||
:visible="showIntroGuide"
|
||||
position-offset-y="85%"
|
||||
@complete="handleIntroGuideComplete"
|
||||
>
|
||||
<GuideStepsItem :audio-src="getPublicPath('audio/py_1_018.MP3')">
|
||||
欢迎来到基础拍摄训练区!
|
||||
</GuideStepsItem>
|
||||
|
||||
Reference in new issue
Block a user