数据显示修改

This commit is contained in:
kron
2025-08-27 18:41:42 +08:00
parent 01f05f4824
commit f076065550
2 changed files with 8 additions and 4 deletions

View File

@@ -78,7 +78,10 @@ onBeforeUnmount(() => {
}"
>
<image src="../static/score-bg.png" mode="widthFix" />
<text>{{ scores[index] }}</text>
<text
:style="{ fontWeight: scores[index] !== undefined ? 'bold' : 'normal' }"
>{{ scores[index] !== undefined ? scores[index] : "-" }}</text
>
</view>
</view>
</template>
@@ -111,7 +114,6 @@ onBeforeUnmount(() => {
}
.score-item > text {
position: relative;
font-weight: bold;
margin-top: 2px;
}
.complete-light {

View File

@@ -11,11 +11,13 @@ import { storeToRefs } from "pinia";
const store = useStore();
const { user } = storeToRefs(store);
const arrows = ref([]);
const total = ref(0);
onLoad(async (options) => {
if (options.id) {
const result = await getPractiseAPI(options.id);
arrows.value = result.arrows;
total.value = result.completed_arrows;
}
});
</script>
@@ -43,8 +45,8 @@ onLoad(async (options) => {
</view>
<ScorePanel
:completeEffect="false"
:rowCount="arrows.length === 12 ? 6 : 9"
:total="arrows.length"
:rowCount="total === 12 ? 6 : 9"
:total="total"
:scores="arrows.map((a) => a.ring)"
:margin="arrows.length === 12 ? 4 : 1"
:fontSize="arrows.length === 12 ? 25 : 22"