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

94 lines
1.6 KiB
Vue
Raw Normal View History

2025-05-10 16:57:36 +08:00
<script setup>
2025-05-16 15:56:54 +08:00
import BowPower from "@/components/BowPower.vue";
2025-05-10 16:57:36 +08:00
defineProps({
totalRound: {
type: Number,
default: 0,
},
currentRound: {
type: Number,
default: 0,
},
avatar: {
type: String,
default: "",
},
power: {
type: Number,
default: 0,
},
tips: {
type: String,
default: "",
},
debug: {
type: Boolean,
default: false,
},
});
</script>
2025-05-08 22:05:53 +08:00
<template>
<view class="container">
<view class="header">
2025-05-16 15:56:54 +08:00
<!-- <text v-if="debug" class="header-tips">大人请射箭</text> -->
<text v-if="totalRound > 0" class="round-count">{{
2025-05-10 16:57:36 +08:00
currentRound + "/" + totalRound
}}</text>
2025-05-16 15:56:54 +08:00
<BowPower v-if="power > 0" :power="power" />
2025-05-08 22:05:53 +08:00
</view>
<image src="../static/bow-target.png" mode="widthFix" />
2025-05-16 15:56:54 +08:00
<view v-if="avatar" class="footer">
2025-05-10 16:57:36 +08:00
<image :src="avatar" mode="widthFix" />
</view>
<text v-if="tips">{{ tips }}</text>
2025-05-08 22:05:53 +08:00
</view>
</template>
<style scoped>
.container {
width: calc(100% - 30px);
2025-05-16 15:56:54 +08:00
margin: 15px;
2025-05-08 22:05:53 +08:00
}
.container > image {
width: 100%;
}
.header {
2025-05-10 22:16:59 +08:00
width: 100%;
2025-05-08 22:05:53 +08:00
display: flex;
align-items: center;
justify-content: space-between;
}
2025-05-10 16:57:36 +08:00
.header > image:first-child {
2025-05-08 22:05:53 +08:00
width: 40px;
height: 40px;
}
2025-05-16 15:56:54 +08:00
.round-count {
2025-05-10 16:57:36 +08:00
font-size: 20px;
color: #fed847;
top: 75px;
}
.header-tips {
font-size: 20px;
color: #fed847;
}
.footer {
width: calc(100% - 20px);
padding: 0 10px;
display: flex;
margin-top: -40px;
}
.footer > image {
width: 40px;
height: 40px;
}
.container > text {
width: 100%;
color: #fed847;
text-align: center;
line-height: 40px;
display: block;
margin-top: 20px;
}
2025-05-08 22:05:53 +08:00
</style>