添加游戏结束,隐藏返回按钮
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user