update
This commit is contained in:
@@ -91,20 +91,32 @@ const circularArea = computed(() => {
|
||||
})
|
||||
|
||||
// 点击隐藏区域显示抽奖弹窗
|
||||
//防止多次点击
|
||||
const isRequesting = ref(false)
|
||||
const handleShowLottery = async () => {
|
||||
// 如果已经在请求中,直接忽略后续点击
|
||||
if (isRequesting.value) return
|
||||
isRequesting.value = true;
|
||||
|
||||
const loading = weui.loading()
|
||||
globalToastEvent.emit(ToastType.SHOW_LOTTERY);
|
||||
|
||||
// 点击隐藏区域后,游戏结束,再次调用game log接口
|
||||
const logId = globalStore.current_game_log_id;
|
||||
let gameLogRes = await Request("game/log", { source: globalStore.game_id, log_id: logId }, "POST");
|
||||
try {
|
||||
const logId = globalStore.current_game_log_id
|
||||
const gameLogRes = await Request("game/log", { source: globalStore.game_id, log_id: logId }, "POST")
|
||||
|
||||
if (!gameLogRes || !gameLogRes.res || (gameLogRes.res.status !== 200 && gameLogRes.res.status !== 201)) {
|
||||
emit('close')
|
||||
loading.hide()
|
||||
return
|
||||
} else {
|
||||
console.log(gameLogRes)
|
||||
}
|
||||
} finally {
|
||||
// 不管成功失败,都关闭 loading,并允许再次点击
|
||||
loading.hide()
|
||||
isRequesting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 轮播图数据
|
||||
|
||||
Reference in New Issue
Block a user