diff --git a/src/App.vue b/src/App.vue index 303e518..521d4dd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -95,6 +95,9 @@ clearInterval(heartBeatTimer.value!) const waveTestData = ref("") // 显示设置窗口 const showSettings = ref(false) +// 显示游戏开始警告 +const showWarnWindow = ref(false) +const warnWindowCountdown = ref(5); // 连接状态 const gameState = ref(false) @@ -129,6 +132,19 @@ watch(selectedGift, (newGift) => { selectedWave.value = waveData[newGift] }) +watch(showWarnWindow, (newVal) => { + if (newVal) { + let timer = setInterval(() => { + warnWindowCountdown.value--; + if (warnWindowCountdown.value <= 0) { + clearInterval(timer); + } + }, 1000); + } else { + warnWindowCountdown.value = 5; // 重置倒计时 + } +}); + const fansMedal = computed({ get: () => settings.value.fansMedal, set: (value) => { settings.value.fansMedal = value === 'true' } @@ -188,6 +204,7 @@ const gameStart = () => { heartBeatThis(game_info.game_id) }, 20000) handleCreateSocket() + showLiveWarn() gameState.value = true } else { console.log("-----游戏开始失败-----") @@ -323,6 +340,17 @@ const acknowledgeSafetyNotice = () => { localStorage.setItem('showSafetyNotice', 'false') } +/** + * 显示直播警告 + */ +const showLiveWarn = () => { + showWarnWindow.value = true + // 五秒后关闭 + setTimeout(() => { + showWarnWindow.value = false + }, 5000) +} + /** * 将数字大航海等级转换为文字 */ @@ -356,7 +384,7 @@ const guardLevelText = computed(() => { -
+

⚠ 本地设置数据升级

@@ -390,6 +418,16 @@ const guardLevelText = computed(() => {
+
+
+ +
+
+
+ 【注意】请不要在直播过程中展示或使用郊狼主机及配件,直播务必遵守平台规则,否则可能导致账号被封禁!({{ warnWindowCountdown }}) +
+
+
@@ -568,4 +606,21 @@ const guardLevelText = computed(() => { margin: 10px 0; font-size: 18px; } + +.warn-window { + display: flex; + position: fixed; + top: 40%; + bottom: 40%; + left: 20%; + right: 20%; + background-color: #a00; + border-radius: 20px; + border: #ffe99d 2px solid; + z-index: 100; + padding: 20px; +} +.warn-window > * { + margin: 10px; +}