添加游戏结束,隐藏返回按钮

This commit is contained in:
kron
2025-07-19 16:41:23 +08:00
parent ca317d62e0
commit 9e83bf89f7
2 changed files with 13 additions and 2 deletions

View File

@@ -23,7 +23,6 @@ function createWebSocket(token, onMessage) {
// 接收消息
uni.onSocketMessage((res) => {
const data = JSON.parse(res.data);
// console.log(res);
if (data.event === "pong" || !data.data.updates) return;
if (onMessage) onMessage(data.data.updates);
const msg = data.data.updates[0];
@@ -50,6 +49,9 @@ function createWebSocket(token, onMessage) {
}
}
}
if (msg.constructor === MESSAGETYPES.MatchOver) {
uni.$emit("game-over");
}
if (msg.constructor === MESSAGETYPES.PaySuccess) {
console.log(1111111, msg);
}