fix: page

This commit is contained in:
zzc
2026-02-24 17:32:45 +08:00
parent 66e483c315
commit 28f0f83531
3 changed files with 557 additions and 5 deletions

View File

@@ -201,7 +201,9 @@
<view class="bottom-spacer"></view>
<!-- 登录弹窗 -->
<LoginPopup ref="loginPopupRef" />
<LoginPopup />
<!-- 运势抽奖弹窗 -->
<LuckyPopup ref="luckyPopupRef" />
</view>
</template>
@@ -213,12 +215,15 @@ import { useUserStore } from "@/stores/user";
import { getRecommendList } from "@/api/system";
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
import LuckyPopup from "@/components/LuckyPopup/LuckyPopup.vue";
const userStore = useUserStore();
const statusBarHeight = ref(getStatusBarHeight());
const loginPopupRef = ref(null);
const luckyPopupRef = ref(null);
const userInfo = computed(() => userStore?.userInfo || {});
const isLoggedIn = computed(() => !!userStore.userInfo.nickName);
const greetingText = computed(() => {
const hour = new Date().getHours();
if (hour < 6) return "凌晨好";
@@ -232,7 +237,7 @@ const greetingText = computed(() => {
const handleLogin = () => {
if (!userInfo.value.nickName) {
loginPopupRef.value?.open();
uni.$emit("show-login-popup");
}
};
const luckyScore = ref(98);
@@ -316,7 +321,11 @@ const onWalletTap = () => {
};
const onOpenLucky = () => {
uni.navigateTo({ url: "/pages/fortune/index" });
if (!isLoggedIn.value) {
uni.$emit("show-login-popup");
return;
}
luckyPopupRef.value?.open();
};
const navTo = (url) => {