细节修改

This commit is contained in:
kron
2025-07-18 15:04:29 +08:00
parent 4f4178b75d
commit b09f68789e
8 changed files with 50 additions and 28 deletions

View File

@@ -296,8 +296,8 @@ const simulShoot2 = async () => {
} }
.stop-sign { .stop-sign {
position: absolute; position: absolute;
font-size: 40px; font-size: 44px;
color: #fff; color: #fff9;
text-align: center; text-align: center;
width: 200px; width: 200px;
height: 60px; height: 60px;

View File

@@ -57,15 +57,9 @@ onMounted(async () => {
}); });
const checkBowData = () => { const checkBowData = () => {
if (data.value.mode === 1) { uni.navigateTo({
uni.navigateTo({ url: `/pages/match-detail?id=${data.value.id}`,
url: `/pages/team-bow-data?battleId=${data.value.id}`, });
});
} else if (data.value.mode === 2) {
uni.navigateTo({
url: `/pages/melee-bow-data?battleId=${data.value.id}`,
});
}
}; };
</script> </script>
@@ -180,7 +174,7 @@ const checkBowData = () => {
}} }}
</text> </text>
<view class="op-btn"> <view class="op-btn">
<view @click="checkBowData">查看靶纸</view> <view @click="checkBowData">查看成绩</view>
<view @click="exit">退出</view> <view @click="exit">退出</view>
</view> </view>
<UserUpgrade <UserUpgrade

View File

