添加全局返回游戏
This commit is contained in:
@@ -47,7 +47,7 @@ const isFinalShoot = ref(false);
|
||||
onLoad(async (options) => {
|
||||
if (options.battleId) {
|
||||
const battleInfo = uni.getStorageSync(`battle-${options.battleId}`);
|
||||
// console.log("----battleInfo", battleInfo);
|
||||
console.log("----battleInfo", battleInfo);
|
||||
if (battleInfo) {
|
||||
battleId.value = battleInfo.id;
|
||||
start.value = true;
|
||||
@@ -83,7 +83,7 @@ onLoad(async (options) => {
|
||||
}
|
||||
});
|
||||
async function stopMatch() {
|
||||
uni.navigateBack();
|
||||
uni.$showHint(3);
|
||||
}
|
||||
async function readyToGo() {
|
||||
if (battleId.value) {
|
||||
@@ -153,6 +153,11 @@ async function onReceiveMessage(messages = []) {
|
||||
msg.target
|
||||
);
|
||||
}
|
||||
} else {
|
||||
roundResults.value.push({
|
||||
redArrows: [],
|
||||
blueArrows: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
|
||||
@@ -217,6 +222,7 @@ onUnmounted(() => {
|
||||
:title="battleId ? '1V1排位赛' : '搜索对手...'"
|
||||
:bgType="1"
|
||||
:onBack="onBack"
|
||||
:showBackToGame="false"
|
||||
>
|
||||
<view class="container">
|
||||
<block v-if="battleId">
|
||||
@@ -260,7 +266,11 @@ onUnmounted(() => {
|
||||
:round="currentRound - 1"
|
||||
:bluePoint="currentBluePoint"
|
||||
:redPoint="currentRedPoint"
|
||||
:roundData="roundResults[roundResults.length - 1]"
|
||||
:roundData="
|
||||
roundResults[roundResults.length - 2]
|
||||
? roundResults[roundResults.length - 2]
|
||||
: []
|
||||
"
|
||||
:onAutoClose="() => (showRoundTip = false)"
|
||||
/>
|
||||
</ScreenHint>
|
||||
|
||||
Reference in New Issue
Block a user