细节完善
This commit is contained in:
@@ -73,6 +73,10 @@ const onClick = async (e) => {
|
||||
// 确认添加箭矢
|
||||
const confirmAdd = () => {
|
||||
if (props.onChange) {
|
||||
targetPos.value = {
|
||||
x: zoomPos.value.x,
|
||||
y: zoomPos.value.y,
|
||||
};
|
||||
props.onChange({
|
||||
x: arrow.value.x / scale.value,
|
||||
y: arrow.value.y / scale.value,
|
||||
|
||||
@@ -148,7 +148,7 @@ onMounted(async () => {
|
||||
<style scoped>
|
||||
.container {
|
||||
width: calc(100% - 20px);
|
||||
padding: 0 15px;
|
||||
padding: 0 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
@@ -6,7 +6,6 @@ import SButton from "@/components/SButton.vue";
|
||||
import BowTargetEdit from "@/components/BowTargetEdit.vue";
|
||||
import { savePointBookAPI } from "@/apis";
|
||||
|
||||
const clickable = ref(false);
|
||||
const showTip = ref(false);
|
||||
const groups = ref(0);
|
||||
const amount = ref(0);
|
||||
@@ -32,10 +31,18 @@ const onBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
const onSubmit = async () => {
|
||||
const isComplete = arrowGroups.value[currentGroup.value].every(
|
||||
(item) => !!item.ring
|
||||
);
|
||||
if (!isComplete) {
|
||||
return uni.showToast({
|
||||
title: "请完善信息",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
if (currentGroup.value < groups.value) {
|
||||
currentGroup.value++;
|
||||
currentArrow.value = 0;
|
||||
clickable.value = false;
|
||||
} else {
|
||||
const pointBook = uni.getStorageSync("point-book");
|
||||
const res = await savePointBookAPI(
|
||||
@@ -56,9 +63,6 @@ const onSubmit = async () => {
|
||||
const onClickRing = (ring) => {
|
||||
if (arrowGroups.value[currentGroup.value]) {
|
||||
arrowGroups.value[currentGroup.value][currentArrow.value] = { ring };
|
||||
clickable.value = arrowGroups.value[currentGroup.value].every(
|
||||
(item) => !!item.ring
|
||||
);
|
||||
if (currentArrow.value < amount.value - 1) currentArrow.value++;
|
||||
}
|
||||
};
|
||||
@@ -67,9 +71,6 @@ const deleteArrow = () => {
|
||||
};
|
||||
const onEditDone = (arrow) => {
|
||||
arrowGroups.value[currentGroup.value][currentArrow.value] = arrow;
|
||||
clickable.value = arrowGroups.value[currentGroup.value].every(
|
||||
(item) => !!item.ring
|
||||
);
|
||||
if (currentArrow.value < amount.value - 1) currentArrow.value++;
|
||||
};
|
||||
|
||||
@@ -166,13 +167,7 @@ onMounted(() => {
|
||||
</ScreenHint2>
|
||||
</view>
|
||||
<view :style="{ marginBottom: '20px' }">
|
||||
<SButton
|
||||
:rounded="50"
|
||||
:disabled="!clickable"
|
||||
:onClick="onSubmit"
|
||||
disabledColor="#DDDDDD"
|
||||
:color="clickable ? '#000' : '#fff'"
|
||||
>
|
||||
<SButton :rounded="50" :onClick="onSubmit">
|
||||
{{ currentGroup === groups ? "记完了,提交看分析" : "下一组" }}
|
||||
</SButton>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user