From 439550cb17309e4310cf821df2bbb67ef27f0a4b Mon Sep 17 00:00:00 2001 From: Hx <2294602187@qq.com> Date: Wed, 2 Apr 2025 10:14:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/login.vue | 1 + src/pages/votingElection/index.vue | 13 +++++-------- src/store/user.ts | 2 ++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index eb6b248..a2e93f6 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -63,6 +63,7 @@ const onLoginSuccess = () => { icon: 'none', success: () => { setTimeout(() => { + userStore.showtoast = false uni.reLaunch({ url: '/pages/votingElection/index' }) }, 1000) } diff --git a/src/pages/votingElection/index.vue b/src/pages/votingElection/index.vue index eb2ece5..8d82274 100644 --- a/src/pages/votingElection/index.vue +++ b/src/pages/votingElection/index.vue @@ -114,15 +114,12 @@ onShow(() => { }) } else if (isEmptyObject(userStore.userInfo)) { showDialogRef.value.show = true + } else if (!userStore.showtoast) { + userStore.showtoast = true + uni.showToast({ title: '签到成功,等待投票!', icon: 'success', duration: 1000 }) + setTimeout(() => reListRef.value.refreshFn(), 1100) } else { - uni.showToast({ - title: '签到成功,等待投票!', - icon: 'success', - duration: 1000, - complete: () => { - setTimeout(() => reListRef.value.refreshFn(), 1100) - } - }) + reListRef.value.refreshFn() } }) }) diff --git a/src/store/user.ts b/src/store/user.ts index 9e33664..753ec44 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -12,6 +12,7 @@ export default defineStore( () => { const openId = ref('') const mobile = ref('') + const showtoast = ref(false) const userInfo = ref({}) function getopenid(params: { code: string }) { @@ -74,6 +75,7 @@ export default defineStore( return { openId, mobile, + showtoast, userInfo, getopenid, bindUser,