feat(KidsMode): 添加播放按钮到主内容区,使用大号播放图标

Made-with: Cursor
This commit is contained in:
zhonghua 2026-03-24 11:33:43 +08:00
parent 5cc99d232a
commit f288155c8c

View File

@ -70,12 +70,10 @@
</div> </div>
<!-- 空状态 --> <!-- 空状态 -->
<div v-else key="empty" class="empty-content"> <div v-else key="empty" class="empty-content"> <button class="play-area-btn"
<div class="empty-icon"> :disabled="allLessonResources.length === 0" @click.stop="playCurrentResource">
<BookOpen :size="80" :stroke-width="1.5" /> <Play :size="120" :stroke-width="2.5" />
</div> </button>
<div class="empty-text">{{ props.currentLesson?.name || '准备开始' }}</div>
<div class="empty-hint">点击下方资源开始播放</div>
</div> </div>
</Transition> </Transition>
</div> </div>
@ -198,6 +196,7 @@ import {
VolumeX, VolumeX,
MonitorPlay, MonitorPlay,
Lightbulb, Lightbulb,
Play,
} from 'lucide-vue-next'; } from 'lucide-vue-next';
import EbookViewer from './viewers/EbookViewer.vue'; import EbookViewer from './viewers/EbookViewer.vue';
import Player from '@/views/office/player.vue'; import Player from '@/views/office/player.vue';
@ -801,6 +800,12 @@ const handleResourceByIndex = (index: number) => {
} }
}; };
//
const playCurrentResource = () => {
if (allLessonResources.value.length === 0) return;
handleResourceByIndex(currentResourceIndex.value);
};
// //
const prevResource = () => { const prevResource = () => {
if (currentResourceIndex.value > 0) { if (currentResourceIndex.value > 0) {
@ -1227,6 +1232,37 @@ onUnmounted(() => {
opacity: 0.7; opacity: 0.7;
color: #8D6E63; color: #8D6E63;
} }
.play-area-btn {
display: flex;
align-items: center;
justify-content: center;
width: 160px;
height: 160px;
margin-top: 32px;
padding: 0;
border-radius: 50%;
background: linear-gradient(135deg, #FF9800 0%, #FF6F00 100%);
border: 4px solid #E65100;
color: white;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 8px 32px rgba(255, 111, 0, 0.45);
&:hover:not(:disabled) {
transform: scale(1.08);
box-shadow: 0 12px 40px rgba(255, 111, 0, 0.55);
}
&:active:not(:disabled) {
transform: scale(0.98);
}
&:disabled {
opacity: 0.4;
cursor: not-allowed;
}
}
} }
// //
@ -1511,7 +1547,8 @@ onUnmounted(() => {
.resources-section { .resources-section {
margin-bottom: 16px; margin-bottom: 16px;
padding: 4px 0; /* 为动画留出上下呼吸空间,避免被父级裁剪 */ padding: 4px 0;
/* 为动画留出上下呼吸空间,避免被父级裁剪 */
.section-label { .section-label {
display: flex; display: flex;
@ -1533,7 +1570,8 @@ onUnmounted(() => {
display: flex; display: flex;
gap: 16px; gap: 16px;
overflow-x: auto; overflow-x: auto;
padding: 16px 12px; /* 增加内边距,为 scale/shadow 动画留出空间 */ padding: 16px 12px;
/* 增加内边距,为 scale/shadow 动画留出空间 */
flex-wrap: wrap; flex-wrap: wrap;
&::-webkit-scrollbar { &::-webkit-scrollbar {