fix: page
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user