完成单组练习接口调试

This commit is contained in:
kron
2025-05-29 23:45:44 +08:00
parent 6466c65b66
commit 9db31ce664
14 changed files with 282 additions and 122 deletions

View File

@@ -1,5 +1,4 @@
<script setup>
import { ref } from "vue";
const props = defineProps({
scores: {
type: Array,
@@ -15,7 +14,7 @@ const getSum = (a, b, c) => {
<view class="container">
<view>
<text>总成绩</text>
<text>23</text>
<text>{{ scores.reduce((last, next) => last + next, 0) }}</text>
</view>
<view
v-for="(title, index) in ['第一轮', '第二轮', '第三轮']"
@@ -24,23 +23,25 @@ const getSum = (a, b, c) => {
>
<text>{{ title }}</text>
<text>{{
scores[index * 3 + 0] ? scores[index * 3 + 0] + "环" : "-"
scores[index * 4 + 0] ? scores[index * 4 + 0] + "环" : "-"
}}</text>
<text>{{
scores[index * 3 + 1] ? scores[index * 3 + 1] + "环" : "-"
scores[index * 4 + 1] ? scores[index * 4 + 1] + "环" : "-"
}}</text>
<text>{{
scores[index * 3 + 2] ? scores[index * 3 + 2] + "环" : "-"
scores[index * 4 + 2] ? scores[index * 4 + 2] + "环" : "-"
}}</text>
<text>{{
scores[index * 4 + 3] ? scores[index * 4 + 3] + "环" : "-"
}}</text>
<text>{{
getSum(
scores[index * 4 + 0],
scores[index * 4 + 1],
scores[index * 4 + 2],
scores[index * 4 + 3]
)
}}</text>
<text
>{{
getSum(
scores[index * 3 + 0],
scores[index * 3 + 1],
scores[index * 3 + 2]
)
}}</text
>
</view>
</view>
</template>