fix: index luck
This commit is contained in:
@@ -257,7 +257,7 @@ import {
|
||||
getRandomRecommendList,
|
||||
getCardSpecialTopic,
|
||||
} from "@/api/system";
|
||||
import { getUserSignInfo, userSignIn } from "@/api/user";
|
||||
import { getUserSignInfo, userSignIn, getUserLuckInfo } from "@/api/user";
|
||||
import calendar from "@/utils/lunar";
|
||||
|
||||
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
|
||||
@@ -479,10 +479,20 @@ const onOpenLucky = async () => {
|
||||
}
|
||||
|
||||
if (signInfo.value.isSignedToday) {
|
||||
luckyPopupRef.value?.open();
|
||||
uni.showLoading({ title: "加载中..." });
|
||||
try {
|
||||
const luckRes = await getUserLuckInfo();
|
||||
luckyPopupRef.value?.open(luckRes, true);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
uni.showToast({ title: "获取好运信息失败", icon: "none" });
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showLoading({ title: "开启好运...", mask: true });
|
||||
try {
|
||||
const res = await userSignIn();
|
||||
if (res && res.success) {
|
||||
@@ -493,7 +503,11 @@ const onOpenLucky = async () => {
|
||||
}
|
||||
fetchUserSingInfo();
|
||||
userStore.fetchUserAssets();
|
||||
luckyPopupRef.value?.open();
|
||||
|
||||
// 获取好运信息
|
||||
const luckRes = await getUserLuckInfo();
|
||||
luckyPopupRef.value?.open(luckRes, false);
|
||||
|
||||
uni.showToast({ title: "获取40积分", icon: "none" });
|
||||
} else {
|
||||
uni.showToast({ title: "签到失败", icon: "none" });
|
||||
|
||||
Reference in New Issue
Block a user