diff --git a/src/components/userAchi/tua-achi-list.vue b/src/components/userAchi/tua-achi-list.vue index 8f86f15e..45350a61 100644 --- a/src/components/userAchi/tua-achi-list.vue +++ b/src/components/userAchi/tua-achi-list.vue @@ -46,10 +46,13 @@ interface TuaAchiListProps { hideFin: boolean; series?: number; search?: string; + isSearch: boolean; } interface TuaAchiListEmits { (e: "update:series", v: number): void; + + (e: "update:isSearch", v: boolean): false; } const props = defineProps(); @@ -72,17 +75,32 @@ const renderAchi = computed>(() => { onMounted(async () => await loadAchi()); watch( - () => [props.series, props.search, props.uid], + () => [props.search, props.isSearch], + async () => await searchAchi(), +); + +watch( + () => [props.series, props.uid], async () => await loadAchi(), ); -async function loadAchi(): Promise { - if (props.search && props.search !== "") { - nameCard.value = undefined; - ncData.value = undefined; - achievements.value = await TSUserAchi.searchAchi(props.uid, props.search); +async function searchAchi(): Promise { + if (!props.isSearch) return; + if (!props.search || props.search === "") { + showSnackbar.warn("请输入搜索内容"); + emits("update:isSearch", false); return; } + nameCard.value = undefined; + ncData.value = undefined; + achievements.value = await TSUserAchi.searchAchi(props.uid, props.search); + if (achievements.value.length > 0) { + showSnackbar.success(`成功获取${achievements.value.length}条成就`); + } + emits("update:isSearch", false); +} + +async function loadAchi(): Promise { achievements.value = await TSUserAchi.getAchievements(props.uid, props.series); if (!selectedAchi.value && achievements.value.length > 0) { selectedAchi.value = achievements.value[0]; diff --git a/src/components/wiki/twc-character.vue b/src/components/wiki/twc-character.vue index f6d97660..17c6c14e 100644 --- a/src/components/wiki/twc-character.vue +++ b/src/components/wiki/twc-character.vue @@ -128,7 +128,7 @@ const box = computed(() => { height: "128px", display: "inner", lt: `/icon/element/${data.value?.element}元素.webp`, - ltSize: "40px", + ltSize: "30px", innerHeight: 30, innerIcon: `/icon/weapon/${data.value?.weapon}.webp`, innerText: data.value?.name, diff --git a/src/pages/common/Achievements.vue b/src/pages/common/Achievements.vue index ef808a64..f81f3981 100644 --- a/src/pages/common/Achievements.vue +++ b/src/pages/common/Achievements.vue @@ -9,6 +9,7 @@ label="搜索" :hide-details="true" :single-line="true" + @keydown.enter="isSearch = true" /> @@ -46,6 +47,7 @@ :hideFin="hideFin" v-model:series="selectedSeries" v-model:search="search" + v-model:isSearch="isSearch" /> @@ -74,6 +76,7 @@ import { } from "../../utils/UIAF.js"; const search = ref(""); +const isSearch = ref(false); const hideFin = ref(false); const uidList = ref([]);