BUG修复

This commit is contained in:
kron
2026-02-10 11:32:53 +08:00
parent 61ff1af4c3
commit 303e1830d3
3 changed files with 31 additions and 43 deletions

View File

@@ -56,16 +56,20 @@ onMounted(() => {
);
});
const validArrows = computed(() => {
return (props.result.details || []).filter(
(arrow) => arrow.x !== -30 && arrow.y !== -30
).length;
});
const getRing = (arrow) => {
if (arrow.ringX) return "X";
return arrow.ring ? arrow.ring + "环" : "-";
return arrow.ring ? arrow.ring : "-";
};
const arrows = computed(() => {
const data = new Array(props.total).fill({});
(props.result.details || []).forEach((arrow, index) => {
data[index] = arrow;
});
return data;
});
const validArrows = computed(() => arrows.value.filter((a) => !!a.ring));
</script>
<template>
@@ -74,8 +78,8 @@ const getRing = (arrow) => {
<image :src="tipSrc" mode="widthFix" />
<image src="../static/finish-frame.png" mode="widthFix" />
<text
>完成<text class="gold-text">{{ validArrows }}</text
>获得<text class="gold-text">{{ validArrows }}</text
>完成<text class="gold-text">{{ validArrows.length }}</text
>获得<text class="gold-text">{{ validArrows.length }}</text
>点经验</text
>
</view>
@@ -96,8 +100,8 @@ const getRing = (arrow) => {
</view>
<view :style="{ gridTemplateColumns: `repeat(${rowCount}, 1fr)` }">
<view v-for="(_, index) in new Array(total).fill(0)" :key="index">
{{ getRing(result.details[index])
}}<text v-if="getRing(result.details[index]) !== '-'"></text>
{{ getRing(arrows[index])
}}<text v-if="getRing(arrows[index]) !== '-'"></text>
</view>
</view>
<view>
@@ -160,8 +164,8 @@ const getRing = (arrow) => {
</view>
</ScreenHint>
<BowData
:total="result.details.length"
:arrows="result.details"
:total="arrows.length"
:arrows="arrows"
:show="showBowData"
:onClose="() => (showBowData = false)"
/>