diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue index ea08984..9378110 100644 --- a/src/components/BowTarget.vue +++ b/src/components/BowTarget.vue @@ -98,13 +98,13 @@ watch( } ); -function calcRealX(num) { +function calcRealX(num, offset = 3.4) { const len = 20.4 + num; - return `calc(${(len / 40.8) * 100 - 1.5}%)`; + return `calc(${(len / 40.8) * 100 - offset / 2}%)`; } -function calcRealY(num) { +function calcRealY(num, offset = 3.4) { const len = num < 0 ? Math.abs(num) + 20.4 : 20.4 - num; - return `calc(${(len / 40.8) * 100 - 1.5}%)`; + return `calc(${(len / 40.8) * 100 - offset / 2}%)`; } const simulShoot = async () => { if (device.value.deviceId) await simulShootAPI(device.value.deviceId); @@ -136,8 +136,8 @@ onMounted(() => { v-if="latestOne && user.id === latestOne.playerId" class="e-value fade-in-out" :style="{ - left: calcRealX(latestOne.ring ? latestOne.x : 0, 66), - top: calcRealY(latestOne.ring ? latestOne.y : 0, 150), + left: calcRealX(latestOne.ring ? latestOne.x : 0, 20), + top: calcRealY(latestOne.ring ? latestOne.y : 0, 40), }" > 经验 +1 @@ -146,8 +146,8 @@ onMounted(() => { v-if="latestOne" class="round-tip fade-in-out" :style="{ - left: calcRealX(latestOne.ring ? latestOne.x : 0, 100), - top: calcRealY(latestOne.ring ? latestOne.y : 0, 100), + left: calcRealX(latestOne.ring ? latestOne.x : 0, 28), + top: calcRealY(latestOne.ring ? latestOne.y : 0, 28), }" >{{ latestOne.ring || "未上靶" }} { } .hit { position: absolute; - width: 3%; - height: 3%; - min-width: 3%; - min-height: 3%; + width: 3.4%; + height: 3.4%; + min-width: 3.4%; + min-height: 3.4%; border-radius: 50%; border: 1px solid #fff; z-index: 1; diff --git a/src/components/CreateRoom.vue b/src/components/CreateRoom.vue index ed7f821..311743b 100644 --- a/src/components/CreateRoom.vue +++ b/src/components/CreateRoom.vue @@ -27,7 +27,10 @@ const createRoom = async () => { if (battleMode.value === 2) size = 10; if (battleMode.value === 3) size = 4; if (battleMode.value === 4) size = 6; - const result = await createRoomAPI(battleMode.value === 2 ? 2 : 1, size); + const result = await createRoomAPI( + battleMode.value === 2 ? 2 : 1, + battleMode.value === 2 ? 10 : size + ); if (result.number) roomNumber.value = result.number; step.value = 2; loading.value = false; diff --git a/src/components/PlayerSeats.vue b/src/components/PlayerSeats.vue index cf0d457..797d2bb 100644 --- a/src/components/PlayerSeats.vue +++ b/src/components/PlayerSeats.vue @@ -65,7 +65,7 @@ const seats = new Array(props.total).fill(1); } .players > view > image:nth-child(2) { width: 40px; - height: 40px; + min-height: 40px; margin: 0 10px; border: 1px solid #fff; border-radius: 50%; diff --git a/src/pages/battle-room.vue b/src/pages/battle-room.vue index a8d9d58..c974789 100644 --- a/src/pages/battle-room.vue +++ b/src/pages/battle-room.vue @@ -34,6 +34,7 @@ const refreshRoomTimer = ref(null); async function refreshRoomData() { if (!roomNumber.value) return; const result = await getRoomAPI(roomNumber.value); + if (result.started) return; room.value = result; battleType.value = result.battleType; (result.members || []).some((m) => { diff --git a/src/pages/my-growth.vue b/src/pages/my-growth.vue index 44cf06c..bed70a9 100644 --- a/src/pages/my-growth.vue +++ b/src/pages/my-growth.vue @@ -101,50 +101,13 @@ const onPractiseLoading = async (page) => { {{ item.createdAt }} - - - - - {{ item.bluePlayers[0].name }} - - - - - - - {{ item.redPlayers[0].name }} - - - - - - - - {{ p.name }} - - +