GettingStartedVideoModal.vue
7.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<template>
<transition name="video-modal-fade">
<div v-if="visible" class="video-modal-overlay">
<div class="video-modal-panel">
<!-- 头部 -->
<header class="video-modal-header">
<button
v-if="selectedVideo"
class="video-modal-back"
type="button"
@click="selectedVideo = null"
>
← 返回视频列表
</button>
<button
v-else
class="video-modal-back"
type="button"
@click="handleBack"
>
← 返回客服中心
</button>
<h2 class="video-modal-title">
{{ selectedVideo ? selectedVideo.title : '上手视频' }}
</h2>
</header>
<!-- 主体内容 -->
<main class="video-modal-main">
<!-- 视频播放视图 -->
<template v-if="selectedVideo">
<div class="video-player-wrap">
<video
class="video-player"
controls
:src="selectedVideo.videoUrl"
:poster="selectedVideo.poster"
>
您的浏览器不支持视频播放。
</video>
</div>
</template>
<!-- 视频列表视图 -->
<template v-else>
<section class="video-modal-section">
<h4 class="video-modal-section-title">快速开始</h4>
<div class="video-card-grid">
<button
v-for="item in quickStartVideos"
:key="item.id"
class="video-card"
type="button"
@click="selectedVideo = item"
>
<span class="video-card-text">{{ item.title }}</span>
<i :class="['fas', item.icon, 'video-card-icon']"></i>
</button>
</div>
</section>
<section class="video-modal-section">
<h4 class="video-modal-section-title">进阶与合规</h4>
<div class="video-card-grid">
<button
v-for="item in advancedVideos"
:key="item.id"
class="video-card"
type="button"
@click="selectedVideo = item"
>
<span class="video-card-text">{{ item.title }}</span>
<i :class="['fas', item.icon, 'video-card-icon']"></i>
</button>
</div>
</section>
</template>
</main>
</div>
</div>
</transition>
</template>
<script setup lang="ts">
import { ref } from 'vue';
interface VideoItem {
id: string;
title: string;
description: string;
icon: string;
videoUrl: string;
poster?: string;
}
const props = defineProps<{
visible: boolean;
}>();
const emit = defineEmits<{
(e: 'back'): void;
}>();
const selectedVideo = ref<VideoItem | null>(null);
// 默认占位视频地址,后续可替换为真实视频链接
const PLACEHOLDER_VIDEO_URL = 'https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4';
const handleBack = () => {
selectedVideo.value = null;
emit('back');
};
const quickStartVideos: VideoItem[] = [
{
id: 'register-login',
title: '如何注册/登录?',
description: '介绍 LinkMed 账号注册与登录流程。',
icon: 'fa-th-large',
videoUrl: PLACEHOLDER_VIDEO_URL,
},
{
id: 'quick-qa',
title: '如何发起快问快答?',
description: '演示如何使用快问快答功能快速获取答案。',
icon: 'fa-tasks',
videoUrl: PLACEHOLDER_VIDEO_URL,
},
{
id: 'deep-search',
title: '如何进行深度检索?',
description: '展示深度检索的使用方法与最佳实践。',
icon: 'fa-gear',
videoUrl: PLACEHOLDER_VIDEO_URL,
},
];
const advancedVideos: VideoItem[] = [
{
id: 'upload-records',
title: '如何上传病历/资料?',
description: '讲解如何上传病历及各类资料到知识库。',
icon: 'fa-handshake',
videoUrl: PLACEHOLDER_VIDEO_URL,
},
{
id: 'generate-doc',
title: '如何生成文档/PPT?',
description: '演示如何利用 AI 生成文档与演示文稿。',
icon: 'fa-file-powerpoint',
videoUrl: PLACEHOLDER_VIDEO_URL,
},
{
id: 'export-share',
title: '如何导出与分享?',
description: '介绍文档导出与团队分享的操作步骤。',
icon: 'fa-share-alt',
videoUrl: PLACEHOLDER_VIDEO_URL,
},
];
</script>
<style scoped>
.video-modal-overlay {
pointer-events: auto;
position: fixed;
inset: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.25);
z-index: 3999;
}
.video-modal-panel {
width: 760px;
max-width: calc(100vw - 80px);
height: 480px;
max-height: calc(100vh - 80px);
display: flex;
flex-direction: column;
background: #f5f7fa;
border-radius: 16px;
box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
overflow: hidden;
}
.video-modal-header {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 20px;
border-bottom: 1px solid #ebeef5;
background: #ffffff;
}
.video-modal-back {
border: none;
background: #f2f3f5;
color: #606266;
border-radius: 999px;
padding: 4px 12px;
font-size: 13px;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
}
.video-modal-back:hover {
background: #e4e7ed;
}
.video-modal-title {
margin: 0;
font-size: 16px;
font-weight: 600;
color: #303133;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.video-modal-main {
padding: 12px 16px;
display: flex;
flex-direction: column;
gap: 18px;
overflow-y: auto;
background: #f5f7fa;
}
/* 分区标题 */
.video-modal-section {
background: #ffffff;
border-radius: 12px;
padding: 14px 16px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.video-modal-section-title {
margin: 0 0 12px;
font-size: 14px;
font-weight: 600;
color: #303133;
}
/* 视频卡片网格 */
.video-card-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
}
.video-card {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
background: linear-gradient(135deg, #5dade2, #3498db);
border: none;
border-radius: 12px;
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease;
text-align: left;
}
.video-card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 16px rgba(52, 152, 219, 0.35);
}
.video-card-text {
font-size: 14px;
font-weight: 500;
color: #ffffff;
flex: 1;
}
.video-card-icon {
font-size: 20px;
color: rgba(255, 255, 255, 0.9);
margin-left: 10px;
}
/* 视频播放区 */
.video-player-wrap {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
background: #ffffff;
border-radius: 12px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.video-player {
width: 100%;
max-height: 380px;
border-radius: 8px;
background: #000000;
}
.video-player-desc {
margin: 12px 0 0;
font-size: 13px;
color: #606266;
line-height: 1.5;
}
/* 动画 */
.video-modal-fade-enter-active,
.video-modal-fade-leave-active {
transition: opacity 0.18s ease;
}
.video-modal-fade-enter-from,
.video-modal-fade-leave-to {
opacity: 0;
}
@media (max-width: 1024px) {
.video-modal-panel {
width: calc(100vw - 40px);
max-height: calc(100vh - 40px);
}
.video-card-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 768px) {
.video-modal-panel {
width: calc(100vw - 24px);
max-height: calc(100vh - 24px);
}
.video-card-grid {
grid-template-columns: 1fr;
}
.video-modal-title {
font-size: 14px;
}
}
</style>