接口调试完毕
This commit is contained in:
@@ -17,7 +17,7 @@ const props = defineProps({
|
||||
},
|
||||
onChange: {
|
||||
type: Function,
|
||||
default: (arrow) => {},
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ const dragStartPos = ref({ x: 0, y: 0 });
|
||||
|
||||
// 点击靶纸创建新的点
|
||||
const onClick = async (e) => {
|
||||
if (arrow.value !== null) return;
|
||||
if (arrow.value !== null || !props.onChange) return;
|
||||
const newArrow = {
|
||||
x: e.detail.x - (rect.value.width * 0.1) / 2,
|
||||
y: e.detail.y - rect.value.top - 10,
|
||||
@@ -45,7 +45,8 @@ const onClick = async (e) => {
|
||||
|
||||
// 确认添加箭矢
|
||||
const confirmAdd = () => {
|
||||
props.onChange(arrow.value);
|
||||
if (props.onChange)
|
||||
props.onChange({ ...arrow.value, ring: arrow.value.ring || "M" });
|
||||
arrow.value = null;
|
||||
};
|
||||
|
||||
|
||||
@@ -65,7 +65,10 @@ const onMeterChange = (e) => {
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
if (!newValue) return;
|
||||
if (!newValue) {
|
||||
selectedIndex.value = -1;
|
||||
return;
|
||||
}
|
||||
if (props.itemIndex === 0 || props.itemIndex === 2) {
|
||||
data.value.forEach((item, index) => {
|
||||
if (item.name === newValue) {
|
||||
@@ -93,7 +96,6 @@ onMounted(() => {
|
||||
} else if (props.itemIndex === 2) {
|
||||
data.value = config.targetOption;
|
||||
}
|
||||
// props.onSelect(props.itemIndex, config[props.itemIndex]);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,29 +1,49 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
signin: {
|
||||
type: Function,
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
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;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="container">
|
||||
<view>
|
||||
<view class="labels">
|
||||
<text>反曲弓</text>
|
||||
<text>5 米</text>
|
||||
<text>40 全环靶</text>
|
||||
<text>{{
|
||||
bowOptions[data.bowType] ? bowOptions[data.bowType].name : ""
|
||||
}}</text>
|
||||
<text>{{ data.distance }} 米</text>
|
||||
<text>{{
|
||||
targetOptions[data.targetType]
|
||||
? targetOptions[data.targetType].name
|
||||
: ""
|
||||
}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>2025-07-10 14:00:00</text>
|
||||
<text>{{ data.createAt }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<image src="../static/bow-target.png" mode="widthFix" />
|
||||
<view class="aroow-amount">
|
||||
<text>共</text>
|
||||
<text>36</text>
|
||||
<text>{{ data.arrows * data.groups }}</text>
|
||||
<text>箭</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user