Files
shoot-miniprograms/src/components/BattleFooter.vue

126 lines
2.6 KiB
Vue
Raw Normal View History

2025-05-16 15:56:54 +08:00
<script setup>
defineProps({
2025-06-06 00:34:54 +08:00
roundResults: {
2025-05-16 15:56:54 +08:00
type: Array,
default: () => [],
},
2025-06-08 20:59:41 +08:00
bluePoints: {
type: Number,
default: 0,
},
redPoints: {
type: Number,
default: 0,
},
2025-05-16 15:56:54 +08:00
});
</script>
<template>
<view class="container">
2025-06-08 20:59:41 +08:00
<view>
<image src="../static/battle-header-melee.png" mode="widthFix" />
<text>蓝队({{ bluePoints }})</text>
<text>红队({{ redPoints }})</text>
</view>
2025-05-16 15:56:54 +08:00
<view class="players">
<view>
2025-06-06 00:34:54 +08:00
<view v-for="(result, index) in roundResults" :key="index">
2025-05-16 15:56:54 +08:00
<text>Round {{ index + 1 }}</text>
<view>
2025-06-06 00:34:54 +08:00
<text>{{
result.blueArrows
.map((item) => item.ring)
.reduce((last, next) => last + next, 0)
}}</text>
2025-05-16 15:56:54 +08:00
<text></text>
</view>
</view>
</view>
<view>
2025-06-06 00:34:54 +08:00
<view v-for="(result, index) in roundResults" :key="index">
2025-05-16 15:56:54 +08:00
<text>Round {{ index + 1 }}</text>
<view>
2025-06-08 20:59:41 +08:00
<text>{{
result.redArrows
2025-06-06 00:34:54 +08:00
.map((item) => item.ring)
2025-06-08 20:59:41 +08:00
.reduce((last, next) => last + next, 0)
}}</text>
2025-05-16 15:56:54 +08:00
<text></text>
</view>
</view>
</view>
</view>
</view>
</template>
<style scoped>
.container {
width: 100%;
margin-top: 20px;
}
2025-06-08 20:59:41 +08:00
.container > view:first-child {
position: relative;
display: flex;
justify-content: space-around;
align-items: center;
font-size: 13px;
}
.container > view:first-child > image:first-child {
2025-05-16 15:56:54 +08:00
position: absolute;
width: 100%;
2025-06-08 20:59:41 +08:00
top: -6px;
}
.container > view:first-child > text {
z-index: 1;
margin-top: 2px;
}
.container > view:first-child > text:nth-child(2) {
color: #364469;
}
.container > view:first-child > text:nth-child(3) {
color: #692735;
2025-05-16 15:56:54 +08:00
}
.players {
display: flex;
}
.players > view {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff;
2025-06-08 20:59:41 +08:00
padding-top: 5px;
2025-05-16 15:56:54 +08:00
}
.players > view:first-child {
background-color: #364469;
}
.players > view:last-child {
background-color: #692735;
}
.players > view > view {
width: 85%;
padding: 5px 20px;
margin-bottom: 5px;
background-image: url("../static/row-bg.png");
background-size: 90% 100%;
background-repeat: no-repeat;
background-position: center;
display: flex;
justify-content: space-between;
align-items: center;
}
.players > view > view > text {
font-size: 14px;
}
.players > view > view > view:last-child {
2025-06-06 00:34:54 +08:00
font-size: 14px;
2025-05-16 15:56:54 +08:00
padding-right: 20px;
}
.players > view > view > view:last-child > text:first-child {
font-size: 20px;
color: #fed847;
margin-right: 5px;
}
</style>