This commit is contained in:
kron
2025-08-05 15:58:43 +08:00
parent 4b9fe45ad2
commit c678a3160a
8 changed files with 38 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref, watch, onMounted, onUnmounted } from "vue";
import { getPointBookConfigAPI } from "@/apis";
const props = defineProps({
itemIndex: {
type: Number,
@@ -88,7 +89,7 @@ watch(
}
}
);
onMounted(() => {
const loadConfig = () => {
const config = uni.getStorageSync("point-book-config");
if (config) {
if (props.itemIndex === 0) {
@@ -97,6 +98,16 @@ onMounted(() => {
data.value = config.targetOption;
}
}
};
onMounted(async () => {
const config = uni.getStorageSync("point-book-config");
if (config) {
loadConfig();
} else {
const config = await getPointBookConfigAPI();
uni.setStorageSync("point-book-config", config);
loadConfig();
}
});
</script>
@@ -247,6 +258,9 @@ onMounted(() => {
width: 85px;
color: #999999;
}
.container > view:first-child > text:nth-child(2) {
font-weight: 500;
}
.container > view:first-child > button {
width: 85px;
display: flex;