Files
shoot-miniprograms/src/components/BowData.vue
2026-02-09 17:27:44 +08:00

117 lines
2.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup>
import AppBackground from "@/components/AppBackground.vue";
import Avatar from "@/components/Avatar.vue";
import BowTarget from "@/components/BowTarget.vue";
import ScorePanel from "@/components/ScorePanel.vue";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
const { user } = storeToRefs(store);
const props = defineProps({
show: {
type: Boolean,
default: false,
},
onClose: {
type: Function,
default: () => {},
},
arrows: {
type: Array,
default: () => [],
},
total: {
type: Number,
default: 0,
},
});
</script>
<template>
<view class="container" :style="{ display: show ? 'flex' : 'none' }">
<AppBackground :type="1" />
<view class="header">
<view>
<Avatar :src="user.avatar" :rankLvl="user.rankLvl" :size="45" />
<view>
<text>{{ user.nickName }}</text>
<text>{{ user.lvlName }}</text>
</view>
</view>
<view @click="onClose">
<image src="../static/close-white.png" mode="widthFix" />
</view>
</view>
<view :style="{ width: '100%', marginBottom: '20px' }">
<BowTarget :scores="arrows" />
</view>
<view class="desc">
<text>{{ arrows.length }}</text>
<text>支箭</text>
<text>{{ arrows.reduce((a, b) => a + b.ring, 0) }}</text>
<text></text>
</view>
<ScorePanel
:completeEffect="false"
:rowCount="arrows.length === 12 ? 6 : 9"
:total="total"
:arrows="arrows"
:margin="arrows.length === 12 ? 4 : 1"
:fontSize="arrows.length === 12 ? 25 : 22"
/>
</view>
</template>
<style scoped>
.container {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: #232323;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 10;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
width: calc(100% - 20px);
padding: 10px;
}
.header > view:first-child {
display: flex;
align-items: center;
margin-left: 10px;
}
.header > view:first-child > view:last-child {
display: flex;
flex-direction: column;
align-items: flex-start;
margin-left: 10px;
color: #fff;
}
.header > view:first-child > view:last-child > text:last-child {
font-size: 10px;
background-color: #5f51ff;
padding: 2px 5px;
border-radius: 10px;
margin-top: 5px;
}
.header > view:last-child > image {
width: 40px;
}
.desc {
color: #fff;
margin-bottom: 40px;
}
.desc > text:nth-child(2),
.desc > text:nth-child(4) {
color: #fed847;
}
</style>