细节调整

This commit is contained in:
kron
2025-07-11 22:21:34 +08:00
parent 81c064ba8b
commit e0807eb06a
14 changed files with 98 additions and 57 deletions

View File

@@ -20,7 +20,6 @@ const { updateUser } = store;
const start = ref(false);
const scores = ref([]);
const total = 36;
const currentRound = ref(0);
const practiseResult = ref({});
const power = ref(0);
const practiseId = ref("");
@@ -28,7 +27,6 @@ const practiseId = ref("");
const onReady = async () => {
const result = await createPractiseAPI(total);
if (result) practiseId.value = result.id;
currentRound.value = 0;
scores.value = [];
start.value = true;
};
@@ -36,9 +34,10 @@ const onReady = async () => {
async function onReceiveMessage(messages = []) {
messages.forEach((msg) => {
if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
scores.value.push(msg.target);
if (scores.value.length < total) {
scores.value.push(msg.target);
}
power.value = msg.target.battery;
currentRound.value += 1;
}
if (msg.constructor === MESSAGETYPES.ShootSyncMePracticeID) {
if (practiseId.value && practiseId.value === msg.practice.id) {
@@ -70,7 +69,6 @@ async function onComplete() {
practiseResult.value = {};
start.value = false;
scores.value = [];
currentRound.value = 0;
}
}
@@ -90,7 +88,7 @@ onUnmounted(() => {
<block v-if="start || practiseResult.arrows">
<ShootProgress
:start="start"
:tips="`请连续射${total}支`"
:tips="`请连续射${total}支`"
:total="120"
/>
<view class="user-row">
@@ -100,7 +98,6 @@ onUnmounted(() => {
<BowTarget
:start="start"
:totalRound="start ? total : 0"
:currentRound="currentRound"
:scores="scores"
/>
<ScorePanel
@@ -130,5 +127,4 @@ onUnmounted(() => {
</Container>
</template>
<style scoped>
</style>
<style scoped></style>