From 5204b7a912218ae771cda3d08011121327088e00 Mon Sep 17 00:00:00 2001 From: expdsn <18111002318@163.com> Date: Mon, 11 Nov 2024 14:15:20 +0800 Subject: [PATCH] save --- src/layout/header/search/SearchSuggestion.tsx | 4 ++-- src/settings/SettingsOverlay.tsx | 9 +++++++-- src/widgets/discount/Middle.tsx | 1 + src/widgets/work/useTomatoStore.ts | 19 ++++++++++--------- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/layout/header/search/SearchSuggestion.tsx b/src/layout/header/search/SearchSuggestion.tsx index 27a8e9b..a924f3c 100644 --- a/src/layout/header/search/SearchSuggestion.tsx +++ b/src/layout/header/search/SearchSuggestion.tsx @@ -51,7 +51,7 @@ export default defineComponent(() => { prefix={aIUrl} path={search.searchStr} label="AI搜索:" - icon={mita} + icon={mita} current={search.current} num={0} /> @@ -59,7 +59,7 @@ export default defineComponent(() => { prefix={translateUrl} path={search.searchStr} label="AI翻译:" - icon={translate} + icon={translate} current={search.current} num={1} /> diff --git a/src/settings/SettingsOverlay.tsx b/src/settings/SettingsOverlay.tsx index 693ca31..596616e 100644 --- a/src/settings/SettingsOverlay.tsx +++ b/src/settings/SettingsOverlay.tsx @@ -100,12 +100,17 @@ export default defineComponent(() => { ) : (
{ - router.go('settings-user') + if (profile.id) { + router.go('settings-user') + }else { + router.go('global-login') + } + // router.go('settings-user') }} > 登录注册 diff --git a/src/widgets/discount/Middle.tsx b/src/widgets/discount/Middle.tsx index 1c91629..7b01d65 100644 --- a/src/widgets/discount/Middle.tsx +++ b/src/widgets/discount/Middle.tsx @@ -14,6 +14,7 @@ export default defineComponent(() => { idx.value = 0 } }, 5000) + }) return () => (
{ const audio = new Audio() const time = useTimeStore() const remainingTime = computed(() => { - if (!state.isStart) { - return 0 - } + return dayjs(state.beginTime).add(1, 'minute').diff(dayjs(time.date), 'second') }) @@ -61,11 +59,7 @@ export default defineStore("work", () => { state.isStart = false state.beginTime = -1 stopMusic() - if (remainingTime.value <= 0) { - state.timeList.push( - dayjs().valueOf() - ) - } + } const togglePlay = () => { if (state.isPlaying) { @@ -97,10 +91,17 @@ export default defineStore("work", () => { } watch(remainingTime, (val) => { - if (val <= 0) { + console.log(val); + + if (val < 0) { stopTomatoTime() } + if (remainingTime.value === 0) { + state.timeList.push( + dayjs().valueOf() + ) + } }) const openShowModel = ref() const openFullscreen = ref(false)