local TaskCell = class("TaskCell", BaseCell) local ICON_BG = {"common_board_131", "common_board_132"} local ICON = {"daily_task_1", "daily_task_2"} function TaskCell:refresh(taskInfo, customProgress) local complete = taskInfo.claimed customProgress = customProgress or 0 local uiMap = self:getUIMap() local icon = complete and ICON_BG[2] or ICON_BG[1] -- uiMap["task_cell.task_icon_bg"]:setSprite(GConst.ATLAS_PATH.COMMON, icon) -- icon = complete and ICON[2] or ICON[1] -- uiMap["task_cell.task_icon"]:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, icon) uiMap["task_cell.desc"]:setText(DataManager.DailyChallengeData:getTaskDesc(taskInfo.task_id, true, customProgress)) for i = 1, 3 do local cell = uiMap["daily_challenge_task_ui.bg.task_cell_" .. i] if taskInfo.reward[i] then cell:setVisible(true) cell:refresh(taskInfo.reward[i]) else cell:setVisible(false) end end end return TaskCell