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

156 lines
3.5 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-07-23 16:01:16 +08:00
<text
>{{ index > 4 ? "决金箭" : "Round" }}
{{ index > 4 ? `R${index - 4}` : index + 1 }}</text
>
2025-05-16 15:56:54 +08:00
<view>
2025-06-06 00:34:54 +08:00
<text>{{
2025-07-11 22:21:34 +08:00
result.blueArrows.length
? result.blueArrows
.map((item) => item.ring)
.reduce((last, next) => last + next, 0)
: ""
2025-06-06 00:34:54 +08:00
}}</text>
2025-05-16 15:56:54 +08:00
<text></text>
</view>
</view>
2025-07-25 09:59:54 +08:00
<block v-if="roundResults.length < 3">
2025-07-25 15:18:46 +08:00
<view v-for="i in 3 - roundResults.length" :key="i">
<text>Round</text>
<view>
<text></text>
<text></text>
</view>
</view>
2025-07-25 09:59:54 +08:00
</block>
2025-05-16 15:56:54 +08:00
</view>
<view>
2025-06-06 00:34:54 +08:00
<view v-for="(result, index) in roundResults" :key="index">
2025-07-23 16:01:16 +08:00
<text
>{{ index > 4 ? "决金箭" : "Round" }}
{{ index > 4 ? `R${index - 4}` : index + 1 }}</text
>
2025-05-16 15:56:54 +08:00
<view>
2025-06-08 20:59:41 +08:00
<text>{{
2025-07-11 22:21:34 +08:00
result.redArrows.length
? result.redArrows
.map((item) => item.ring)
.reduce((last, next) => last + next, 0)
: ""
2025-06-08 20:59:41 +08:00
}}</text>
2025-05-16 15:56:54 +08:00
<text></text>
</view>
</view>
2025-07-25 09:59:54 +08:00
<block v-if="roundResults.length < 3">
2025-07-25 15:18:46 +08:00
<view v-for="i in 3 - roundResults.length" :key="i">
<text>Round</text>
<view>
<text></text>
<text></text>
</view>
</view>
2025-07-25 09:59:54 +08:00
</block>
2025-05-16 15:56:54 +08:00
</view>
</view>
</view>
</template>
<style scoped>
.container {
width: 100%;
margin-top: 20px;
2025-06-26 22:54:17 +08:00
overflow: hidden;
2025-05-16 15:56:54 +08:00
}
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 {
2025-07-25 09:59:54 +08:00
min-height: 28px;
2025-05-16 15:56:54 +08:00
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>