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

117 lines
2.6 KiB
Vue
Raw Normal View History

2025-06-15 15:53:57 +08:00
<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: () => [],
},
2025-11-17 14:30:54 +08:00
total: {
type: Number,
default: 0,
},
2025-06-15 15:53:57 +08:00
});
</script>
<template>
<view class="container" :style="{ display: show ? 'flex' : 'none' }">
<AppBackground :type="1" />
<view class="header">
<view>
2025-07-14 15:13:10 +08:00
<Avatar :src="user.avatar" :rankLvl="user.rankLvl" :size="45" />
2025-06-15 15:53:57 +08:00
<view>
<text>{{ user.nickName }}</text>
2025-06-18 02:26:42 +08:00
<text>{{ user.lvlName }}</text>
2025-06-15 15:53:57 +08:00
</view>
</view>
<view @click="onClose">
<image src="../static/close-white.png" mode="widthFix" />
</view>
</view>
<view :style="{ width: '100%', marginBottom: '20px' }">
2025-07-16 09:33:33 +08:00
<BowTarget :scores="arrows" />
2025-06-15 15:53:57 +08:00
</view>
<view class="desc">
<text>{{ arrows.length }}</text>
<text>支箭</text>
<text>{{ arrows.reduce((a, b) => a + b.ring, 0) }}</text>
<text></text>
</view>
<ScorePanel
2025-06-25 22:02:10 +08:00
:completeEffect="false"
2025-06-15 15:53:57 +08:00
:rowCount="arrows.length === 12 ? 6 : 9"
2025-11-17 14:30:54 +08:00
:total="total"
2026-02-09 17:27:44 +08:00
:arrows="arrows"
2025-06-24 13:18:03 +08:00
:margin="arrows.length === 12 ? 4 : 1"
:fontSize="arrows.length === 12 ? 25 : 22"
2025-06-15 15:53:57 +08:00
/>
</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;
2025-06-15 20:55:34 +08:00
margin-left: 10px;
2025-06-15 15:53:57 +08:00
}
.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>