fix: check-in

This commit is contained in:
zzc
2026-02-25 14:50:47 +08:00
parent 32457aa947
commit 72eb440504
2 changed files with 17 additions and 0 deletions

View File

@@ -213,6 +213,7 @@ import { getStatusBarHeight } from "@/utils/system";
import { onShareAppMessage, onShareTimeline, onShow } from "@dcloudio/uni-app";
import { useUserStore } from "@/stores/user";
import { getRecommendList } from "@/api/system";
import { getUserSignInfo } from "@/api/user";
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
import LuckyPopup from "@/components/LuckyPopup/LuckyPopup.vue";
@@ -223,6 +224,7 @@ const loginPopupRef = ref(null);
const luckyPopupRef = ref(null);
const userInfo = computed(() => userStore?.userInfo || {});
const isLoggedIn = computed(() => !!userStore.userInfo.nickName);
const signInfo = ref({}); // 用户签到信息
const greetingText = computed(() => {
const hour = new Date().getHours();
@@ -262,6 +264,7 @@ const lunarDate = ref({
const rankingList = ref([]);
onMounted(() => {
fetchUserSingInfo(); // 获取用户签到信息
fetchRankingData();
});
@@ -271,6 +274,12 @@ onShow(() => {
}
});
const fetchUserSingInfo = async () => {
if (!isLoggedIn.value) return;
const res = await getUserSignInfo();
signInfo.value = res || {};
};
const fetchRankingData = async () => {
// 模拟数据或调用 API
// 实际项目中可以调用 getRecommendList 并根据 currentTab 筛选