bug 修复

This commit is contained in:
kron
2025-08-21 18:32:28 +08:00
parent 4347dea41e
commit 17e463a884
5 changed files with 25 additions and 58 deletions

View File

@@ -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 || "未上靶"
}}<text v-if="latestOne.ring"></text></view
@@ -246,10 +246,10 @@ onMounted(() => {
}
.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;

View File

@@ -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;

View File

@@ -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%;