From 6c5ddb43ec19dac7cd1155e2ad750c14086c1e6f Mon Sep 17 00:00:00 2001 From: expdsn <18111002318@163.com> Date: Tue, 8 Oct 2024 19:10:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A3=81=E7=BA=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GlobalModal.tsx | 2 +- src/layout/background/BackgroundSwtich.tsx | 144 ++++++++++++++++----- src/utils/CategoryTab.tsx | 40 +++--- 3 files changed, 130 insertions(+), 56 deletions(-) diff --git a/src/GlobalModal.tsx b/src/GlobalModal.tsx index 55239d6..8db28a9 100644 --- a/src/GlobalModal.tsx +++ b/src/GlobalModal.tsx @@ -43,7 +43,7 @@ export default defineComponent(() => {
{ const layout = useLayoutStore() + const router = useRouterStore() const isGame = computed(() => layout.state.current === 0) const selectType = ref('') const addTo = ref(layout.state.currentPage) const typeList = ref([]) + const wallpaperList = ref([]) + const selectAttr = ref(0) + const userStore = useUserStore() + const backgroundStore = useBackgroundStore() const sortBy = ref<'hotNum' | 'time'>('hotNum') onMounted(() => { request("GET", "/api/backgroundTypes").then(res => { @@ -52,13 +73,18 @@ export default defineComponent(() => { }) }) watch(() => [selectType.value, sortBy.value], (e) => { - request("GET", `/api/backgrounds?typeId=${e}&sort=${sortBy.value}`).then(res => { + wallpaperList.value = [] + request("GET", `/api/backgrounds?typeId=${e[0]}&sort=${sortBy.value}`).then(res => { console.log(res); - + wallpaperList.value = res }) }, { immediate: true }) + watch(selectAttr, (e) => { + + selectType.value = typeList.value.filter(val => val.attr === e)[0].id || '' + }) return () => (
{ backgroundImage: `url('/bg/gameModel.png')`, backgroundSize: '100% 100%', } : null}> -
+
壁纸库
-