feat:增加状态提示文本
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m56s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m56s
This commit is contained in:
parent
e3f81d4f7b
commit
36cd9aeaf0
64
src/App.vue
64
src/App.vue
@ -72,6 +72,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 状态提示文本(字幕与拾音按钮之间) -->
|
||||
<div class="status-hint">{{ statusText }}</div>
|
||||
|
||||
<!-- 拾音按钮 - 左下角 -->
|
||||
<button
|
||||
v-if="audioMode === 'btn'"
|
||||
@ -439,7 +442,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { ref, watch, computed } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import SubtitlePanel from "@/components/SubtitlePanel.vue";
|
||||
import { useDigitalHuman } from "@/hooks/useDigitalHuman";
|
||||
@ -502,6 +505,17 @@ const toggleMic = () => {
|
||||
};
|
||||
const dhInterrupt = () => interrupt();
|
||||
|
||||
// 状态提示文本:与拾音按钮状态实时同步,使用繁体字显示
|
||||
const statusText = computed(() => {
|
||||
if (pickPhase.value === "recording") return "接受語音";
|
||||
if (pickPhase.value === "processing" || pickPhase.value === "waiting")
|
||||
return "思考中";
|
||||
if (pickPhase.value === "broadcasting") return "播報中";
|
||||
// idle 状态
|
||||
if (audioMode.value === "rtc" && !isMuted.value) return "接受語音";
|
||||
return "麥克風關閉";
|
||||
});
|
||||
|
||||
// 语音有效性辅助函数:去除空白和标点后检查是否有实质内容
|
||||
const hasSubstantialContent = (text: string): boolean => {
|
||||
const cleaned = text.replace(
|
||||
@ -1008,6 +1022,25 @@ async function handleVoiceQueryComplete(text: string) {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/* ===== 状态提示文本(字幕与拾音按钮之间) ===== */
|
||||
.status-hint {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: 20%;
|
||||
z-index: 25;
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 0.65);
|
||||
letter-spacing: 2px;
|
||||
text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
|
||||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
transition:
|
||||
color 0.3s ease,
|
||||
opacity 0.3s ease;
|
||||
}
|
||||
|
||||
/* ===== 拾音按钮 ===== */
|
||||
.mic-btn {
|
||||
flex-shrink: 0;
|
||||
@ -1371,6 +1404,12 @@ async function handleVoiceQueryComplete(text: string) {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.status-hint {
|
||||
font-size: 28px;
|
||||
bottom: 20%;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.subtitle-container {
|
||||
max-height: 40vh;
|
||||
}
|
||||
@ -1482,6 +1521,11 @@ async function handleVoiceQueryComplete(text: string) {
|
||||
padding: 20px 28px;
|
||||
}
|
||||
|
||||
.status-hint {
|
||||
font-size: 32px;
|
||||
bottom: 20%;
|
||||
}
|
||||
|
||||
.mic-bottom-left {
|
||||
left: 50%;
|
||||
transform: translateX(-220px);
|
||||
@ -1639,6 +1683,12 @@ async function handleVoiceQueryComplete(text: string) {
|
||||
padding: 18px 24px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.status-hint {
|
||||
font-size: 44px;
|
||||
letter-spacing: 3px;
|
||||
bottom: 20%;
|
||||
}
|
||||
}
|
||||
|
||||
/* 1440×2560 分辨率专用优化 */
|
||||
@ -1687,6 +1737,12 @@ async function handleVoiceQueryComplete(text: string) {
|
||||
font-size: 20px;
|
||||
border-radius: 36px;
|
||||
}
|
||||
|
||||
.status-hint {
|
||||
font-size: 56px;
|
||||
letter-spacing: 4px;
|
||||
bottom: 20%;
|
||||
}
|
||||
}
|
||||
|
||||
/* 横屏模式 */
|
||||
@ -1727,6 +1783,12 @@ async function handleVoiceQueryComplete(text: string) {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.status-hint {
|
||||
font-size: 28px;
|
||||
bottom: 20%;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.mic-bottom-left {
|
||||
left: 50%;
|
||||
transform: translateX(-180px);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user