UI完善
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user