update:大乱斗优化
This commit is contained in:
@@ -15,6 +15,12 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
const rowCount = new Array(6).fill(0);
|
||||
|
||||
const getRingText = (arrow) => {
|
||||
if (!arrow) return "-";
|
||||
if (arrow.ringX && arrow.ring) return "X环";
|
||||
return arrow.ring ? `${arrow.ring}环` : "-";
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -35,23 +41,19 @@ const rowCount = new Array(6).fill(0);
|
||||
<view>
|
||||
<view>
|
||||
<view v-for="(_, index) in rowCount" :key="index">
|
||||
<text>{{
|
||||
scores[0] && scores[0][index] ? `${scores[0][index].ring}环` : "-"
|
||||
}}</text>
|
||||
<text>{{ getRingText(scores[0]?.[index]) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view v-for="(_, index) in rowCount" :key="index">
|
||||
<text>{{
|
||||
scores[1] && scores[1][index] ? `${scores[1][index].ring}环` : "-"
|
||||
}}</text>
|
||||
<text>{{ getRingText(scores[1]?.[index]) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<text
|
||||
>{{
|
||||
scores
|
||||
.map((s) => s.reduce((last, next) => last + next.ring, 0))
|
||||
.map((s) => (s || []).reduce((last, next) => last + next.ring, 0))
|
||||
.reduce((last, next) => last + next, 0)
|
||||
}}环</text
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user