2025-05-10 16:57:36 +08:00
|
|
|
<script setup>
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
scores: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => [],
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
const getSum = (a, b, c) => {
|
|
|
|
|
const sum = (Number(a) || 0) + (Number(b) || 0) + (Number(c) || 0);
|
|
|
|
|
return sum > 0 ? sum + "环" : "-";
|
|
|
|
|
};
|
2025-06-17 12:50:59 +08:00
|
|
|
const roundsName = ["第一轮", "第二轮", "第三轮", "第四轮"];
|
2025-05-10 16:57:36 +08:00
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<view class="container">
|
|
|
|
|
<view>
|
2025-06-17 12:50:59 +08:00
|
|
|
<text :style="{ transform: 'translateX(-10%)' }">总成绩</text>
|
2025-05-29 23:45:44 +08:00
|
|
|
<text>{{ scores.reduce((last, next) => last + next, 0) }}环</text>
|
2025-05-10 16:57:36 +08:00
|
|
|
</view>
|
|
|
|
|
<view
|
2025-06-17 12:50:59 +08:00
|
|
|
v-for="(_, index) in new Array(Math.ceil(scores.length / 3)).fill(1)"
|
2025-05-10 16:57:36 +08:00
|
|
|
:key="index"
|
|
|
|
|
class="score-item"
|
|
|
|
|
>
|
2025-06-17 12:50:59 +08:00
|
|
|
<text>{{ roundsName[index] }}</text>
|
2025-05-10 16:57:36 +08:00
|
|
|
<text>{{
|
2025-06-17 12:50:59 +08:00
|
|
|
scores[index * 3 + 0] ? scores[index * 3 + 0] + "环" : "-"
|
2025-05-10 16:57:36 +08:00
|
|
|
}}</text>
|
|
|
|
|
<text>{{
|
2025-06-17 12:50:59 +08:00
|
|
|
scores[index * 3 + 1] ? scores[index * 3 + 1] + "环" : "-"
|
2025-05-10 16:57:36 +08:00
|
|
|
}}</text>
|
|
|
|
|
<text>{{
|
2025-06-17 12:50:59 +08:00
|
|
|
scores[index * 3 + 2] ? scores[index * 3 + 2] + "环" : "-"
|
2025-05-29 23:45:44 +08:00
|
|
|
}}</text>
|
2025-06-17 12:50:59 +08:00
|
|
|
<text :style="{ width: '40%', transform: 'translateX(20%)' }">{{
|
2025-05-29 23:45:44 +08:00
|
|
|
getSum(
|
2025-06-17 12:50:59 +08:00
|
|
|
scores[index * 3 + 0],
|
|
|
|
|
scores[index * 3 + 1],
|
|
|
|
|
scores[index * 3 + 2]
|
2025-05-29 23:45:44 +08:00
|
|
|
)
|
2025-05-10 16:57:36 +08:00
|
|
|
}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.container {
|
|
|
|
|
width: 100vw;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
}
|
|
|
|
|
.container > view {
|
2025-06-17 12:50:59 +08:00
|
|
|
width: calc(100% - 30px);
|
2025-05-10 16:57:36 +08:00
|
|
|
color: aliceblue;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2025-06-17 12:50:59 +08:00
|
|
|
padding: 12px 15px;
|
2025-05-10 16:57:36 +08:00
|
|
|
border-bottom: 1px solid #ffffff66;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #fffc;
|
|
|
|
|
}
|
|
|
|
|
.container > view:first-child {
|
|
|
|
|
color: #fed847;
|
|
|
|
|
background-color: #ffffff33;
|
|
|
|
|
}
|
|
|
|
|
.container text {
|
|
|
|
|
display: block;
|
2025-06-17 12:50:59 +08:00
|
|
|
width: 20%;
|
2025-05-10 16:57:36 +08:00
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
</style>
|