feat(展播): 退出时先跳转谢谢观看页再关闭窗口

- 新增 BroadcastThanksView 谢谢观看页
- 展播退出时先跳转谢谢观看页
- 谢谢观看页尝试关闭窗口,无法关闭则停留该页

Made-with: Cursor
This commit is contained in:
zhonghua 2026-03-24 14:34:53 +08:00
parent 67af92ddfd
commit 37d821990f
3 changed files with 48 additions and 5 deletions

View File

@ -309,6 +309,12 @@ const routes: RouteRecordRaw[] = [
component: () => import('@/views/teacher/lessons/LessonRecordsView.vue'),
meta: { title: '课后记录' },
},
{
path: 'broadcast/thanks',
name: 'TeacherBroadcastThanks',
component: () => import('@/views/teacher/lessons/BroadcastThanksView.vue'),
meta: { title: '谢谢观看' },
},
{
path: 'broadcast/:id',
name: 'TeacherBroadcast',

View File

@ -0,0 +1,40 @@
<template>
<div class="broadcast-thanks pos-fixed top-0 left-0 w-full h-full z-999">
<div class="thanks-content">
<h1 class="thanks-title">谢谢观看</h1>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted } from 'vue';
onMounted(() => {
// window.open
window.close();
});
</script>
<style scoped lang="scss">
.broadcast-thanks {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: #1a1a2e;
}
.thanks-content {
text-align: center;
}
.thanks-title {
font-size: 48px;
font-weight: 600;
color: #fff;
margin: 0;
letter-spacing: 0.2em;
opacity: 0.95;
}
</style>

View File

@ -280,15 +280,12 @@ const goBackToLesson = () => {
}
};
// 退
// 退
const handleExit = () => {
// opener
if (window.opener && !window.opener.closed) {
window.opener.focus();
window.close();
} else {
goBackToLesson();
}
router.replace({ name: 'TeacherBroadcastThanks' });
};
//