细节调整

This commit is contained in:
kron
2025-06-17 19:35:21 +08:00
parent 28e3d49e57
commit ab8aa08a35
5 changed files with 55 additions and 44 deletions

View File

@@ -18,12 +18,14 @@ const start = ref(false);
const showScore = ref(false);
const scores = ref([]);
const total = 36;
const currentRound = ref(0);
const practiseResult = ref({});
const power = ref(0);
const onReady = async () => {
await createPractiseAPI(total);
start.value = true;
currentRound.value = 0;
scores.value = [];
};
@@ -33,6 +35,7 @@ async function onReceiveMessage(content) {
if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
scores.value.push(msg.target);
power.value = msg.target.battery;
currentRound.value += 1;
if (scores.value.length === total) {
showScore.value = true;
}
@@ -73,8 +76,8 @@ onUnmounted(() => {
<BowPower :power="power" />
</view>
<BowTarget
:totalRound="total"
:currentRound="scores.length + 1"
:totalRound="start ? total : 0"
:currentRound="currentRound"
:scores="scores"
:tips="
!start && scores.length > 0