diff --git a/src/components/HomePage.vue b/src/components/HomePage.vue
index 7500219..35a6fcd 100644
--- a/src/components/HomePage.vue
+++ b/src/components/HomePage.vue
@@ -22,6 +22,7 @@ const videoLoaded = ref(false);
const videoError = ref(false);
const lotteryShow = ref(false)
const lotteryType = ref("draw")
+const lotteryNoticeData = ref(null)
// 初始化全局音频实例
const initGlobalAudio = () => {
@@ -228,6 +229,8 @@ const handleLottery = () => {
if (globalStore.draw_chances <= 0) {
return weui.alert("还没有抽奖机会,快去参加活动吧")
};
+ lotteryType.value = 'draw'
+ lotteryNoticeData.value = null
globalToastEvent.emit(ToastType.SHOW_LOTTERY)
}
@@ -307,12 +310,20 @@ const initUserGameInfos = async (refresh_official, refresh_cap_scan) => {
globalToastEvent.emit(ToastType.MOUNTED)
}
}
-
+const getNotice = async () => {
+ const result = await Request('notice/latest', {}, "GET")
+ if (result.json.notification) {
+ lotteryType.value = 'notice'
+ lotteryNoticeData.value = result.json.notification
+ lotteryShow.value = true
+ }
+}
const handleLoginSuccess = async () => {
console.log("已登录")
loginShow.value = false
await initUserGameInfos(true, true)
+ await getNotice()
}
if (isLogin()) {
@@ -334,7 +345,7 @@ watch(() => mergeId, async (newVal) => {
}
}, { immediate: true })
-globalToastEvent.on(ToastType.SHOW_LOTTERY, async() => {
+globalToastEvent.on(ToastType.SHOW_LOTTERY, async () => {
await initUserGameInfos(false, false);
lotteryShow.value = true
})
@@ -413,7 +424,7 @@ globalToastEvent.on(ToastType.SHOW_LOTTERY, async() => {
-
+