This commit is contained in:
puxuan 2025-10-27 11:51:20 +08:00
parent 676ced2dec
commit 9d97844bea
2 changed files with 20 additions and 20 deletions

View File

@ -19,22 +19,22 @@ function MailCell:refresh(entity)
local readNode = uiMap["mail_cell.bg_read"] local readNode = uiMap["mail_cell.bg_read"]
local isReadType = false local isReadType = false
if entity:getMailType() == GConst.MailConst.MAIL_TYPE.CUSTOM then if entity:getMailType() == GConst.MailConst.MAIL_TYPE.CUSTOM then
normalNode:setVisible(false) normalNode:setActive(false)
adNode:setVisible(false) adNode:setActive(false)
readNode:setVisible(true) readNode:setActive(true)
isReadType = true isReadType = true
elseif entity:getMailType() == GConst.MailConst.MAIL_TYPE.AD then elseif entity:getMailType() == GConst.MailConst.MAIL_TYPE.AD then
normalNode:setVisible(false) normalNode:setActive(false)
adNode:setVisible(true) adNode:setActive(true)
readNode:setVisible(false) readNode:setActive(false)
elseif entity:getMailType() == GConst.MailConst.MAIL_TYPE.NORMAL then elseif entity:getMailType() == GConst.MailConst.MAIL_TYPE.NORMAL then
normalNode:setVisible(true) normalNode:setActive(true)
adNode:setVisible(false) adNode:setActive(false)
readNode:setVisible(false) readNode:setActive(false)
elseif entity:getMailType() == GConst.MailConst.MAIL_TYPE.READ then elseif entity:getMailType() == GConst.MailConst.MAIL_TYPE.READ then
normalNode:setVisible(false) normalNode:setActive(false)
adNode:setVisible(false) adNode:setActive(false)
readNode:setVisible(true) readNode:setActive(true)
isReadType = true isReadType = true
end end
GFunc.setAdsSprite(uiMap["mail_cell.bg_ad.claim_btn.ad"]) GFunc.setAdsSprite(uiMap["mail_cell.bg_ad.claim_btn.ad"])
@ -62,7 +62,7 @@ function MailCell:refresh(entity)
end) end)
self.icon = icon self.icon = icon
end end
uiMap["mail_cell.new"]:setVisible(entity:showNew()) uiMap["mail_cell.new"]:setActive(entity:showNew())
uiMap["mail_cell.desc"]:setText(entity:getMailName()) uiMap["mail_cell.desc"]:setText(entity:getMailName())
uiMap["mail_cell.time"]:setText(entity:getRemainCdStr()) uiMap["mail_cell.time"]:setText(entity:getRemainCdStr())
local rewardBg = uiMap["mail_cell.reward_bg"] local rewardBg = uiMap["mail_cell.reward_bg"]
@ -73,16 +73,16 @@ function MailCell:refresh(entity)
local rewards = entity:getRewards() local rewards = entity:getRewards()
local showCheck = entity:isReceived() local showCheck = entity:isReceived()
if rewards[2] then if rewards[2] then
rewardBg:setVisible(true) rewardBg:setActive(true)
self.rewardCell:getBaseObject():setVisible(false) self.rewardCell:setActive(false)
mask:setVisible(showCheck) mask:setActive(showCheck)
else else
rewardBg:setVisible(false) rewardBg:setActive(false)
if entity:haveReward() then if entity:haveReward() then
self.rewardCell:getBaseObject():setVisible(true, 0.7) self.rewardCell:setActive(true)
self.rewardCell:refreshByConfig(rewards[1], showCheck, showCheck) self.rewardCell:refreshByConfig(rewards[1], showCheck, showCheck)
else else
self.rewardCell:getBaseObject():setVisible(false) self.rewardCell:setActive(false)
end end
end end
if isReadType then if isReadType then

View File

@ -69,7 +69,7 @@ function MailUI:_display()
self.root:addClickListener(function() self.root:addClickListener(function()
self:closeUI() self:closeUI()
end) end)
uiMap["mail_ui.bg.title_bg.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAIL_TITLE)) uiMap["mail_ui.bg.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAIL_TITLE))
uiMap["mail_ui.bg.btn_delect.btn_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_DELETE_ALL_READ_MAIL)) uiMap["mail_ui.bg.btn_delect.btn_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_DELETE_ALL_READ_MAIL))
uiMap["mail_ui.bg.btn_claimed.btn_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM_ALL)) uiMap["mail_ui.bg.btn_claimed.btn_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM_ALL))