添加游戏异常结束处理
This commit is contained in:
@@ -421,9 +421,16 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||
uni.setStorageSync("last-battle", msg.endStatus);
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
});
|
||||
if (msg.endStatus.nosaved) {
|
||||
uni.showToast({
|
||||
title: "游戏结束",
|
||||
icon: "none",
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -148,9 +148,16 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||
uni.setStorageSync("last-battle", msg.endStatus);
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
});
|
||||
if (msg.endStatus.nosaved) {
|
||||
uni.showToast({
|
||||
title: "游戏结束",
|
||||
icon: "none",
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -214,9 +214,16 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||
uni.setStorageSync("last-battle", msg.endStatus);
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
});
|
||||
if (msg.endStatus.nosaved) {
|
||||
uni.showToast({
|
||||
title: "游戏结束",
|
||||
icon: "none",
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user