This commit is contained in:
yixu
2025-12-25 15:55:57 +08:00
parent f9c7f9c939
commit 47b1c1db04
2 changed files with 6 additions and 25 deletions

View File

@@ -116,21 +116,10 @@ const isConfirmBtnDisplay = computed(() => {
}) })
const getGameInfo = async () => { const getGameInfo = async () => {
const result = await Request('game/info', { refresh_official: true, refresh_cap_scan: true }, "GET") slides.value = slides.value.map(slide => ({
if (result?.res?.status === 200) { ...slide,
console.log(result) show: globalStore.completed_games_today.includes(`game${slide.id}`)
globalStore.completed_games_today = result.json.completed_games_today || []; }));
//TODO: 测试数据
// globalStore.completed_games_today = ['game1', 'game3'];
slides.value = slides.value.map(slide => ({
...slide,
show: globalStore.completed_games_today.includes(`game${slide.id}`)
}));
} else {
weui.alert("获取游戏数据失败,请刷新页面重试");
emit('close');
return
}
} }
watch(() => props.show, async (newVal) => { watch(() => props.show, async (newVal) => {

View File

@@ -317,20 +317,11 @@ const initUserGameInfos = async (refresh_official, refresh_cap_scan) => {
globalToastEvent.emit(ToastType.MOUNTED) 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 () => { const handleLoginSuccess = async () => {
console.log("已登录") console.log("已登录")
loginShow.value = false loginShow.value = false
await fromShare() await fromShare()
// await initUserGameInfos(true, true) await initUserGameInfos(true, true)
// await getNotice()
} }
if (isLogin()) { if (isLogin()) {
@@ -362,6 +353,7 @@ const navigateGamePage = async () => {
const result = await Request('game/info', { refresh_official: false, refresh_cap_scan: false }, "GET") const result = await Request('game/info', { refresh_official: false, refresh_cap_scan: false }, "GET")
if (result?.res?.status === 200) { if (result?.res?.status === 200) {
globalStore.draw_chances = result.json.draw_chances globalStore.draw_chances = result.json.draw_chances
globalStore.completed_games_today = result.json.completed_games_today || [];
if (globalStore.draw_chances <= 0) { if (globalStore.draw_chances <= 0) {
return weui.alert("还没有探索机会,快去参加活动吧") return weui.alert("还没有探索机会,快去参加活动吧")
} else { } else {