diff --git a/lua/app/ui/task/cell/daily_task_cell.lua b/lua/app/ui/task/cell/daily_task_cell.lua index 7f10bd70..abde4499 100644 --- a/lua/app/ui/task/cell/daily_task_cell.lua +++ b/lua/app/ui/task/cell/daily_task_cell.lua @@ -7,35 +7,37 @@ function DailyTaskCell:init() self.progressBg = uiMap["task_cell.progress_bg"] self.progress = uiMap["task_cell.progress_bg.progress"] self.progressTx = uiMap["task_cell.progress_bg.progress_tx"] - self.getBtn = uiMap["task_cell.get_btn"] - self.getBtn:addClickListener(function() + self.getBtnRoot = uiMap["task_cell.get_btn"] + local getBtn = uiMap["task_cell.get_btn.btn"] + getBtn:addClickListener(function() if self.taskId then ModuleManager.TaskManager:claimDailyTask(self.taskId) end end) - self.getBtnTx = uiMap["task_cell.get_btn.text"] + self.getBtnTx = uiMap["task_cell.get_btn.btn.text"] self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM)) - self.refreshBtn = uiMap["task_cell.refresh_btn"] - self.refreshBtn:addClickListener(function() + self.refreshBtnRoot = uiMap["task_cell.refresh_btn"] + local refreshBtn = uiMap["task_cell.refresh_btn.btn"] + refreshBtn:addClickListener(function() if self.taskId then ModuleManager.TaskManager:refreshDailyTask(self.taskId) end end) - self.refreshBtnTx = uiMap["task_cell.refresh_btn.text"] + self.refreshBtnTx = uiMap["task_cell.refresh_btn.btn.text"] self.refreshBtnTx:setText("临时文本:刷新") self.rewardCellComp = uiMap["task_cell.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) self.lockNode = uiMap["task_cell.lock_node"] self.lockBg = uiMap["task_cell.lock_bg"] - self.lockBtn = uiMap["task_cell.lock_node.lock_btn"] - self.lockBtnTx = uiMap["task_cell.lock_node.lock_btn.text"] - self.lockTx = uiMap["task_cell.lock_node.lock_tx"] - self.lockBtn:addClickListener(function() + local lockBtn = uiMap["task_cell.lock_node.lock_btn.btn"] + lockBtn:addClickListener(function() end) - self.lockBtnTx:setText("临时文本:解锁") - self.lockTx:setText("临时文本:通行证专属任务") + local lockBtnTx = uiMap["task_cell.lock_node.lock_btn.btn.text"] + lockBtnTx:setText("临时文本:解锁") + local lockTx = uiMap["task_cell.lock_node.lock_tx"] + lockTx:setText("临时文本:通行证专属任务") self.completeNode = uiMap["task_cell.complete"] - self.completeTx = uiMap["task_cell.complete.text"] - self.completeTx:setText("临时文本:已完成") + local completeTx = uiMap["task_cell.complete.text"] + completeTx:setText("临时文本:已完成") end function DailyTaskCell:refresh(task) @@ -49,8 +51,8 @@ function DailyTaskCell:refresh(task) self.lockNode:setVisible(true) self.lockBg:setVisible(true) self.progressBg:setVisible(false) - self.refreshBtn:setVisible(false) - self.getBtn:setVisible(false) + self.refreshBtnRoot:setVisible(false) + self.getBtnRoot:setVisible(false) self.completeNode:setVisible(false) else if task.lock == nil then @@ -64,8 +66,8 @@ function DailyTaskCell:refresh(task) local needCount = task.needProgress if task.claimed then -- 已经领过了 self.completeNode:setVisible(true) - self.getBtn:setVisible(false) - self.refreshBtn:setVisible(false) + self.getBtnRoot:setVisible(false) + self.refreshBtnRoot:setVisible(false) if count >= needCount then count = needCount end @@ -73,19 +75,19 @@ function DailyTaskCell:refresh(task) self.completeNode:setVisible(false) if count >= needCount then count = needCount - self.getBtn:setVisible(true) - self.refreshBtn:setVisible(false) + self.getBtnRoot:setVisible(true) + self.refreshBtnRoot:setVisible(false) else - self.getBtn:setVisible(false) + self.getBtnRoot:setVisible(false) local canRefresh = DataManager.DailyTaskData:getDailyTaskCanRefresh(task.id) if canRefresh then if task.refresh then -- 刷过了 - self.refreshBtn:setVisible(false) + self.refreshBtnRoot:setVisible(false) else - self.refreshBtn:setVisible(true) + self.refreshBtnRoot:setVisible(true) end else - self.refreshBtn:setVisible(false) + self.refreshBtnRoot:setVisible(false) end end end diff --git a/lua/app/ui/task/task_main_ui.lua b/lua/app/ui/task/task_main_ui.lua index 21405fb0..875418ad 100644 --- a/lua/app/ui/task/task_main_ui.lua +++ b/lua/app/ui/task/task_main_ui.lua @@ -233,7 +233,6 @@ function TaskMainUI:refreshDailyTaskFinalCell() end function TaskMainUI:refreshDailyTasks() - Logger.logHighlight("refreshDailyTasks") if self.dailyTaskScrollRect == nil then self:initDailyTasks() else