计分本配置接口接入

This commit is contained in:
kron
2025-08-04 16:28:34 +08:00
parent 54a51d2a28
commit 97d23aa731
9 changed files with 181 additions and 129 deletions

View File

@@ -3,15 +3,23 @@ import { ref, onMounted, onUnmounted } from "vue";
import Container from "@/components/Container.vue";
import EditOption from "@/components/EditOption.vue";
import SButton from "@/components/SButton.vue";
import { getPointBookConfigAPI } from "@/apis";
const clickable = ref(false);
const expandIndex = ref(-1);
const bowType = ref("");
const bowType = ref({});
const distance = ref(0);
const bowtargetType = ref("");
const amountGroup = ref("");
const onExpandChange = (index, expand) => {
expandIndex.value = !expand ? -1 : index;
if (expandIndex.value !== -1) {
expandIndex.value = -1;
setTimeout(() => {
expandIndex.value = !expand ? -1 : index;
}, 100);
} else {
expandIndex.value = !expand ? -1 : index;
}
};
const toListPage = () => {
@@ -41,11 +49,16 @@ const onSelect = (itemIndex, value) => {
}
};
const toEditPage = () => {
expandIndex.value = -1;
uni.navigateTo({
url: "/pages/point-book-edit",
});
};
onMounted(() => {
onMounted(async () => {
const config = await getPointBookConfigAPI();
if (config) {
uni.setStorageSync("point-book-config", config);
}
const pointBook = uni.getStorageSync("point-book");
if (pointBook) {
bowType.value = pointBook.bowType;
@@ -73,7 +86,7 @@ onMounted(() => {
:expand="expandIndex === 0"
:onExpand="onExpandChange"
:onSelect="onSelect"
:value="bowType"
:value="bowType.name"
/>
<EditOption
:itemIndex="1"
@@ -87,7 +100,7 @@ onMounted(() => {
:expand="expandIndex === 2"
:onExpand="onExpandChange"
:onSelect="onSelect"
:value="bowtargetType"
:value="bowtargetType.name"
/>
<EditOption
:itemIndex="3"