细节修改

This commit is contained in:
kron
2025-07-25 09:59:54 +08:00
parent 553e23ed46
commit 85f1f7e33d
9 changed files with 52 additions and 32 deletions

View File

@@ -40,6 +40,9 @@ defineProps({
<text></text>
</view>
</view>
<block v-if="roundResults.length < 3">
<view v-for="i in 3 - roundResults.length" :key="i"> </view>
</block>
</view>
<view>
<view v-for="(result, index) in roundResults" :key="index">
@@ -58,6 +61,9 @@ defineProps({
<text></text>
</view>
</view>
<block v-if="roundResults.length < 3">
<view v-for="i in 3 - roundResults.length" :key="i"> </view>
</block>
</view>
</view>
</view>
@@ -110,6 +116,7 @@ defineProps({
background-color: #692735;
}
.players > view > view {
min-height: 28px;
width: 85%;
padding: 5px 20px;
margin-bottom: 5px;

View File

@@ -1,5 +1,5 @@
<script setup>
import { ref, onMounted } from "vue";
import { ref, onMounted, onUnmounted } from "vue";
import { onShow } from "@dcloudio/uni-app";
import AppBackground from "@/components/AppBackground.vue";
import Header from "@/components/Header.vue";
@@ -47,6 +47,11 @@ onMounted(() => {
const deviceInfo = uni.getDeviceInfo();
isIos.value = deviceInfo.osName === "ios";
});
onUnmounted(() => {
// const pages = getCurrentPages();
// const currentPage = pages[pages.length - 1];
// uni.setStorageSync("last-route", currentPage.route);
});
onShow(() => {
uni.$showHint = showGlobalHint;
uni.$hideHint = hideGlobalHint;

View File

@@ -110,7 +110,7 @@ const setClipboardData = () => {
padding: 0 10px;
display: flex;
flex-wrap: wrap;
gap: 15px;
gap: 12px;
justify-content: center;
margin-bottom: 15px;
}
@@ -119,7 +119,8 @@ const setClipboardData = () => {
height: 55px;
text-align: center;
border-radius: 10px;
border: 1px solid #fff3;
border: 2rpx solid #fff3;
box-sizing: border-box;
color: #fff;
display: flex;
flex-direction: column;
@@ -128,6 +129,7 @@ const setClipboardData = () => {
}
.battle-choosen {
color: #fed847;
border: 4rpx solid #fff3;
border-color: #fed847;
}
.battle-close {

View File

@@ -104,8 +104,8 @@ onUnmounted(() => {
align-items: center;
}
.back-btn > image {
width: 22px;
height: 22px;
width: 18px;
height: 18px;
margin-right: 10px;
}
.first-try-steps {

View File

@@ -73,6 +73,9 @@ onUnmounted(() => {
}}</text>
<text></text>
</view>
<text v-if="bluePoint === 0 && redPoint === 0">
本场比赛无人射箭已取消
</text>
<text v-if="bluePoint === redPoint">
红队蓝队各得<text :style="{ color: '#fed847', margin: '0 5px' }">{{
redPoint

View File

@@ -466,17 +466,19 @@ async function onReceiveMessage(messages = []) {
tips.value = "准备下半场";
}
if (msg.constructor === MESSAGETYPES.MatchOver) {
uni.setStorageSync("last-battle", msg.endStatus);
if (msg.endStatus.noSaved) {
uni.showToast({
title: "本场比赛无人射箭,已取消",
icon: "none",
});
// uni.showToast({
// title: "本场比赛无人射箭,已取消",
// icon: "none",
// });
currentBluePoint.value = 0;
currentRedPoint.value = 0;
setTimeout(() => {
uni.navigateBack();
}, 1500);
} else {
isEnded.value = true;
uni.setStorageSync("last-battle", msg.endStatus);
setTimeout(() => {
uni.redirectTo({
url: "/pages/battle-result",
@@ -537,7 +539,7 @@ onUnmounted(() => {
const refreshTimer = ref(null);
onShow(async () => {
if (battleId.value) {
if (!isEnded.value && (await isGameEnded())) return;
if (!isEnded.value && (await isGameEnded(battleId.value))) return;
getCurrentGameAPI();
const refreshData = () => {
const lastAwakeTime = uni.getStorageSync("last-awake-time");

View File

@@ -162,23 +162,13 @@ async function onReceiveMessage(messages = []) {
tips.value = "准备下半场";
}
if (msg.constructor === MESSAGETYPES.MatchOver) {
isEnded.value = true;
uni.setStorageSync("last-battle", msg.endStatus);
if (msg.endStatus.noSaved) {
uni.showToast({
title: "本场比赛无人射箭,已取消",
icon: "none",
setTimeout(() => {
uni.redirectTo({
url: "/pages/battle-result",
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
} else {
isEnded.value = true;
setTimeout(() => {
uni.redirectTo({
url: "/pages/battle-result",
});
}, 1500);
}
}, 1500);
}
if (msg.constructor === MESSAGETYPES.BackToGame) {
uni.$emit("update-header-loading", false);

View File

@@ -233,6 +233,7 @@ async function onReceiveMessage(messages = []) {
}
}
if (msg.constructor === MESSAGETYPES.FinalShoot) {
currentShooterId.value = 0;
if (!isFinalShoot.value) {
isFinalShoot.value = true;
showRoundTip.value = true;
@@ -240,17 +241,19 @@ async function onReceiveMessage(messages = []) {
}
}
if (msg.constructor === MESSAGETYPES.MatchOver) {
uni.setStorageSync("last-battle", msg.endStatus);
if (msg.endStatus.noSaved) {
uni.showToast({
title: "本场比赛无人射箭,已取消",
icon: "none",
});
// uni.showToast({
// title: "本场比赛无人射箭,已取消",
// icon: "none",
// });
currentBluePoint.value = 0;
currentRedPoint.value = 0;
setTimeout(() => {
uni.navigateBack();
}, 1500);
} else {
isEnded.value = true;
uni.setStorageSync("last-battle", msg.endStatus);
setTimeout(() => {
uni.redirectTo({
url: "/pages/battle-result",
@@ -289,7 +292,7 @@ onUnmounted(() => {
const refreshTimer = ref(null);
onShow(async () => {
if (battleId.value) {
if (!isEnded.value && (await isGameEnded())) return;
if (!isEnded.value && (await isGameEnded(battleId.value))) return;
getCurrentGameAPI();
const refreshData = () => {
const lastAwakeTime = uni.getStorageSync("last-awake-time");

View File

@@ -37,6 +37,14 @@ function createWebSocket(token, onMessage) {
) {
return;
}
// const lastRoute = uni.getStorageSync("last-route");
// if (
// lastRoute === "pages/battle-room" ||
// lastRoute === "pages/team-match" ||
// lastRoute === "pages/melee-match"
// ) {
// return;
// }
const { battleInfo } = msg;
uni.setStorageSync("current-battle", battleInfo);
console.log("----battleInfo", battleInfo);