添加轮数的声音
This commit is contained in:
@@ -75,6 +75,8 @@ export const audioFils = {
|
|||||||
"https://static.shelingxingqiu.com/attachment/2025-11-12/de6ellen3zoalxcb06.mp3",
|
"https://static.shelingxingqiu.com/attachment/2025-11-12/de6ellen3zoalxcb06.mp3",
|
||||||
向左上调整:
|
向左上调整:
|
||||||
"https://static.shelingxingqiu.com/attachment/2025-11-12/de6ellf37a2iw6w4pu.mp3",
|
"https://static.shelingxingqiu.com/attachment/2025-11-12/de6ellf37a2iw6w4pu.mp3",
|
||||||
|
最后30秒:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-11-13/de7kzzllq0futwynso.mp3",
|
||||||
};
|
};
|
||||||
|
|
||||||
// 版本控制日志函数
|
// 版本控制日志函数
|
||||||
|
|||||||
@@ -168,14 +168,16 @@ async function onReceiveMessage(messages = []) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (wait.value !== msg.wait) {
|
if (wait.value !== msg.wait) {
|
||||||
wait.value = msg.wait;
|
setTimeout(() => {
|
||||||
if (msg.wait === 20) {
|
wait.value = msg.wait;
|
||||||
halfTime.value = true;
|
if (msg.wait === 20) {
|
||||||
audioManager.play("中场休息");
|
halfTime.value = true;
|
||||||
}
|
audioManager.play("中场休息");
|
||||||
if (msg.wait === 0) {
|
}
|
||||||
halfTime.value = false;
|
if (msg.wait === 0) {
|
||||||
}
|
halfTime.value = false;
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
} else if (msg.constructor === MESSAGETYPES.MatchOver) {
|
} else if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||||
audioManager.play("比赛结束");
|
audioManager.play("比赛结束");
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ const practiseId = ref("");
|
|||||||
const showGuide = ref(false);
|
const showGuide = ref(false);
|
||||||
const tips = ref("");
|
const tips = ref("");
|
||||||
const wait = ref(0);
|
const wait = ref(0);
|
||||||
|
const timer = ref(null);
|
||||||
|
|
||||||
const onReady = async () => {
|
const onReady = async () => {
|
||||||
const result = await createPractiseAPI(total);
|
const result = await createPractiseAPI(total);
|
||||||
@@ -34,9 +35,7 @@ const onReady = async () => {
|
|||||||
currentRound.value = 0;
|
currentRound.value = 0;
|
||||||
scores.value = [];
|
scores.value = [];
|
||||||
start.value = true;
|
start.value = true;
|
||||||
setTimeout(() => {
|
audioManager.play(["请开始射击", "第一轮"]);
|
||||||
uni.$emit("play-sound", "请开始射击");
|
|
||||||
}, 300);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
async function onReceiveMessage(messages = []) {
|
async function onReceiveMessage(messages = []) {
|
||||||
@@ -55,6 +54,10 @@ async function onReceiveMessage(messages = []) {
|
|||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
if (scores.value.length === 3) audioManager.play("第二轮");
|
||||||
|
if (scores.value.length === 9) audioManager.play("第四轮");
|
||||||
|
}, 500);
|
||||||
} else if (msg.constructor === MESSAGETYPES.ShootSyncMePracticeID) {
|
} else if (msg.constructor === MESSAGETYPES.ShootSyncMePracticeID) {
|
||||||
if (practiseId.value && practiseId.value === msg.practice.id) {
|
if (practiseId.value && practiseId.value === msg.practice.id) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -69,7 +72,19 @@ async function onReceiveMessage(messages = []) {
|
|||||||
} else if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
|
} else if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
|
||||||
wait.value = msg.wait;
|
wait.value = msg.wait;
|
||||||
if (msg.wait === 20) uni.$emit("update-ramain", 0);
|
if (msg.wait === 20) uni.$emit("update-ramain", 0);
|
||||||
if (msg.wait === 0) uni.$emit("update-ramain", 60);
|
if (msg.wait === 0) {
|
||||||
|
let count = 60;
|
||||||
|
uni.$emit("update-ramain", count);
|
||||||
|
if (scores.value.length === 6) audioManager.play("第三轮");
|
||||||
|
setInterval(() => {
|
||||||
|
count -= 1;
|
||||||
|
if (count === 30) {
|
||||||
|
audioManager.play("最后30秒");
|
||||||
|
clearInterval(timer.value);
|
||||||
|
timer.value = null;
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -95,6 +110,7 @@ const onClickShare = debounce(async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
audioManager.play("第一轮");
|
||||||
uni.setKeepScreenOn({
|
uni.setKeepScreenOn({
|
||||||
keepScreenOn: true,
|
keepScreenOn: true,
|
||||||
});
|
});
|
||||||
@@ -109,6 +125,10 @@ onBeforeUnmount(() => {
|
|||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
uni.$off("share-image", onClickShare);
|
uni.$off("share-image", onClickShare);
|
||||||
audioManager.stopAll();
|
audioManager.stopAll();
|
||||||
|
if (timer.value) {
|
||||||
|
clearTimeout(timer.value);
|
||||||
|
timer.value = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user