From 35a4f253662f0fc6c2614a78015d550aa0e8ba9a Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 16 Jun 2023 16:59:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/sdk_manager.lua | 1 - lua/app/ui/mail/cell/mail_cell.lua | 24 ++++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lua/app/common/sdk_manager.lua b/lua/app/common/sdk_manager.lua index 93dc038e..28f30c04 100644 --- a/lua/app/common/sdk_manager.lua +++ b/lua/app/common/sdk_manager.lua @@ -368,7 +368,6 @@ function SDKManager:showFullScreenAds(adsClickType, adCallback) end function SDKManager:adRewradAd(noReport) - Logger.logHighlight("-------------------") ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_WATCH_AD) if not noReport then -- BIReport:postAdEvent() diff --git a/lua/app/ui/mail/cell/mail_cell.lua b/lua/app/ui/mail/cell/mail_cell.lua index c4287215..dedc2637 100644 --- a/lua/app/ui/mail/cell/mail_cell.lua +++ b/lua/app/ui/mail/cell/mail_cell.lua @@ -41,16 +41,10 @@ function MailCell:refresh(entity) uiMap["mail_cell.bg_normal.claim_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM)) uiMap["mail_cell.bg_read.claim_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_READ)) uiMap["mail_cell.bg_normal.claim_btn"]:addClickListener(function() - if entity:canClaim() then - ModuleManager.MailManager:claimMail({entity:getId()}) - end + self:claimMail(entity) end) uiMap["mail_cell.bg_ad.claim_btn"]:addClickListener(function() - if entity:canClaim() then - SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.MAIL, function() - ModuleManager.MailManager:claimMail({entity:getId()}) - end) - end + self:claimMail(entity) end) uiMap["mail_cell.bg_read.claim_btn"]:addClickListener(function() BIReport:postMailClick(entity:getId()) @@ -105,4 +99,18 @@ function MailCell:refresh(entity) end end +function MailCell:claimMail(entity) + if not entity:canClaim() then + return + end + + if entity:getIsAdMail() then + SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.MAIL, function() + ModuleManager.MailManager:claimMail({entity:getId()}) + end) + elseif entity:getIsNormalMail() then + ModuleManager.MailManager:claimMail({entity:getId()}) + end +end + return MailCell \ No newline at end of file