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

142 lines
3.0 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({});
2025-09-24 21:05:06 +08:00
const toDetailPage = () => {
uni.navigateTo({
url: `/pages/point-book-detail?id=${props.data.id}`,
});
};
2025-08-05 11:51:09 +08:00
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>
2025-09-24 21:05:06 +08:00
<view class="container" @click="toDetailPage">
2025-07-30 09:55:15 +08:00
<view>
<view class="labels">
2025-09-24 21:05:06 +08:00
<view></view>
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>
2025-09-24 21:05:06 +08:00
<view>
<text>黄心率{{ data.yellowRate * 100 }}%</text>
<text>10环数{{ data.tenRings }}</text>
<text>平均{{ data.averageRing }}</text>
</view>
2025-07-30 09:55:15 +08:00
</view>
<view>
<image src="../static/bow-target.png" mode="widthFix" />
2025-09-24 21:05:06 +08:00
<view class="arrow-amount">
2025-07-30 09:55:15 +08:00
<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;
display: flex;
2025-09-24 21:05:06 +08:00
align-items: center;
border-radius: 25rpx;
margin-bottom: 25rpx;
height: 200rpx;
border: 1rpx solid #fed847;
2025-07-30 09:55:15 +08:00
}
.container > view {
position: relative;
margin-left: 15px;
}
.container > view:first-child {
2025-09-24 21:05:06 +08:00
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
height: calc(100% - 50rpx);
color: #333333;
2025-07-30 09:55:15 +08:00
}
.container > view:first-child > view {
width: 100%;
2025-09-24 21:05:06 +08:00
display: flex;
position: relative;
}
.container > view:first-child > view:nth-child(3) {
2025-07-30 09:55:15 +08:00
display: flex;
align-items: center;
2025-09-24 21:05:06 +08:00
font-size: 20rpx;
color: #666;
2025-07-30 09:55:15 +08:00
}
2025-09-24 21:05:06 +08:00
.container > view:first-child > view:nth-child(3) > text {
margin-right: 10rpx;
2025-08-05 15:58:43 +08:00
}
2025-07-30 09:55:15 +08:00
.labels {
align-items: flex-end !important;
}
2025-09-24 21:05:06 +08:00
.labels > view:first-child {
position: absolute;
bottom: 0;
height: 10rpx;
background: #fee947;
border-radius: 5rpx;
width: 300rpx;
}
2025-07-30 09:55:15 +08:00
.labels > text {
2025-09-24 21:05:06 +08:00
font-size: 26rpx;
2025-07-30 09:55:15 +08:00
margin-right: 10px;
2025-09-24 21:05:06 +08:00
position: relative;
2025-07-30 09:55:15 +08:00
}
.container > view:last-child {
margin-right: 1vw;
}
.container > view:last-child > image {
width: 24vw;
}
2025-09-24 21:05:06 +08:00
.arrow-amount {
2025-07-30 09:55:15 +08:00
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);
}
2025-09-24 21:05:06 +08:00
.arrow-amount > text:nth-child(2) {
2025-07-30 09:55:15 +08:00
color: #fff;
font-size: 14px;
margin: 0 3px;
}
</style>