Commit accdab78 authored by 俞嘉婷's avatar 俞嘉婷

feat: 主按钮次数不足 置灰处理

parent c90c082f
......@@ -81,7 +81,7 @@ export class TaskPanel extends Panel {
}
updateTaskInfo = async () => {
const { boolLogin } = this.data;
const { boolLogin } = getWebData(WebNetName.tcs_Index).data || {};
const [taskRes] = await Promise.all([
sendWebNet(WebNetName.queryTasks, { branchType: store.BRANCH_TYPE }),
]);
......
......@@ -47,6 +47,11 @@ export class runMainPage extends Scene {
@property(Node)
guide1: Node = null;
// 主按钮 高亮态
@property(SpriteFrame) mainBtnSF: SpriteFrame = null;
// 主按钮 置灰态
@property(SpriteFrame) mainBtnGreySF: SpriteFrame = null;
private static _ins: runMainPage = null;
......@@ -71,6 +76,8 @@ export class runMainPage extends Scene {
const { success, data } = await sendWebNet(WebNetName.tcs_Index);
if (success) {
this.startLab.string = `剩余次数:${data.remainJoinNum || 0}`
// 主按钮置灰处理
this.startBtn.getComponent(Sprite).spriteFrame = data.remainJoinNum > 0 ? this.mainBtnSF : this.mainBtnGreySF;
// 新手引导1
if (data.alreadyGuide == 0) {
this.guide1.active = true
......@@ -105,9 +112,7 @@ export class runMainPage extends Scene {
})
click_Task = _asyncThrottle(() => {
showPanel(TaskPanel, {
boolLogin: getWebData(WebNetName.tcs_Index).data?.boolLogin,
})
showPanel(TaskPanel)
})
click_startGame = _asyncThrottle(async () => {
const { data, timeStamp } = getWebData(WebNetName.tcs_Index) || {};
......@@ -138,7 +143,8 @@ export class runMainPage extends Scene {
return
}
if (remainJoinNum <= 0) {
showToast("快去完成任务增加游戏次数吧~")
showToast("当前无游戏机会,任务可获得更多游戏机会哦~")
showPanel(TaskPanel)
return false
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment