update
This commit is contained in:
@@ -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")
|
|
||||||
if (result?.res?.status === 200) {
|
|
||||||
console.log(result)
|
|
||||||
globalStore.completed_games_today = result.json.completed_games_today || [];
|
|
||||||
//TODO: 测试数据
|
|
||||||
// globalStore.completed_games_today = ['game1', 'game3'];
|
|
||||||
slides.value = slides.value.map(slide => ({
|
slides.value = slides.value.map(slide => ({
|
||||||
...slide,
|
...slide,
|
||||||
show: globalStore.completed_games_today.includes(`game${slide.id}`)
|
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) => {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user