bug修复

This commit is contained in:
kron
2026-02-07 11:59:21 +08:00
parent 6101cd80ce
commit 715e614f9d
8 changed files with 22 additions and 22 deletions

View File

@@ -59,26 +59,25 @@ const seats = new Array(props.total).fill(1);
<style scoped>
.players {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
-moz-column-gap: 20px;
column-gap: 14px;
display: grid;
grid-template-columns: repeat(2, 1fr);
row-gap: 20rpx;
column-gap: 25rpx;
margin-bottom: 20px;
font-size: 14px;
padding: 0 14px;
}
.players > view {
width: calc(50% - 7px);
display: flex;
align-items: center;
position: relative;
color: #fff;
height: 100px;
height: 176rpx;
overflow: hidden;
}
.players > view > image:first-child {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
}

View File

@@ -96,8 +96,12 @@ const resetTimer = (count) => {
watch(
() => props.start,
(newVal) => {
if (newVal) resetTimer(props.total);
else if (timer.value) clearInterval(timer.value);
if (newVal) {
resetTimer(props.total);
} else {
remain.value = 0;
clearInterval(timer.value);
}
},
{
immediate: true,

View File

@@ -32,7 +32,6 @@ onLoad(async (options) => {
if (!options.battleId) return;
const myId = user.value.id;
const result = await getBattleAPI(options.battleId || "59090720979554304");
console.log("result", result);
data.value = result;
if (result.winTeam) {
ifWin.value = result.teams[result.winTeam].players.some(
@@ -74,7 +73,7 @@ const myTeam = computed(() => {
const checkBowData = () => {
uni.navigateTo({
url: `/pages/match-detail?id=${data.value.matchId}`,
url: `/pages/match-detail?battleId=${data.value.matchId}`,
});
};
</script>

View File

@@ -153,7 +153,7 @@ async function onReceiveMessage(message) {
uni.setStorageSync("blue-team", message.teams[1].players || []);
uni.setStorageSync("red-team", message.teams[2].players || []);
uni.redirectTo({
url: "/pages/team-battle?battleId" + message.matchId,
url: "/pages/team-battle?battleId=" + message.matchId,
});
} else {
uni.redirectTo({
@@ -252,7 +252,7 @@ onBeforeUnmount(() => {
</view>
<image src="../static/versus.png" mode="widthFix" />
<view
v-if="!opponent.id"
v-if="opponent.id"
class="player"
:style="{ transform: 'translateY(60px)' }"
>

View File

@@ -26,6 +26,7 @@ const roomID = ref("");
const loading = ref(false);
const enterRoom = debounce(async (number) => {
if (loading.value) return;
if (!canEenter(user.value, device.value, online.value)) return;
if (game.value.inBattle) {
uni.$showHint(1);

View File

@@ -15,8 +15,8 @@ const data = ref({
const players = ref([]);
onLoad(async (options) => {
if (!options.id) return;
battleId.value = options.id || "59090720979554304";
if (!options.battleId) return;
battleId.value = options.battleId || "59090720979554304";
const result = await getBattleAPI(battleId.value);
data.value = result;
if (result.mode > 3) {
@@ -43,11 +43,11 @@ onLoad(async (options) => {
});
const checkBowData = (selected) => {
if (data.value.way === 1) {
if (data.value.mode <= 3) {
uni.navigateTo({
url: `/pages/team-bow-data?battleId=${battleId.value}&selected=${selected}`,
});
} else if (data.value.way === 2) {
} else {
uni.navigateTo({
url: `/pages/melee-bow-data?battleId=${battleId.value}`,
});

View File

@@ -30,7 +30,6 @@ const halfTimeTip = ref(false);
const halfRest = ref(false);
function recoverData(battleInfo, { force = false } = {}) {
console.log("battleInfo", battleInfo);
if (battleInfo.way === 1) title.value = "好友约战 - 大乱斗";
if (battleInfo.way === 2) title.value = "排位赛 - 大乱斗";
players.value = battleInfo.teams[0].players;
@@ -82,8 +81,6 @@ function recoverData(battleInfo, { force = false } = {}) {
uni.$emit("update-remain", 90 - remain - 0.2);
}, 200);
}
} else {
uni.$emit("update-remain", battleInfo.readyTime);
}
}

View File

@@ -14,8 +14,8 @@ const currentUser = ref({
const players = ref([]);
onLoad(async (options) => {
if (!options.id) return;
const result = await getBattleAPI(options.battleId || "59090720979554304");
if (!options.battleId) return;
const result = await getBattleAPI(options.battleId || "59348111700660224");
players.value = result.resultList.map((item, index) => {
const plist = result.teams[0] ? result.teams[0].players : [];
const p = plist.find((p) => p.id === item.userId);