添加全局返回游戏
This commit is contained in:
@@ -277,6 +277,11 @@ async function onReceiveMessage(messages = []) {
|
||||
msg.target
|
||||
);
|
||||
}
|
||||
} else {
|
||||
roundResults.value.push({
|
||||
redArrows: [],
|
||||
blueArrows: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
if (room.value.battleType === 2) {
|
||||
@@ -373,7 +378,12 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Container title="对战" :onBack="onBack" :bgType="battleId ? 1 : 0">
|
||||
<Container
|
||||
title="对战"
|
||||
:onBack="onBack"
|
||||
:bgType="battleId ? 1 : 0"
|
||||
:showBackToGame="false"
|
||||
>
|
||||
<view class="standby-phase" v-if="step === 1">
|
||||
<Guide>
|
||||
<view class="battle-guide">
|
||||
|
||||
@@ -7,6 +7,7 @@ import UserHeader from "@/components/UserHeader.vue";
|
||||
import SModal from "@/components/SModal.vue";
|
||||
import Signin from "@/components/Signin.vue";
|
||||
import BubbleTip from "@/components/BubbleTip.vue";
|
||||
import BackToGame from "@/components/BackToGame.vue";
|
||||
import {
|
||||
getAppConfig,
|
||||
getHomeData,
|
||||
@@ -100,6 +101,7 @@ const comingSoon = () => {
|
||||
<Container :isHome="true">
|
||||
<view class="container" :style="{ paddingTop: isIos ? '100rpx' : '70rpx' }">
|
||||
<UserHeader showRank :onSignin="() => (showModal = true)" />
|
||||
<BackToGame />
|
||||
<view :style="{ padding: '12px 10px' }">
|
||||
<view class="feature-grid">
|
||||
<view class="bow-card">
|
||||
|
||||
@@ -93,7 +93,7 @@ onLoad(async (options) => {
|
||||
}
|
||||
});
|
||||
async function stopMatch() {
|
||||
uni.navigateBack();
|
||||
uni.$showHint(3);
|
||||
}
|
||||
async function readyToGo() {
|
||||
if (battleId.value) {
|
||||
@@ -184,6 +184,7 @@ onUnmounted(() => {
|
||||
:title="battleId ? '大乱斗排位赛' : '搜索对手...'"
|
||||
:bgType="1"
|
||||
:onBack="onBack"
|
||||
:showBackToGame="false"
|
||||
>
|
||||
<view class="container">
|
||||
<block v-if="battleId">
|
||||
|
||||
@@ -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