细节修改

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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