hookehuyr

feat(page): 学习详情和课程详情页标题改为动态显示课程名

- StudyDetailPage: 标题显示具体课程名,默认"学习详情"
- StudyCoursePage: 标题显示具体课程名,默认"课程详情"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
......@@ -120,7 +120,7 @@
</template>
<script setup>
import { ref, onMounted, nextTick, onUnmounted, computed } from 'vue';
import { ref, onMounted, nextTick, onUnmounted, computed, watch } from 'vue';
import { useTitle } from '@vueuse/core';
import { useRouter } from "vue-router";
import dayjs from 'dayjs';
......@@ -137,9 +137,6 @@ const course_id = computed(() => {
return router.currentRoute.value.params.id || '';
});
// 页面标题
useTitle('课程详情');
// 当前激活的标签页
const activeTab = ref('detail');
// tabs DOM映射
......@@ -258,6 +255,11 @@ const updateTabsWrapperHeight = () => {
};
const course = ref([]);
// 页面标题(动态显示课程名)
const pageTitle = computed(() => course.value?.title || '课程详情');
watch(pageTitle, (newTitle) => useTitle(newTitle), { immediate: true });
const course_lessons = ref([]);
const course_type_maps = ref({
video: '视频',
......
......@@ -238,7 +238,7 @@
</template>
<script setup>
import { ref, onMounted, nextTick } from 'vue';
import { ref, onMounted, nextTick, computed, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useTitle } from '@vueuse/core';
import VideoPlayer from '@/components/media/VideoPlayer.vue';
......@@ -396,8 +396,9 @@ const handleCheckInSuccess = () => {
const audioList = ref([]);
// 设置页面标题
useTitle('学习详情');
// 设置页面标题(动态显示课程名)
const pageTitle = computed(() => course.value?.title || '学习详情');
watch(pageTitle, (newTitle) => useTitle(newTitle), { immediate: true });
const topWrapperHeight = ref(0);
const bottomWrapperHeight = ref(0);
......