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

113 lines
2.3 KiB
Vue
Raw Normal View History

2025-07-30 09:55:15 +08:00
<script setup>
2025-08-05 11:51:09 +08:00
import { ref, onMounted } from "vue";
2025-07-30 09:55:15 +08:00
const props = defineProps({
2025-08-05 11:51:09 +08:00
data: {
type: Object,
2025-07-30 09:55:15 +08:00
default: () => {},
},
});
2025-08-05 11:51:09 +08:00
const bowOptions = ref({});
const targetOptions = ref({});
onMounted(() => {
const result = uni.getStorageSync("point-book-config");
(result.bowOption || []).forEach((item) => {
bowOptions.value[item.id] = item;
});
(result.targetOption || []).forEach((item) => {
targetOptions.value[item.id] = item;
});
});
2025-07-30 09:55:15 +08:00
</script>
<template>
<view class="container">
<view>
<view class="labels">
2025-08-05 11:51:09 +08:00
<text>{{
bowOptions[data.bowType] ? bowOptions[data.bowType].name : ""
}}</text>
<text>{{ data.distance }} </text>
<text>{{
targetOptions[data.targetType]
? targetOptions[data.targetType].name
: ""
}}</text>
2025-07-30 09:55:15 +08:00
</view>
<view>
2025-08-05 11:51:09 +08:00
<text>{{ data.createAt }}</text>
2025-07-30 09:55:15 +08:00
</view>
</view>
<view>
<image src="../static/bow-target.png" mode="widthFix" />
<view class="aroow-amount">
<text></text>
2025-08-05 11:51:09 +08:00
<text>{{ data.arrows * data.groups }}</text>
2025-07-30 09:55:15 +08:00
<text></text>
</view>
</view>
</view>
</template>
<style scoped>
.container {
background-color: #fff;
border-radius: 15px;
display: flex;
margin-bottom: 15px;
height: 24vw;
}
.container > view {
position: relative;
margin-left: 15px;
}
.container > view:first-child {
width: calc(100% - 5vw);
}
.container > view:first-child > view {
width: 100%;
height: 50%;
display: flex;
align-items: center;
}
2025-08-05 15:58:43 +08:00
.container > view:first-child > view:last-child {
font-weight: 500;
}
2025-07-30 09:55:15 +08:00
.labels {
align-items: flex-end !important;
}
.labels > text {
font-size: 12px;
color: #333333;
border: 1px solid #eee;
margin-right: 10px;
border-radius: 10px;
padding: 5px 10px;
}
.container > view:last-child {
margin-right: 1vw;
}
.container > view:last-child > image {
width: 24vw;
}
.aroow-amount {
position: absolute;
background-color: #0009;
border-radius: 10px;
color: #fffc;
font-size: 12px;
line-height: 22px;
width: 60px;
display: flex;
justify-content: center;
top: calc(50% - 11px);
left: calc(50% - 30px);
}
.aroow-amount > text:nth-child(2) {
color: #fff;
font-size: 14px;
margin: 0 3px;
}
</style>