@@ -155,13 +155,15 @@ onLoad(async (options) => {
if (battleInfo.startTime < 0) return; if (battleInfo.startTime < 0) return;
start.value = true; start.value = true;
step.value = 3; step.value = 3;
tips.value = "请连续射出6支箭";
players.value.forEach((p) => { players.value.forEach((p) => {
playersScores.value[p.id] = p.arrows; playersScores.value[p.id] = p.arrows;
if (p.id === user.value.id) { if (p.id === user.value.id) {
scores.value = p.arrows; scores.value = p.arrows;
} }
}); });
tips.value = `${
scores.value.length ? "下半场-" : "上半场-"
}请连续射出6支箭`;
const remain = Date.now() / 1000 - battleInfo.startTime; const remain = Date.now() / 1000 - battleInfo.startTime;
if (remain <= 90) { if (remain <= 90) {
setTimeout(() => { setTimeout(() => {
@@ -346,11 +348,17 @@ async function onReceiveMessage(messages = []) {
step.value = 3; step.value = 3;
seq.value += 1; seq.value += 1;
timerSeq.value = 0; timerSeq.value = 0;
tips.value = "请连续射出6支箭"; tips.value = `${
scores.value.length ? "下半场-" : "上半场-"
}请连续射出6支箭`;
total.value = 90; total.value = 90;
halfTimeTip.value = false; halfTimeTip.value = false;
} }
if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) { if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) {
if (!start.value) {
start.value = true;
step.value = 3;
}
if (battleType.value === 1) { if (battleType.value === 1) {
if (currentShooterId.value !== msg.userId) { if (currentShooterId.value !== msg.userId) {
seq.value += 1; seq.value += 1;
@@ -394,7 +402,7 @@ async function onReceiveMessage(messages = []) {
}); });
} }
} }
if (battleType.value === 2) { if (battleType.value === 2 && msg.userId === user.value.id) {
scores.value.push(msg.target); scores.value.push(msg.target);
power.value = msg.target.battery; power.value = msg.target.battery;
} }
@@ -590,13 +598,13 @@ onUnmounted(() => {
:currentShooterId="currentShooterId" :currentShooterId="currentShooterId"
/> />
<BowTarget <BowTarget
:mode="battleType ? 'team' : 'solo'" :mode="battleType === 1 ? 'team' : 'solo'"
:power="start ? power : 0" :power="start ? power : 0"
:currentRound="currentRound" :currentRound="currentRound"
:totalRound="totalRounds" :totalRound="totalRounds"
:scores="scores" :scores="scores"
:blueScores="blueScores" :blueScores="blueScores"
:stop="halfTimeTip && !startCount" :stop="!startCount"
/> />
<BattleFooter <BattleFooter
v-if="roundResults.length" v-if="roundResults.length"

View File

@@ -33,6 +33,7 @@ onLoad(async (options) => {
<template> <template>
<Container title="靶纸"> <Container title="靶纸">
<view class="container"> <view class="container">
<image src="../static/battle-header-melee.png" mode="widthFix" />
<view class="players" v-if="data.players"> <view class="players" v-if="data.players">
<view <view
v-for="(player, index) in data.players" v-for="(player, index) in data.players"
@@ -49,7 +50,6 @@ onLoad(async (options) => {
:style="{ :style="{
width: `${Math.max(100 / data.players.length, 18)}vw`, width: `${Math.max(100 / data.players.length, 18)}vw`,
}" }"
mode="widthFix"
class="player-bg" class="player-bg"
/> />
<Avatar <Avatar
@@ -90,11 +90,18 @@ onLoad(async (options) => {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative;
}
.container > image:first-child {
position: absolute;
width: 100%;
z-index: 1;
} }
.players { .players {
display: flex; display: flex;
width: 100%; width: 100%;
overflow-x: auto; overflow-x: auto;
margin-top: 25px;
} }
.players::-webkit-scrollbar { .players::-webkit-scrollbar {
width: 0; width: 0;
@@ -112,12 +119,13 @@ onLoad(async (options) => {
position: relative; position: relative;
height: 68px; height: 68px;
margin-bottom: 10px; margin-bottom: 10px;
padding-top: 7px; padding-top: 10px;
} }
.player-bg { .player-bg {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 85px;
top: 0;
} }
.players > view > text { .players > view > text {
margin: 5px 0; margin: 5px 0;

View File

@@ -63,13 +63,15 @@ onLoad(async (options) => {
}); });
if (battleInfo.startTime <= 0) return; if (battleInfo.startTime <= 0) return;
start.value = true; start.value = true;
tips.value = "请连续射出6支箭";
players.value.forEach((p) => { players.value.forEach((p) => {
playersScores.value[p.id] = p.arrows; playersScores.value[p.id] = p.arrows;
if (p.id === user.value.id) { if (p.id === user.value.id) {
scores.value = p.arrows; scores.value = p.arrows;
} }
}); });
tips.value = `${
scores.value.length ? "下半场-" : "上半场-"
}请连续射出6支箭`;
const remain = Date.now() / 1000 - battleInfo.startTime; const remain = Date.now() / 1000 - battleInfo.startTime;
if (remain <= 90) { if (remain <= 90) {
setTimeout(() => { setTimeout(() => {
@@ -134,7 +136,9 @@ async function onReceiveMessage(messages = []) {
startCount.value = true; startCount.value = true;
seq.value += 1; seq.value += 1;
timerSeq.value = 0; timerSeq.value = 0;
tips.value = "请连续射出6支箭"; tips.value = `${
scores.value.length ? "下半场-" : "上半场-"
}请连续射出6支箭`;
halfTimeTip.value = false; halfTimeTip.value = false;
} }
if (msg.constructor === MESSAGETYPES.ShootResult) { if (msg.constructor === MESSAGETYPES.ShootResult) {

View File

@@ -196,7 +196,10 @@ const onPractiseLoading = async (page) => {
class="practice-record" class="practice-record"
@click="() => getPractiseDetail(item.id)" @click="() => getPractiseDetail(item.id)"
> >
<text>单组练习 {{ item.createdAt }}</text> <text
>{{ item.completed_arrows === 36 ? "耐力挑战" : "单组练习" }}
{{ item.createdAt }}</text
>
<image src="../static/back.png" mode="widthFix" /> <image src="../static/back.png" mode="widthFix" />
</view> </view>
</ScrollList> </ScrollList>

View File

@@ -1,6 +1,6 @@
<script setup> <script setup>
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { onHide } from "@dcloudio/uni-app"; import { onShow, onHide } from "@dcloudio/uni-app";
import Container from "@/components/Container.vue"; import Container from "@/components/Container.vue";
import Avatar from "@/components/Avatar.vue"; import Avatar from "@/components/Avatar.vue";
import { getRankListAPI, isGamingAPI } from "@/apis"; import { getRankListAPI, isGamingAPI } from "@/apis";
@@ -37,7 +37,7 @@ const handleSelect = (index) => {
} }
}; };
onMounted(async () => { onShow(async () => {
const result = await getHomeData(); const result = await getHomeData();
currentList.value = result.rank; currentList.value = result.rank;
rankData.value = result; rankData.value = result;
@@ -137,9 +137,10 @@ const updateData = () => {
}); });
} }
}; };
onHide(() => { onShow,
showSeasonList.value = false; () => {
}); showSeasonList.value = false;
};
</script> </script>
<template> <template>

View File

@@ -165,6 +165,10 @@ async function onReceiveMessage(messages = []) {
}); });
} }
if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) { if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) {
if (!start.value) {
start.value = true;
step.value = 3;
}
if (currentShooterId.value !== msg.userId) { if (currentShooterId.value !== msg.userId) {
seq.value += 1; seq.value += 1;
currentShooterId.value = msg.userId; currentShooterId.value = msg.userId;